OSDN Git Service

Don't try to launch broadcast receivers during boot
authorChristopher Tate <ctate@google.com>
Tue, 20 Jan 2015 22:29:22 +0000 (14:29 -0800)
committerChristopher Tate <ctate@google.com>
Tue, 20 Jan 2015 22:29:22 +0000 (14:29 -0800)
It turns out that sysUI visibility / interactivity is racing with
boot, and it's possible in some circumstances for the user to start
the secure camera swipe gesture before formal boot-completed.  Make
sure we only send the camera-related broadcast to registered
receivers in that case, otherwise we'll implicitly be asking to
launch other apps before boot, which is forbidden.

Bug 19060618

Change-Id: I7fcf13b5af7b2edfbb4aac06ef04a0fde2c6a0f7

packages/SystemUI/src/com/android/systemui/statusbar/phone/SecureCameraLaunchManager.java

index 3f5cf3f..4a43c47 100644 (file)
@@ -175,6 +175,7 @@ public class SecureCameraLaunchManager {
                 public void run() {
                     Intent intent = new Intent();
                     intent.setAction(CLOSE_CAMERA_ACTION_NAME);
+                    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
                     mContext.sendBroadcast(intent);
                 }
             });