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

Commit ad45cc9e authored by Yeabkal Wubshit's avatar Yeabkal Wubshit
Browse files

Read Stem Primary Key Behaviors once in PhoneWindowManager#init

These behaviors were read as a configuration-dependent behaviors, every
time device configuration changed. Since the stem primary key is not
configuration dependent as of now, there's no need to re-read it on
every configuration change.

Bug: 283029769
Test: manual
Change-Id: I422a76743e1744a609710eea16ccac2232252edd
parent d7476641
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -2204,6 +2204,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                com.android.internal.R.integer.config_shortPressOnSleepBehavior);
        mAllowStartActivityForLongPressOnPowerDuringSetup = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_allowStartActivityForLongPressOnPowerInSetup);
        mShortPressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_shortPressOnStemPrimaryBehavior);
        mLongPressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longPressOnStemPrimaryBehavior);
        mDoublePressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_doublePressOnStemPrimaryBehavior);
        mTriplePressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_triplePressOnStemPrimaryBehavior);

        mHapticTextHandleEnabled = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_enableHapticTextHandle);
@@ -2610,14 +2618,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (mPackageManager.hasSystemFeature(FEATURE_PICTURE_IN_PICTURE)) {
            mShortPressOnWindowBehavior = SHORT_PRESS_WINDOW_PICTURE_IN_PICTURE;
        }
        mShortPressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_shortPressOnStemPrimaryBehavior);
        mLongPressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longPressOnStemPrimaryBehavior);
        mDoublePressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_doublePressOnStemPrimaryBehavior);
        mTriplePressOnStemPrimaryBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_triplePressOnStemPrimaryBehavior);
    }

    public void updateSettings() {