Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +7 −2 Original line number Diff line number Diff line Loading @@ -252,8 +252,7 @@ public class BubbleExpandedView extends LinearLayout { mPositioner = mBubbles.getPositioner(); mTaskView = new TaskView(mContext, mBubbles.getTaskOrganizer(), new HandlerExecutor(getHandler())); mTaskView = new TaskView(mContext, mBubbles.getTaskOrganizer()); // Set ActivityView's alpha value as zero, since there is no view content to be shown. setContentVisibility(false); Loading Loading @@ -310,6 +309,12 @@ public class BubbleExpandedView extends LinearLayout { setLayoutDirection(LAYOUT_DIRECTION_LOCALE); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); mTaskView.setExecutor(new HandlerExecutor(getHandler())); } void updateDimensions() { Resources res = getResources(); mMinHeight = res.getDimensionPixelSize(R.dimen.bubble_expanded_default_height); Loading packages/SystemUI/src/com/android/systemui/bubbles/TaskView.java +11 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.content.pm.LauncherApps; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.Binder; import android.os.Handler; import android.view.SurfaceControl; import android.view.SurfaceHolder; import android.view.SurfaceView; Loading Loading @@ -82,21 +81,25 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, private boolean mSurfaceCreated; private boolean mIsInitialized; private Listener mListener; private final Executor mExecutor; private Executor mExecutor; private final Rect mTmpRect = new Rect(); private final Rect mTmpRootRect = new Rect(); public TaskView(Context context, ShellTaskOrganizer organizer, Executor executor) { public TaskView(Context context, ShellTaskOrganizer organizer) { super(context, null, 0, 0, true /* disableBackgroundLayer */); mExecutor = executor; mTaskOrganizer = organizer; setUseAlpha(); getHolder().addCallback(this); mGuard.open("release"); } // TODO: Use TaskOrganizer executor when part of wmshell proper public void setExecutor(Executor executor) { mExecutor = executor; } /** * Only one listener may be set on the view, throws an exception otherwise. */ Loading Loading @@ -225,6 +228,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) { if (mExecutor == null) return; mExecutor.execute(() -> { mTaskInfo = taskInfo; mTaskToken = taskInfo.token; Loading Loading @@ -253,6 +257,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) { if (mExecutor == null) return; mExecutor.execute(() -> { if (mTaskToken == null || !mTaskToken.equals(taskInfo.token)) return; Loading @@ -268,6 +273,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) { if (mExecutor == null) return; mExecutor.execute(() -> { mTaskInfo.taskDescription = taskInfo.taskDescription; setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor()); Loading @@ -276,6 +282,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onBackPressedOnTaskRoot(ActivityManager.RunningTaskInfo taskInfo) { if (mExecutor == null) return; mExecutor.execute(() -> { if (mTaskToken == null || !mTaskToken.equals(taskInfo.token)) return; if (mListener != null) { Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/TaskViewTest.java +4 −3 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.PendingIntent; import android.content.Context; import android.os.Handler; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.SurfaceControl; Loading Loading @@ -101,7 +100,8 @@ public class TaskViewTest extends SysuiTestCase { return null; }).when(mExecutor).execute(any()); mTaskView = new TaskView(mContext, mOrganizer, mExecutor); mTaskView = new TaskView(mContext, mOrganizer); mTaskView.setExecutor(mExecutor); mTaskView.setListener(mViewListener); } Loading @@ -114,7 +114,8 @@ public class TaskViewTest extends SysuiTestCase { @Test public void testSetPendingListener_throwsException() { TaskView taskView = new TaskView(mContext, mOrganizer, mExecutor); TaskView taskView = new TaskView(mContext, mOrganizer); mTaskView.setExecutor(mExecutor); taskView.setListener(mViewListener); try { taskView.setListener(mViewListener); Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +7 −2 Original line number Diff line number Diff line Loading @@ -252,8 +252,7 @@ public class BubbleExpandedView extends LinearLayout { mPositioner = mBubbles.getPositioner(); mTaskView = new TaskView(mContext, mBubbles.getTaskOrganizer(), new HandlerExecutor(getHandler())); mTaskView = new TaskView(mContext, mBubbles.getTaskOrganizer()); // Set ActivityView's alpha value as zero, since there is no view content to be shown. setContentVisibility(false); Loading Loading @@ -310,6 +309,12 @@ public class BubbleExpandedView extends LinearLayout { setLayoutDirection(LAYOUT_DIRECTION_LOCALE); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); mTaskView.setExecutor(new HandlerExecutor(getHandler())); } void updateDimensions() { Resources res = getResources(); mMinHeight = res.getDimensionPixelSize(R.dimen.bubble_expanded_default_height); Loading
packages/SystemUI/src/com/android/systemui/bubbles/TaskView.java +11 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.content.pm.LauncherApps; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.Binder; import android.os.Handler; import android.view.SurfaceControl; import android.view.SurfaceHolder; import android.view.SurfaceView; Loading Loading @@ -82,21 +81,25 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, private boolean mSurfaceCreated; private boolean mIsInitialized; private Listener mListener; private final Executor mExecutor; private Executor mExecutor; private final Rect mTmpRect = new Rect(); private final Rect mTmpRootRect = new Rect(); public TaskView(Context context, ShellTaskOrganizer organizer, Executor executor) { public TaskView(Context context, ShellTaskOrganizer organizer) { super(context, null, 0, 0, true /* disableBackgroundLayer */); mExecutor = executor; mTaskOrganizer = organizer; setUseAlpha(); getHolder().addCallback(this); mGuard.open("release"); } // TODO: Use TaskOrganizer executor when part of wmshell proper public void setExecutor(Executor executor) { mExecutor = executor; } /** * Only one listener may be set on the view, throws an exception otherwise. */ Loading Loading @@ -225,6 +228,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) { if (mExecutor == null) return; mExecutor.execute(() -> { mTaskInfo = taskInfo; mTaskToken = taskInfo.token; Loading Loading @@ -253,6 +257,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) { if (mExecutor == null) return; mExecutor.execute(() -> { if (mTaskToken == null || !mTaskToken.equals(taskInfo.token)) return; Loading @@ -268,6 +273,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) { if (mExecutor == null) return; mExecutor.execute(() -> { mTaskInfo.taskDescription = taskInfo.taskDescription; setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor()); Loading @@ -276,6 +282,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, @Override public void onBackPressedOnTaskRoot(ActivityManager.RunningTaskInfo taskInfo) { if (mExecutor == null) return; mExecutor.execute(() -> { if (mTaskToken == null || !mTaskToken.equals(taskInfo.token)) return; if (mListener != null) { Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/TaskViewTest.java +4 −3 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.PendingIntent; import android.content.Context; import android.os.Handler; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.SurfaceControl; Loading Loading @@ -101,7 +100,8 @@ public class TaskViewTest extends SysuiTestCase { return null; }).when(mExecutor).execute(any()); mTaskView = new TaskView(mContext, mOrganizer, mExecutor); mTaskView = new TaskView(mContext, mOrganizer); mTaskView.setExecutor(mExecutor); mTaskView.setListener(mViewListener); } Loading @@ -114,7 +114,8 @@ public class TaskViewTest extends SysuiTestCase { @Test public void testSetPendingListener_throwsException() { TaskView taskView = new TaskView(mContext, mOrganizer, mExecutor); TaskView taskView = new TaskView(mContext, mOrganizer); mTaskView.setExecutor(mExecutor); taskView.setListener(mViewListener); try { taskView.setListener(mViewListener); Loading