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

Commit b32f8902 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge remote-tracking branch 'origin/lineage-15.1' into v1-oreo

parents ab1e53dc 7660e09c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

    <uses-permission android:name="android.permission.CONTROL_VPN" />
    <uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" />
    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"/>

    <application android:label="VpnDialogs"
            android:allowBackup="false" >
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.vpndialogs;

import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
@@ -78,6 +80,7 @@ public class ConfirmDialog extends AlertActivity
        setupAlert();

        getWindow().setCloseOnTouchOutside(false);
        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
        Button button = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
        button.setFilterTouchesWhenObscured(true);
    }
+21 −13
Original line number Diff line number Diff line
@@ -4601,20 +4601,12 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                            mLockTaskNotify = new LockTaskNotify(mService.mContext);
                        }
                        mLockTaskNotify.show(false);
                        try {
                            boolean shouldLockKeyguard = Settings.Secure.getIntForUser(
                                    mService.mContext.getContentResolver(),
                                    Settings.Secure.LOCK_TO_APP_EXIT_LOCKED,
                                    UserHandle.USER_CURRENT) != 0;
                            if (mLockTaskModeState == LOCK_TASK_MODE_PINNED && shouldLockKeyguard) {
                        if (mLockTaskModeState == LOCK_TASK_MODE_PINNED && shouldLockKeyguard()) {
                            mWindowManager.lockNow(null);
                            mWindowManager.dismissKeyguard(null /* callback */);
                            new LockPatternUtils(mService.mContext)
                                    .requireCredentialEntry(UserHandle.USER_ALL);
                        }
                        } catch (SettingNotFoundException e) {
                            // No setting, don't lock.
                        }
                    } catch (RemoteException ex) {
                        throw new RuntimeException(ex);
                    } finally {
@@ -4640,6 +4632,22 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        }
    }

    private boolean shouldLockKeyguard() {
        // This functionality should be kept consistent with
        // com.android.settings.security.ScreenPinningSettings (see b/127605586)
        try {
            return Settings.Secure.getIntForUser(
                mService.mContext.getContentResolver(),
                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED,
                UserHandle.USER_CURRENT) != 0;
        } catch (Settings.SettingNotFoundException e) {
            // Log to SafetyNet for b/127605586
            android.util.EventLog.writeEvent(0x534e4554, "127605586", -1, "");
            LockPatternUtils lockPatternUtils = new LockPatternUtils(mService.mContext);
            return lockPatternUtils.isSecure(mCurrentUser);
        }
    }

    // TODO: Move to its own file.
    /** Exactly one of these classes per Display in the system. Capable of holding zero or more
     * attached {@link ActivityStack}s */