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

Commit 73a72444 authored by Joshua McCloskey's avatar Joshua McCloskey Committed by Joshua Mccloskey
Browse files

Removed fp acquire start wakes up device.

Test: Manually verified fingerprint tap from screen off no longer wakes
up device.
Bug: 246774240

Change-Id: I2ccf76d4e34802af3cb6382b5d030751a65a20a9
Merged-In: I2ccf76d4e34802af3cb6382b5d030751a65a20a9
parent a9680091
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
    <bool name="kg_enable_camera_default_widget">true</bool>
    <bool name="kg_center_small_widgets_vertically">false</bool>
    <bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool>
    <bool name="kg_wake_on_acquire_start">false</bool>
    <bool name="action_bar_embed_tabs">true</bool>
    <bool name="split_action_bar_is_narrow">true</bool>
    <bool name="preferences_prefer_dual_pane">false</bool>
+0 −1
Original line number Diff line number Diff line
@@ -2841,7 +2841,6 @@
  <java-symbol type="dimen" name="fast_scroller_minimum_touch_target" />
  <java-symbol type="array" name="config_cdma_international_roaming_indicators" />
  <java-symbol type="string" name="kg_text_message_separator" />
  <java-symbol type="bool" name="kg_wake_on_acquire_start" />

  <java-symbol type="bool" name="config_use_sim_language_file" />
  <java-symbol type="bool" name="config_LTE_eri_for_network_name" />
+0 −13
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_N
import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_PERMANENT;
import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_TIMED;
import static android.hardware.biometrics.BiometricConstants.LockoutMode;
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_START;
import static android.hardware.biometrics.BiometricSourceType.FACE;
import static android.hardware.biometrics.BiometricSourceType.FINGERPRINT;
import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN;
@@ -352,7 +351,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private final Executor mBackgroundExecutor;
    private final SensorPrivacyManager mSensorPrivacyManager;
    private final ActiveUnlockConfig mActiveUnlockConfig;
    private final PowerManager mPowerManager;
    private final IDreamManager mDreamManager;
    private final TelephonyManager mTelephonyManager;
    @Nullable
@@ -360,7 +358,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    @Nullable
    private final FaceManager mFaceManager;
    private final LockPatternUtils mLockPatternUtils;
    private final boolean mWakeOnFingerprintAcquiredStart;
    @VisibleForTesting
    @DevicePostureController.DevicePostureInt
    protected int mConfigFaceAuthSupportedPosture;
@@ -884,11 +881,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private void handleFingerprintAcquired(
            @BiometricFingerprintConstants.FingerprintAcquired int acquireInfo) {
        Assert.isMainThread();
        if (mWakeOnFingerprintAcquiredStart && acquireInfo == FINGERPRINT_ACQUIRED_START) {
            mPowerManager.wakeUp(
                    SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_BIOMETRIC,
                    "com.android.systemui.keyguard:FINGERPRINT_ACQUIRED_START");
        }
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
@@ -2049,7 +2041,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            UiEventLogger uiEventLogger,
            // This has to be a provider because SessionTracker depends on KeyguardUpdateMonitor :(
            Provider<SessionTracker> sessionTrackerProvider,
            PowerManager powerManager,
            TrustManager trustManager,
            SubscriptionManager subscriptionManager,
            UserManager userManager,
@@ -2086,7 +2077,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        mLogger = logger;
        mUiEventLogger = uiEventLogger;
        mSessionTrackerProvider = sessionTrackerProvider;
        mPowerManager = powerManager;
        mTrustManager = trustManager;
        mUserManager = userManager;
        mDreamManager = dreamManager;
@@ -2097,8 +2087,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        mFpm = fingerprintManager;
        mFaceManager = faceManager;
        mActiveUnlockConfig.setKeyguardUpdateMonitor(this);
        mWakeOnFingerprintAcquiredStart = context.getResources()
                        .getBoolean(com.android.internal.R.bool.kg_wake_on_acquire_start);
        mFaceAcquiredInfoIgnoreList = Arrays.stream(
                mContext.getResources().getIntArray(
                        R.array.config_face_acquire_device_entry_ignorelist))
@@ -3877,7 +3865,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        pw.println("  getUserHasTrust()=" + getUserHasTrust(getCurrentUser()));
        pw.println("  getUserUnlockedWithBiometric()="
                + getUserUnlockedWithBiometric(getCurrentUser()));
        pw.println("  mWakeOnFingerprintAcquiredStart=" + mWakeOnFingerprintAcquiredStart);
        pw.println("  SIM States:");
        for (SimData data : mSimDatas.values()) {
            pw.println("    " + data.toString());
+1 −33
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.keyguard;

import static android.app.StatusBarManager.SESSION_KEYGUARD;
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_START;
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_LOCKOUT;
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_LOCKOUT_PERMANENT;
import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_POWER_BUTTON;
@@ -41,7 +40,6 @@ import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
@@ -95,7 +93,6 @@ import android.os.PowerManager;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
import android.service.dreams.IDreamManager;
import android.service.trust.TrustAgentService;
import android.telephony.ServiceState;
@@ -238,8 +235,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
    @Mock
    private UiEventLogger mUiEventLogger;
    @Mock
    private PowerManager mPowerManager;
    @Mock
    private GlobalSettings mGlobalSettings;
    private FaceWakeUpTriggersConfig mFaceWakeUpTriggersConfig;
    @Mock
@@ -1871,28 +1866,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
        assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(true)).isEqualTo(true);
    }

    @Test
    public void testFingerAcquired_wakesUpPowerManager() {
        cleanupKeyguardUpdateMonitor();
        mContext.getOrCreateTestableResources().addOverride(
                com.android.internal.R.bool.kg_wake_on_acquire_start, true);
        mKeyguardUpdateMonitor = new TestableKeyguardUpdateMonitor(mContext);
        fingerprintAcquireStart();

        verify(mPowerManager).wakeUp(anyLong(), anyInt(), anyString());
    }

    @Test
    public void testFingerAcquired_doesNotWakeUpPowerManager() {
        cleanupKeyguardUpdateMonitor();
        mContext.getOrCreateTestableResources().addOverride(
                com.android.internal.R.bool.kg_wake_on_acquire_start, false);
        mKeyguardUpdateMonitor = new TestableKeyguardUpdateMonitor(mContext);
        fingerprintAcquireStart();

        verify(mPowerManager, never()).wakeUp(anyLong(), anyInt(), anyString());
    }

    @Test
    public void testDreamingStopped_faceDoesNotRun() {
        mKeyguardUpdateMonitor.dispatchDreamingStopped();
@@ -2374,11 +2347,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
                .onAuthenticationError(FINGERPRINT_ERROR_LOCKOUT, "Fingerprint locked out");
    }

    private void fingerprintAcquireStart() {
        mKeyguardUpdateMonitor.mFingerprintAuthenticationCallback
                .onAuthenticationAcquired(FINGERPRINT_ACQUIRED_START);
    }

    private void deviceInPostureStateOpened() {
        mKeyguardUpdateMonitor.mPostureCallback.onPostureChanged(DEVICE_POSTURE_OPENED);
    }
@@ -2525,7 +2493,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
                    mAuthController, mTelephonyListenerManager,
                    mInteractionJankMonitor, mLatencyTracker, mActiveUnlockConfig,
                    mKeyguardUpdateMonitorLogger, mUiEventLogger, () -> mSessionTracker,
                    mPowerManager, mTrustManager, mSubscriptionManager, mUserManager,
                    mTrustManager, mSubscriptionManager, mUserManager,
                    mDreamManager, mDevicePolicyManager, mSensorPrivacyManager, mTelephonyManager,
                    mPackageManager, mFaceManager, mFingerprintManager, mBiometricManager,
                    mFaceWakeUpTriggersConfig, mDevicePostureController,