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

Commit be02d08a authored by Pechetty Sravani (xWF)'s avatar Pechetty Sravani (xWF) Committed by Android (Google) Code Review
Browse files

Merge changes from topic...

Merge changes from topic "revert-30763741-revert-30698369-revert-30412668-HWHJRSWUQP-SSEJIYIUHQ-GVJJHDAEEE" into main

* changes:
  Revert "Revert "Revert "Allow focused privileged windows to capt..."
  Revert^3 "Launch wallet app on double tap option."
  Revert "Fixes failing PowerMenuTest."
parents 020fcf01 6eba2471
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -27,13 +27,11 @@ public class KeyInterceptionInfo {
    // Debug friendly name to help identify the window
    // Debug friendly name to help identify the window
    public final String windowTitle;
    public final String windowTitle;
    public final int windowOwnerUid;
    public final int windowOwnerUid;
    public final int inputFeaturesFlags;


    public KeyInterceptionInfo(int type, int flags, String title, int uid, int inputFeaturesFlags) {
    public KeyInterceptionInfo(int type, int flags, String title, int uid) {
        layoutParamsType = type;
        layoutParamsType = type;
        layoutParamsPrivateFlags = flags;
        layoutParamsPrivateFlags = flags;
        windowTitle = title;
        windowTitle = title;
        windowOwnerUid = uid;
        windowOwnerUid = uid;
        this.inputFeaturesFlags = inputFeaturesFlags;
    }
    }
}
}
+46 −263
Original line number Original line Diff line number Diff line
@@ -16,14 +16,9 @@


package com.android.server;
package com.android.server;


import static android.service.quickaccesswallet.Flags.launchWalletOptionOnPowerDoubleTap;

import static com.android.hardware.input.Flags.overridePowerKeyBehaviorInFocusedWindow;
import static com.android.internal.R.integer.config_defaultMinEmergencyGestureTapDurationMillis;
import static com.android.internal.R.integer.config_defaultMinEmergencyGestureTapDurationMillis;


import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.app.StatusBarManager;
import android.content.BroadcastReceiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Context;
@@ -38,7 +33,6 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.hardware.SensorManager;
import android.hardware.TriggerEvent;
import android.hardware.TriggerEvent;
import android.hardware.TriggerEventListener;
import android.hardware.TriggerEventListener;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.PowerManager.WakeLock;
@@ -47,12 +41,10 @@ import android.os.SystemProperties;
import android.os.Trace;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings;
import android.service.quickaccesswallet.QuickAccessWalletClient;
import android.util.MutableBoolean;
import android.util.MutableBoolean;
import android.util.Slog;
import android.util.Slog;
import android.view.KeyEvent;
import android.view.KeyEvent;


import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.UiEvent;
import com.android.internal.logging.UiEvent;
@@ -78,8 +70,7 @@ public class GestureLauncherService extends SystemService {
     * Time in milliseconds in which the power button must be pressed twice so it will be considered
     * Time in milliseconds in which the power button must be pressed twice so it will be considered
     * as a camera launch.
     * as a camera launch.
     */
     */
    @VisibleForTesting
    @VisibleForTesting static final long CAMERA_POWER_DOUBLE_TAP_MAX_TIME_MS = 300;
    static final long POWER_DOUBLE_TAP_MAX_TIME_MS = 300;




    /**
    /**
@@ -109,23 +100,10 @@ public class GestureLauncherService extends SystemService {
    @VisibleForTesting
    @VisibleForTesting
    static final int EMERGENCY_GESTURE_POWER_BUTTON_COOLDOWN_PERIOD_MS_MAX = 5000;
    static final int EMERGENCY_GESTURE_POWER_BUTTON_COOLDOWN_PERIOD_MS_MAX = 5000;


    /** Indicates camera should be launched on power double tap. */
    /**
    @VisibleForTesting static final int LAUNCH_CAMERA_ON_DOUBLE_TAP_POWER = 0;
     * Number of taps required to launch camera shortcut.

     */
    /** Indicates wallet should be launched on power double tap. */
    private static final int CAMERA_POWER_TAP_COUNT_THRESHOLD = 2;
    @VisibleForTesting static final int LAUNCH_WALLET_ON_DOUBLE_TAP_POWER = 1;

    /** Number of taps required to launch the double tap shortcut (either camera or wallet). */
    public static final int DOUBLE_POWER_TAP_COUNT_THRESHOLD = 2;

    /** Bundle to send with PendingIntent to grant background activity start privileges. */
    private static final Bundle GRANT_BACKGROUND_START_PRIVILEGES =
            ActivityOptions.makeBasic()
                    .setPendingIntentBackgroundActivityStartMode(
                            ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS)
                    .toBundle();

    private final QuickAccessWalletClient mQuickAccessWalletClient;


    /** The listener that receives the gesture event. */
    /** The listener that receives the gesture event. */
    private final GestureEventListener mGestureListener = new GestureEventListener();
    private final GestureEventListener mGestureListener = new GestureEventListener();
@@ -180,9 +158,6 @@ public class GestureLauncherService extends SystemService {
     */
     */
    private boolean mCameraDoubleTapPowerEnabled;
    private boolean mCameraDoubleTapPowerEnabled;


    /** Whether wallet double tap power button gesture is currently enabled. */
    private boolean mWalletDoubleTapPowerEnabled;

    /**
    /**
     * Whether emergency gesture is currently enabled
     * Whether emergency gesture is currently enabled
     */
     */
@@ -229,22 +204,14 @@ public class GestureLauncherService extends SystemService {
        }
        }
    }
    }
    public GestureLauncherService(Context context) {
    public GestureLauncherService(Context context) {
        this(
        this(context, new MetricsLogger(), new UiEventLoggerImpl());
                context,
                new MetricsLogger(),
                QuickAccessWalletClient.create(context),
                new UiEventLoggerImpl());
    }
    }


    @VisibleForTesting
    @VisibleForTesting
    public GestureLauncherService(
    GestureLauncherService(Context context, MetricsLogger metricsLogger,
            Context context,
            MetricsLogger metricsLogger,
            QuickAccessWalletClient quickAccessWalletClient,
            UiEventLogger uiEventLogger) {
            UiEventLogger uiEventLogger) {
        super(context);
        super(context);
        mContext = context;
        mContext = context;
        mQuickAccessWalletClient = quickAccessWalletClient;
        mMetricsLogger = metricsLogger;
        mMetricsLogger = metricsLogger;
        mUiEventLogger = uiEventLogger;
        mUiEventLogger = uiEventLogger;
    }
    }
@@ -270,9 +237,6 @@ public class GestureLauncherService extends SystemService {
                    "GestureLauncherService");
                    "GestureLauncherService");
            updateCameraRegistered();
            updateCameraRegistered();
            updateCameraDoubleTapPowerEnabled();
            updateCameraDoubleTapPowerEnabled();
            if (launchWalletOptionOnPowerDoubleTap()) {
                updateWalletDoubleTapPowerEnabled();
            }
            updateEmergencyGestureEnabled();
            updateEmergencyGestureEnabled();
            updateEmergencyGesturePowerButtonCooldownPeriodMs();
            updateEmergencyGesturePowerButtonCooldownPeriodMs();


@@ -327,14 +291,6 @@ public class GestureLauncherService extends SystemService {
        }
        }
    }
    }


    @VisibleForTesting
    void updateWalletDoubleTapPowerEnabled() {
        boolean enabled = isWalletDoubleTapPowerSettingEnabled(mContext, mUserId);
        synchronized (this) {
            mWalletDoubleTapPowerEnabled = enabled;
        }
    }

    @VisibleForTesting
    @VisibleForTesting
    void updateEmergencyGestureEnabled() {
    void updateEmergencyGestureEnabled() {
        boolean enabled = isEmergencyGestureSettingEnabled(mContext, mUserId);
        boolean enabled = isEmergencyGestureSettingEnabled(mContext, mUserId);
@@ -462,34 +418,11 @@ public class GestureLauncherService extends SystemService {
                        Settings.Secure.CAMERA_GESTURE_DISABLED, 0, userId) == 0);
                        Settings.Secure.CAMERA_GESTURE_DISABLED, 0, userId) == 0);
    }
    }


    /** Checks if camera should be launched on double press of the power button. */
    public static boolean isCameraDoubleTapPowerSettingEnabled(Context context, int userId) {
    public static boolean isCameraDoubleTapPowerSettingEnabled(Context context, int userId) {
        boolean res;
        return isCameraDoubleTapPowerEnabled(context.getResources())

        if (launchWalletOptionOnPowerDoubleTap()) {
            res = isDoubleTapPowerGestureSettingEnabled(context, userId)
                    && getDoubleTapPowerGestureAction(context, userId)
                    == LAUNCH_CAMERA_ON_DOUBLE_TAP_POWER;
        } else {
            // These are legacy settings that will be deprecated once the option to launch both
            // wallet and camera has been created.
            res = isCameraDoubleTapPowerEnabled(context.getResources())
                && (Settings.Secure.getIntForUser(context.getContentResolver(),
                && (Settings.Secure.getIntForUser(context.getContentResolver(),
                        Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0, userId) == 0);
                        Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0, userId) == 0);
    }
    }
        return res;
    }

    /** Checks if wallet should be launched on double tap of the power button. */
    public static boolean isWalletDoubleTapPowerSettingEnabled(Context context, int userId) {
        if (!launchWalletOptionOnPowerDoubleTap()) {
            return false;
        }

        return isDoubleTapPowerGestureSettingEnabled(context, userId)
                && getDoubleTapPowerGestureAction(context, userId)
                        == LAUNCH_WALLET_ON_DOUBLE_TAP_POWER;
    }


    public static boolean isCameraLiftTriggerSettingEnabled(Context context, int userId) {
    public static boolean isCameraLiftTriggerSettingEnabled(Context context, int userId) {
        return isCameraLiftTriggerEnabled(context.getResources())
        return isCameraLiftTriggerEnabled(context.getResources())
@@ -508,28 +441,6 @@ public class GestureLauncherService extends SystemService {
                isDefaultEmergencyGestureEnabled(context.getResources()) ? 1 : 0, userId) != 0;
                isDefaultEmergencyGestureEnabled(context.getResources()) ? 1 : 0, userId) != 0;
    }
    }


    private static int getDoubleTapPowerGestureAction(Context context, int userId) {
        return Settings.Secure.getIntForUser(
                context.getContentResolver(),
                Settings.Secure.DOUBLE_TAP_POWER_BUTTON_GESTURE,
                LAUNCH_CAMERA_ON_DOUBLE_TAP_POWER,
                userId);
    }

    /** Whether the shortcut to launch app on power double press is enabled. */
    private static boolean isDoubleTapPowerGestureSettingEnabled(Context context, int userId) {
        return Settings.Secure.getIntForUser(
                                context.getContentResolver(),
                                Settings.Secure.DOUBLE_TAP_POWER_BUTTON_GESTURE_ENABLED,
                                isDoubleTapConfigEnabled(context.getResources()) ? 1 : 0,
                                userId)
                        == 1;
    }

    private static boolean isDoubleTapConfigEnabled(Resources resources) {
        return resources.getBoolean(R.bool.config_doubleTapPowerGestureEnabled);
    }

    /**
    /**
     * Gets power button cooldown period in milliseconds after emergency gesture is triggered. The
     * Gets power button cooldown period in milliseconds after emergency gesture is triggered. The
     * value is capped at a maximum
     * value is capped at a maximum
@@ -583,56 +494,10 @@ public class GestureLauncherService extends SystemService {
     * Whether GestureLauncherService should be enabled according to system properties.
     * Whether GestureLauncherService should be enabled according to system properties.
     */
     */
    public static boolean isGestureLauncherEnabled(Resources resources) {
    public static boolean isGestureLauncherEnabled(Resources resources) {
        boolean res =
        return isCameraLaunchEnabled(resources)
                isCameraLaunchEnabled(resources)
                || isCameraDoubleTapPowerEnabled(resources)
                || isCameraLiftTriggerEnabled(resources)
                || isCameraLiftTriggerEnabled(resources)
                || isEmergencyGestureEnabled(resources);
                || isEmergencyGestureEnabled(resources);
        if (launchWalletOptionOnPowerDoubleTap()) {
            res |= isDoubleTapConfigEnabled(resources);
        } else {
            res |= isCameraDoubleTapPowerEnabled(resources);
        }
        return res;
    }

    /**
     * Processes a power key event in GestureLauncherService without performing an action. This
     * method is called on every KEYCODE_POWER ACTION_DOWN event and ensures that, even if
     * KEYCODE_POWER events are passed to and handled by the app, the GestureLauncherService still
     * keeps track of all running KEYCODE_POWER events for its gesture detection and relevant
     * actions.
     */
    public void processPowerKeyDown(KeyEvent event) {
        if (mEmergencyGestureEnabled && mEmergencyGesturePowerButtonCooldownPeriodMs >= 0
                && event.getEventTime() - mLastEmergencyGestureTriggered
                < mEmergencyGesturePowerButtonCooldownPeriodMs) {
            return;
        }
        if (event.isLongPress()) {
            return;
        }

        final long powerTapInterval;

        synchronized (this) {
            powerTapInterval = event.getEventTime() - mLastPowerDown;
            mLastPowerDown = event.getEventTime();
            if (powerTapInterval >= POWER_SHORT_TAP_SEQUENCE_MAX_INTERVAL_MS) {
                // Tap too slow, reset consecutive tap counts.
                mFirstPowerDown = event.getEventTime();
                mPowerButtonConsecutiveTaps = 1;
                mPowerButtonSlowConsecutiveTaps = 1;
            } else if (powerTapInterval >= POWER_DOUBLE_TAP_MAX_TIME_MS) {
                // Tap too slow for shortcuts
                mFirstPowerDown = event.getEventTime();
                mPowerButtonConsecutiveTaps = 1;
                mPowerButtonSlowConsecutiveTaps++;
            } else if (powerTapInterval > 0) {
                // Fast consecutive tap
                mPowerButtonConsecutiveTaps++;
                mPowerButtonSlowConsecutiveTaps++;
            }
        }
    }
    }


    /**
    /**
@@ -642,8 +507,8 @@ public class GestureLauncherService extends SystemService {
     * @param outLaunched true if some action is taken as part of the key intercept (eg, app launch)
     * @param outLaunched true if some action is taken as part of the key intercept (eg, app launch)
     * @return true if the key down event is intercepted
     * @return true if the key down event is intercepted
     */
     */
    public boolean interceptPowerKeyDown(
    public boolean interceptPowerKeyDown(KeyEvent event, boolean interactive,
            KeyEvent event, boolean interactive, MutableBoolean outLaunched) {
            MutableBoolean outLaunched) {
        if (mEmergencyGestureEnabled && mEmergencyGesturePowerButtonCooldownPeriodMs >= 0
        if (mEmergencyGestureEnabled && mEmergencyGesturePowerButtonCooldownPeriodMs >= 0
                && event.getEventTime() - mLastEmergencyGestureTriggered
                && event.getEventTime() - mLastEmergencyGestureTriggered
                < mEmergencyGesturePowerButtonCooldownPeriodMs) {
                < mEmergencyGesturePowerButtonCooldownPeriodMs) {
@@ -665,7 +530,6 @@ public class GestureLauncherService extends SystemService {
            return false;
            return false;
        }
        }
        boolean launchCamera = false;
        boolean launchCamera = false;
        boolean launchWallet = false;
        boolean launchEmergencyGesture = false;
        boolean launchEmergencyGesture = false;
        boolean intercept = false;
        boolean intercept = false;
        long powerTapInterval;
        long powerTapInterval;
@@ -677,12 +541,12 @@ public class GestureLauncherService extends SystemService {
                mFirstPowerDown  = event.getEventTime();
                mFirstPowerDown  = event.getEventTime();
                mPowerButtonConsecutiveTaps = 1;
                mPowerButtonConsecutiveTaps = 1;
                mPowerButtonSlowConsecutiveTaps = 1;
                mPowerButtonSlowConsecutiveTaps = 1;
            } else if (powerTapInterval >= POWER_DOUBLE_TAP_MAX_TIME_MS) {
            } else if (powerTapInterval >= CAMERA_POWER_DOUBLE_TAP_MAX_TIME_MS) {
                // Tap too slow for shortcuts
                // Tap too slow for shortcuts
                mFirstPowerDown  = event.getEventTime();
                mFirstPowerDown  = event.getEventTime();
                mPowerButtonConsecutiveTaps = 1;
                mPowerButtonConsecutiveTaps = 1;
                mPowerButtonSlowConsecutiveTaps++;
                mPowerButtonSlowConsecutiveTaps++;
            } else if (!overridePowerKeyBehaviorInFocusedWindow() || powerTapInterval > 0) {
            } else {
                // Fast consecutive tap
                // Fast consecutive tap
                mPowerButtonConsecutiveTaps++;
                mPowerButtonConsecutiveTaps++;
                mPowerButtonSlowConsecutiveTaps++;
                mPowerButtonSlowConsecutiveTaps++;
@@ -722,16 +586,10 @@ public class GestureLauncherService extends SystemService {
                }
                }
            }
            }
            if (mCameraDoubleTapPowerEnabled
            if (mCameraDoubleTapPowerEnabled
                    && powerTapInterval < POWER_DOUBLE_TAP_MAX_TIME_MS
                    && powerTapInterval < CAMERA_POWER_DOUBLE_TAP_MAX_TIME_MS
                    && mPowerButtonConsecutiveTaps == DOUBLE_POWER_TAP_COUNT_THRESHOLD) {
                    && mPowerButtonConsecutiveTaps == CAMERA_POWER_TAP_COUNT_THRESHOLD) {
                launchCamera = true;
                launchCamera = true;
                intercept = interactive;
                intercept = interactive;
            } else if (launchWalletOptionOnPowerDoubleTap()
                    && mWalletDoubleTapPowerEnabled
                    && powerTapInterval < POWER_DOUBLE_TAP_MAX_TIME_MS
                    && mPowerButtonConsecutiveTaps == DOUBLE_POWER_TAP_COUNT_THRESHOLD) {
                launchWallet = true;
                intercept = interactive;
            }
            }
        }
        }
        if (mPowerButtonConsecutiveTaps > 1 || mPowerButtonSlowConsecutiveTaps > 1) {
        if (mPowerButtonConsecutiveTaps > 1 || mPowerButtonSlowConsecutiveTaps > 1) {
@@ -750,10 +608,6 @@ public class GestureLauncherService extends SystemService {
                        (int) powerTapInterval);
                        (int) powerTapInterval);
                mUiEventLogger.log(GestureLauncherEvent.GESTURE_CAMERA_DOUBLE_TAP_POWER);
                mUiEventLogger.log(GestureLauncherEvent.GESTURE_CAMERA_DOUBLE_TAP_POWER);
            }
            }
        } else if (launchWallet) {
            Slog.i(TAG, "Power button double tap gesture detected, launching wallet. Interval="
                    + powerTapInterval + "ms");
            launchWallet = sendGestureTargetActivityPendingIntent();
        } else if (launchEmergencyGesture) {
        } else if (launchEmergencyGesture) {
            Slog.i(TAG, "Emergency gesture detected, launching.");
            Slog.i(TAG, "Emergency gesture detected, launching.");
            launchEmergencyGesture = handleEmergencyGesture();
            launchEmergencyGesture = handleEmergencyGesture();
@@ -769,74 +623,11 @@ public class GestureLauncherService extends SystemService {
                mPowerButtonSlowConsecutiveTaps);
                mPowerButtonSlowConsecutiveTaps);
        mMetricsLogger.histogram("power_double_tap_interval", (int) powerTapInterval);
        mMetricsLogger.histogram("power_double_tap_interval", (int) powerTapInterval);


        outLaunched.value = launchCamera || launchEmergencyGesture || launchWallet;
        outLaunched.value = launchCamera || launchEmergencyGesture;
        // Intercept power key event if the press is part of a gesture (camera, eGesture) and the
        // Intercept power key event if the press is part of a gesture (camera, eGesture) and the
        // user has completed setup.
        // user has completed setup.
        return intercept && isUserSetupComplete();
        return intercept && isUserSetupComplete();
    }
    }

    /**
     * Fetches and sends gestureTargetActivityPendingIntent from QuickAccessWallet, which is a
     * specific activity that QuickAccessWalletService has defined to be launch on detection of the
     * power button gesture.
     */
    private boolean sendGestureTargetActivityPendingIntent() {
        boolean userSetupComplete = isUserSetupComplete();
        if (mQuickAccessWalletClient == null
                || !mQuickAccessWalletClient.isWalletServiceAvailable()) {
            Slog.w(TAG, "QuickAccessWalletService is not available, ignoring wallet gesture.");
            return false;
        }

        if (!userSetupComplete) {
            if (DBG) {
                Slog.d(TAG, "userSetupComplete = false, ignoring wallet gesture.");
            }
            return false;
        }
        if (DBG) {
            Slog.d(TAG, "userSetupComplete = true, performing wallet gesture.");
        }

        mQuickAccessWalletClient.getGestureTargetActivityPendingIntent(
                getContext().getMainExecutor(),
                gesturePendingIntent -> {
                    if (gesturePendingIntent == null) {
                        Slog.d(TAG, "getGestureTargetActivityPendingIntent is null.");
                        sendFallbackPendingIntent();
                        return;
                    }
                    sendPendingIntentWithBackgroundStartPrivileges(gesturePendingIntent);
                });
        return true;
    }

    /**
     * If gestureTargetActivityPendingIntent is null, this method is invoked to start the activity
     * that QuickAccessWalletService has defined to host the Wallet view, which is typically the
     * home screen of the Wallet application.
     */
    private void sendFallbackPendingIntent() {
        mQuickAccessWalletClient.getWalletPendingIntent(
                getContext().getMainExecutor(),
                walletPendingIntent -> {
                    if (walletPendingIntent == null) {
                        Slog.w(TAG, "getWalletPendingIntent returns null. Not launching "
                                + "anything for wallet.");
                        return;
                    }
                    sendPendingIntentWithBackgroundStartPrivileges(walletPendingIntent);
                });
    }

    private void sendPendingIntentWithBackgroundStartPrivileges(PendingIntent pendingIntent) {
        try {
            pendingIntent.send(GRANT_BACKGROUND_START_PRIVILEGES);
        } catch (PendingIntent.CanceledException e) {
            Slog.e(TAG, "PendingIntent was canceled", e);
        }
    }

    /**
    /**
     * @return true if camera was launched, false otherwise.
     * @return true if camera was launched, false otherwise.
     */
     */
@@ -909,8 +700,7 @@ public class GestureLauncherService extends SystemService {
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
    }
    }


    private final BroadcastReceiver mUserReceiver =
    private final BroadcastReceiver mUserReceiver = new BroadcastReceiver() {
            new BroadcastReceiver() {
        @Override
        @Override
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) {
            if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) {
@@ -919,24 +709,17 @@ public class GestureLauncherService extends SystemService {
                registerContentObservers();
                registerContentObservers();
                updateCameraRegistered();
                updateCameraRegistered();
                updateCameraDoubleTapPowerEnabled();
                updateCameraDoubleTapPowerEnabled();
                        if (launchWalletOptionOnPowerDoubleTap()) {
                            updateWalletDoubleTapPowerEnabled();
                        }
                updateEmergencyGestureEnabled();
                updateEmergencyGestureEnabled();
                updateEmergencyGesturePowerButtonCooldownPeriodMs();
                updateEmergencyGesturePowerButtonCooldownPeriodMs();
            }
            }
        }
        }
    };
    };


    private final ContentObserver mSettingObserver =
    private final ContentObserver mSettingObserver = new ContentObserver(new Handler()) {
            new ContentObserver(new Handler()) {
        public void onChange(boolean selfChange, android.net.Uri uri, int userId) {
        public void onChange(boolean selfChange, android.net.Uri uri, int userId) {
            if (userId == mUserId) {
            if (userId == mUserId) {
                updateCameraRegistered();
                updateCameraRegistered();
                updateCameraDoubleTapPowerEnabled();
                updateCameraDoubleTapPowerEnabled();
                        if (launchWalletOptionOnPowerDoubleTap()) {
                            updateWalletDoubleTapPowerEnabled();
                        }
                updateEmergencyGestureEnabled();
                updateEmergencyGestureEnabled();
                updateEmergencyGesturePowerButtonCooldownPeriodMs();
                updateEmergencyGesturePowerButtonCooldownPeriodMs();
            }
            }
+5 −228

File changed.

Preview size limit exceeded, changes collapsed.

+2 −3
Original line number Original line Diff line number Diff line
@@ -5750,10 +5750,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                || mKeyInterceptionInfo.layoutParamsPrivateFlags != getAttrs().privateFlags
                || mKeyInterceptionInfo.layoutParamsPrivateFlags != getAttrs().privateFlags
                || mKeyInterceptionInfo.layoutParamsType != getAttrs().type
                || mKeyInterceptionInfo.layoutParamsType != getAttrs().type
                || mKeyInterceptionInfo.windowTitle != getWindowTag()
                || mKeyInterceptionInfo.windowTitle != getWindowTag()
                || mKeyInterceptionInfo.windowOwnerUid != getOwningUid()
                || mKeyInterceptionInfo.windowOwnerUid != getOwningUid()) {
                || mKeyInterceptionInfo.inputFeaturesFlags != getAttrs().inputFeatures) {
            mKeyInterceptionInfo = new KeyInterceptionInfo(getAttrs().type, getAttrs().privateFlags,
            mKeyInterceptionInfo = new KeyInterceptionInfo(getAttrs().type, getAttrs().privateFlags,
                    getWindowTag().toString(), getOwningUid(), getAttrs().inputFeatures);
                    getWindowTag().toString(), getOwningUid());
        }
        }
        return mKeyInterceptionInfo;
        return mKeyInterceptionInfo;
    }
    }
+71 −489

File changed.

Preview size limit exceeded, changes collapsed.

Loading