diff options
author | Dave Mankoff <mankoff@google.com> | 2020-09-22 00:24:04 +0000 |
---|---|---|
committer | Dave Mankoff <mankoff@google.com> | 2020-09-22 13:26:39 +0000 |
commit | 612c5d78c418ff33b36a19a7911e4279a26bcf9b (patch) | |
tree | 749b78dcf83a55167651065f00ebeacc4beba08c /packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java | |
parent | 87f6d21e679af9f783777d21f08c46f8bcaf04c0 (diff) |
Revert "5/N Add KeyguardSecurityViewFlipperController."
Revert submission 12585643-b166448040-keyguard-message-area
Reason for revert: http://b/169081305 & http://b/169020145
Reverted Changes:
I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer....
Iecf265744:5/N Add KeyguardSecurityViewFlipperController.
I90ab99b2f:6/N Add Controller for KeyguardPatternView
I4b74eddd1:7/N controllers for remaining Keyguard Password Vi...
I805286374:8/N Remove View Injection from KeyguardMessageArea...
I362755980:9/N Clean Up Keyguard Class Structure
Change-Id: I5cbe04c0cfb1c081fbf2e9958cb22dca3e4d80ad
Fixes: 169081305
Fixes: 169020145
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java | 186 |
1 files changed, 0 insertions, 186 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java deleted file mode 100644 index 07cfdb8672c5..000000000000 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewFlipperController.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.keyguard; - -import android.content.res.ColorStateList; -import android.util.Log; -import android.view.LayoutInflater; - -import com.android.internal.annotations.VisibleForTesting; -import com.android.internal.widget.LockPatternUtils; -import com.android.keyguard.KeyguardInputViewController.Factory; -import com.android.keyguard.KeyguardSecurityModel.SecurityMode; -import com.android.keyguard.dagger.KeyguardBouncerScope; -import com.android.systemui.R; -import com.android.systemui.util.InjectionInflationController; -import com.android.systemui.util.ViewController; - -import java.util.ArrayList; -import java.util.List; - -import javax.inject.Inject; - -/** - * Controller for a {@link KeyguardSecurityViewFlipper}. - */ -@KeyguardBouncerScope -public class KeyguardSecurityViewFlipperController - extends ViewController<KeyguardSecurityViewFlipper> implements KeyguardSecurityView { - - private static final boolean DEBUG = KeyguardConstants.DEBUG; - private static final String TAG = "KeyguardSecurityView"; - - private final List<KeyguardInputViewController> mChildren = new ArrayList<>(); - private final LayoutInflater mLayoutInflater; - private final Factory mKeyguardSecurityViewControllerFactory; - - @Inject - protected KeyguardSecurityViewFlipperController(KeyguardSecurityViewFlipper view, - LayoutInflater layoutInflater, - InjectionInflationController injectionInflationController, - KeyguardInputViewController.Factory keyguardSecurityViewControllerFactory) { - super(view); - mKeyguardSecurityViewControllerFactory = keyguardSecurityViewControllerFactory; - mLayoutInflater = injectionInflationController.injectable(layoutInflater); - } - - @Override - protected void onViewAttached() { - - } - - @Override - protected void onViewDetached() { - - } - - @Override - public void setKeyguardCallback(KeyguardSecurityCallback callback) { - mView.setKeyguardCallback(callback); - } - - @Override - public void setLockPatternUtils(LockPatternUtils utils) { - mView.setLockPatternUtils(utils); - } - - @Override - public void reset() { - mView.reset(); - } - - @Override - public void onPause() { - mView.onPause(); - } - - @Override - public void onResume(int reason) { - mView.onResume(reason); - } - - @Override - public boolean needsInput() { - return mView.needsInput(); - } - - @Override - public KeyguardSecurityCallback getCallback() { - return mView.getCallback(); - } - - @Override - public void showPromptReason(int reason) { - mView.showPromptReason(reason); - } - - @Override - public void showMessage(CharSequence message, ColorStateList colorState) { - mView.showMessage(message, colorState); - } - - @Override - public void showUsabilityHint() { - mView.showUsabilityHint(); - } - - @Override - public void startAppearAnimation() { - mView.startAppearAnimation(); - } - - @Override - public boolean startDisappearAnimation(Runnable finishRunnable) { - return mView.startDisappearAnimation(finishRunnable); - } - - @Override - public CharSequence getTitle() { - return mView.getTitle(); - } - - @VisibleForTesting - KeyguardInputViewController getSecurityView(SecurityMode securityMode, - KeyguardSecurityCallback keyguardSecurityCallback) { - KeyguardInputViewController childController = null; - for (KeyguardInputViewController mChild : mChildren) { - if (mChild.getSecurityMode() == securityMode) { - childController = mChild; - break; - } - } - - if (childController == null - && securityMode != SecurityMode.None && securityMode != SecurityMode.Invalid) { - - int layoutId = getLayoutIdFor(securityMode); - KeyguardInputView view = null; - if (layoutId != 0) { - if (DEBUG) Log.v(TAG, "inflating id = " + layoutId); - view = (KeyguardInputView) mLayoutInflater.inflate( - layoutId, mView, false); - mView.addView(view); - childController = mKeyguardSecurityViewControllerFactory.create( - view, securityMode, keyguardSecurityCallback); - - mChildren.add(childController); - } - } - - return childController; - } - - private int getLayoutIdFor(SecurityMode securityMode) { - switch (securityMode) { - case Pattern: return com.android.systemui.R.layout.keyguard_pattern_view; - case PIN: return com.android.systemui.R.layout.keyguard_pin_view; - case Password: return com.android.systemui.R.layout.keyguard_password_view; - case SimPin: return com.android.systemui.R.layout.keyguard_sim_pin_view; - case SimPuk: return R.layout.keyguard_sim_puk_view; - default: - return 0; - } - } - - /** Makes the supplied child visible if it is contained win this view, */ - public void show(KeyguardInputViewController childController) { - int index = childController.getIndexIn(mView); - if (index != -1) { - mView.setDisplayedChild(index); - } - } -} |