summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMill Chen <millchen@google.com>2020-02-26 18:41:56 +0800
committerAnis Assi <anisassi@google.com>2020-03-12 13:34:30 -0700
commitafdfe99117dbb6481d349b79d3c55dc2f343e9d0 (patch)
treefb1076960820d93d832de5dcfffb8e764eb39d40
parent373ded27296eedeee3e0d15fd24757d9b6a49e51 (diff)
downloadpackages_apps_Settings-afdfe99117dbb6481d349b79d3c55dc2f343e9d0.tar.gz
packages_apps_Settings-afdfe99117dbb6481d349b79d3c55dc2f343e9d0.tar.bz2
packages_apps_Settings-afdfe99117dbb6481d349b79d3c55dc2f343e9d0.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 101c9be6c1f7f89cb1b8a788b8e6e62358684d94)
-rw-r--r--src/com/android/settings/SettingsActivity.java9
-rw-r--r--src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java5
2 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index c0ffc19df5..11654ae670 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -255,7 +255,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();
}
@@ -964,6 +964,13 @@ public class SettingsActivity extends SettingsDrawerActivity
startActivity(intent);
}
+ /**
+ * @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 =
getApplicationContext().getSystemService(ActivityManager.class);
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java
index d2bd934b7c..6d48a953a7 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialBaseActivity.java
@@ -134,6 +134,11 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
}
}
+ @Override
+ public boolean isLaunchableInTaskModePinned() {
+ return true;
+ }
+
public void prepareEnterAnimation() {
getFragment().prepareEnterAnimation();
}