Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c0b0c9a authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: handle camera launch gesture from keyhadler



Ref: OPO-427

Change-Id: Ic15543a8f63ad4521ab0ab536d00224b0bd70f8c
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 8dba5d60
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1289,6 +1289,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();
@@ -3526,6 +3527,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);
            }
        }
    };