Merge "Streamline activity start flow"

This commit is contained in:
TreeHugger Robot
2019-09-02 06:41:23 +00:00
committed by Android (Google) Code Review
3 changed files with 408 additions and 556 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -279,6 +279,13 @@ public class LockTaskController {
}
}
/**
* @return true if currently in the lock task mode, otherwise, return false.
*/
boolean isInLockTaskMode() {
return !mLockTaskModeTasks.isEmpty();
}
/**
* @return whether the requested task is disallowed to be launched.
*/

View File

@@ -499,6 +499,7 @@ public class ActivityStarterTests extends ActivityTestsBase {
final ActivityStarter starter = prepareStarter(0);
final LockTaskController lockTaskController = mService.getLockTaskController();
doReturn(true).when(lockTaskController).isInLockTaskMode();
doReturn(true).when(lockTaskController).isLockTaskModeViolation(any());
final int result = starter.setReason("testTaskModeViolation").execute();