summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2015-07-22 18:13:04 -0700
committerAdrian Roos <roosa@google.com>2015-07-22 19:13:19 -0700
commita4eba9fc35165dc3391fb1b9580341bba7928277 (patch)
treed54b3191ab0a5eff49ab1b955b4330b2f1941582 /packages
parent75f6b94a5d5cadb218725011729466e8e438b231 (diff)
downloadframeworks_base-a4eba9fc35165dc3391fb1b9580341bba7928277.zip
frameworks_base-a4eba9fc35165dc3391fb1b9580341bba7928277.tar.gz
frameworks_base-a4eba9fc35165dc3391fb1b9580341bba7928277.tar.bz2
Disable Keyguard affordances before setup is completed
Bug: 22665279 Change-Id: I5d3c62a5b6896b808d55026df67022192f0b8bfd
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java4
4 files changed, 28 insertions, 16 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
index 58fb2b1..164c496 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
@@ -69,7 +69,7 @@ public class KeyguardAffordanceView extends ImageView {
private float mCircleStartValue;
private boolean mCircleWillBeHidden;
private int[] mTempPoint = new int[2];
- private float mImageScale;
+ private float mImageScale = 1f;
private int mCircleColor;
private boolean mIsLeft;
private View mPreviewView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
index 6670ae0..10019f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
@@ -86,9 +86,9 @@ public class KeyguardAffordanceHelper {
mContext = context;
mCallback = callback;
initIcons();
- updateIcon(mLeftIcon, 0.0f, mLeftIcon.getRestingAlpha(), false, false);
- updateIcon(mCenterIcon, 0.0f, mCenterIcon.getRestingAlpha(), false, false);
- updateIcon(mRightIcon, 0.0f, mRightIcon.getRestingAlpha(), false, false);
+ updateIcon(mLeftIcon, 0.0f, mLeftIcon.getRestingAlpha(), false, false, true);
+ updateIcon(mCenterIcon, 0.0f, mCenterIcon.getRestingAlpha(), false, false, true);
+ updateIcon(mRightIcon, 0.0f, mRightIcon.getRestingAlpha(), false, false, true);
initDimens();
}
@@ -387,15 +387,15 @@ public class KeyguardAffordanceHelper {
boolean slowAnimation = isReset && isBelowFalsingThreshold();
if (!isReset) {
updateIcon(targetView, radius, alpha + fadeOutAlpha * targetView.getRestingAlpha(),
- false, false);
+ false, false, false);
} else {
updateIcon(targetView, 0.0f, fadeOutAlpha * targetView.getRestingAlpha(),
- animateIcons, slowAnimation);
+ animateIcons, slowAnimation, false);
}
updateIcon(otherView, 0.0f, fadeOutAlpha * otherView.getRestingAlpha(),
- animateIcons, slowAnimation);
+ animateIcons, slowAnimation, false);
updateIcon(mCenterIcon, 0.0f, fadeOutAlpha * mCenterIcon.getRestingAlpha(),
- animateIcons, slowAnimation);
+ animateIcons, slowAnimation, false);
mTranslation = translation;
}
@@ -431,13 +431,13 @@ public class KeyguardAffordanceHelper {
public void animateHideLeftRightIcon() {
cancelAnimation();
- updateIcon(mRightIcon, 0f, 0f, true, false);
- updateIcon(mLeftIcon, 0f, 0f, true, false);
+ updateIcon(mRightIcon, 0f, 0f, true, false, false);
+ updateIcon(mLeftIcon, 0f, 0f, true, false, false);
}
private void updateIcon(KeyguardAffordanceView view, float circleRadius, float alpha,
- boolean animate, boolean slowRadiusAnimation) {
- if (view.getVisibility() != View.VISIBLE) {
+ boolean animate, boolean slowRadiusAnimation, boolean force) {
+ if (view.getVisibility() != View.VISIBLE && !force) {
return;
}
view.setCircleRadius(circleRadius, slowRadiusAnimation);
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..fd459c6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -109,6 +109,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
private PhoneStatusBar mPhoneStatusBar;
private final Interpolator mLinearOutSlowInInterpolator;
+ private boolean mUserSetupComplete;
private boolean mPrewarmBound;
private Messenger mPrewarmMessenger;
private final ServiceConnection mPrewarmConnection = new ServiceConnection() {
@@ -253,6 +254,12 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
updateCameraVisibility(); // in case onFinishInflate() was called too early
}
+ public void setUserSetupComplete(boolean userSetupComplete) {
+ mUserSetupComplete = userSetupComplete;
+ updateCameraVisibility();
+ updateLeftAffordanceIcon();
+ }
+
private Intent getCameraIntent() {
KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
boolean currentUserHasTrust = updateMonitor.getUserHasTrust(
@@ -270,7 +277,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
PackageManager.MATCH_DEFAULT_ONLY,
KeyguardUpdateMonitor.getCurrentUser());
boolean visible = !isCameraDisabledByDpm() && resolved != null
- && getResources().getBoolean(R.bool.config_keyguardShowCameraAffordance);
+ && getResources().getBoolean(R.bool.config_keyguardShowCameraAffordance)
+ && mUserSetupComplete;
mCameraImageView.setVisibility(visible ? View.VISIBLE : View.GONE);
}
@@ -278,16 +286,16 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
mLeftIsVoiceAssist = canLaunchVoiceAssist();
int drawableId;
int contentDescription;
+ boolean visible = mUserSetupComplete;
if (mLeftIsVoiceAssist) {
- mLeftAffordanceView.setVisibility(View.VISIBLE);
drawableId = R.drawable.ic_mic_26dp;
contentDescription = R.string.accessibility_voice_assist_button;
} else {
- boolean visible = isPhoneVisible();
- mLeftAffordanceView.setVisibility(visible ? View.VISIBLE : View.GONE);
+ visible &= isPhoneVisible();
drawableId = R.drawable.ic_phone_24dp;
contentDescription = R.string.accessibility_phone_button;
}
+ mLeftAffordanceView.setVisibility(visible ? View.VISIBLE : View.GONE);
mLeftAffordanceView.setImageDrawable(mContext.getDrawable(drawableId));
mLeftAffordanceView.setContentDescription(mContext.getString(contentDescription));
}
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..4619abf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -364,6 +364,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mUserSetup = userSetup;
if (!mUserSetup && mStatusBarView != null)
animateCollapseQuickSettings();
+ if (mKeyguardBottomArea != null) {
+ mKeyguardBottomArea.setUserSetupComplete(mUserSetup);
+ }
}
if (mIconPolicy != null) {
mIconPolicy.setCurrentUserSetup(mUserSetup);
@@ -834,6 +837,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mFlashlightController = new FlashlightController(mContext);
mKeyguardBottomArea.setFlashlightController(mFlashlightController);
mKeyguardBottomArea.setPhoneStatusBar(this);
+ mKeyguardBottomArea.setUserSetupComplete(mUserSetup);
mAccessibilityController = new AccessibilityController(mContext);
mKeyguardBottomArea.setAccessibilityController(mAccessibilityController);
mNextAlarmController = new NextAlarmController(mContext);