summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2015-07-17 01:29:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-07-17 01:29:29 +0000
commit60e15dae5aac3ea7529c13981ad339a8312e2fb2 (patch)
treece7b08121512d5a4650be715f26ecf4837489655 /packages
parentd19ed4c16d0c11bb68dd3a7aab0fb1845814dac8 (diff)
parente8bae6288bf0f241f0cea70f2c5e8294f930d4d8 (diff)
downloadframeworks_base-60e15dae5aac3ea7529c13981ad339a8312e2fb2.zip
frameworks_base-60e15dae5aac3ea7529c13981ad339a8312e2fb2.tar.gz
frameworks_base-60e15dae5aac3ea7529c13981ad339a8312e2fb2.tar.bz2
Merge "Fixed a bug where a fingerprint animation was not running" into mnc-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java3
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java21
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java2
10 files changed, 42 insertions, 33 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
index 23bd238..85da298 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -308,7 +308,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
boolean showNextSecurityScreenOrFinish(boolean authenticated) {
if (DEBUG) Log.d(TAG, "showNextSecurityScreenOrFinish(" + authenticated + ")");
boolean finish = false;
- if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
+ if (mUpdateMonitor.getUserCanSkipBouncer(
+ KeyguardUpdateMonitor.getCurrentUser())) {
finish = true;
} else if (SecurityMode.None == mCurrentSecuritySelection) {
SecurityMode securityMode = mSecurityModel.getSecurityMode();
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 6574e4e..9e5644e 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -455,9 +455,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
& DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0;
}
+ public boolean getUserCanSkipBouncer(int userId) {
+ return getUserHasTrust(userId) || mUserFingerprintAuthenticated.get(userId);
+ }
+
public boolean getUserHasTrust(int userId) {
- return !isTrustDisabled(userId) && mUserHasTrust.get(userId)
- || mUserFingerprintAuthenticated.get(userId);
+ return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
}
public boolean getUserTrustIsManaged(int userId) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
index 937615a..61695b2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
@@ -92,7 +92,8 @@ public class CastTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleUpdateState(BooleanState state, Object arg) {
- state.visible = !(mKeyguard.isSecure() && mKeyguard.isShowing() && !mKeyguard.isTrusted());
+ state.visible = !mKeyguard.isSecure() || !mKeyguard.isShowing()
+ || mKeyguard.canSkipBouncer();
state.label = mContext.getString(R.string.quick_settings_cast_title);
state.value = false;
state.autoMirrorDrawable = false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index 815e123..91adc46 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -18,7 +18,6 @@ package com.android.systemui.statusbar.phone;
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
-import android.app.Application;
import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -30,8 +29,6 @@ import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.InsetDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.IBinder;
@@ -255,10 +252,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
private Intent getCameraIntent() {
KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
- boolean currentUserHasTrust = updateMonitor.getUserHasTrust(
+ boolean canSkipBouncer = updateMonitor.getUserCanSkipBouncer(
KeyguardUpdateMonitor.getCurrentUser());
boolean secure = mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
- return (secure && !currentUserHasTrust) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
+ return (secure && !canSkipBouncer) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}
private void updateCameraVisibility() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index 6bcb766..9e2ce15 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -214,7 +214,7 @@ public class LockIcon extends KeyguardAffordanceView {
} else if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
} else if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN
- && !mUnlockMethodCache.isCurrentlyInsecure()) {
+ && !mUnlockMethodCache.isTrusted()) {
return R.drawable.lockscreen_fingerprint_draw_off_animation;
} else if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
return R.drawable.lockscreen_fingerprint_draw_on_animation;
@@ -226,7 +226,7 @@ public class LockIcon extends KeyguardAffordanceView {
private int getState() {
boolean fingerprintRunning =
KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
- if (mUnlockMethodCache.isCurrentlyInsecure()) {
+ if (mUnlockMethodCache.canSkipBouncer()) {
return STATE_LOCK_OPEN;
} else if (mTransientFpError) {
return STATE_FINGERPRINT_ERROR;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 1e78f66..4b04ec7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -2001,7 +2001,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
public boolean isKeyguardCurrentlySecure() {
- return !mUnlockMethodCache.isCurrentlyInsecure();
+ return !mUnlockMethodCache.canSkipBouncer();
}
public void setPanelExpanded(boolean isExpanded) {
@@ -3051,20 +3051,20 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
boolean isOccluded = mStatusBarKeyguardViewManager.isOccluded();
boolean isBouncerShowing = mStatusBarKeyguardViewManager.isBouncerShowing();
boolean isSecure = mUnlockMethodCache.isMethodSecure();
- boolean isCurrentlyInsecure = mUnlockMethodCache.isCurrentlyInsecure();
+ boolean canSkipBouncer = mUnlockMethodCache.canSkipBouncer();
int stateFingerprint = getLoggingFingerprint(mState,
isShowing,
isOccluded,
isBouncerShowing,
isSecure,
- isCurrentlyInsecure);
+ canSkipBouncer);
if (stateFingerprint != mLastLoggedStateFingerprint) {
EventLogTags.writeSysuiStatusBarState(mState,
isShowing ? 1 : 0,
isOccluded ? 1 : 0,
isBouncerShowing ? 1 : 0,
isSecure ? 1 : 0,
- isCurrentlyInsecure ? 1 : 0);
+ canSkipBouncer ? 1 : 0);
mLastLoggedStateFingerprint = stateFingerprint;
}
}
@@ -3668,7 +3668,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
public void onTrackingStopped(boolean expand) {
if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
- if (!expand && !mUnlockMethodCache.isCurrentlyInsecure()) {
+ if (!expand && !mUnlockMethodCache.canSkipBouncer()) {
showBouncer();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index bacf890..6816399 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -105,7 +105,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
public void onTrackingStarted() {
mExpanding = true;
- mDarkenWhileDragging = !mUnlockMethodCache.isCurrentlyInsecure();
+ mDarkenWhileDragging = !mUnlockMethodCache.canSkipBouncer();
}
public void onExpandingFinished() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
index 66d71f6..6fc15a8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java
@@ -39,9 +39,10 @@ public class UnlockMethodCache {
/** Whether the user configured a secure unlock method (PIN, password, etc.) */
private boolean mSecure;
/** Whether the unlock method is currently insecure (insecure method or trusted environment) */
- private boolean mCurrentlyInsecure;
+ private boolean mCanSkipBouncer;
private boolean mTrustManaged;
private boolean mFaceUnlockRunning;
+ private boolean mTrusted;
private UnlockMethodCache(Context ctx) {
mLockPatternUtils = new LockPatternUtils(ctx);
@@ -64,11 +65,15 @@ public class UnlockMethodCache {
return mSecure;
}
+ public boolean isTrusted() {
+ return mTrusted;
+ }
+
/**
- * @return whether the lockscreen is currently insecure, i. e. the bouncer won't be shown
+ * @return whether the lockscreen is currently insecure, and the bouncer won't be shown
*/
- public boolean isCurrentlyInsecure() {
- return mCurrentlyInsecure;
+ public boolean canSkipBouncer() {
+ return mCanSkipBouncer;
}
public void addListener(OnUnlockMethodChangedListener listener) {
@@ -82,15 +87,17 @@ public class UnlockMethodCache {
private void update(boolean updateAlways) {
int user = KeyguardUpdateMonitor.getCurrentUser();
boolean secure = mLockPatternUtils.isSecure(user);
- boolean currentlyInsecure = !secure || mKeyguardUpdateMonitor.getUserHasTrust(user);
+ boolean canSkipBouncer = !secure || mKeyguardUpdateMonitor.getUserCanSkipBouncer(user);
boolean trustManaged = mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
+ boolean trusted = mKeyguardUpdateMonitor.getUserHasTrust(user);
boolean faceUnlockRunning = mKeyguardUpdateMonitor.isFaceUnlockRunning(user)
&& trustManaged;
- boolean changed = secure != mSecure || currentlyInsecure != mCurrentlyInsecure ||
+ boolean changed = secure != mSecure || canSkipBouncer != mCanSkipBouncer ||
trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
if (changed || updateAlways) {
mSecure = secure;
- mCurrentlyInsecure = currentlyInsecure;
+ mCanSkipBouncer = canSkipBouncer;
+ mTrusted = trusted;
mTrustManaged = trustManaged;
mFaceUnlockRunning = faceUnlockRunning;
notifyListeners();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java
index d4eb553..d907b00 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java
@@ -36,7 +36,7 @@ public final class KeyguardMonitor extends KeyguardUpdateMonitorCallback {
private int mCurrentUser;
private boolean mShowing;
private boolean mSecure;
- private boolean mTrusted;
+ private boolean mCanSkipBouncer;
private boolean mListening;
@@ -47,7 +47,7 @@ public final class KeyguardMonitor extends KeyguardUpdateMonitorCallback {
@Override
public void onUserSwitched(int newUserId) {
mCurrentUser = newUserId;
- updateTrustedState();
+ updateCanSkipBouncerState();
}
};
}
@@ -57,7 +57,7 @@ public final class KeyguardMonitor extends KeyguardUpdateMonitorCallback {
if (mCallbacks.size() != 0 && !mListening) {
mListening = true;
mCurrentUser = ActivityManager.getCurrentUser();
- updateTrustedState();
+ updateCanSkipBouncerState();
mKeyguardUpdateMonitor.registerCallback(this);
mUserTracker.startTracking();
}
@@ -79,8 +79,8 @@ public final class KeyguardMonitor extends KeyguardUpdateMonitorCallback {
return mSecure;
}
- public boolean isTrusted() {
- return mTrusted;
+ public boolean canSkipBouncer() {
+ return mCanSkipBouncer;
}
public void notifyKeyguardState(boolean showing, boolean secure) {
@@ -92,12 +92,12 @@ public final class KeyguardMonitor extends KeyguardUpdateMonitorCallback {
@Override
public void onTrustChanged(int userId) {
- updateTrustedState();
+ updateCanSkipBouncerState();
notifyKeyguardChanged();
}
- private void updateTrustedState() {
- mTrusted = mKeyguardUpdateMonitor.getUserHasTrust(mCurrentUser);
+ private void updateCanSkipBouncerState() {
+ mCanSkipBouncer = mKeyguardUpdateMonitor.getUserCanSkipBouncer(mCurrentUser);
}
private void notifyKeyguardChanged() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index 41fc967..6fabe9b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -412,7 +412,7 @@ public class UserSwitcherController {
public int getCount() {
boolean secureKeyguardShowing = mController.mKeyguardMonitor.isShowing()
&& mController.mKeyguardMonitor.isSecure()
- && !mController.mKeyguardMonitor.isTrusted();
+ && !mController.mKeyguardMonitor.canSkipBouncer();
if (!secureKeyguardShowing) {
return mController.mUsers.size();
}