Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ebcdfdd authored by Adrian Roos's avatar Adrian Roos
Browse files

Implement final lock now affordance

Also removes the GlobalAction. Also fixes the animation not
being applied to the background of the affordance.

Bug: 15344542
Bug: 16952834

Change-Id: Ie790b40a5d1ba10fa42a793c8cfeaf6687d17c61
parent 70236bf4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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>
+3 −0
Original line number Diff line number Diff line
@@ -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>
+5 −1
Original line number Diff line number Diff line
@@ -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);
+13 −0
Original line number Diff line number Diff line
@@ -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;
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -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) {
Loading