Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +3 −2 Original line number Diff line number Diff line Loading @@ -732,10 +732,11 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides static ShellController provideShellController(ShellInit shellInit, static ShellController provideShellController(Context context, ShellInit shellInit, ShellCommandHandler shellCommandHandler, @ShellMainThread ShellExecutor mainExecutor) { return new ShellController(shellInit, shellCommandHandler, mainExecutor); return new ShellController(context, shellInit, shellCommandHandler, mainExecutor); } // Loading libs/WindowManager/Shell/src/com/android/wm/shell/sysui/ShellController.java +18 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.pm.UserInfo; import android.content.res.Configuration; import android.os.Bundle; import android.util.ArrayMap; import android.view.SurfaceControlRegistry; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; Loading @@ -52,6 +53,7 @@ import java.util.function.Supplier; public class ShellController { private static final String TAG = ShellController.class.getSimpleName(); private final Context mContext; private final ShellInit mShellInit; private final ShellCommandHandler mShellCommandHandler; private final ShellExecutor mMainExecutor; Loading @@ -72,8 +74,11 @@ public class ShellController { private Configuration mLastConfiguration; public ShellController(ShellInit shellInit, ShellCommandHandler shellCommandHandler, public ShellController(Context context, ShellInit shellInit, ShellCommandHandler shellCommandHandler, ShellExecutor mainExecutor) { mContext = context; mShellInit = shellInit; mShellCommandHandler = shellCommandHandler; mMainExecutor = mainExecutor; Loading Loading @@ -254,6 +259,16 @@ public class ShellController { } } private void handleInit() { SurfaceControlRegistry.createProcessInstance(mContext); mShellInit.init(); } private void handleDump(PrintWriter pw) { mShellCommandHandler.dump(pw); SurfaceControlRegistry.dump(100 /* limit */, false /* runGc */, pw); } public void dump(@NonNull PrintWriter pw, String prefix) { final String innerPrefix = prefix + " "; pw.println(prefix + TAG); Loading @@ -279,7 +294,7 @@ public class ShellController { @Override public void onInit() { try { mMainExecutor.executeBlocking(() -> mShellInit.init()); mMainExecutor.executeBlocking(() -> ShellController.this.handleInit()); } catch (InterruptedException e) { throw new RuntimeException("Failed to initialize the Shell in 2s", e); } Loading Loading @@ -344,7 +359,7 @@ public class ShellController { @Override public void dump(PrintWriter pw) { try { mMainExecutor.executeBlocking(() -> mShellCommandHandler.dump(pw)); mMainExecutor.executeBlocking(() -> ShellController.this.handleDump(pw)); } catch (InterruptedException e) { throw new RuntimeException("Failed to dump the Shell in 2s", e); } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public class PipControllerTest extends ShellTestCase { return null; }).when(mMockExecutor).execute(any()); mShellInit = spy(new ShellInit(mMockExecutor)); mShellController = spy(new ShellController(mShellInit, mMockShellCommandHandler, mShellController = spy(new ShellController(mContext, mShellInit, mMockShellCommandHandler, mMockExecutor)); mPipController = new PipController(mContext, mShellInit, mMockShellCommandHandler, mShellController, mMockDisplayController, mMockPipAnimationController, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ public class RecentTasksControllerTest extends ShellTestCase { mMainExecutor = new TestShellExecutor(); when(mContext.getPackageManager()).thenReturn(mock(PackageManager.class)); mShellInit = spy(new ShellInit(mMainExecutor)); mShellController = spy(new ShellController(mShellInit, mShellCommandHandler, mShellController = spy(new ShellController(mContext, mShellInit, mShellCommandHandler, mMainExecutor)); mRecentTasksControllerReal = new RecentTasksController(mContext, mShellInit, mShellController, mShellCommandHandler, mTaskStackListener, mActivityTaskManager, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ public class SplitScreenControllerTests extends ShellTestCase { public void setup() { assumeTrue(ActivityTaskManager.supportsSplitScreenMultiWindow(mContext)); MockitoAnnotations.initMocks(this); mShellController = spy(new ShellController(mShellInit, mShellCommandHandler, mShellController = spy(new ShellController(mContext, mShellInit, mShellCommandHandler, mMainExecutor)); mSplitScreenController = spy(new SplitScreenController(mContext, mShellInit, mShellCommandHandler, mShellController, mTaskOrganizer, mSyncQueue, Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +3 −2 Original line number Diff line number Diff line Loading @@ -732,10 +732,11 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides static ShellController provideShellController(ShellInit shellInit, static ShellController provideShellController(Context context, ShellInit shellInit, ShellCommandHandler shellCommandHandler, @ShellMainThread ShellExecutor mainExecutor) { return new ShellController(shellInit, shellCommandHandler, mainExecutor); return new ShellController(context, shellInit, shellCommandHandler, mainExecutor); } // Loading
libs/WindowManager/Shell/src/com/android/wm/shell/sysui/ShellController.java +18 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.content.pm.UserInfo; import android.content.res.Configuration; import android.os.Bundle; import android.util.ArrayMap; import android.view.SurfaceControlRegistry; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; Loading @@ -52,6 +53,7 @@ import java.util.function.Supplier; public class ShellController { private static final String TAG = ShellController.class.getSimpleName(); private final Context mContext; private final ShellInit mShellInit; private final ShellCommandHandler mShellCommandHandler; private final ShellExecutor mMainExecutor; Loading @@ -72,8 +74,11 @@ public class ShellController { private Configuration mLastConfiguration; public ShellController(ShellInit shellInit, ShellCommandHandler shellCommandHandler, public ShellController(Context context, ShellInit shellInit, ShellCommandHandler shellCommandHandler, ShellExecutor mainExecutor) { mContext = context; mShellInit = shellInit; mShellCommandHandler = shellCommandHandler; mMainExecutor = mainExecutor; Loading Loading @@ -254,6 +259,16 @@ public class ShellController { } } private void handleInit() { SurfaceControlRegistry.createProcessInstance(mContext); mShellInit.init(); } private void handleDump(PrintWriter pw) { mShellCommandHandler.dump(pw); SurfaceControlRegistry.dump(100 /* limit */, false /* runGc */, pw); } public void dump(@NonNull PrintWriter pw, String prefix) { final String innerPrefix = prefix + " "; pw.println(prefix + TAG); Loading @@ -279,7 +294,7 @@ public class ShellController { @Override public void onInit() { try { mMainExecutor.executeBlocking(() -> mShellInit.init()); mMainExecutor.executeBlocking(() -> ShellController.this.handleInit()); } catch (InterruptedException e) { throw new RuntimeException("Failed to initialize the Shell in 2s", e); } Loading Loading @@ -344,7 +359,7 @@ public class ShellController { @Override public void dump(PrintWriter pw) { try { mMainExecutor.executeBlocking(() -> mShellCommandHandler.dump(pw)); mMainExecutor.executeBlocking(() -> ShellController.this.handleDump(pw)); } catch (InterruptedException e) { throw new RuntimeException("Failed to dump the Shell in 2s", e); } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public class PipControllerTest extends ShellTestCase { return null; }).when(mMockExecutor).execute(any()); mShellInit = spy(new ShellInit(mMockExecutor)); mShellController = spy(new ShellController(mShellInit, mMockShellCommandHandler, mShellController = spy(new ShellController(mContext, mShellInit, mMockShellCommandHandler, mMockExecutor)); mPipController = new PipController(mContext, mShellInit, mMockShellCommandHandler, mShellController, mMockDisplayController, mMockPipAnimationController, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ public class RecentTasksControllerTest extends ShellTestCase { mMainExecutor = new TestShellExecutor(); when(mContext.getPackageManager()).thenReturn(mock(PackageManager.class)); mShellInit = spy(new ShellInit(mMainExecutor)); mShellController = spy(new ShellController(mShellInit, mShellCommandHandler, mShellController = spy(new ShellController(mContext, mShellInit, mShellCommandHandler, mMainExecutor)); mRecentTasksControllerReal = new RecentTasksController(mContext, mShellInit, mShellController, mShellCommandHandler, mTaskStackListener, mActivityTaskManager, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitScreenControllerTests.java +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ public class SplitScreenControllerTests extends ShellTestCase { public void setup() { assumeTrue(ActivityTaskManager.supportsSplitScreenMultiWindow(mContext)); MockitoAnnotations.initMocks(this); mShellController = spy(new ShellController(mShellInit, mShellCommandHandler, mShellController = spy(new ShellController(mContext, mShellInit, mShellCommandHandler, mMainExecutor)); mSplitScreenController = spy(new SplitScreenController(mContext, mShellInit, mShellCommandHandler, mShellController, mTaskOrganizer, mSyncQueue, Loading