diff options
author | Danny Baumann <dannybaumann@web.de> | 2013-06-21 08:57:11 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2013-06-26 08:45:04 +0200 |
commit | 1621c284856753f674a0f54ec6f0f7c71a3a98ba (patch) | |
tree | be6376a62b55208e19129362537938a157f6622f /policy | |
parent | 3754b94205e9f22b38337a099376e406c390d372 (diff) | |
download | frameworks_base-1621c284856753f674a0f54ec6f0f7c71a3a98ba.zip frameworks_base-1621c284856753f674a0f54ec6f0f7c71a3a98ba.tar.gz frameworks_base-1621c284856753f674a0f54ec6f0f7c71a3a98ba.tar.bz2 |
Use sticky broadcast to convey torch state (1/2).
It doesn't really make sense to store the (non-persistent) state of the
torch in a (persistent) setting. As the torch is sending a broadcast
anyway, make that broadcast sticky and use it to convey the state.
Also unify the torch constants (actions, extras, activity names) at a
common place.
Change-Id: If845bef27cc79990794aa748dce18cfea3bac1f5
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java index af58a05..3fd5946 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java @@ -46,6 +46,7 @@ import android.view.WindowManager; import android.widget.FrameLayout; import com.android.internal.R; +import com.android.internal.util.cm.TorchConstants; import com.android.internal.widget.LockPatternUtils; /** @@ -239,7 +240,7 @@ public class KeyguardViewManager { private static boolean runAction(Context context, String uri) { if ("FLASHLIGHT".equals(uri)) { - context.sendBroadcast(new Intent("net.cactii.flash2.TOGGLE_FLASHLIGHT")); + context.sendBroadcast(new Intent(TorchConstants.ACTION_TOGGLE_STATE)); return true; } else if ("NEXT".equals(uri)) { sendMediaButtonEvent(context, KeyEvent.KEYCODE_MEDIA_NEXT); |