Merge "RESTRICT AUTOMERGE Allow LockScreenPattern to be launched in the pinning screen" into qt-dev

This commit is contained in:
TreeHugger Robot
2020-03-11 17:51:30 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 1 deletions

View File

@@ -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++) {

View File

@@ -184,6 +184,11 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
} }
} }
@Override
public boolean isLaunchableInTaskModePinned() {
return true;
}
public void prepareEnterAnimation() { public void prepareEnterAnimation() {
getFragment().prepareEnterAnimation(); getFragment().prepareEnterAnimation();
} }