Add unit test to verify option propagation from starter to modifier.
This changelist adds a test, which makes sure that the options
specified when executing an ActivityStarter are properly communicated
to the LaunchParamsModifier if a task is created during start.
Change-Id: Id244006106b72977206d5199c4e508807924d028
Fixes: 69270257
Test: atest FrameworksServicesTests:ActivityStarterTests#testCreateTaskLayout
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
index 1195188..a916585 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityTestsBase.java
@@ -101,6 +101,7 @@
protected ActivityManagerService setupActivityManagerService(ActivityManagerService service) {
service = spy(service);
doReturn(mock(IPackageManager.class)).when(service).getPackageManager();
+ doNothing().when(service).grantEphemeralAccessLocked(anyInt(), any(), anyInt(), anyInt());
service.mWindowManager = prepareMockWindowManager();
return service;
}
@@ -131,6 +132,11 @@
return this;
}
+ static ComponentName getDefaultComponent() {
+ return ComponentName.createRelative(DEFAULT_COMPONENT_PACKAGE_NAME,
+ DEFAULT_COMPONENT_PACKAGE_NAME);
+ }
+
ActivityBuilder setTask(TaskRecord task) {
mTaskRecord = task;
return this;
@@ -151,10 +157,6 @@
return this;
}
- String getDefaultComponentPackageName() {
- return DEFAULT_COMPONENT_PACKAGE_NAME;
- }
-
ActivityRecord build() {
if (mComponent == null) {
final int id = sCurrentActivityId++;