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

Commit e4ba8cdb authored by Jessica Wagantall's avatar Jessica Wagantall
Browse files

Merge tag 'android-5.1.1_r34' into HEAD

Android 5.1.1 release 34
Ticket: CYNGNOS-1522

Change-Id: I74c53dc2d16212c305cb3eef006ce1b686cf70c4
parents 9a56b446 c2640ef6
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.graphics.Rect;
import android.os.Handler;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
@@ -254,6 +255,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    /** Shows the Recents. */
    @ProxyFromPrimaryToCurrentUser
    public void onShowRecents(boolean triggeredFromAltTab) {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isDeviceProvisioned()) {
            return;
        }

        if (mSystemServicesProxy.isForegroundUserOwner()) {
            showRecents(triggeredFromAltTab);
        } else {
@@ -276,6 +283,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    /** Hides the Recents. */
    @ProxyFromPrimaryToCurrentUser
    public void onHideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isDeviceProvisioned()) {
            return;
        }

        if (mSystemServicesProxy.isForegroundUserOwner()) {
            hideRecents(triggeredFromAltTab, triggeredFromHomeKey);
        } else {
@@ -302,6 +315,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    /** Toggles the Recents activity. */
    @ProxyFromPrimaryToCurrentUser
    public void onToggleRecents() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isDeviceProvisioned()) {
            return;
        }

        if (mSystemServicesProxy.isForegroundUserOwner()) {
            toggleRecents();
        } else {
@@ -323,6 +342,12 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    /** Preloads info for the Recents activity. */
    @ProxyFromPrimaryToCurrentUser
    public void onPreloadRecents() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isDeviceProvisioned()) {
            return;
        }

        if (mSystemServicesProxy.isForegroundUserOwner()) {
            preloadRecents();
        } else {
@@ -415,10 +440,22 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    }

    public void onShowNextAffiliatedTask() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isDeviceProvisioned()) {
            return;
        }

        showRelativeAffiliatedTask(true);
    }

    public void onShowPrevAffiliatedTask() {
        // Ensure the device has been provisioned before allowing the user to interact with
        // recents
        if (!isDeviceProvisioned()) {
            return;
        }

        showRelativeAffiliatedTask(false);
    }

@@ -762,6 +799,14 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        return plan;
    }

    /**
     * @return whether this device is provisioned.
     */
    private boolean isDeviceProvisioned() {
        return Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.DEVICE_PROVISIONED, 0) != 0;
    }

    /**** OnAnimationStartedListener Implementation ****/

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -3386,7 +3386,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        // Display task switcher for ALT-TAB.
        if (down && repeatCount == 0 && keyCode == KeyEvent.KEYCODE_TAB) {
            if (mRecentAppsHeldModifiers == 0 && !keyguardOn) {
            if (mRecentAppsHeldModifiers == 0 && !keyguardOn && isUserSetupComplete()) {
                final int shiftlessModifiers = event.getModifiers() & ~KeyEvent.META_SHIFT_MASK;
                if (KeyEvent.metaStateHasModifiers(shiftlessModifiers, KeyEvent.META_ALT_ON)) {
                    mRecentAppsHeldModifiers = shiftlessModifiers;