From 1c3556bb6a8d05bb785c7d03cef52e07198a8c85 Mon Sep 17 00:00:00 2001 From: xinhe Date: Mon, 8 Dec 2014 11:26:34 -0800 Subject: Crash in Phone observed while launching SIM Toolkit app This bug is due to the BOOT_COMPLETE propagate to the STK broadcast receiver too late. Instead, we listen to the USER_INITIALZE now. Bug:18607600 Change-Id: Iaf588797a75e9fcfabe78177df7d9270ae4e0ed9 --- src/com/android/stk/BootCompletedReceiver.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/stk/BootCompletedReceiver.java b/src/com/android/stk/BootCompletedReceiver.java index 8fb938c..ff46a50 100644 --- a/src/com/android/stk/BootCompletedReceiver.java +++ b/src/com/android/stk/BootCompletedReceiver.java @@ -38,6 +38,12 @@ public class BootCompletedReceiver extends BroadcastReceiver { // make sure the app icon is removed every time the device boots. if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { + Bundle args = new Bundle(); + args.putInt(StkAppService.OPCODE, StkAppService.OP_BOOT_COMPLETED); + context.startService(new Intent(context, StkAppService.class) + .putExtras(args)); + CatLog.d(LOG_TAG, "[ACTION_BOOT_COMPLETED]"); + } else if(action.equals(Intent.ACTION_USER_INITIALIZE)) { if (!android.os.Process.myUserHandle().isOwner()) { //Disable package for all secondary users. Package is only required for device //owner. @@ -45,11 +51,6 @@ public class BootCompletedReceiver extends BroadcastReceiver { PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0); return; } - Bundle args = new Bundle(); - args.putInt(StkAppService.OPCODE, StkAppService.OP_BOOT_COMPLETED); - context.startService(new Intent(context, StkAppService.class) - .putExtras(args)); - CatLog.d(LOG_TAG, "[ACTION_BOOT_COMPLETED]"); } } } -- cgit v1.2.3