summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMill Chen <millchen@google.com>2020-02-26 23:55:51 +0800
committerAnis Assi <anisassi@google.com>2020-03-12 13:37:16 -0700
commit1a690debcc11e3cd2f163f96a7f058086bdafe13 (patch)
tree2bce2e2e0c0b72084bbfabccad435c07d10925c9
parent842dcadf0df03450b5b3c002265d5ca13f8d6af6 (diff)
downloadpackages_apps_Settings-1a690debcc11e3cd2f163f96a7f058086bdafe13.tar.gz
packages_apps_Settings-1a690debcc11e3cd2f163f96a7f058086bdafe13.tar.bz2
packages_apps_Settings-1a690debcc11e3cd2f163f96a7f058086bdafe13.zip
Allow LockScreenPattern to be launched in the pinning screen If work profile lock is enabled and work app is pinned, users will get a black/white screen on the phone. That's because Settings is prevented from other apps launch any pages of Settings in the pinning mode. In order to launch some pages of Settings from other apps, we add a condition to the preventive mechanism and allow the activity inherited from SettingsBaseActivity to override the condition to have the activity to be launched from other apps in the pinning mode. Bug: 137015265 Bug: 135604684 Test: manual test Change-Id: I8070de79a83350d1658efcb19e983669dad0e673 Merged-In: I8070de79a83350d1658efcb19e983669dad0e673 (cherry picked from commit 3f4d3b4ac257451ccc1676f65321dedb2cb1870e)
-rw-r--r--src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java5
-rw-r--r--src/com/android/settings/SettingsActivity.java8
2 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
index d04014852d..82e389d075 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
@@ -129,6 +129,11 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
}
}
+ @Override
+ public boolean isLaunchableInTaskModePinned() {
+ return true;
+ }
+
public void prepareEnterAnimation() {
getFragment().prepareEnterAnimation();
}
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 5c671206e9..80adec689a 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -278,7 +278,7 @@ public class SettingsActivity extends SettingsDrawerActivity
protected void onCreate(Bundle savedState) {
super.onCreate(savedState);
- if (isLockTaskModePinned() && !isSettingsRunOnTop()) {
+ if (isLockTaskModePinned() && !isSettingsRunOnTop() && !isLaunchableInTaskModePinned()) {
Log.w(LOG_TAG, "Devices lock task mode pinned.");
finish();
}
@@ -946,6 +946,12 @@ public class SettingsActivity extends SettingsDrawerActivity
return bitmap;
}
+ /**
+ * @return whether or not the activity can be launched from other apps in the pinning screen.
+ */
+ public boolean isLaunchableInTaskModePinned() {
+ return false;
+ }
private boolean isLockTaskModePinned() {
final ActivityManager activityManager =