Loading services/core/java/com/android/server/am/PersisterQueue.java +5 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,11 @@ class PersisterQueue { mListeners.add(listener); } @VisibleForTesting boolean removeListener(Listener listener) { return mListeners.remove(listener); } private void processNextItem() throws InterruptedException { // This part is extracted into a method so that the GC can clearly see the end of the // scope of the variable 'item'. If this part was in the loop in LazyTaskWriterThread, the Loading services/tests/servicestests/utils/com/android/server/testutils/TestHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ public class TestHandler extends Handler { @Override public int compareTo(MsgInfo o) { return (int) (sendTime - o.sendTime); return Long.compare(sendTime, o.sendTime); } @Override Loading services/tests/wmtests/Android.mk +7 −1 Original line number Diff line number Diff line Loading @@ -11,12 +11,18 @@ LOCAL_MODULE_TAGS := tests # Include all test java files. LOCAL_SRC_FILES := \ $(call all-java-files-under, src) \ $(call all-java-files-under, ../servicestests/utils) $(call all-java-files-under, ../servicestests/utils) \ LOCAL_STATIC_JAVA_LIBRARIES := \ frameworks-base-testutils \ services.core \ androidx.test.runner \ androidx.test.rules \ mockito-target-minus-junit4 \ platform-test-annotations \ truth-prebuilt \ testables \ ub-uiautomator \ LOCAL_JAVA_LIBRARIES := \ android.test.mock \ Loading services/tests/wmtests/AndroidManifest.xml +15 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,21 @@ android:minSdkVersion="1" android:targetSdkVersion="28" /> <application android:testOnly="true" /> <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" /> <uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" /> <uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.STORAGE_INTERNAL" /> <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" /> <application android:testOnly="true"> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityB" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityRequestedOrientationChange" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskChangeCallbacks" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskDescriptionChange" /> </application> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" Loading services/tests/servicestests/src/com/android/server/am/ActivityDisplayTests.java→services/tests/wmtests/src/com/android/server/am/ActivityDisplayTests.java +0 −5 Original line number Diff line number Diff line Loading @@ -32,11 +32,9 @@ import static org.mockito.Mockito.doReturn; import android.platform.test.annotations.Presubmit; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; /** * Tests for the {@link ActivityDisplay} class. Loading @@ -46,13 +44,10 @@ import org.junit.runner.RunWith; */ @SmallTest @Presubmit @RunWith(AndroidJUnit4.class) public class ActivityDisplayTests extends ActivityTestsBase { @Before @Override public void setUp() throws Exception { super.setUp(); setupActivityTaskManagerService(); } Loading Loading
services/core/java/com/android/server/am/PersisterQueue.java +5 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,11 @@ class PersisterQueue { mListeners.add(listener); } @VisibleForTesting boolean removeListener(Listener listener) { return mListeners.remove(listener); } private void processNextItem() throws InterruptedException { // This part is extracted into a method so that the GC can clearly see the end of the // scope of the variable 'item'. If this part was in the loop in LazyTaskWriterThread, the Loading
services/tests/servicestests/utils/com/android/server/testutils/TestHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ public class TestHandler extends Handler { @Override public int compareTo(MsgInfo o) { return (int) (sendTime - o.sendTime); return Long.compare(sendTime, o.sendTime); } @Override Loading
services/tests/wmtests/Android.mk +7 −1 Original line number Diff line number Diff line Loading @@ -11,12 +11,18 @@ LOCAL_MODULE_TAGS := tests # Include all test java files. LOCAL_SRC_FILES := \ $(call all-java-files-under, src) \ $(call all-java-files-under, ../servicestests/utils) $(call all-java-files-under, ../servicestests/utils) \ LOCAL_STATIC_JAVA_LIBRARIES := \ frameworks-base-testutils \ services.core \ androidx.test.runner \ androidx.test.rules \ mockito-target-minus-junit4 \ platform-test-annotations \ truth-prebuilt \ testables \ ub-uiautomator \ LOCAL_JAVA_LIBRARIES := \ android.test.mock \ Loading
services/tests/wmtests/AndroidManifest.xml +15 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,21 @@ android:minSdkVersion="1" android:targetSdkVersion="28" /> <application android:testOnly="true" /> <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" /> <uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" /> <uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.STORAGE_INTERNAL" /> <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" /> <application android:testOnly="true"> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityB" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityRequestedOrientationChange" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskChangeCallbacks" /> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskDescriptionChange" /> </application> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" Loading
services/tests/servicestests/src/com/android/server/am/ActivityDisplayTests.java→services/tests/wmtests/src/com/android/server/am/ActivityDisplayTests.java +0 −5 Original line number Diff line number Diff line Loading @@ -32,11 +32,9 @@ import static org.mockito.Mockito.doReturn; import android.platform.test.annotations.Presubmit; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; /** * Tests for the {@link ActivityDisplay} class. Loading @@ -46,13 +44,10 @@ import org.junit.runner.RunWith; */ @SmallTest @Presubmit @RunWith(AndroidJUnit4.class) public class ActivityDisplayTests extends ActivityTestsBase { @Before @Override public void setUp() throws Exception { super.setUp(); setupActivityTaskManagerService(); } Loading