RESTRICT AUTOMERGE
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
(cherry picked from commit 077dd9b07f
)
This commit is contained in:
committed by
android-build-team Robot
parent
0f2d02be9c
commit
abe9cee25e
@@ -63,7 +63,7 @@ public class SettingsBaseActivity extends FragmentActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if (isLockTaskModePinned() && !isSettingsRunOnTop()) {
|
if (isLockTaskModePinned() && !isSettingsRunOnTop() && !isLaunchableInTaskModePinned()) {
|
||||||
Log.w(TAG, "Devices lock task mode pinned.");
|
Log.w(TAG, "Devices lock task mode pinned.");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -147,6 +147,13 @@ public class SettingsBaseActivity extends FragmentActivity {
|
|||||||
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
|
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return whether or not the activity can be launched from other apps in the pinning screen.
|
||||||
|
*/
|
||||||
|
public boolean isLaunchableInTaskModePinned() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void onCategoriesChanged() {
|
private void onCategoriesChanged() {
|
||||||
final int N = mCategoryListeners.size();
|
final int N = mCategoryListeners.size();
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
|
@@ -188,6 +188,11 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isLaunchableInTaskModePinned() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void prepareEnterAnimation() {
|
public void prepareEnterAnimation() {
|
||||||
getFragment().prepareEnterAnimation();
|
getFragment().prepareEnterAnimation();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user