У меня есть приемник полной загрузки, который не вызывался при перезапуске телефона, поэтому я удалил все из метода onReceive, добавил оператор журнала и использовал оболочку ADB для отправки трансляций BOOT_COMPLETE, теперь приложение просто закрывается без каких-либо сообщенийкогда я отправляю широковещательную рассылку, и статус приложения переходит в DEAD в раскрывающемся списке пакета logcat.В моем файле манифеста определено следующее разрешение:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Вот как я регистрирую получателя:
<receiver
android:name=".BootCompleteBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
Я пытался без Android: exported = "true" тег.Я ничего не делаю в методе onReceive, у меня просто есть запись в журнале, которая не печатается.
Вот логкат, приложения как-то принудительно закрыты, никаких ошибок:
04-24 19:34:28.639 768 1645 D ReceiverController: getBootReceiverEnabledSetting(com.vysh.theeye) at User(0) with identity: 1001
04-24 19:34:28.639 898 898 D AppChangedReceiver: kill back service:com.vysh.theeye
04-24 19:34:28.642 768 1633 V PackageController: forceStopPackage: com.vysh.theeye
04-24 19:34:28.642 768 1633 I ActivityManager: Force stopping com.vysh.theeye appid=10119 user=0: from pid 768
04-24 19:34:28.643 768 1633 I ActivityManager: Killing 31461:com.vysh.theeye/u0a119 (adj 0): stop com.vysh.theeye
04-24 19:34:28.696 195 822 I BufferQueueProducer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:195) disconnect(P): api 1
04-24 19:34:28.697 195 822 I BufferQueueConsumer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:195) getReleasedBuffers: returning mask 0xffffffffffffffff
04-24 19:34:28.697 768 3699 I WindowState: WIN DEATH: Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.MainActivity}
04-24 19:34:28.697 768 3699 V WindowManager: Remove Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.MainActivity} client=1866e45, surface=Surface(name=com.vysh.theeye/com.vysh.theeye.MainActivity) Callers=com.android.server.wm.WindowState$DeathRecipient.binderDied:1217 android.os.BinderProxy.sendDeathNotice:566 <bottom of call stack> <bottom of call stack>
04-24 19:34:28.699 195 195 I BufferQueueConsumer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:-1) disconnect(C)
04-24 19:34:28.700 768 1633 D ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{f2d64fb 31461:com.vysh.theeye/u0a119}, app.pid = 31461
04-24 19:34:28.702 195 821 I BufferQueue: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:-1) ~BufferQueueCore
04-24 19:34:28.704 768 1633 W ActivityManager: Scheduling restart of crashed service com.vysh.theeye/.WatcherService in 10229ms
04-24 19:34:28.705 768 1633 D ActivityManager: removeDyingProviderLocked: cpr=ContentProviderRecord{6c3aebd u0 com.vysh.theeye/com.google.firebase.provider.FirebaseInitProvider} always=false inLaunching=false
04-24 19:34:28.705 768 1633 W ActivityManager: Force removing ActivityRecord{e3b6f3d u0 com.vysh.theeye/.MainActivity t2248}: app died, no saved state