Loading packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java +8 −7 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba public void handleMessage(Message msg) { switch(msg.what) { case MSG_SHOW_DIALOG: handleShowDialog((SomeArgs) msg.obj); handleShowDialog((SomeArgs) msg.obj, false /* skipAnimation */); break; case MSG_BIOMETRIC_AUTHENTICATED: handleBiometricAuthenticated(); Loading Loading @@ -178,7 +178,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba mHandler.obtainMessage(MSG_HIDE_DIALOG, false /* userCanceled */).sendToTarget(); } private void handleShowDialog(SomeArgs args) { private void handleShowDialog(SomeArgs args, boolean skipAnimation) { mCurrentDialogArgs = args; final int type = args.argi1; mCurrentDialog = mDialogs.get(type); Loading @@ -195,6 +195,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba mReceiver = (IBiometricPromptReceiver) args.arg2; mCurrentDialog.setBundle((Bundle)args.arg1); mCurrentDialog.setRequireConfirmation((boolean)args.arg3); mCurrentDialog.setSkipIntro(skipAnimation); mWindowManager.addView(mCurrentDialog, mCurrentDialog.getLayoutParams()); mDialogShowing = true; } Loading Loading @@ -278,15 +279,15 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); final boolean wasShowing = mDialogShowing; if (mDialogShowing) { mCurrentDialog.forceRemove(); mDialogShowing = false; } createDialogs(); if (mDialogShowing) { mCurrentDialog = mDialogs.get(mCurrentDialogArgs.argi1); mCurrentDialog.forceRemove(); // Prevents intro animation when reattaching. mDialogShowing = false; handleShowDialog(mCurrentDialogArgs); if (wasShowing) { handleShowDialog(mCurrentDialogArgs, true /* skipAnimation */); } } } packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java +18 −10 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public abstract class BiometricDialogView extends LinearLayout { private final float mAnimationTranslationOffset; private final int mErrorColor; private final int mTextColor; private final float mDisplayWidth; private final float mDialogWidth; private final DialogViewCallback mCallback; private ViewGroup mLayout; Loading @@ -76,6 +76,7 @@ public abstract class BiometricDialogView extends LinearLayout { private int mLastState; private boolean mAnimatingAway; private boolean mWasForceRemoved; private boolean mSkipIntro; protected boolean mRequireConfirmation; protected abstract void updateIcon(int lastState, int newState); Loading Loading @@ -131,7 +132,7 @@ public abstract class BiometricDialogView extends LinearLayout { DisplayMetrics metrics = new DisplayMetrics(); mWindowManager.getDefaultDisplay().getMetrics(metrics); mDisplayWidth = metrics.widthPixels; mDialogWidth = Math.min(metrics.widthPixels, metrics.heightPixels); // Create the dialog LayoutInflater factory = LayoutInflater.from(getContext()); Loading Loading @@ -198,8 +199,7 @@ public abstract class BiometricDialogView extends LinearLayout { final Button negative = mLayout.findViewById(R.id.button2); final Button positive = mLayout.findViewById(R.id.button1); mDialog.getLayoutParams().width = (int) mDisplayWidth; mDialog.getLayoutParams().width = (int) mDialogWidth; mLastState = STATE_NONE; updateState(STATE_AUTHENTICATING); Loading Loading @@ -228,20 +228,21 @@ public abstract class BiometricDialogView extends LinearLayout { negative.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT)); if (!mWasForceRemoved) { // Dim the background and slide the dialog up mDialog.setTranslationY(mAnimationTranslationOffset); mLayout.setAlpha(0f); postOnAnimation(mShowAnimationRunnable); } else { if (mWasForceRemoved || mSkipIntro) { // Show the dialog immediately mLayout.animate().cancel(); mDialog.animate().cancel(); mDialog.setAlpha(1.0f); mDialog.setTranslationY(0); mLayout.setAlpha(1.0f); } else { // Dim the background and slide the dialog up mDialog.setTranslationY(mAnimationTranslationOffset); mLayout.setAlpha(0f); postOnAnimation(mShowAnimationRunnable); } mWasForceRemoved = false; mSkipIntro = false; } private void setDismissesDialog(View v) { Loading Loading @@ -296,6 +297,13 @@ public abstract class BiometricDialogView extends LinearLayout { mWasForceRemoved = true; } /** * Skip the intro animation */ public void setSkipIntro(boolean skip) { mSkipIntro = skip; } public boolean isAnimatingAway() { return mAnimatingAway; } Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java +8 −7 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba public void handleMessage(Message msg) { switch(msg.what) { case MSG_SHOW_DIALOG: handleShowDialog((SomeArgs) msg.obj); handleShowDialog((SomeArgs) msg.obj, false /* skipAnimation */); break; case MSG_BIOMETRIC_AUTHENTICATED: handleBiometricAuthenticated(); Loading Loading @@ -178,7 +178,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba mHandler.obtainMessage(MSG_HIDE_DIALOG, false /* userCanceled */).sendToTarget(); } private void handleShowDialog(SomeArgs args) { private void handleShowDialog(SomeArgs args, boolean skipAnimation) { mCurrentDialogArgs = args; final int type = args.argi1; mCurrentDialog = mDialogs.get(type); Loading @@ -195,6 +195,7 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba mReceiver = (IBiometricPromptReceiver) args.arg2; mCurrentDialog.setBundle((Bundle)args.arg1); mCurrentDialog.setRequireConfirmation((boolean)args.arg3); mCurrentDialog.setSkipIntro(skipAnimation); mWindowManager.addView(mCurrentDialog, mCurrentDialog.getLayoutParams()); mDialogShowing = true; } Loading Loading @@ -278,15 +279,15 @@ public class BiometricDialogImpl extends SystemUI implements CommandQueue.Callba @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); final boolean wasShowing = mDialogShowing; if (mDialogShowing) { mCurrentDialog.forceRemove(); mDialogShowing = false; } createDialogs(); if (mDialogShowing) { mCurrentDialog = mDialogs.get(mCurrentDialogArgs.argi1); mCurrentDialog.forceRemove(); // Prevents intro animation when reattaching. mDialogShowing = false; handleShowDialog(mCurrentDialogArgs); if (wasShowing) { handleShowDialog(mCurrentDialogArgs, true /* skipAnimation */); } } }
packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java +18 −10 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public abstract class BiometricDialogView extends LinearLayout { private final float mAnimationTranslationOffset; private final int mErrorColor; private final int mTextColor; private final float mDisplayWidth; private final float mDialogWidth; private final DialogViewCallback mCallback; private ViewGroup mLayout; Loading @@ -76,6 +76,7 @@ public abstract class BiometricDialogView extends LinearLayout { private int mLastState; private boolean mAnimatingAway; private boolean mWasForceRemoved; private boolean mSkipIntro; protected boolean mRequireConfirmation; protected abstract void updateIcon(int lastState, int newState); Loading Loading @@ -131,7 +132,7 @@ public abstract class BiometricDialogView extends LinearLayout { DisplayMetrics metrics = new DisplayMetrics(); mWindowManager.getDefaultDisplay().getMetrics(metrics); mDisplayWidth = metrics.widthPixels; mDialogWidth = Math.min(metrics.widthPixels, metrics.heightPixels); // Create the dialog LayoutInflater factory = LayoutInflater.from(getContext()); Loading Loading @@ -198,8 +199,7 @@ public abstract class BiometricDialogView extends LinearLayout { final Button negative = mLayout.findViewById(R.id.button2); final Button positive = mLayout.findViewById(R.id.button1); mDialog.getLayoutParams().width = (int) mDisplayWidth; mDialog.getLayoutParams().width = (int) mDialogWidth; mLastState = STATE_NONE; updateState(STATE_AUTHENTICATING); Loading Loading @@ -228,20 +228,21 @@ public abstract class BiometricDialogView extends LinearLayout { negative.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT)); if (!mWasForceRemoved) { // Dim the background and slide the dialog up mDialog.setTranslationY(mAnimationTranslationOffset); mLayout.setAlpha(0f); postOnAnimation(mShowAnimationRunnable); } else { if (mWasForceRemoved || mSkipIntro) { // Show the dialog immediately mLayout.animate().cancel(); mDialog.animate().cancel(); mDialog.setAlpha(1.0f); mDialog.setTranslationY(0); mLayout.setAlpha(1.0f); } else { // Dim the background and slide the dialog up mDialog.setTranslationY(mAnimationTranslationOffset); mLayout.setAlpha(0f); postOnAnimation(mShowAnimationRunnable); } mWasForceRemoved = false; mSkipIntro = false; } private void setDismissesDialog(View v) { Loading Loading @@ -296,6 +297,13 @@ public abstract class BiometricDialogView extends LinearLayout { mWasForceRemoved = true; } /** * Skip the intro animation */ public void setSkipIntro(boolean skip) { mSkipIntro = skip; } public boolean isAnimatingAway() { return mAnimatingAway; } Loading