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

Commit 7b82a41a authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Android (Google) Code Review
Browse files

Merge "Removed fp acquire start wakes up device."

parents a4312782 95270beb
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
@@ -2774,7 +2774,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;
@@ -353,7 +352,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
@@ -361,7 +359,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;
@@ -885,11 +882,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) {
@@ -2051,7 +2043,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,
@@ -2088,7 +2079,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        mLogger = logger;
        mUiEventLogger = uiEventLogger;
        mSessionTrackerProvider = sessionTrackerProvider;
        mPowerManager = powerManager;
        mTrustManager = trustManager;
        mUserManager = userManager;
        mDreamManager = dreamManager;
@@ -2099,8 +2089,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))
@@ -3884,7 +3872,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 −32
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.keyguard;

import static android.app.StatusBarManager.SESSION_KEYGUARD;
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
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;
@@ -42,7 +41,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;
@@ -238,8 +236,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
    @Mock
    private UiEventLogger mUiEventLogger;
    @Mock
    private PowerManager mPowerManager;
    @Mock
    private GlobalSettings mGlobalSettings;
    private FaceWakeUpTriggersConfig mFaceWakeUpTriggersConfig;
    @Mock
@@ -1883,28 +1879,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();
@@ -2386,11 +2360,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);
    }
@@ -2537,7 +2506,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,