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

Commit 0d210f63 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Animation for touch, wake and unlock

- Add callback to inform SysUI when the screen has been unblocked
and turned on.
- Cleanup inconsistent messaging about device interactive/screen on
and off.
- Add callbacks to inform SysUI about screen states
- Implement a quick fade for the scrim after touch, wake, and unlock.
  First, start with a black scrim on top of everything, and then fade
  it out.
- Make sure we play the normal unlock animation when device is pulsing
- Override navigation bar animations for touch, wake and unlock: Fade
  in the same manner as the scrim.

Bug: 22571198
Bug: 21855614
Change-Id: I8ff08d72cced1e0f03c78d71ff710d8a4f6b848c
parent 751a96a0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -994,6 +994,12 @@ public interface WindowManagerPolicy {
     */
    public void screenTurningOn(ScreenOnListener screenOnListener);

    /**
     * Called when the device has actually turned on the screen, i.e. the display power state has
     * been set to ON and the screen is unblocked.
     */
    public void screenTurnedOn();

    /**
     * Called when the device has turned the screen off.
     */
+10 −0
Original line number Diff line number Diff line
@@ -64,6 +64,16 @@ oneway interface IKeyguardService {
     */
    void onScreenTurningOn(IKeyguardDrawnCallback callback);

    /**
     * Called when the screen has actually turned on.
     */
    void onScreenTurnedOn();

    /**
     * Called when the screen has turned off.
     */
    void onScreenTurnedOff();

    void setKeyguardEnabled(boolean enabled);
    void onSystemReady();
    void doKeyguardTimeout(in Bundle options);
+4 −5
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import java.util.Objects;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
@@ -59,11 +58,11 @@ public class CarrierText extends TextView {
            updateCarrierText();
        }

        public void onScreenTurnedOff(int why) {
        public void onFinishedGoingToSleep(int why) {
            setSelected(false);
        };

        public void onScreenTurnedOn() {
        public void onStartedWakingUp() {
            setSelected(true);
        };
    };
@@ -193,8 +192,8 @@ public class CarrierText extends TextView {
        super.onFinishInflate();
        mSeparator = getResources().getString(
                com.android.internal.R.string.kg_text_message_separator);
        final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
        setSelected(screenOn); // Allow marquee to work.
        boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
        setSelected(shouldMarquee); // Allow marquee to work.
    }

    @Override
+4 −4
Original line number Diff line number Diff line
@@ -58,10 +58,10 @@ class KeyguardMessageArea extends TextView implements SecurityMessageDisplay {
    };

    private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
        public void onScreenTurnedOff(int why) {
        public void onFinishedGoingToSleep(int why) {
            setSelected(false);
        };
        public void onScreenTurnedOn() {
        public void onStartedWakingUp() {
            setSelected(true);
        };
    };
@@ -126,8 +126,8 @@ class KeyguardMessageArea extends TextView implements SecurityMessageDisplay {

    @Override
    protected void onFinishInflate() {
        final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
        setSelected(screenOn); // This is required to ensure marquee works
        boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
        setSelected(shouldMarquee); // This is required to ensure marquee works
    }

    private void securityMessageChanged(CharSequence message) {
+4 −4
Original line number Diff line number Diff line
@@ -67,12 +67,12 @@ public class KeyguardStatusView extends GridLayout {
        }

        @Override
        public void onScreenTurnedOn() {
        public void onStartedWakingUp() {
            setEnableMarquee(true);
        }

        @Override
        public void onScreenTurnedOff(int why) {
        public void onFinishedGoingToSleep(int why) {
            setEnableMarquee(false);
        }

@@ -113,8 +113,8 @@ public class KeyguardStatusView extends GridLayout {
        mClockView.setShowCurrentUserTime(true);
        mOwnerInfo = (TextView) findViewById(R.id.owner_info);

        final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
        setEnableMarquee(screenOn);
        boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
        setEnableMarquee(shouldMarquee);
        refresh();
        updateOwnerInfo();

Loading