Make ActivityStackSupervisor instrumentable for unit tests.
Currently, the ActivityStackSupervisor passes an instance of itself during construction to a number of its member variables. Passing a self reference at this time leads to an incomplete object being passed. In the case of testing, it's possible for the instance to be copied after construction for instrumentation, leading to the original instance being retained. This changelist addresses this by moving the creation of these variables to a separate initialize methods. In addition, the affected variables accessed outside the class are now behind accessors to prevent their modification. Bug: 64750076 Test: bit FrameworksServicesTests:com.android.server.am.ActivityStarterTests Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests Test: bit FrameworksServicesTests:com.android.server.am.LaunchingBoundsControllerTests Test: bit FrameworksServicesTests:com.android.server.am.LaunchingActivityPositionerTests Test: bit FrameworksServicesTests:com.android.server.am.LaunchingTaskPositionerTests Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java Change-Id: I19647b24925b82db0ab0955585d7588a28e00f94
Loading
Please register or sign in to comment