Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +2 −0 Original line number Diff line number Diff line Loading @@ -206,12 +206,14 @@ public class Bubble implements BubbleViewProvider { public Bubble(Intent intent, UserHandle user, @Nullable Icon icon, Executor mainExecutor) { mKey = KEY_APP_BUBBLE; mGroupKey = null; mLocusId = null; mFlags = 0; mUser = user; mIcon = icon; mShowBubbleUpdateDot = false; mMainExecutor = mainExecutor; mTaskId = INVALID_TASK_ID; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +6 −4 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.content.pm.UserInfo; import android.content.res.Configuration; import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.drawable.Icon; import android.os.Binder; import android.os.Handler; import android.os.RemoteException; Loading Loading @@ -1034,8 +1035,9 @@ public class BubbleController implements ConfigurationChangeListener { * * @param intent the intent to display in the bubble expanded view. * @param user the {@link UserHandle} of the user to start this activity for. * @param icon the {@link Icon} to use for the bubble view. */ public void showOrHideAppBubble(Intent intent, UserHandle user) { public void showOrHideAppBubble(Intent intent, UserHandle user, @Nullable Icon icon) { if (intent == null || intent.getPackage() == null) { Log.w(TAG, "App bubble failed to show, invalid intent: " + intent + ((intent != null) ? " with package: " + intent.getPackage() : " ")); Loading Loading @@ -1063,7 +1065,7 @@ public class BubbleController implements ConfigurationChangeListener { } } else { // App bubble does not exist, lets add and expand it Bubble b = new Bubble(intent, user, mMainExecutor); Bubble b = new Bubble(intent, user, icon, mMainExecutor); b.setShouldAutoExpand(true); inflateAndAdd(b, /* suppressFlyout= */ true, /* showInShade= */ false); } Loading Loading @@ -1871,9 +1873,9 @@ public class BubbleController implements ConfigurationChangeListener { } @Override public void showOrHideAppBubble(Intent intent, UserHandle user) { public void showOrHideAppBubble(Intent intent, UserHandle user, @Nullable Icon icon) { mMainExecutor.execute( () -> BubbleController.this.showOrHideAppBubble(intent, user)); () -> BubbleController.this.showOrHideAppBubble(intent, user, icon)); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +3 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; import android.app.NotificationChannel; import android.content.Intent; import android.content.pm.UserInfo; import android.graphics.drawable.Icon; import android.hardware.HardwareBuffer; import android.os.UserHandle; import android.service.notification.NotificationListenerService; Loading Loading @@ -135,8 +136,9 @@ public interface Bubbles { * * @param intent the intent to display in the bubble expanded view. * @param user the {@link UserHandle} of the user to start this activity for. * @param icon the {@link Icon} to use for the bubble view. */ void showOrHideAppBubble(Intent intent, UserHandle user); void showOrHideAppBubble(Intent intent, UserHandle user, @Nullable Icon icon); /** @return true if the specified {@code taskId} corresponds to app bubble's taskId. */ boolean isAppBubbleTaskId(int taskId); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,8 @@ public class BubbleDataTest extends ShellTestCase { Intent appBubbleIntent = new Intent(mContext, BubblesTestActivity.class); appBubbleIntent.setPackage(mContext.getPackageName()); mAppBubble = new Bubble(appBubbleIntent, new UserHandle(1), mMainExecutor); mAppBubble = new Bubble(appBubbleIntent, new UserHandle(1), mock(Icon.class), mMainExecutor); mPositioner = new TestableBubblePositioner(mContext, mock(WindowManager.class)); Loading packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt +2 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,8 @@ constructor( logDebug { "onShowNoteTask - start: $info on user#${user.identifier}" } when (info.launchMode) { is NoteTaskLaunchMode.AppBubble -> { bubbles.showOrHideAppBubble(intent, userTracker.userHandle) // TODO: provide app bubble icon bubbles.showOrHideAppBubble(intent, userTracker.userHandle, null /* icon */) // App bubble logging happens on `onBubbleExpandChanged`. logDebug { "onShowNoteTask - opened as app bubble: $info" } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +2 −0 Original line number Diff line number Diff line Loading @@ -206,12 +206,14 @@ public class Bubble implements BubbleViewProvider { public Bubble(Intent intent, UserHandle user, @Nullable Icon icon, Executor mainExecutor) { mKey = KEY_APP_BUBBLE; mGroupKey = null; mLocusId = null; mFlags = 0; mUser = user; mIcon = icon; mShowBubbleUpdateDot = false; mMainExecutor = mainExecutor; mTaskId = INVALID_TASK_ID; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +6 −4 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.content.pm.UserInfo; import android.content.res.Configuration; import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.drawable.Icon; import android.os.Binder; import android.os.Handler; import android.os.RemoteException; Loading Loading @@ -1034,8 +1035,9 @@ public class BubbleController implements ConfigurationChangeListener { * * @param intent the intent to display in the bubble expanded view. * @param user the {@link UserHandle} of the user to start this activity for. * @param icon the {@link Icon} to use for the bubble view. */ public void showOrHideAppBubble(Intent intent, UserHandle user) { public void showOrHideAppBubble(Intent intent, UserHandle user, @Nullable Icon icon) { if (intent == null || intent.getPackage() == null) { Log.w(TAG, "App bubble failed to show, invalid intent: " + intent + ((intent != null) ? " with package: " + intent.getPackage() : " ")); Loading Loading @@ -1063,7 +1065,7 @@ public class BubbleController implements ConfigurationChangeListener { } } else { // App bubble does not exist, lets add and expand it Bubble b = new Bubble(intent, user, mMainExecutor); Bubble b = new Bubble(intent, user, icon, mMainExecutor); b.setShouldAutoExpand(true); inflateAndAdd(b, /* suppressFlyout= */ true, /* showInShade= */ false); } Loading Loading @@ -1871,9 +1873,9 @@ public class BubbleController implements ConfigurationChangeListener { } @Override public void showOrHideAppBubble(Intent intent, UserHandle user) { public void showOrHideAppBubble(Intent intent, UserHandle user, @Nullable Icon icon) { mMainExecutor.execute( () -> BubbleController.this.showOrHideAppBubble(intent, user)); () -> BubbleController.this.showOrHideAppBubble(intent, user, icon)); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +3 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; import android.app.NotificationChannel; import android.content.Intent; import android.content.pm.UserInfo; import android.graphics.drawable.Icon; import android.hardware.HardwareBuffer; import android.os.UserHandle; import android.service.notification.NotificationListenerService; Loading Loading @@ -135,8 +136,9 @@ public interface Bubbles { * * @param intent the intent to display in the bubble expanded view. * @param user the {@link UserHandle} of the user to start this activity for. * @param icon the {@link Icon} to use for the bubble view. */ void showOrHideAppBubble(Intent intent, UserHandle user); void showOrHideAppBubble(Intent intent, UserHandle user, @Nullable Icon icon); /** @return true if the specified {@code taskId} corresponds to app bubble's taskId. */ boolean isAppBubbleTaskId(int taskId); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,8 @@ public class BubbleDataTest extends ShellTestCase { Intent appBubbleIntent = new Intent(mContext, BubblesTestActivity.class); appBubbleIntent.setPackage(mContext.getPackageName()); mAppBubble = new Bubble(appBubbleIntent, new UserHandle(1), mMainExecutor); mAppBubble = new Bubble(appBubbleIntent, new UserHandle(1), mock(Icon.class), mMainExecutor); mPositioner = new TestableBubblePositioner(mContext, mock(WindowManager.class)); Loading
packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt +2 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,8 @@ constructor( logDebug { "onShowNoteTask - start: $info on user#${user.identifier}" } when (info.launchMode) { is NoteTaskLaunchMode.AppBubble -> { bubbles.showOrHideAppBubble(intent, userTracker.userHandle) // TODO: provide app bubble icon bubbles.showOrHideAppBubble(intent, userTracker.userHandle, null /* icon */) // App bubble logging happens on `onBubbleExpandChanged`. logDebug { "onShowNoteTask - opened as app bubble: $info" } } Loading