am 5e363bcb: am 92b5e337: Implement final lock now affordance
* commit '5e363bcb4eed72b8116098461d97ea43c8d84b18': Implement final lock now affordance
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user