diff options
6 files changed, 23 insertions, 8 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 8517ad5..bf97ca5 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1590,7 +1590,6 @@ --> <string-array translatable="false" name="config_globalActionsList"> <item>power</item> - <item>lockdown</item> <item>bugreport</item> <item>users</item> </string-array> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 93ed231..72886c6 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -782,4 +782,7 @@ <!-- Monitoring dialog legacy VPN with device owner text [CHAR LIMIT=300] --> <string name="monitoring_description_legacy_vpn_device_owned">This device is managed by:\n<xliff:g id="organization">%1$s</xliff:g>\n\nYour administrator is capable of monitoring your network activity including emails, apps, and secure websites. For more information, contact your administrator.\n\nAlso, you\'re connected to a VPN (\"<xliff:g id="application">%2$s</xliff:g>\"). Your VPN service provider can monitor network activity too.</string> + <!-- Indication on the keyguard that appears when the user disables trust agents until the next time they unlock manually. [CHAR LIMIT=NONE] --> + <string name="keyguard_indication_trust_disabled">Device will stay locked until you manually unlock</string> + </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java index 6779e4e..4a6bfa10 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java @@ -401,7 +401,9 @@ public class KeyguardAffordanceView extends ImageView { Interpolator interpolator, Runnable runnable) { cancelAnimator(mAlphaAnimator); int endAlpha = (int) (alpha * 255); + final Drawable background = getBackground(); if (!animate) { + if (background != null) background.mutate().setAlpha(endAlpha); setImageAlpha(endAlpha); } else { int currentAlpha = getImageAlpha(); @@ -410,7 +412,9 @@ public class KeyguardAffordanceView extends ImageView { animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { - setImageAlpha((int) animation.getAnimatedValue()); + int alpha = (int) animation.getAnimatedValue(); + if (background != null) background.mutate().setAlpha(alpha); + setImageAlpha(alpha); } }); animator.addListener(mAlphaEndListener); 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 79f9da4..e11f20f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -38,6 +38,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.systemui.R; +import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.policy.FlashlightController; import com.android.systemui.statusbar.KeyguardAffordanceView; import com.android.systemui.statusbar.policy.PreviewInflater; @@ -72,6 +73,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private LockPatternUtils mLockPatternUtils; private FlashlightController mFlashlightController; private PreviewInflater mPreviewInflater; + private KeyguardIndicationController mIndicationController; private boolean mFaceUnlockRunning; public KeyguardBottomAreaView(Context context) { @@ -111,6 +113,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL setClipToPadding(false); mPreviewInflater = new PreviewInflater(mContext, new LockPatternUtils(mContext)); inflatePreviews(); + mLockIcon.setOnClickListener(this); } public void setActivityStarter(ActivityStarter activityStarter) { @@ -204,6 +207,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL launchCamera(); } else if (v == mPhoneImageView) { launchPhone(); + } if (v == mLockIcon) { + mIndicationController.showTransientIndication( + R.string.keyguard_indication_trust_disabled); + mLockPatternUtils.requireCredentialEntry(mLockPatternUtils.getCurrentUser()); } } @@ -244,6 +251,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL boolean trustManaged = mUnlockMethodCache.isTrustManaged(); mLockIcon.setBackgroundResource(trustManaged && !mFaceUnlockRunning ? R.drawable.trust_circle : 0); + mLockIcon.setClickable(trustManaged); } public KeyguardAffordanceView getPhoneView() { @@ -318,4 +326,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL updateLockIcon(); } }; + + public void setKeyguardIndicationController( + KeyguardIndicationController keyguardIndicationController) { + mIndicationController = keyguardIndicationController; + } } 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 f8319c2..caecf1d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -721,6 +721,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mKeyguardIndicationController = new KeyguardIndicationController(mContext, (KeyguardIndicationTextView) mStatusBarWindow.findViewById( R.id.keyguard_indication_text)); + mKeyguardBottomArea.setKeyguardIndicationController(mKeyguardIndicationController); mTickerEnabled = res.getBoolean(R.bool.enable_ticker); if (mTickerEnabled) { diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java index 56a8f7c..da8ec2a 100644 --- a/policy/src/com/android/internal/policy/impl/GlobalActions.java +++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java @@ -283,7 +283,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac addUsersToMenu(mItems); } else if (GLOBAL_ACTION_KEY_SETTINGS.equals(actionKey)) { mItems.add(getSettingsAction()); - } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey) && hasTrustAgents()) { + } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) { mItems.add(getLockdownAction()); } else { Log.e(TAG, "Invalid global action key " + actionKey); @@ -323,11 +323,6 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac return dialog; } - private boolean hasTrustAgents() { - // TODO: Add implementation. - return true; - } - private final class PowerAction extends SinglePressAction implements LongPressAction { private PowerAction() { super(com.android.internal.R.drawable.ic_lock_power_off, |