Remove setDockedStackMinimized credentials prompt

Reverts functional parts of commit 853304c0b1

This lives in a TaskStackListener now, so we just start the prompt for
activity stacks that need it, not for the whole device at once.

Bug: 31001762
Test: make -j20 && Boot, `adb shell service call trust 6 i32 {userid} i32 1`, resize docked stack.
Change-Id: I58be5174e10779f01149de1cd5c2a4db00b98490
This commit is contained in:
Robin Lee
2016-12-30 17:26:25 +00:00
parent 8e332cc54b
commit 4403f2fe17
2 changed files with 0 additions and 56 deletions

View File

@@ -4093,18 +4093,6 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
void setDockedStackMinimized(boolean minimized) {
mIsDockMinimized = minimized;
if (minimized) {
// Docked stack is not visible, no need to confirm credentials for its top activity.
return;
}
final ActivityStack dockedStack = getStack(StackId.DOCKED_STACK_ID);
if (dockedStack == null) {
return;
}
final ActivityRecord top = dockedStack.topRunningActivityLocked();
if (top != null && mService.mUserController.shouldConfirmCredentials(top.userId)) {
mService.mActivityStarter.showConfirmDeviceCredential(top.userId);
}
}
private final class ActivityStackSupervisorHandler extends Handler {

View File

@@ -608,50 +608,6 @@ class ActivityStarter {
}
}
void showConfirmDeviceCredential(int userId) {
// First, retrieve the stack that we want to resume after credential is confirmed.
ActivityStack targetStack;
ActivityStack fullscreenStack =
mSupervisor.getStack(FULLSCREEN_WORKSPACE_STACK_ID);
if (fullscreenStack != null &&
fullscreenStack.getStackVisibilityLocked(null) != ActivityStack.STACK_INVISIBLE) {
// Single window case and the case that the docked stack is shown with fullscreen stack.
targetStack = fullscreenStack;
} else {
// The case that the docked stack is shown with recent.
targetStack = mSupervisor.getStack(HOME_STACK_ID);
}
if (targetStack == null) {
return;
}
final KeyguardManager km = (KeyguardManager) mService.mContext
.getSystemService(Context.KEYGUARD_SERVICE);
final Intent credential =
km.createConfirmDeviceCredentialIntent(null, null, userId);
// For safety, check null here in case users changed the setting after the checking.
if (credential == null) {
return;
}
final ActivityRecord activityRecord = targetStack.topRunningActivityLocked();
if (activityRecord != null) {
final IIntentSender target = mService.getIntentSenderLocked(
ActivityManager.INTENT_SENDER_ACTIVITY,
activityRecord.launchedFromPackage,
activityRecord.launchedFromUid,
activityRecord.userId,
null, null, 0,
new Intent[] { activityRecord.intent },
new String[] { activityRecord.resolvedType },
PendingIntent.FLAG_CANCEL_CURRENT |
PendingIntent.FLAG_ONE_SHOT |
PendingIntent.FLAG_IMMUTABLE,
null);
credential.putExtra(Intent.EXTRA_INTENT, new IntentSender(target));
// Show confirm credentials activity.
startConfirmCredentialIntent(credential, null);
}
}
void startConfirmCredentialIntent(Intent intent, Bundle optionsBundle) {
intent.addFlags(FLAG_ACTIVITY_NEW_TASK |
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS |