Loading src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java +38 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ import android.os.Vibrator; import android.text.TextUtils; import android.util.Log; import android.view.MotionEvent; import android.view.OrientationEventListener; import android.view.Surface; import android.view.View; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; Loading Loading @@ -116,6 +118,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { private AccessibilityManager mAccessibilityManager; private boolean mIsAccessibilityEnabled; private OrientationEventListener mOrientationEventListener; private int mPreviousRotation = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading @@ -128,6 +133,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { mAccessibilityManager = getSystemService(AccessibilityManager.class); mIsAccessibilityEnabled = mAccessibilityManager.isEnabled(); listenOrientationEvent(); if (mCanAssumeUdfps) { if (BiometricUtils.isReverseLandscape(getApplicationContext())) { setContentView(R.layout.udfps_enroll_enrolling_land); Loading Loading @@ -255,6 +262,12 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { stopIconAnimation(); } @Override protected void onDestroy() { stopListenOrientationEvent(); super.onDestroy(); } private void animateProgress(int progress) { if (mCanAssumeUdfps) { // UDFPS animations are owned by SystemUI Loading Loading @@ -451,6 +464,31 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { } } private void listenOrientationEvent() { mOrientationEventListener = new OrientationEventListener(this) { @Override public void onOrientationChanged(int orientation) { final int currentRotation = getDisplay().getRotation(); if ((mPreviousRotation == Surface.ROTATION_90 && currentRotation == Surface.ROTATION_270) || ( mPreviousRotation == Surface.ROTATION_270 && currentRotation == Surface.ROTATION_90)) { mPreviousRotation = currentRotation; recreate(); } } }; mOrientationEventListener.enable(); mPreviousRotation = getDisplay().getRotation(); } private void stopListenOrientationEvent() { if (mOrientationEventListener != null) { mOrientationEventListener.disable(); } mOrientationEventListener = null; } private final Animator.AnimatorListener mProgressAnimationListener = new Animator.AnimatorListener() { Loading Loading
src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java +38 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ import android.os.Vibrator; import android.text.TextUtils; import android.util.Log; import android.view.MotionEvent; import android.view.OrientationEventListener; import android.view.Surface; import android.view.View; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; Loading Loading @@ -116,6 +118,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { private AccessibilityManager mAccessibilityManager; private boolean mIsAccessibilityEnabled; private OrientationEventListener mOrientationEventListener; private int mPreviousRotation = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading @@ -128,6 +133,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { mAccessibilityManager = getSystemService(AccessibilityManager.class); mIsAccessibilityEnabled = mAccessibilityManager.isEnabled(); listenOrientationEvent(); if (mCanAssumeUdfps) { if (BiometricUtils.isReverseLandscape(getApplicationContext())) { setContentView(R.layout.udfps_enroll_enrolling_land); Loading Loading @@ -255,6 +262,12 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { stopIconAnimation(); } @Override protected void onDestroy() { stopListenOrientationEvent(); super.onDestroy(); } private void animateProgress(int progress) { if (mCanAssumeUdfps) { // UDFPS animations are owned by SystemUI Loading Loading @@ -451,6 +464,31 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { } } private void listenOrientationEvent() { mOrientationEventListener = new OrientationEventListener(this) { @Override public void onOrientationChanged(int orientation) { final int currentRotation = getDisplay().getRotation(); if ((mPreviousRotation == Surface.ROTATION_90 && currentRotation == Surface.ROTATION_270) || ( mPreviousRotation == Surface.ROTATION_270 && currentRotation == Surface.ROTATION_90)) { mPreviousRotation = currentRotation; recreate(); } } }; mOrientationEventListener.enable(); mPreviousRotation = getDisplay().getRotation(); } private void stopListenOrientationEvent() { if (mOrientationEventListener != null) { mOrientationEventListener.disable(); } mOrientationEventListener = null; } private final Animator.AnimatorListener mProgressAnimationListener = new Animator.AnimatorListener() { Loading