update documentation for testing the latest error

This commit is contained in:
2026-11-11 14:34:22 -07:00
parent 66719f10e5
commit 5953daa423
+27 -18
View File
@@ -83,11 +83,15 @@ adb shell am start -n org.timesafari.dailynotification/.MainActivity
# 2. Verify initial scheduling
adb shell "dumpsys alarm | grep timesafari"
# 3. Reboot, wait for boot, unlock
# 3. Enlarge the log buffer so app lines survive the boot flood
# (the default 256 KiB main buffer drops them); persists across reboot if the image allows it
adb shell setprop persist.logd.size 16M
# 4. Reboot, then unlock the device once the lock screen appears
adb reboot
adb wait-for-device
# 4. Check recovery logs
# 5. Check recovery logs
adb logcat -d | grep -E "DNP-BOOT|DNP-REACTIVATION" | tail -10
```
@@ -140,35 +144,40 @@ DNP-REACTIVATION: Boot recovery complete: missed=0, rescheduled=1, verified=0, e
**Objective**: Verify nothing crashes between reboot and first unlock, and recovery runs after unlock
Works on an emulator or device, API 24+. adb cannot observe or drive the locked phase on every image: Android 17 emulator images report the device as `unauthorized` until first unlock, and emulator-console key events (`adb emu event …`) do not reach the lock screen. The test therefore unlocks by hand and reads the log buffers afterwards; they survive the unlock.
**Steps**:
```bash
# 1. Schedule a notification, then set a lock-screen PIN
# 1. Schedule a notification
adb shell am start -n org.timesafari.dailynotification/.MainActivity
# 2. Enlarge the log buffer so app lines survive the boot flood (the default
# 256 KiB main buffer drops them). `adb logcat -G 16M` lasts only until reboot.
adb shell setprop persist.logd.size 16M
# 3. Set a lock-screen PIN
adb shell locksettings set-pin 1234
# 2. Reboot
# 4. Reboot; leave the device locked for a minute or more after the lock screen appears
adb reboot
adb wait-for-device
# 3. BEFORE unlocking, check for crashes
adb logcat -d -b crash,main | grep -E "FATAL|DNP-BOOT|credential encrypted"
# 5. Unlock by hand (emulator window or device)
# 4. Unlock
adb shell input keyevent 82
adb shell input text 1234
adb shell input keyevent 66
# 5. Check recovery and alarms
adb logcat -d | grep -E "DNP-BOOT|DNP-REACTIVATION" | tail -5
# 6. Read what happened while locked
adb logcat -d -b crash -v time
adb logcat -d -v time | grep -E "LOCKED_BOOT_COMPLETED|USER_UNLOCKED|Start proc [0-9]+:org.timesafari.dailynotification|DNP-BOOT|DNP-REACTIVATION"
adb shell "dumpsys alarm | grep timesafari"
# 6. Clear the PIN
# 7. Clear the PIN
adb shell locksettings clear --old 1234
```
**Success Criteria**:
- ✅ No `FATAL EXCEPTION` and no `credential encrypted` error for the app before unlock
- ✅ Either no app process before unlock, or `DNP-BOOT: Ignoring locked boot` (manifests that declare the locked action anyway)
- ✅ After unlock, `DNP-BOOT` reports boot recovery and `dumpsys alarm` lists the rescheduled alarm
- ✅ Crash buffer has no `FATAL EXCEPTION` for the app package
- ✅ The app's `Start proc` line comes after `USER_UNLOCKED`, or after `DNP-BOOT: Ignoring locked boot` when a manifest declares the locked action anyway
- ✅ `DNP-BOOT` reports boot recovery after unlock, and `dumpsys alarm` lists the rescheduled alarm
**Reference result** (consuming app, release build, receiver without the locked action): `LOCKED_BOOT_COMPLETED` logged, device left locked for 15 minutes, app process started one second after `USER_UNLOCKED` for `BootReceiver`, crash buffer empty.
### **Test 5: Exact Alarm Permission Test**