diff options
author | Roman Birg <roman@cyngn.com> | 2016-02-16 17:22:01 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-02-18 12:09:03 -0800 |
commit | 3bc505f8610574da143626de6032ddc046eeec9a (patch) | |
tree | ce0cf0c2a850d63e264ff804fdb3318ac69941fe /packages/SystemUI/src | |
parent | 6050db8bc284712086ccc01588bea5c83491faf5 (diff) | |
download | frameworks_base-3bc505f8610574da143626de6032ddc046eeec9a.zip frameworks_base-3bc505f8610574da143626de6032ddc046eeec9a.tar.gz frameworks_base-3bc505f8610574da143626de6032ddc046eeec9a.tar.bz2 |
SystemUI: handle camera launch gesture from keyhadler
Includes partial reverts:
Revert "KeyHandler: don't break old interfaces"
This reverts commit 31ecbdc5fcc1263e9028107858565d951798fd93.
Revert "framework: move device key handler logic, fix gesture camera launch"
This reverts commit db1b4e6e4880be1828342be9bc468d36565a2ef0.
Ref: OPO-427
Change-Id: Ic15543a8f63ad4521ab0ab536d00224b0bd70f8c
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index ee0789a..6ab9ed8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1288,6 +1288,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_KEYGUARD_WALLPAPER_CHANGED); + filter.addAction(cyanogenmod.content.Intent.ACTION_SCREEN_CAMERA_GESTURE); context.registerReceiverAsUser(mBroadcastReceiver, UserHandle.ALL, filter, null, null); IntentFilter demoFilter = new IntentFilter(); @@ -3516,6 +3517,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, Context.WALLPAPER_SERVICE); mKeyguardWallpaper = wm.getKeyguardBitmap(); updateMediaMetaData(true); + } else if (cyanogenmod.content.Intent.ACTION_SCREEN_CAMERA_GESTURE.equals(action)) { + boolean userSetupComplete = Settings.Secure.getInt(mContext.getContentResolver(), + Settings.Secure.USER_SETUP_COMPLETE, 0) != 0; + if (!userSetupComplete) { + if (DEBUG) Log.d(TAG, String.format( + "userSetupComplete = %s, ignoring camera launch gesture.", + userSetupComplete)); + return; + } + + onCameraLaunchGestureDetected(StatusBarManager.CAMERA_LAUNCH_SOURCE_SCREEN_GESTURE); } } }; |