diff options
author | 2020-10-27 11:37:11 +0800 | |
---|---|---|
committer | 2020-11-04 11:01:56 +0800 | |
commit | eb01a25c87070145984dd1659efc33a627cbdbf6 (patch) | |
tree | a0bc87c532d5df4b1e65bed3fc59db809b9c4a16 | |
parent | 02c367d8c12dd25c693ef6c18fad29871137a0a3 (diff) |
Migrate Bubbles to wm-shell (5/n)
Move bubbles package and related resources to shell package,
also copied some used codes and resources.
Bug: 161980186
Test: atest SystemUITests
Test: atest WMShellUnitTests
Change-Id: Ia108bd4149b3c3bf86631ba1a7a6bce0e76af78f
138 files changed, 959 insertions, 977 deletions
diff --git a/core/java/com/android/internal/inputmethod/SoftInputShowHideReason.java b/core/java/com/android/internal/inputmethod/SoftInputShowHideReason.java index f46626be48a8..ffc7f05eb703 100644 --- a/core/java/com/android/internal/inputmethod/SoftInputShowHideReason.java +++ b/core/java/com/android/internal/inputmethod/SoftInputShowHideReason.java @@ -144,7 +144,7 @@ public @interface SoftInputShowHideReason { int HIDE_RECENTS_ANIMATION = 18; /** - * Hide soft input when {@link com.android.systemui.bubbles.BubbleController} is expanding, + * Hide soft input when {@link com.android.wm.shell.bubbles.BubbleController} is expanding, * switching, or collapsing Bubbles. */ int HIDE_BUBBLES = 19; diff --git a/libs/WindowManager/Shell/Android.bp b/libs/WindowManager/Shell/Android.bp index 0defbd6451fe..39e32c694d2e 100644 --- a/libs/WindowManager/Shell/Android.bp +++ b/libs/WindowManager/Shell/Android.bp @@ -116,12 +116,15 @@ android_library { "res", ], static_libs: [ + "androidx.appcompat_appcompat", + "androidx.arch.core_core-runtime", "androidx.dynamicanimation_dynamicanimation", "kotlinx-coroutines-android", "kotlinx-coroutines-core", + "iconloader_base", "protolog-lib", + "SettingsLib", "WindowManager-Shell-proto", - "androidx.appcompat_appcompat", ], kotlincflags: ["-Xjvm-default=enable"], manifest: "AndroidManifest.xml", diff --git a/libs/WindowManager/Shell/res/drawable/bubble_dismiss_circle.xml b/libs/WindowManager/Shell/res/drawable/bubble_dismiss_circle.xml new file mode 100644 index 000000000000..2104be48d1d9 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/bubble_dismiss_circle.xml @@ -0,0 +1,28 @@ +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<!-- + The transparent circle outline that encircles the bubbles when they're in the dismiss target. +--> +<shape + xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="oval"> + + <stroke + android:width="1dp" + android:color="#66FFFFFF" /> + + <solid android:color="#B3000000" /> +</shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/bubble_dismiss_icon.xml b/libs/WindowManager/Shell/res/drawable/bubble_dismiss_icon.xml index 5c8de581f8d1..ff8feded11ab 100644 --- a/packages/SystemUI/res/drawable/bubble_dismiss_icon.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_dismiss_icon.xml @@ -1,18 +1,18 @@ <!-- - Copyright (C) 2019 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> <!-- The 'X' bubble dismiss icon. This is just ic_close with a stroke. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" diff --git a/libs/WindowManager/Shell/res/drawable/bubble_ic_create_bubble.xml b/libs/WindowManager/Shell/res/drawable/bubble_ic_create_bubble.xml new file mode 100644 index 000000000000..920671a24204 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/bubble_ic_create_bubble.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="20dp" + android:height="20dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#FF000000" + android:pathData="M23,5v8h-2V5H3v14h10v2v0H3c-1.1,0 -2,-0.9 -2,-2V5c0,-1.1 0.9,-2 2,-2h18C22.1,3 23,3.9 23,5zM10,8v2.59L5.71,6.29L4.29,7.71L8.59,12H6v2h6V8H10zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_empty_bubble_overflow_dark.xml b/libs/WindowManager/Shell/res/drawable/bubble_ic_empty_overflow_dark.xml index 8f8f1b664692..8f8f1b664692 100644 --- a/packages/SystemUI/res/drawable/ic_empty_bubble_overflow_dark.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_ic_empty_overflow_dark.xml diff --git a/packages/SystemUI/res/drawable/ic_empty_bubble_overflow_light.xml b/libs/WindowManager/Shell/res/drawable/bubble_ic_empty_overflow_light.xml index 5e02f67700e7..5e02f67700e7 100644 --- a/packages/SystemUI/res/drawable/ic_empty_bubble_overflow_light.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_ic_empty_overflow_light.xml diff --git a/packages/SystemUI/res/drawable/ic_bubble_overflow_button.xml b/libs/WindowManager/Shell/res/drawable/bubble_ic_overflow_button.xml index 3acebc12a807..3acebc12a807 100644 --- a/packages/SystemUI/res/drawable/ic_bubble_overflow_button.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_ic_overflow_button.xml diff --git a/libs/WindowManager/Shell/res/drawable/bubble_ic_stop_bubble.xml b/libs/WindowManager/Shell/res/drawable/bubble_ic_stop_bubble.xml new file mode 100644 index 000000000000..8609576ce789 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/bubble_ic_stop_bubble.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="20dp" + android:height="20dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="#FF000000" + android:pathData="M11.29,14.71L7,10.41V13H5V7h6v2H8.41l4.29,4.29L11.29,14.71zM21,3H3C1.9,3 1,3.9 1,5v14c0,1.1 0.9,2 2,2h10v0v-2H3V5h18v8h2V5C23,3.9 22.1,3 21,3zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/bubble_manage_menu_row.xml b/libs/WindowManager/Shell/res/drawable/bubble_manage_menu_row.xml index a793680a037d..c61ac1c5f2d5 100644 --- a/packages/SystemUI/res/drawable/bubble_manage_menu_row.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_manage_menu_row.xml @@ -12,7 +12,7 @@ ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and - ~ limitations under the License + ~ limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> diff --git a/packages/SystemUI/res/drawable/bubble_stack_user_education_bg.xml b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg.xml index 4b9219cd6194..4b9219cd6194 100644 --- a/packages/SystemUI/res/drawable/bubble_stack_user_education_bg.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg.xml diff --git a/packages/SystemUI/res/drawable/bubble_stack_user_education_bg_rtl.xml b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg_rtl.xml index c7baba14b5e5..c7baba14b5e5 100644 --- a/packages/SystemUI/res/drawable/bubble_stack_user_education_bg_rtl.xml +++ b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg_rtl.xml diff --git a/libs/WindowManager/Shell/res/drawable/ic_remove_no_shadow.xml b/libs/WindowManager/Shell/res/drawable/ic_remove_no_shadow.xml new file mode 100644 index 000000000000..265c5019c79a --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/ic_remove_no_shadow.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/textColorPrimary" > + <path + android:fillColor="#FFFFFFFF" + android:pathData="M13.41,12l5.29-5.29c0.39-0.39,0.39-1.02,0-1.41c-0.39-0.39-1.02-0.39-1.41,0L12,10.59L6.71, + 5.29c-0.39-0.39-1.02-0.39-1.41,0c-0.39,0.39-0.39,1.02,0,1.41L10.59,12l-5.29,5.29c-0.39,0.39-0.39,1.02, + 0,1.41c0.39,0.39,1.02,0.39,1.41,0L12,13.41l5.29,5.29c0.39,0.39,1.02,0.39,1.41,0c0.39-0.39,0.39-1.02,0-1.41L13.41,12z"/> +</vector>
\ No newline at end of file diff --git a/libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml b/libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml new file mode 100644 index 000000000000..e95744573960 --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/rounded_bg_full.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="?android:attr/colorBackgroundFloating" /> + <corners + android:bottomLeftRadius="?android:attr/dialogCornerRadius" + android:topLeftRadius="?android:attr/dialogCornerRadius" + android:bottomRightRadius="?android:attr/dialogCornerRadius" + android:topRightRadius="?android:attr/dialogCornerRadius" + /> +</shape> diff --git a/packages/SystemUI/res/layout/bubble_dismiss_target.xml b/libs/WindowManager/Shell/res/layout/bubble_dismiss_target.xml index f5cd727a6d03..f5cd727a6d03 100644 --- a/packages/SystemUI/res/layout/bubble_dismiss_target.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_dismiss_target.xml diff --git a/packages/SystemUI/res/layout/bubble_expanded_view.xml b/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml index db40c4fde053..54b08c6f220e 100644 --- a/packages/SystemUI/res/layout/bubble_expanded_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- - ~ Copyright (C) 2018 The Android Open Source Project + ~ Copyright (C) 2020 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -12,9 +12,9 @@ ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and - ~ limitations under the License + ~ limitations under the License. --> -<com.android.systemui.bubbles.BubbleExpandedView +<com.android.wm.shell.bubbles.BubbleExpandedView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="match_parent" @@ -27,7 +27,7 @@ android:layout_height="@dimen/bubble_pointer_height" /> - <com.android.systemui.statusbar.AlphaOptimizedButton + <com.android.wm.shell.common.AlphaOptimizedButton style="@android:style/Widget.Material.Button.Borderless" android:id="@+id/settings_button" android:layout_gravity="start" @@ -35,7 +35,7 @@ android:layout_height="wrap_content" android:focusable="true" android:text="@string/manage_bubbles_text" - android:textColor="?attr/wallpaperTextColor" + android:textColor="?android:attr/textColorPrimaryInverse" /> -</com.android.systemui.bubbles.BubbleExpandedView> +</com.android.wm.shell.bubbles.BubbleExpandedView> diff --git a/packages/SystemUI/res/layout/bubble_flyout.xml b/libs/WindowManager/Shell/res/layout/bubble_flyout.xml index 22a81357ee15..7fdf290efd09 100644 --- a/packages/SystemUI/res/layout/bubble_flyout.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_flyout.xml @@ -34,7 +34,7 @@ android:layout_height="30dp" android:layout_marginEnd="@dimen/bubble_flyout_avatar_message_space" android:scaleType="centerInside" - android:src="@drawable/ic_create_bubble"/> + android:src="@drawable/bubble_ic_create_bubble"/> <LinearLayout android:layout_width="wrap_content" diff --git a/packages/SystemUI/res/layout/bubble_manage_menu.xml b/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml index 84948828bdbe..3a6aa805d071 100644 --- a/packages/SystemUI/res/layout/bubble_manage_menu.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml @@ -35,7 +35,7 @@ android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/ic_remove_no_shadow" - android:tint="@color/global_actions_text"/> + android:tint="@color/bubbles_icon_tint"/> <TextView android:layout_width="wrap_content" @@ -59,8 +59,8 @@ <ImageView android:layout_width="24dp" android:layout_height="24dp" - android:src="@drawable/ic_stop_bubble" - android:tint="@color/global_actions_text"/> + android:src="@drawable/bubble_ic_stop_bubble" + android:tint="@color/bubbles_icon_tint"/> <TextView android:layout_width="wrap_content" diff --git a/packages/SystemUI/res/layout/bubble_menu_view.xml b/libs/WindowManager/Shell/res/layout/bubble_menu_view.xml index 24608d3e9611..0c1d1a54507a 100644 --- a/packages/SystemUI/res/layout/bubble_menu_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_menu_view.xml @@ -14,7 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> -<com.android.systemui.bubbles.BubbleMenuView +<com.android.wm.shell.bubbles.BubbleMenuView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" @@ -30,14 +30,14 @@ <ImageView android:id="@*android:id/icon" - android:layout_width="@dimen/global_actions_grid_item_icon_width" - android:layout_height="@dimen/global_actions_grid_item_icon_height" - android:layout_marginTop="@dimen/global_actions_grid_item_icon_top_margin" - android:layout_marginBottom="@dimen/global_actions_grid_item_icon_bottom_margin" - android:layout_marginLeft="@dimen/global_actions_grid_item_icon_side_margin" - android:layout_marginRight="@dimen/global_actions_grid_item_icon_side_margin" + android:layout_width="@dimen/bubble_grid_item_icon_width" + android:layout_height="@dimen/bubble_grid_item_icon_height" + android:layout_marginTop="@dimen/bubble_grid_item_icon_top_margin" + android:layout_marginBottom="@dimen/bubble_grid_item_icon_bottom_margin" + android:layout_marginLeft="@dimen/bubble_grid_item_icon_side_margin" + android:layout_marginRight="@dimen/bubble_grid_item_icon_side_margin" android:scaleType="centerInside" - android:tint="@color/global_actions_text" + android:tint="@color/bubbles_icon_tint" /> </FrameLayout> -</com.android.systemui.bubbles.BubbleMenuView> +</com.android.wm.shell.bubbles.BubbleMenuView> diff --git a/packages/SystemUI/res/layout/bubble_overflow_activity.xml b/libs/WindowManager/Shell/res/layout/bubble_overflow_activity.xml index 306061911f8d..306061911f8d 100644 --- a/packages/SystemUI/res/layout/bubble_overflow_activity.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_overflow_activity.xml diff --git a/packages/SystemUI/res/layout/bubble_overflow_button.xml b/libs/WindowManager/Shell/res/layout/bubble_overflow_button.xml index 8f0fd4f37461..61000fe19d2c 100644 --- a/packages/SystemUI/res/layout/bubble_overflow_button.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_overflow_button.xml @@ -14,9 +14,9 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<com.android.systemui.bubbles.BadgedImageView +<com.android.wm.shell.bubbles.BadgedImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bubble_overflow_button" android:layout_width="@dimen/individual_bubble_size" android:layout_height="@dimen/individual_bubble_size" - android:src="@drawable/ic_bubble_overflow_button"/> + android:src="@drawable/bubble_ic_overflow_button"/> diff --git a/packages/SystemUI/res/layout/bubble_overflow_view.xml b/libs/WindowManager/Shell/res/layout/bubble_overflow_view.xml index 1218fba23502..c1f67bd27d93 100644 --- a/packages/SystemUI/res/layout/bubble_overflow_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_overflow_view.xml @@ -21,7 +21,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <com.android.systemui.bubbles.BadgedImageView + <com.android.wm.shell.bubbles.BadgedImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bubble_view" android:layout_gravity="center" diff --git a/packages/SystemUI/res/layout/bubble_stack_user_education.xml b/libs/WindowManager/Shell/res/layout/bubble_stack_user_education.xml index fe1ed4b6f726..fe1ed4b6f726 100644 --- a/packages/SystemUI/res/layout/bubble_stack_user_education.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_stack_user_education.xml diff --git a/packages/SystemUI/res/layout/bubble_view.xml b/libs/WindowManager/Shell/res/layout/bubble_view.xml index 78f7cffab650..a28bd678c9ab 100644 --- a/packages/SystemUI/res/layout/bubble_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_view.xml @@ -14,7 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<com.android.systemui.bubbles.BadgedImageView +<com.android.wm.shell.bubbles.BadgedImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bubble_view" android:layout_width="@dimen/individual_bubble_size" diff --git a/packages/SystemUI/res/layout/bubbles_manage_button_education.xml b/libs/WindowManager/Shell/res/layout/bubbles_manage_button_education.xml index b51dc93dc373..8de06c7732d4 100644 --- a/packages/SystemUI/res/layout/bubbles_manage_button_education.xml +++ b/libs/WindowManager/Shell/res/layout/bubbles_manage_button_education.xml @@ -64,7 +64,7 @@ android:id="@+id/button_layout" android:orientation="horizontal" > - <com.android.systemui.statusbar.AlphaOptimizedButton + <com.android.wm.shell.common.AlphaOptimizedButton style="@android:style/Widget.Material.Button.Borderless" android:id="@+id/manage" android:layout_gravity="start" @@ -73,10 +73,10 @@ android:focusable="true" android:clickable="false" android:text="@string/manage_bubbles_text" - android:textColor="?attr/wallpaperTextColor" + android:textColor="?android:attr/textColorPrimaryInverse" /> - <com.android.systemui.statusbar.AlphaOptimizedButton + <com.android.wm.shell.common.AlphaOptimizedButton style="@android:style/Widget.Material.Button.Borderless" android:id="@+id/got_it" android:layout_gravity="start" @@ -84,7 +84,7 @@ android:layout_height="wrap_content" android:focusable="true" android:text="@string/bubbles_user_education_got_it" - android:textColor="?attr/wallpaperTextColor" + android:textColor="?android:attr/textColorPrimaryInverse" /> </LinearLayout> </LinearLayout> diff --git a/libs/WindowManager/Shell/res/values-land/dimens.xml b/libs/WindowManager/Shell/res/values-land/dimens.xml index 77a601ddf440..aafba58cef59 100644 --- a/libs/WindowManager/Shell/res/values-land/dimens.xml +++ b/libs/WindowManager/Shell/res/values-land/dimens.xml @@ -18,4 +18,8 @@ <resources> <dimen name="docked_divider_handle_width">2dp</dimen> <dimen name="docked_divider_handle_height">16dp</dimen> + + <!-- Padding between status bar and bubbles when displayed in expanded state, smaller + value in landscape since we have limited vertical space--> + <dimen name="bubble_padding_top">4dp</dimen> </resources>
\ No newline at end of file diff --git a/libs/WindowManager/Shell/res/values-night/colors.xml b/libs/WindowManager/Shell/res/values-night/colors.xml new file mode 100644 index 000000000000..24b364043938 --- /dev/null +++ b/libs/WindowManager/Shell/res/values-night/colors.xml @@ -0,0 +1,20 @@ +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<resources> + <!-- Bubbles --> + <color name="bubbles_icon_tint">@color/GM2_grey_200</color> +</resources>
\ No newline at end of file diff --git a/libs/WindowManager/Shell/res/values/colors.xml b/libs/WindowManager/Shell/res/values/colors.xml index cc3bf2a09454..1674d0bf78be 100644 --- a/libs/WindowManager/Shell/res/values/colors.xml +++ b/libs/WindowManager/Shell/res/values/colors.xml @@ -25,4 +25,14 @@ <!-- Background for the various drop targets when handling drag and drop. --> <color name="drop_outline_background">#330000FF</color> + + <!-- Bubbles --> + <color name="bubbles_light">#FFFFFF</color> + <color name="bubbles_dark">@color/GM2_grey_800</color> + <color name="bubbles_icon_tint">@color/GM2_grey_700</color> + + <!-- GM2 colors --> + <color name="GM2_grey_200">#E8EAED</color> + <color name="GM2_grey_700">#5F6368</color> + <color name="GM2_grey_800">#3C4043</color> </resources>
\ No newline at end of file diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml index b87a642a8dc7..8a60aafcd13d 100644 --- a/libs/WindowManager/Shell/res/values/dimen.xml +++ b/libs/WindowManager/Shell/res/values/dimen.xml @@ -75,4 +75,94 @@ <!-- The amount to inset the drop target regions from the edge of the display --> <dimen name="drop_layout_display_margin">16dp</dimen> + + <!-- The menu grid size for bubble menu. --> + <dimen name="bubble_grid_item_icon_width">20dp</dimen> + <dimen name="bubble_grid_item_icon_height">20dp</dimen> + <dimen name="bubble_grid_item_icon_top_margin">12dp</dimen> + <dimen name="bubble_grid_item_icon_bottom_margin">4dp</dimen> + <dimen name="bubble_grid_item_icon_side_margin">22dp</dimen> + + <!-- How much each bubble is elevated. --> + <dimen name="bubble_elevation">1dp</dimen> + <!-- How much the bubble flyout text container is elevated. --> + <dimen name="bubble_flyout_elevation">4dp</dimen> + <!-- How much padding is around the left and right sides of the flyout text. --> + <dimen name="bubble_flyout_padding_x">12dp</dimen> + <!-- How much padding is around the top and bottom of the flyout text. --> + <dimen name="bubble_flyout_padding_y">10dp</dimen> + <!-- Size of the triangle that points from the flyout to the bubble stack. --> + <dimen name="bubble_flyout_pointer_size">6dp</dimen> + <!-- How much space to leave between the flyout (tip of the arrow) and the bubble stack. --> + <dimen name="bubble_flyout_space_from_bubble">8dp</dimen> + <!-- How much space to leave between the flyout text and the avatar displayed in the flyout. --> + <dimen name="bubble_flyout_avatar_message_space">6dp</dimen> + <!-- Padding between status bar and bubbles when displayed in expanded state --> + <dimen name="bubble_padding_top">16dp</dimen> + <!-- Size of individual bubbles. --> + <dimen name="individual_bubble_size">60dp</dimen> + <!-- Size of bubble bitmap. --> + <dimen name="bubble_bitmap_size">52dp</dimen> + <!-- Size of bubble icon bitmap. --> + <dimen name="bubble_overflow_icon_bitmap_size">24dp</dimen> + <!-- Extra padding added to the touchable rect for bubbles so they are easier to grab. --> + <dimen name="bubble_touch_padding">12dp</dimen> + <!-- Size of the circle around the bubbles when they're in the dismiss target. --> + <dimen name="bubble_dismiss_encircle_size">52dp</dimen> + <!-- Padding around the view displayed when the bubble is expanded --> + <dimen name="bubble_expanded_view_padding">4dp</dimen> + <!-- This should be at least the size of bubble_expanded_view_padding; it is used to include + a slight touch slop around the expanded view. --> + <dimen name="bubble_expanded_view_slop">8dp</dimen> + <!-- Default (and minimum) height of the expanded view shown when the bubble is expanded --> + <dimen name="bubble_expanded_default_height">180dp</dimen> + <!-- Default height of bubble overflow --> + <dimen name="bubble_overflow_height">480dp</dimen> + <!-- Bubble overflow padding when there are no bubbles --> + <dimen name="bubble_overflow_empty_state_padding">16dp</dimen> + <!-- Padding of container for overflow bubbles --> + <dimen name="bubble_overflow_padding">15dp</dimen> + <!-- Padding of label for bubble overflow view --> + <dimen name="bubble_overflow_text_padding">7dp</dimen> + <!-- Height of bubble overflow empty state illustration --> + <dimen name="bubble_empty_overflow_image_height">200dp</dimen> + <!-- Padding of bubble overflow empty state subtitle --> + <dimen name="bubble_empty_overflow_subtitle_padding">50dp</dimen> + <!-- Height of the triangle that points to the expanded bubble --> + <dimen name="bubble_pointer_height">8dp</dimen> + <!-- Width of the triangle that points to the expanded bubble --> + <dimen name="bubble_pointer_width">12dp</dimen> + <!-- Extra padding around the dismiss target for bubbles --> + <dimen name="bubble_dismiss_slop">16dp</dimen> + <!-- Height of button allowing users to adjust settings for bubbles. --> + <dimen name="bubble_manage_button_height">48dp</dimen> + <!-- Max width of the message bubble--> + <dimen name="bubble_message_max_width">144dp</dimen> + <!-- Min width of the message bubble --> + <dimen name="bubble_message_min_width">32dp</dimen> + <!-- Interior padding of the message bubble --> + <dimen name="bubble_message_padding">4dp</dimen> + <!-- Offset between bubbles in their stacked position. --> + <dimen name="bubble_stack_offset">10dp</dimen> + <!-- Offset between stack y and animation y for bubble swap. --> + <dimen name="bubble_swap_animation_offset">15dp</dimen> + <!-- How far offscreen the bubble stack rests. Cuts off padding and part of icon bitmap. --> + <dimen name="bubble_stack_offscreen">9dp</dimen> + <!-- How far down the screen the stack starts. --> + <dimen name="bubble_stack_starting_offset_y">120dp</dimen> + <!-- Space between the pointer triangle and the bubble expanded view --> + <dimen name="bubble_pointer_margin">8dp</dimen> + <!-- Padding applied to the bubble dismiss target. Touches in this padding cause the bubbles to + snap to the dismiss target. --> + <dimen name="bubble_dismiss_target_padding_x">40dp</dimen> + <dimen name="bubble_dismiss_target_padding_y">20dp</dimen> + <dimen name="bubble_manage_menu_elevation">4dp</dimen> + + <!-- Bubbles user education views --> + <dimen name="bubbles_manage_education_width">160dp</dimen> + <!-- The inset from the top bound of the manage button to place the user education. --> + <dimen name="bubbles_manage_education_top_inset">65dp</dimen> + <!-- Size of padding for the user education cling, this should at minimum be larger than + individual_bubble_size + some padding. --> + <dimen name="bubble_stack_user_education_side_inset">72dp</dimen> </resources> diff --git a/libs/WindowManager/Shell/res/values/ids.xml b/libs/WindowManager/Shell/res/values/ids.xml index fb892388cf74..434a000010c4 100644 --- a/libs/WindowManager/Shell/res/values/ids.xml +++ b/libs/WindowManager/Shell/res/values/ids.xml @@ -23,4 +23,21 @@ <item type="id" name="action_move_tl_50" /> <item type="id" name="action_move_tl_30" /> <item type="id" name="action_move_rb_full" /> + + <!-- For saving PhysicsAnimationLayout animations/animators as view tags. --> + <item type="id" name="translation_x_dynamicanimation_tag"/> + <item type="id" name="translation_y_dynamicanimation_tag"/> + <item type="id" name="translation_z_dynamicanimation_tag"/> + <item type="id" name="alpha_dynamicanimation_tag"/> + <item type="id" name="scale_x_dynamicanimation_tag"/> + <item type="id" name="scale_y_dynamicanimation_tag"/> + <item type="id" name="physics_animator_tag"/> + <item type="id" name="target_animator_tag" /> + <item type="id" name="reorder_animator_tag"/> + + <!-- Accessibility actions for bubbles. --> + <item type="id" name="action_move_top_left"/> + <item type="id" name="action_move_top_right"/> + <item type="id" name="action_move_bottom_left"/> + <item type="id" name="action_move_bottom_right"/> </resources> diff --git a/libs/WindowManager/Shell/res/values/integers.xml b/libs/WindowManager/Shell/res/values/integers.xml new file mode 100644 index 000000000000..583bf3341a69 --- /dev/null +++ b/libs/WindowManager/Shell/res/values/integers.xml @@ -0,0 +1,25 @@ +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<resources> + <!-- Maximum number of bubbles to render and animate at one time. While the animations used are + lightweight translation animations, this number can be reduced on lower end devices if any + performance issues arise. --> + <integer name="bubbles_max_rendered">5</integer> + <!-- Number of columns in bubble overflow. --> + <integer name="bubbles_overflow_columns">4</integer> + <!-- Maximum number of bubbles we allow in overflow before we dismiss the oldest one. --> + <integer name="bubbles_max_overflow">16</integer> +</resources>
\ No newline at end of file diff --git a/libs/WindowManager/Shell/res/values/strings.xml b/libs/WindowManager/Shell/res/values/strings.xml index da5965dab71a..30ef72c2a352 100644 --- a/libs/WindowManager/Shell/res/values/strings.xml +++ b/libs/WindowManager/Shell/res/values/strings.xml @@ -97,4 +97,53 @@ <string name="accessibility_action_start_one_handed">Start one-handed mode</string> <!-- Accessibility description for stop one-handed mode [CHAR LIMIT=NONE] --> <string name="accessibility_action_stop_one_handed">Exit one-handed mode</string> + + <!-- Text used for content description of settings button in the header of expanded bubble + view. [CHAR_LIMIT=NONE] --> + <string name="bubbles_settings_button_description">Settings for <xliff:g id="app_name" example="YouTube">%1$s</xliff:g> bubbles</string> + <!-- Content description for button that shows bubble overflow on click [CHAR LIMIT=NONE] --> + <string name="bubble_overflow_button_content_description">Overflow</string> + <!-- Action to add overflow bubble back to stack. [CHAR LIMIT=NONE] --> + <string name="bubble_accessibility_action_add_back">Add back to stack</string> + <!-- Content description when a bubble is focused. [CHAR LIMIT=NONE] --> + <string name="bubble_content_description_single"><xliff:g id="notification_title" example="some title">%1$s</xliff:g> from <xliff:g id="app_name" example="YouTube">%2$s</xliff:g></string> + <!-- Content description when the stack of bubbles is focused. [CHAR LIMIT=NONE] --> + <string name="bubble_content_description_stack"><xliff:g id="notification_title" example="some title">%1$s</xliff:g> from <xliff:g id="app_name" example="YouTube">%2$s</xliff:g> and <xliff:g id="bubble_count" example="4">%3$d</xliff:g> more</string> + <!-- Action in accessibility menu to move the stack of bubbles to the top left of the screen. [CHAR LIMIT=30] --> + <string name="bubble_accessibility_action_move_top_left">Move top left</string> + <!-- Action in accessibility menu to move the stack of bubbles to the top right of the screen. [CHAR LIMIT=30] --> + <string name="bubble_accessibility_action_move_top_right">Move top right</string> + <!-- Action in accessibility menu to move the stack of bubbles to the bottom left of the screen. [CHAR LIMIT=30]--> + <string name="bubble_accessibility_action_move_bottom_left">Move bottom left</string> + <!-- Action in accessibility menu to move the stack of bubbles to the bottom right of the screen. [CHAR LIMIT=30]--> + <string name="bubble_accessibility_action_move_bottom_right">Move bottom right</string> + <!-- Label for the button that takes the user to the notification settings for the given app. --> + <string name="bubbles_app_settings"><xliff:g id="notification_title" example="Android Messages">%1$s</xliff:g> settings</string> + <!-- Text used for the bubble dismiss area. Bubbles dragged to, or flung towards, this area will go away. [CHAR LIMIT=30] --> + <string name="bubble_dismiss_text">Dismiss bubble</string> + <!-- Button text to stop a conversation from bubbling [CHAR LIMIT=60]--> + <string name="bubbles_dont_bubble_conversation">Don\u2019t bubble conversation</string> + <!-- Title text for the bubbles feature education cling shown when a bubble is on screen for the first time. [CHAR LIMIT=60]--> + <string name="bubbles_user_education_title">Chat using bubbles</string> + <!-- Descriptive text for the bubble feature education cling shown when a bubble is on screen for the first time. [CHAR LIMIT=NONE] --> + <string name="bubbles_user_education_description">New conversations appear as floating icons, or bubbles. Tap to open bubble. Drag to move it.</string> + <!-- Title text for the bubble "manage" button tool tip highlighting where users can go to control bubble settings. [CHAR LIMIT=60]--> + <string name="bubbles_user_education_manage_title">Control bubbles anytime</string> + <!-- Descriptive text for the bubble "manage" button tool tip highlighting where users can go to control bubble settings. [CHAR LIMIT=80]--> + <string name="bubbles_user_education_manage">Tap Manage to turn off bubbles from this app</string> + <!-- Button text for dismissing the bubble "manage" button tool tip [CHAR LIMIT=20]--> + <string name="bubbles_user_education_got_it">Got it</string> + <!-- [CHAR LIMIT=NONE] Empty overflow title --> + <string name="bubble_overflow_empty_title">No recent bubbles</string> + <!-- [CHAR LIMIT=NONE] Empty overflow subtitle --> + <string name="bubble_overflow_empty_subtitle">Recent bubbles and dismissed bubbles will appear here</string> + + <!-- [CHAR LIMIT=100] Notification Importance title --> + <string name="notification_bubble_title">Bubble</string> + + <!-- The text for the manage bubbles link. [CHAR LIMIT=NONE] --> + <string name="manage_bubbles_text">Manage</string> + + <!-- Content description to tell the user a bubble has been dismissed. --> + <string name="accessibility_bubble_dismissed">Bubble dismissed.</string> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/TaskView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java index 0a2cfbfffd9e..59a765d49a14 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/TaskView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; @@ -30,26 +30,23 @@ import android.content.pm.LauncherApps; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.Binder; +import android.util.CloseGuard; import android.view.SurfaceControl; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; -import com.android.wm.shell.ShellTaskOrganizer; - -import dalvik.system.CloseGuard; - import java.io.PrintWriter; import java.util.concurrent.Executor; /** * View that can display a task. */ -// TODO: Place in com.android.wm.shell vs. com.android.wm.shell.bubbles on shell migration. public class TaskView extends SurfaceView implements SurfaceHolder.Callback, ShellTaskOrganizer.TaskListener { + /** Callback for listening task state. */ public interface Listener { /** Called when the container is ready for launching activities. */ default void onInitialized() {} @@ -70,7 +67,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, default void onBackPressedOnTaskRoot(int taskId) {} } - private final CloseGuard mGuard = CloseGuard.get(); + private final CloseGuard mGuard = new CloseGuard(); private final ShellTaskOrganizer mTaskOrganizer; diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/animation/Interpolators.java b/libs/WindowManager/Shell/src/com/android/wm/shell/animation/Interpolators.java index a3b720c457c6..8aca01d2467b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/animation/Interpolators.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/animation/Interpolators.java @@ -56,4 +56,10 @@ public class Interpolators { * Interpolator to be used when animating a move based on a click. Pair with enough duration. */ public static final Interpolator TOUCH_RESPONSE = new PathInterpolator(0.3f, 0f, 0.1f, 1f); + + /** + * Interpolator to be used when animating a panel closing. + */ + public static final Interpolator PANEL_CLOSE_ACCELERATED = + new PathInterpolator(0.3f, 0, 0.5f, 1); } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BadgedImageView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java index 8bcffc8ece1a..4d06c039551b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BadgedImageView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; + +import static android.graphics.Paint.DITHER_FLAG; +import static android.graphics.Paint.FILTER_BITMAP_FLAG; import android.annotation.Nullable; import android.content.Context; @@ -28,14 +31,11 @@ import android.util.PathParser; import android.widget.ImageView; import com.android.launcher3.icons.DotRenderer; -import com.android.systemui.Interpolators; -import com.android.systemui.R; +import com.android.wm.shell.R; +import com.android.wm.shell.animation.Interpolators; import java.util.EnumSet; -import static android.graphics.Paint.DITHER_FLAG; -import static android.graphics.Paint.FILTER_BITMAP_FLAG; - /** * View that displays an adaptive icon with an app-badge and a dot. * diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java index 09d9e03cb0cb..93ed3959776b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/Bubble.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.os.AsyncTask.Status.FINISHED; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 598a604099ac..05acb552a8d9 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.service.notification.NotificationListenerService.REASON_CANCEL; @@ -22,8 +22,8 @@ import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.annotation.NonNull; import android.annotation.UserIdInt; @@ -59,8 +59,6 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.UiEventLogger; import com.android.internal.statusbar.IStatusBarService; -import com.android.systemui.bubbles.dagger.BubbleModule; -import com.android.systemui.dagger.qualifiers.Main; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.WindowManagerShellWrapper; import com.android.wm.shell.common.FloatingContentCoordinator; @@ -165,7 +163,7 @@ public class BubbleController implements Bubbles { private boolean mIsStatusBarShade = true; /** - * Injected constructor. See {@link BubbleModule}. + * Injected constructor. */ public static BubbleController create(Context context, @Nullable BubbleStackView.SurfaceSynchronizer synchronizer, @@ -175,7 +173,7 @@ public class BubbleController implements Bubbles { WindowManagerShellWrapper windowManagerShellWrapper, LauncherApps launcherApps, UiEventLogger uiEventLogger, - @Main Handler mainHandler, + Handler mainHandler, ShellTaskOrganizer organizer) { BubbleLogger logger = new BubbleLogger(uiEventLogger); return new BubbleController(context, @@ -903,7 +901,7 @@ public class BubbleController implements Bubbles { } if (!mBubbleData.hasBubbleInStackWithKey(bubble.getKey())) { if (!mBubbleData.hasOverflowBubbleWithKey(bubble.getKey()) - && (!bubble.showInShade() + && (!bubble.showInShade() || reason == DISMISS_NOTIF_CANCEL || reason == DISMISS_GROUP_CANCELLED)) { // The bubble is now gone & the notification is hidden from the shade, so diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java index 8cacc8f2ef01..b6a97e251009 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE; -import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_DATA; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_DATA; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.annotation.NonNull; import android.app.PendingIntent; @@ -33,8 +33,8 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.FrameworkStatsLog; -import com.android.systemui.R; -import com.android.systemui.bubbles.Bubbles.DismissReason; +import com.android.wm.shell.R; +import com.android.wm.shell.bubbles.Bubbles.DismissReason; import java.io.FileDescriptor; import java.io.PrintWriter; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDataRepository.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDataRepository.kt index 2ab9e8734bef..fc565f17546d 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDataRepository.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDataRepository.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles +package com.android.wm.shell.bubbles import android.annotation.SuppressLint import android.annotation.UserIdInt @@ -24,9 +24,9 @@ import android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC import android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER import android.os.UserHandle import android.util.Log -import com.android.systemui.bubbles.storage.BubbleEntity -import com.android.systemui.bubbles.storage.BubblePersistentRepository -import com.android.systemui.bubbles.storage.BubbleVolatileRepository +import com.android.wm.shell.bubbles.storage.BubbleEntity +import com.android.wm.shell.bubbles.storage.BubblePersistentRepository +import com.android.wm.shell.bubbles.storage.BubbleVolatileRepository import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDebugConfig.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java index 3937422750cc..53f4e87b0495 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDebugConfig.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleDebugConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import android.content.Context; import android.provider.Settings; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleEntry.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleEntry.java index a0d3391f8347..ff68861eb40c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleEntry.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleEntry.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static android.app.Notification.FLAG_BUBBLE; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index ae3c683cb165..74521c761d10 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,17 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; -import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_EXPANDED_VIEW; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; -import static com.android.systemui.bubbles.BubbleOverflowActivity.EXTRA_BUBBLE_CONTROLLER; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_EXPANDED_VIEW; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.wm.shell.bubbles.BubbleOverflowActivity.EXTRA_BUBBLE_CONTROLLER; import android.annotation.NonNull; import android.annotation.SuppressLint; @@ -54,10 +54,11 @@ import android.widget.LinearLayout; import androidx.annotation.Nullable; import com.android.internal.policy.ScreenDecorationsUtils; -import com.android.systemui.R; -import com.android.systemui.recents.TriangleShape; -import com.android.systemui.statusbar.AlphaOptimizedButton; +import com.android.wm.shell.R; +import com.android.wm.shell.TaskView; +import com.android.wm.shell.common.AlphaOptimizedButton; import com.android.wm.shell.common.HandlerExecutor; +import com.android.wm.shell.common.TriangleShape; import java.io.FileDescriptor; import java.io.PrintWriter; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleFlyoutView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java index d8b32500db85..460e0e798bdb 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleFlyoutView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,13 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static android.graphics.Paint.ANTI_ALIAS_FLAG; import static android.graphics.Paint.FILTER_BITMAP_FLAG; -import static com.android.systemui.Interpolators.ALPHA_IN; -import static com.android.systemui.Interpolators.ALPHA_OUT; + +import static com.android.wm.shell.animation.Interpolators.ALPHA_IN; +import static com.android.wm.shell.animation.Interpolators.ALPHA_OUT; import android.animation.ArgbEvaluator; import android.content.Context; @@ -47,8 +48,8 @@ import android.widget.TextView; import androidx.annotation.Nullable; -import com.android.systemui.R; -import com.android.systemui.recents.TriangleShape; +import com.android.wm.shell.R; +import com.android.wm.shell.common.TriangleShape; /** * Flyout view that appears as a 'chat bubble' alongside the bubble stack. The flyout can visually diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleIconFactory.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleIconFactory.java index 371e8490d235..2d9da215efb7 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleIconFactory.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleIconFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import android.annotation.NonNull; import android.annotation.Nullable; @@ -26,14 +26,13 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.drawable.AdaptiveIconDrawable; -import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import com.android.launcher3.icons.BaseIconFactory; import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.ShadowGenerator; -import com.android.systemui.R; +import com.android.wm.shell.R; /** * Factory for creating normalized bubble icons. diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleLogger.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleLogger.java index a24f5c2b54c5..3361c4ce11da 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleLogger.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleLogger.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.UiEvent; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflow.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt index 297144a86143..686d2d4e1d9f 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflow.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles +package com.android.wm.shell.bubbles import android.app.ActivityTaskManager.INVALID_TASK_ID import android.content.Context @@ -31,7 +31,7 @@ import android.util.TypedValue import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout -import com.android.systemui.R +import com.android.wm.shell.R class BubbleOverflow( private val context: Context, @@ -72,7 +72,7 @@ class BubbleOverflow( updateResources() expandedView.applyThemeAttrs() // Apply inset and new style to fresh icon drawable. - overflowBtn.setImageResource(R.drawable.ic_bubble_overflow_button) + overflowBtn.setImageResource(R.drawable.bubble_ic_overflow_button) updateBtnTheme() } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowActivity.java index bc841730833c..2759b590bfad 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowActivity.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; -import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_OVERFLOW; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_OVERFLOW; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.app.Activity; import android.content.Context; @@ -43,13 +43,12 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.android.internal.util.ContrastColorUtil; -import com.android.systemui.R; +import com.android.wm.shell.R; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; - /** * Activity for showing aged out bubbles. * Must be public to be accessible to androidx...AppComponentFactory @@ -168,8 +167,8 @@ public class BubbleOverflowActivity extends Activity { final boolean isNightMode = (mode == Configuration.UI_MODE_NIGHT_YES); mEmptyStateImage.setImageDrawable(isNightMode - ? res.getDrawable(R.drawable.ic_empty_bubble_overflow_dark) - : res.getDrawable(R.drawable.ic_empty_bubble_overflow_light)); + ? res.getDrawable(R.drawable.bubble_ic_empty_overflow_dark) + : res.getDrawable(R.drawable.bubble_ic_empty_overflow_light)); findViewById(android.R.id.content) .setBackgroundColor(isNightMode diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubblePositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java index 029caee6364f..eccd00980209 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubblePositioner.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import android.content.Context; import android.content.res.Configuration; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 69ed5b72c1b2..155f3427f3d4 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; -import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_STACK_VIEW; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_STACK_VIEW; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -71,13 +71,13 @@ import androidx.dynamicanimation.animation.SpringForce; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.FrameworkStatsLog; -import com.android.systemui.Interpolators; -import com.android.systemui.R; -import com.android.systemui.bubbles.animation.AnimatableScaleMatrix; -import com.android.systemui.bubbles.animation.ExpandedAnimationController; -import com.android.systemui.bubbles.animation.PhysicsAnimationLayout; -import com.android.systemui.bubbles.animation.StackAnimationController; +import com.android.wm.shell.R; +import com.android.wm.shell.animation.Interpolators; import com.android.wm.shell.animation.PhysicsAnimator; +import com.android.wm.shell.bubbles.animation.AnimatableScaleMatrix; +import com.android.wm.shell.bubbles.animation.ExpandedAnimationController; +import com.android.wm.shell.bubbles.animation.PhysicsAnimationLayout; +import com.android.wm.shell.bubbles.animation.StackAnimationController; import com.android.wm.shell.common.FloatingContentCoordinator; import com.android.wm.shell.common.magnetictarget.MagnetizedObject; @@ -2661,14 +2661,17 @@ public class BubbleStackView extends FrameLayout .floatValue(); } + /** Set the start position of the bubble stack. */ public void setStackStartPosition(RelativeStackPosition position) { mStackAnimationController.setStackStartPosition(position); } + /** @return the position of the bubble stack. */ public PointF getStackPosition() { return mStackAnimationController.getStackPosition(); } + /** @return the relative position of the bubble stack. */ public RelativeStackPosition getRelativeStackPosition() { return mStackAnimationController.getRelativeStackPosition(); } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleViewInfoTask.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java index a3e6a1ecc387..0b683067c45b 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleViewInfoTask.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewInfoTask.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; -import static com.android.systemui.bubbles.BadgedImageView.DEFAULT_PATH_SIZE; -import static com.android.systemui.bubbles.BadgedImageView.WHITE_SCRIM_ALPHA; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.wm.shell.bubbles.BadgedImageView.DEFAULT_PATH_SIZE; +import static com.android.wm.shell.bubbles.BadgedImageView.WHITE_SCRIM_ALPHA; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.annotation.NonNull; import android.content.Context; @@ -42,7 +42,7 @@ import androidx.annotation.Nullable; import com.android.internal.graphics.ColorUtils; import com.android.launcher3.icons.BitmapInfo; -import com.android.systemui.R; +import com.android.wm.shell.R; import java.lang.ref.WeakReference; import java.util.Objects; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleViewProvider.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewProvider.java index 589017242311..ec900be13658 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleViewProvider.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleViewProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import android.graphics.Bitmap; import android.graphics.Path; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/Bubbles.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java index 415edb1b647c..79c42d83d7ea 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/Bubbles.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.LOCAL_VARIABLE; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/DismissView.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/DismissView.kt index b3c552d24dcd..04b5ad6dddf9 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/DismissView.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/DismissView.kt @@ -1,4 +1,20 @@ -package com.android.systemui.bubbles +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.wm.shell.bubbles import android.content.Context import android.graphics.drawable.TransitionDrawable @@ -9,9 +25,9 @@ import android.widget.FrameLayout import androidx.dynamicanimation.animation.DynamicAnimation import androidx.dynamicanimation.animation.SpringForce.DAMPING_RATIO_LOW_BOUNCY import androidx.dynamicanimation.animation.SpringForce.STIFFNESS_LOW -import com.android.systemui.R -import com.android.wm.shell.common.DismissCircleView +import com.android.wm.shell.R import com.android.wm.shell.animation.PhysicsAnimator +import com.android.wm.shell.common.DismissCircleView /* * View that handles interactions between DismissCircleView and BubbleStackView. diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/ManageEducationView.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/ManageEducationView.kt index 3db07c227d02..4cc67025fff4 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/ManageEducationView.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/ManageEducationView.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles +package com.android.wm.shell.bubbles import android.content.Context import android.graphics.Color @@ -24,8 +24,8 @@ import android.widget.Button import android.widget.LinearLayout import android.widget.TextView import com.android.internal.util.ContrastColorUtil -import com.android.systemui.Interpolators -import com.android.systemui.R +import com.android.wm.shell.R +import com.android.wm.shell.animation.Interpolators /** * User education view to highlight the manage button that allows a user to configure the settings diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/ObjectWrapper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/ObjectWrapper.java index f054122eaa47..528907f5e483 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/ObjectWrapper.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/ObjectWrapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import android.os.Binder; import android.os.IBinder; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/RelativeTouchListener.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/RelativeTouchListener.kt index b1291a507b57..b34732901648 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/RelativeTouchListener.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/RelativeTouchListener.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles +package com.android.wm.shell.bubbles import android.graphics.PointF import android.os.Handler diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/StackEducationView.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/StackEducationView.kt index 216df2e1f402..04c4dfb9b08d 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/StackEducationView.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/StackEducationView.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles +package com.android.wm.shell.bubbles import android.content.Context import android.graphics.Color @@ -23,8 +23,8 @@ import android.view.View import android.widget.LinearLayout import android.widget.TextView import com.android.internal.util.ContrastColorUtil -import com.android.systemui.Interpolators -import com.android.systemui.R +import com.android.wm.shell.R +import com.android.wm.shell.animation.Interpolators /** * User education view to highlight the collapsed stack of bubbles. diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/AnimatableScaleMatrix.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/AnimatableScaleMatrix.java index 07acb710c6d7..2612b81aae00 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/AnimatableScaleMatrix.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/AnimatableScaleMatrix.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import android.graphics.Matrix; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationController.java index 5a70401abb4a..61fbf813ebfd 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import android.content.res.Configuration; import android.content.res.Resources; @@ -28,10 +28,10 @@ import androidx.annotation.Nullable; import androidx.dynamicanimation.animation.DynamicAnimation; import androidx.dynamicanimation.animation.SpringForce; -import com.android.systemui.Interpolators; -import com.android.systemui.R; -import com.android.systemui.bubbles.BubblePositioner; +import com.android.wm.shell.R; +import com.android.wm.shell.animation.Interpolators; import com.android.wm.shell.animation.PhysicsAnimator; +import com.android.wm.shell.bubbles.BubblePositioner; import com.android.wm.shell.common.magnetictarget.MagnetizedObject; import com.google.android.collect.Sets; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/OneTimeEndListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/OneTimeEndListener.java index 4e0abc8009b4..37355c41810c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/OneTimeEndListener.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/OneTimeEndListener.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import androidx.dynamicanimation.animation.DynamicAnimation; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/PhysicsAnimationLayout.java index 0a596d5c69b6..0618d5d5f213 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/PhysicsAnimationLayout.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -35,7 +35,7 @@ import androidx.dynamicanimation.animation.DynamicAnimation; import androidx.dynamicanimation.animation.SpringAnimation; import androidx.dynamicanimation.animation.SpringForce; -import com.android.systemui.R; +import com.android.wm.shell.R; import java.util.ArrayList; import java.util.HashMap; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java index 43893f215d8a..d7f2e4b20e64 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import android.content.ContentResolver; import android.content.res.Resources; @@ -34,11 +34,11 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat; import androidx.dynamicanimation.animation.SpringAnimation; import androidx.dynamicanimation.animation.SpringForce; -import com.android.systemui.R; -import com.android.systemui.bubbles.BadgedImageView; -import com.android.systemui.bubbles.BubblePositioner; -import com.android.systemui.bubbles.BubbleStackView; +import com.android.wm.shell.R; import com.android.wm.shell.animation.PhysicsAnimator; +import com.android.wm.shell.bubbles.BadgedImageView; +import com.android.wm.shell.bubbles.BubblePositioner; +import com.android.wm.shell.bubbles.BubbleStackView; import com.android.wm.shell.common.FloatingContentCoordinator; import com.android.wm.shell.common.magnetictarget.MagnetizedObject; diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubbleEntity.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubbleEntity.kt index 24768cd84a76..aeba302bf487 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubbleEntity.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubbleEntity.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage import android.annotation.DimenRes import android.annotation.UserIdInt diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubblePersistentRepository.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubblePersistentRepository.kt index ce0786d86460..66a75af7d64c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubblePersistentRepository.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubblePersistentRepository.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage import android.content.Context import android.util.AtomicFile diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubbleVolatileRepository.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubbleVolatileRepository.kt index e0a7c7879f43..7f0b165bdc25 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubbleVolatileRepository.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubbleVolatileRepository.kt @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage import android.content.pm.LauncherApps import android.os.UserHandle import com.android.internal.annotations.VisibleForTesting -import com.android.systemui.bubbles.ShortcutKey +import com.android.wm.shell.bubbles.ShortcutKey private const val CAPACITY = 16 diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubbleXmlHelper.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubbleXmlHelper.kt index bf163a230aff..fe72bd301e04 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/storage/BubbleXmlHelper.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/storage/BubbleXmlHelper.kt @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage -import com.android.internal.util.FastXmlSerializer -import org.xmlpull.v1.XmlSerializer -import java.io.IOException import android.util.Xml +import com.android.internal.util.FastXmlSerializer import com.android.internal.util.XmlUtils import org.xmlpull.v1.XmlPullParser +import org.xmlpull.v1.XmlSerializer +import java.io.IOException import java.io.InputStream import java.io.OutputStream import java.nio.charset.StandardCharsets diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/AlphaOptimizedButton.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/AlphaOptimizedButton.java new file mode 100644 index 000000000000..6f0a61b3187f --- /dev/null +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/AlphaOptimizedButton.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.wm.shell.common; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.Button; + +/** + * A Button which doesn't have overlapping drawing commands + * + * This is the copy from SystemUI/statusbar. + */ +public class AlphaOptimizedButton extends Button { + public AlphaOptimizedButton(Context context) { + super(context); + } + + public AlphaOptimizedButton(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public AlphaOptimizedButton(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public AlphaOptimizedButton(Context context, AttributeSet attrs, int defStyleAttr, + int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + @Override + public boolean hasOverlappingRendering() { + return false; + } +} diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/TriangleShape.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/TriangleShape.java new file mode 100644 index 000000000000..707919033065 --- /dev/null +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/TriangleShape.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.wm.shell.common; + +import android.graphics.Outline; +import android.graphics.Path; +import android.graphics.drawable.shapes.PathShape; + +import androidx.annotation.NonNull; + +/** + * Wrapper around {@link PathShape} + * that creates a shape with a triangular path (pointing up or down). + * + * This is the copy from SystemUI/recents. + */ +public class TriangleShape extends PathShape { + private Path mTriangularPath; + + public TriangleShape(Path path, float stdWidth, float stdHeight) { + super(path, stdWidth, stdHeight); + mTriangularPath = path; + } + + public static TriangleShape create(float width, float height, boolean isPointingUp) { + Path triangularPath = new Path(); + if (isPointingUp) { + triangularPath.moveTo(0, height); + triangularPath.lineTo(width, height); + triangularPath.lineTo(width / 2, 0); + triangularPath.close(); + } else { + triangularPath.moveTo(0, 0); + triangularPath.lineTo(width / 2, height); + triangularPath.lineTo(width, 0); + triangularPath.close(); + } + return new TriangleShape(triangularPath, width, height); + } + + /** Create an arrow TriangleShape that points to the left or the right */ + public static TriangleShape createHorizontal( + float width, float height, boolean isPointingLeft) { + Path triangularPath = new Path(); + if (isPointingLeft) { + triangularPath.moveTo(0, height / 2); + triangularPath.lineTo(width, height); + triangularPath.lineTo(width, 0); + triangularPath.close(); + } else { + triangularPath.moveTo(0, height); + triangularPath.lineTo(width, height / 2); + triangularPath.lineTo(0, 0); + triangularPath.close(); + } + return new TriangleShape(triangularPath, width, height); + } + + @Override + public void getOutline(@NonNull Outline outline) { + outline.setPath(mTriangularPath); + } +} diff --git a/libs/WindowManager/Shell/tests/unittest/AndroidManifest.xml b/libs/WindowManager/Shell/tests/unittest/AndroidManifest.xml index a8f795ec8a8d..59d9104fb5ba 100644 --- a/libs/WindowManager/Shell/tests/unittest/AndroidManifest.xml +++ b/libs/WindowManager/Shell/tests/unittest/AndroidManifest.xml @@ -22,6 +22,13 @@ <application android:debuggable="true" android:largeHeap="true"> <uses-library android:name="android.test.mock" /> <uses-library android:name="android.test.runner" /> + + <activity android:name=".bubbles.BubblesTestActivity" + android:allowEmbedded="true" + android:documentLaunchMode="always" + android:excludeFromRecents="true" + android:exported="false" + android:resizeableActivity="true" /> </application> <instrumentation diff --git a/libs/WindowManager/Shell/tests/unittest/res/layout/main.xml b/libs/WindowManager/Shell/tests/unittest/res/layout/main.xml new file mode 100644 index 000000000000..0d09f868126e --- /dev/null +++ b/libs/WindowManager/Shell/tests/unittest/res/layout/main.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2020 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + > + <TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="this is a test activity" + /> + <EditText + android:layout_height="wrap_content" + android:id="@+id/editText1" + android:layout_width="match_parent"> + <requestFocus></requestFocus> + </EditText> +</LinearLayout> diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTestCase.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTestCase.java index fdebe4e4e6f5..5bdf831a81f4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTestCase.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTestCase.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.wm.shell.pip; +package com.android.wm.shell; import static android.view.Display.DEFAULT_DISPLAY; @@ -24,17 +24,18 @@ import android.testing.TestableContext; import androidx.test.InstrumentationRegistry; +import org.junit.After; import org.junit.Before; /** - * Base class that does One Handed specific setup. + * Base class that does shell test case setup. */ -public abstract class PipTestCase { +public abstract class ShellTestCase { protected TestableContext mContext; @Before - public void setup() { + public void shellSetup() { final Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); final DisplayManager dm = context.getSystemService(DisplayManager.class); @@ -47,6 +48,14 @@ public abstract class PipTestCase { .adoptShellPermissionIdentity(); } + @After + public void shellTearDown() { + InstrumentationRegistry + .getInstrumentation() + .getUiAutomation() + .dropShellPermissionIdentity(); + } + protected Context getContext() { return mContext; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/TaskViewTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java index 5c148598f10a..34f772faf9a9 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/TaskViewTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; @@ -30,7 +30,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import android.app.ActivityManager; import android.app.ActivityOptions; @@ -45,8 +44,6 @@ import android.window.WindowContainerToken; import androidx.test.filters.SmallTest; -import com.android.systemui.SysuiTestCase; -import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.common.HandlerExecutor; import org.junit.After; @@ -60,8 +57,7 @@ import org.mockito.invocation.InvocationOnMock; @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper(setAsMainLooper = true) -// TODO: Place in com.android.wm.shell vs. com.android.wm.shell.bubbles on shell migration. -public class TaskViewTest extends SysuiTestCase { +public class TaskViewTest extends ShellTestCase { @Mock TaskView.Listener mViewListener; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java index 31c08ae471ae..7adc4112fa90 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; @@ -38,8 +38,8 @@ import android.util.Pair; import androidx.test.filters.SmallTest; -import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.BubbleData.TimeSource; +import com.android.wm.shell.ShellTestCase; +import com.android.wm.shell.bubbles.BubbleData.TimeSource; import com.google.common.collect.ImmutableList; @@ -63,7 +63,7 @@ import org.mockito.MockitoAnnotations; @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper(setAsMainLooper = true) -public class BubbleDataTest extends SysuiTestCase { +public class BubbleDataTest extends ShellTestCase { private BubbleEntry mEntryA1; private BubbleEntry mEntryA2; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleFlyoutViewTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleFlyoutViewTest.java index fd6e2ee66107..5b77e4a0b72f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleFlyoutViewTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleFlyoutViewTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotSame; @@ -30,8 +30,8 @@ import android.widget.TextView; import androidx.test.filters.SmallTest; -import com.android.systemui.R; -import com.android.systemui.SysuiTestCase; +import com.android.wm.shell.R; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.junit.Test; @@ -42,7 +42,7 @@ import org.mockito.MockitoAnnotations; @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper(setAsMainLooper = true) -public class BubbleFlyoutViewTest extends SysuiTestCase { +public class BubbleFlyoutViewTest extends ShellTestCase { private BubbleFlyoutView mFlyout; private TextView mFlyoutText; private TextView mSenderName; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleTest.java index 690a1ad42861..069305212958 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.wm.shell.bubbles; import static com.google.common.truth.Truth.assertThat; @@ -37,8 +37,8 @@ import android.testing.TestableLooper; import androidx.test.filters.SmallTest; -import com.android.systemui.R; -import com.android.systemui.SysuiTestCase; +import com.android.wm.shell.R; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.junit.Test; @@ -49,7 +49,7 @@ import org.mockito.MockitoAnnotations; @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper -public class BubbleTest extends SysuiTestCase { +public class BubbleTest extends ShellTestCase { @Mock private Notification mNotif; @Mock @@ -72,7 +72,7 @@ public class BubbleTest extends SysuiTestCase { Intent target = new Intent(mContext, BubblesTestActivity.class); Notification.BubbleMetadata metadata = new Notification.BubbleMetadata.Builder( PendingIntent.getActivity(mContext, 0, target, 0), - Icon.createWithResource(mContext, R.drawable.android)) + Icon.createWithResource(mContext, R.drawable.bubble_ic_create_bubble)) .build(); when(mSbn.getNotification()).thenReturn(mNotif); when(mNotif.getBubbleMetadata()).thenReturn(metadata); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java new file mode 100644 index 000000000000..d5fbe556045a --- /dev/null +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.wm.shell.bubbles; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.android.wm.shell.R; + +/** + * Referenced by NotificationTestHelper#makeBubbleMetadata + */ +public class BubblesTestActivity extends Activity { + + public static final String BUBBLE_ACTIVITY_OPENED = "BUBBLE_ACTIVITY_OPENED"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + Intent i = new Intent(BUBBLE_ACTIVITY_OPENED); + sendBroadcast(i); + } +} diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/ExpandedAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationControllerTest.java index a5bb8ea23559..9c4f341bdfd5 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/ExpandedAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; @@ -34,8 +34,8 @@ import android.widget.FrameLayout; import androidx.dynamicanimation.animation.DynamicAnimation; import androidx.test.filters.SmallTest; -import com.android.systemui.R; -import com.android.systemui.bubbles.BubblePositioner; +import com.android.wm.shell.R; +import com.android.wm.shell.bubbles.BubblePositioner; import org.junit.Before; import org.junit.Ignore; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayoutTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/PhysicsAnimationLayoutTest.java index 498330c83dcb..c4edbb286e16 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayoutTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/PhysicsAnimationLayoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayoutTestCase.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/PhysicsAnimationLayoutTestCase.java index a5f2e8b3db37..a7a7db869776 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayoutTestCase.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/PhysicsAnimationLayoutTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import static org.mockito.Mockito.when; @@ -30,8 +30,8 @@ import android.widget.FrameLayout; import androidx.dynamicanimation.animation.DynamicAnimation; import androidx.dynamicanimation.animation.SpringForce; -import com.android.systemui.R; -import com.android.systemui.SysuiTestCase; +import com.android.wm.shell.R; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.mockito.Mock; @@ -50,7 +50,7 @@ import java.util.concurrent.TimeUnit; * * See physics-animation-testing.md. */ -public class PhysicsAnimationLayoutTestCase extends SysuiTestCase { +public class PhysicsAnimationLayoutTestCase extends ShellTestCase { TestablePhysicsAnimationLayout mLayout; List<View> mViews = new ArrayList<>(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/StackAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/StackAnimationControllerTest.java index 7d0abec79de1..6b01462afd8d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/StackAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/animation/StackAnimationControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles.animation; +package com.android.wm.shell.bubbles.animation; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; @@ -33,8 +33,8 @@ import androidx.dynamicanimation.animation.DynamicAnimation; import androidx.dynamicanimation.animation.SpringForce; import androidx.test.filters.SmallTest; -import com.android.systemui.R; -import com.android.systemui.bubbles.BubblePositioner; +import com.android.wm.shell.R; +import com.android.wm.shell.bubbles.BubblePositioner; import com.android.wm.shell.common.FloatingContentCoordinator; import org.junit.Before; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/storage/BubblePersistentRepositoryTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/storage/BubblePersistentRepositoryTest.kt index 9b8fd11febe3..416028088294 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/storage/BubblePersistentRepositoryTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/storage/BubblePersistentRepositoryTest.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest -import com.android.systemui.SysuiTestCase +import com.android.wm.shell.ShellTestCase import junit.framework.Assert.assertEquals import junit.framework.Assert.assertNotNull import junit.framework.Assert.assertTrue @@ -28,7 +28,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidTestingRunner::class) -class BubblePersistentRepositoryTest : SysuiTestCase() { +class BubblePersistentRepositoryTest : ShellTestCase() { private val bubbles = listOf( BubbleEntity(0, "com.example.messenger", "shortcut-1", "key-1", 120, 0), diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/storage/BubbleVolatileRepositoryTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/storage/BubbleVolatileRepositoryTest.kt index 7ea611c9c6a9..4fab9a5496ec 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/storage/BubbleVolatileRepositoryTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/storage/BubbleVolatileRepositoryTest.kt @@ -14,14 +14,14 @@ * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage import android.content.pm.LauncherApps import android.os.UserHandle import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest -import com.android.systemui.SysuiTestCase import com.android.systemui.util.mockito.eq +import com.android.wm.shell.ShellTestCase import junit.framework.Assert.assertEquals import org.junit.Before import org.junit.Test @@ -32,7 +32,7 @@ import org.mockito.Mockito.verifyNoMoreInteractions @SmallTest @RunWith(AndroidTestingRunner::class) -class BubbleVolatileRepositoryTest : SysuiTestCase() { +class BubbleVolatileRepositoryTest : ShellTestCase() { private val user0 = UserHandle.of(0) private val user10 = UserHandle.of(10) diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/storage/BubbleXmlHelperTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/storage/BubbleXmlHelperTest.kt index 8cf4534ecdce..e0891a95c6a6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/storage/BubbleXmlHelperTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/storage/BubbleXmlHelperTest.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.android.systemui.bubbles.storage +package com.android.wm.shell.bubbles.storage import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest -import com.android.systemui.SysuiTestCase +import com.android.wm.shell.ShellTestCase import junit.framework.Assert.assertEquals import junit.framework.Assert.assertTrue import org.junit.Test @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream @SmallTest @RunWith(AndroidTestingRunner::class) -class BubbleXmlHelperTest : SysuiTestCase() { +class BubbleXmlHelperTest : ShellTestCase() { private val bubbles = listOf( BubbleEntity(0, "com.example.messenger", "shortcut-1", "k1", 120, 0), diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java index 255e74917ca0..55e7a354f4cd 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipAnimationControllerTest.java @@ -32,9 +32,7 @@ import android.view.SurfaceControl; import androidx.test.filters.SmallTest; -import com.android.wm.shell.pip.PipAnimationController; -import com.android.wm.shell.pip.PipSurfaceTransactionHelper; -import com.android.wm.shell.pip.PipTestCase; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.junit.Test; @@ -49,7 +47,7 @@ import org.mockito.MockitoAnnotations; @RunWith(AndroidTestingRunner.class) @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) -public class PipAnimationControllerTest extends PipTestCase { +public class PipAnimationControllerTest extends ShellTestCase { private PipAnimationController mPipAnimationController; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsHandlerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsHandlerTest.java index 37421d910513..5169243f02d6 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsHandlerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsHandlerTest.java @@ -30,8 +30,7 @@ import android.view.Gravity; import androidx.test.filters.SmallTest; -import com.android.wm.shell.pip.PipBoundsHandler; -import com.android.wm.shell.pip.PipTestCase; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.junit.Test; @@ -46,7 +45,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidTestingRunner.class) @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) -public class PipBoundsHandlerTest extends PipTestCase { +public class PipBoundsHandlerTest extends ShellTestCase { private static final int ROUNDING_ERROR_MARGIN = 16; private static final float ASPECT_RATIO_ERROR_MARGIN = 0.01f; private static final float DEFAULT_ASPECT_RATIO = 1f; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java index dc9399edaa3b..844f82d00dad 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java @@ -28,6 +28,8 @@ import android.util.Size; import androidx.test.filters.SmallTest; +import com.android.wm.shell.ShellTestCase; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,7 +40,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @SmallTest -public class PipBoundsStateTest extends PipTestCase { +public class PipBoundsStateTest extends ShellTestCase { private static final Rect DEFAULT_BOUNDS = new Rect(0, 0, 10, 10); private static final float DEFAULT_SNAP_FRACTION = 1.0f; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java index 39381c6d677e..efe553a1a3a4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java @@ -40,6 +40,7 @@ import android.view.DisplayInfo; import android.window.WindowContainerToken; import com.android.wm.shell.ShellTaskOrganizer; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.pip.phone.PipMenuActivityController; import com.android.wm.shell.splitscreen.SplitScreen; @@ -58,7 +59,7 @@ import java.util.Optional; @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper -public class PipTaskOrganizerTest extends PipTestCase { +public class PipTaskOrganizerTest extends ShellTestCase { private PipTaskOrganizer mSpiedPipTaskOrganizer; @Mock private DisplayController mMockdDisplayController; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java index 5f0f1964814f..a00a3b6a654e 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java @@ -35,6 +35,7 @@ import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.WindowManagerShellWrapper; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.ShellExecutor; @@ -42,7 +43,6 @@ import com.android.wm.shell.pip.PipBoundsHandler; import com.android.wm.shell.pip.PipBoundsState; import com.android.wm.shell.pip.PipMediaController; import com.android.wm.shell.pip.PipTaskOrganizer; -import com.android.wm.shell.pip.PipTestCase; import org.junit.Before; import org.junit.Test; @@ -56,7 +56,7 @@ import org.mockito.MockitoAnnotations; @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper -public class PipControllerTest extends PipTestCase { +public class PipControllerTest extends ShellTestCase { private PipController mPipController; @Mock private DisplayController mMockDisplayController; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java index 3f60cc01f20b..f6dcec23626b 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java @@ -31,17 +31,13 @@ import android.util.Size; import androidx.test.filters.SmallTest; import com.android.wm.shell.R; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.FloatingContentCoordinator; import com.android.wm.shell.pip.PipBoundsHandler; import com.android.wm.shell.pip.PipBoundsState; import com.android.wm.shell.pip.PipSnapAlgorithm; import com.android.wm.shell.pip.PipTaskOrganizer; -import com.android.wm.shell.pip.PipTestCase; import com.android.wm.shell.pip.PipUiEventLogger; -import com.android.wm.shell.pip.phone.PipMenuActivityController; -import com.android.wm.shell.pip.phone.PipMotionHelper; -import com.android.wm.shell.pip.phone.PipResizeGestureHandler; -import com.android.wm.shell.pip.phone.PipTouchHandler; import org.junit.Before; import org.junit.Test; @@ -59,7 +55,7 @@ import org.mockito.MockitoAnnotations; @RunWith(AndroidTestingRunner.class) @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) -public class PipTouchHandlerTest extends PipTestCase { +public class PipTouchHandlerTest extends ShellTestCase { private PipTouchHandler mPipTouchHandler; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchStateTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchStateTest.java index 40667f76b17e..000f7e8b2e85 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchStateTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchStateTest.java @@ -35,8 +35,7 @@ import android.view.ViewConfiguration; import androidx.test.filters.SmallTest; -import com.android.wm.shell.pip.PipTestCase; -import com.android.wm.shell.pip.phone.PipTouchState; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.junit.Test; @@ -47,7 +46,7 @@ import java.util.concurrent.CountDownLatch; @RunWith(AndroidTestingRunner.class) @SmallTest @RunWithLooper -public class PipTouchStateTest extends PipTestCase { +public class PipTouchStateTest extends ShellTestCase { private PipTouchState mTouchState; private CountDownLatch mDoubleTapCallbackTriggeredLatch; diff --git a/packages/CarSystemUI/src/com/android/systemui/CarSystemUIBinder.java b/packages/CarSystemUI/src/com/android/systemui/CarSystemUIBinder.java index 3def945dd03c..ec1240fac5ae 100644 --- a/packages/CarSystemUI/src/com/android/systemui/CarSystemUIBinder.java +++ b/packages/CarSystemUI/src/com/android/systemui/CarSystemUIBinder.java @@ -17,7 +17,6 @@ package com.android.systemui; import com.android.systemui.biometrics.AuthController; -import com.android.systemui.bubbles.dagger.BubbleModule; import com.android.systemui.car.navigationbar.CarNavigationBar; import com.android.systemui.car.notification.CarNotificationModule; import com.android.systemui.car.sideloaded.SideLoadedAppController; @@ -48,8 +47,7 @@ import dagger.multibindings.IntoMap; /** Binder for car specific {@link SystemUI} modules. */ @Module(includes = {RecentsModule.class, StatusBarModule.class, NotificationsModule.class, - BubbleModule.class, KeyguardModule.class, OverlayWindowModule.class, - CarNotificationModule.class}) + KeyguardModule.class, OverlayWindowModule.class, CarNotificationModule.class}) public abstract class CarSystemUIBinder { /** Inject into AuthController. */ @Binds diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index f9268eece293..39a6ed12c02d 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -352,7 +352,7 @@ android:exported="true" /> <activity - android:name=".bubbles.BubbleOverflowActivity" + android:name="com.android.wm.shell.bubbles.BubbleOverflowActivity" android:theme="@style/BubbleOverflow" android:excludeFromRecents="true" android:documentLaunchMode="always" diff --git a/packages/SystemUI/res/drawable/bubble_dismiss_circle.xml b/packages/SystemUI/res/drawable/bubble_dismiss_circle.xml deleted file mode 100644 index 8c7e82f82186..000000000000 --- a/packages/SystemUI/res/drawable/bubble_dismiss_circle.xml +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - Copyright (C) 2019 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<!-- - The transparent circle outline that encircles the bubbles when they're in the dismiss target. ---> -<shape - xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="oval"> - - <stroke - android:width="1dp" - android:color="#66FFFFFF" /> - - <solid android:color="#B3000000" /> -</shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/ic_create_bubble.xml b/packages/SystemUI/res/drawable/ic_create_bubble.xml deleted file mode 100644 index 4abbc8179b4d..000000000000 --- a/packages/SystemUI/res/drawable/ic_create_bubble.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2019 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="20dp" - android:height="20dp" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="#FF000000" - android:pathData="M23,5v8h-2V5H3v14h10v2v0H3c-1.1,0 -2,-0.9 -2,-2V5c0,-1.1 0.9,-2 2,-2h18C22.1,3 23,3.9 23,5zM10,8v2.59L5.71,6.29L4.29,7.71L8.59,12H6v2h6V8H10zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/> -</vector> diff --git a/packages/SystemUI/res/drawable/ic_stop_bubble.xml b/packages/SystemUI/res/drawable/ic_stop_bubble.xml deleted file mode 100644 index 6cf67a77ff55..000000000000 --- a/packages/SystemUI/res/drawable/ic_stop_bubble.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2020 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="20dp" - android:height="20dp" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="#FF000000" - android:pathData="M11.29,14.71L7,10.41V13H5V7h6v2H8.41l4.29,4.29L11.29,14.71zM21,3H3C1.9,3 1,3.9 1,5v14c0,1.1 0.9,2 2,2h10v0v-2H3V5h18v8h2V5C23,3.9 22.1,3 21,3zM19,15c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S20.66,15 19,15z"/> -</vector> diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml index b584dfee1e60..e45f4eb3f2ca 100644 --- a/packages/SystemUI/res/values-land/dimens.xml +++ b/packages/SystemUI/res/values-land/dimens.xml @@ -36,10 +36,6 @@ <dimen name="volume_tool_tip_right_margin">136dp</dimen> <dimen name="volume_tool_tip_top_margin">12dp</dimen> - <!-- Padding between status bar and bubbles when displayed in expanded state, smaller - value in landscape since we have limited vertical space--> - <dimen name="bubble_padding_top">4dp</dimen> - <dimen name="controls_activity_view_top_offset">25dp</dimen> <dimen name="biometric_dialog_button_negative_max_width">140dp</dimen> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 6df8b4e733bb..be36316d013c 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -204,10 +204,6 @@ <color name="global_screenshot_dismiss_foreground">@color/GM2_grey_500</color> <color name="global_screenshot_background_protection_start">#40000000</color> <!-- 25% black --> - <!-- Bubbles --> - <color name="bubbles_light">#FFFFFF</color> - <color name="bubbles_dark">@color/GM2_grey_800</color> - <!-- GM2 colors --> <color name="GM2_grey_50">#F8F9FA</color> <color name="GM2_grey_100">#F1F3F4</color> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 17dc4004ae9b..a2e9f39feefd 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1159,90 +1159,6 @@ <!-- Radius of Ongoing App Ops chip corners --> <dimen name="ongoing_appops_chip_bg_corner_radius">16dp</dimen> - - <!-- How much each bubble is elevated. --> - <dimen name="bubble_elevation">1dp</dimen> - <!-- How much the bubble flyout text container is elevated. --> - <dimen name="bubble_flyout_elevation">4dp</dimen> - <!-- How much padding is around the left and right sides of the flyout text. --> - <dimen name="bubble_flyout_padding_x">12dp</dimen> - <!-- How much padding is around the top and bottom of the flyout text. --> - <dimen name="bubble_flyout_padding_y">10dp</dimen> - <!-- Size of the triangle that points from the flyout to the bubble stack. --> - <dimen name="bubble_flyout_pointer_size">6dp</dimen> - <!-- How much space to leave between the flyout (tip of the arrow) and the bubble stack. --> - <dimen name="bubble_flyout_space_from_bubble">8dp</dimen> - <!-- How much space to leave between the flyout text and the avatar displayed in the flyout. --> - <dimen name="bubble_flyout_avatar_message_space">6dp</dimen> - <!-- Padding between status bar and bubbles when displayed in expanded state --> - <dimen name="bubble_padding_top">16dp</dimen> - <!-- Size of individual bubbles. --> - <dimen name="individual_bubble_size">60dp</dimen> - <!-- Size of bubble bitmap. --> - <dimen name="bubble_bitmap_size">52dp</dimen> - <!-- Size of bubble icon bitmap. --> - <dimen name="bubble_overflow_icon_bitmap_size">24dp</dimen> - <!-- Extra padding added to the touchable rect for bubbles so they are easier to grab. --> - <dimen name="bubble_touch_padding">12dp</dimen> - <!-- Size of the circle around the bubbles when they're in the dismiss target. --> - <dimen name="bubble_dismiss_encircle_size">52dp</dimen> - <!-- Padding around the view displayed when the bubble is expanded --> - <dimen name="bubble_expanded_view_padding">4dp</dimen> - <!-- This should be at least the size of bubble_expanded_view_padding; it is used to include - a slight touch slop around the expanded view. --> - <dimen name="bubble_expanded_view_slop">8dp</dimen> - <!-- Default (and minimum) height of the expanded view shown when the bubble is expanded --> - <dimen name="bubble_expanded_default_height">180dp</dimen> - <!-- Default height of bubble overflow --> - <dimen name="bubble_overflow_height">480dp</dimen> - <!-- Bubble overflow padding when there are no bubbles --> - <dimen name="bubble_overflow_empty_state_padding">16dp</dimen> - <!-- Padding of container for overflow bubbles --> - <dimen name="bubble_overflow_padding">15dp</dimen> - <!-- Padding of label for bubble overflow view --> - <dimen name="bubble_overflow_text_padding">7dp</dimen> - <!-- Height of bubble overflow empty state illustration --> - <dimen name="bubble_empty_overflow_image_height">200dp</dimen> - <!-- Padding of bubble overflow empty state subtitle --> - <dimen name="bubble_empty_overflow_subtitle_padding">50dp</dimen> - <!-- Height of the triangle that points to the expanded bubble --> - <dimen name="bubble_pointer_height">8dp</dimen> - <!-- Width of the triangle that points to the expanded bubble --> - <dimen name="bubble_pointer_width">12dp</dimen> - <!-- Extra padding around the dismiss target for bubbles --> - <dimen name="bubble_dismiss_slop">16dp</dimen> - <!-- Height of button allowing users to adjust settings for bubbles. --> - <dimen name="bubble_manage_button_height">48dp</dimen> - <!-- Max width of the message bubble--> - <dimen name="bubble_message_max_width">144dp</dimen> - <!-- Min width of the message bubble --> - <dimen name="bubble_message_min_width">32dp</dimen> - <!-- Interior padding of the message bubble --> - <dimen name="bubble_message_padding">4dp</dimen> - <!-- Offset between bubbles in their stacked position. --> - <dimen name="bubble_stack_offset">10dp</dimen> - <!-- Offset between stack y and animation y for bubble swap. --> - <dimen name="bubble_swap_animation_offset">15dp</dimen> - <!-- How far offscreen the bubble stack rests. Cuts off padding and part of icon bitmap. --> - <dimen name="bubble_stack_offscreen">9dp</dimen> - <!-- How far down the screen the stack starts. --> - <dimen name="bubble_stack_starting_offset_y">120dp</dimen> - <!-- Space between the pointer triangle and the bubble expanded view --> - <dimen name="bubble_pointer_margin">8dp</dimen> - <!-- Padding applied to the bubble dismiss target. Touches in this padding cause the bubbles to - snap to the dismiss target. --> - <dimen name="bubble_dismiss_target_padding_x">40dp</dimen> - <dimen name="bubble_dismiss_target_padding_y">20dp</dimen> - <dimen name="bubble_manage_menu_elevation">4dp</dimen> - - <!-- Bubbles user education views --> - <dimen name="bubbles_manage_education_width">160dp</dimen> - <!-- The inset from the top bound of the manage button to place the user education. --> - <dimen name="bubbles_manage_education_top_inset">65dp</dimen> - <!-- Size of padding for the user education cling, this should at minimum be larger than - individual_bubble_size + some padding. --> - <dimen name="bubble_stack_user_education_side_inset">72dp</dimen> - <!-- Size of the RAT type for CellularTile --> <dimen name="celltile_rat_type_size">10sp</dimen> diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml index 7d3135ac1937..5f68bdb4f0c6 100644 --- a/packages/SystemUI/res/values/ids.xml +++ b/packages/SystemUI/res/values/ids.xml @@ -130,12 +130,6 @@ <item type="id" name="action_snooze_assistant_suggestion_1"/> <item type="id" name="action_snooze"/> - <!-- Accessibility actions for bubbles. --> - <item type="id" name="action_move_top_left"/> - <item type="id" name="action_move_top_right"/> - <item type="id" name="action_move_bottom_left"/> - <item type="id" name="action_move_bottom_right"/> - <!-- For StatusIconContainer to tag its icon views --> <item type="id" name="status_bar_view_state_tag" /> @@ -146,17 +140,6 @@ <!-- Optional cancel button on Keyguard --> <item type="id" name="cancel_button"/> - <!-- For saving PhysicsAnimationLayout animations/animators as view tags. --> - <item type="id" name="translation_x_dynamicanimation_tag"/> - <item type="id" name="translation_y_dynamicanimation_tag"/> - <item type="id" name="translation_z_dynamicanimation_tag"/> - <item type="id" name="alpha_dynamicanimation_tag"/> - <item type="id" name="scale_x_dynamicanimation_tag"/> - <item type="id" name="scale_y_dynamicanimation_tag"/> - <item type="id" name="physics_animator_tag"/> - <item type="id" name="target_animator_tag" /> - <item type="id" name="reorder_animator_tag"/> - <!-- Global Actions Menu --> <item type="id" name="global_actions_view" /> diff --git a/packages/SystemUI/res/values/integers.xml b/packages/SystemUI/res/values/integers.xml index b1e91c8a86c6..b50b5c14b1fa 100644 --- a/packages/SystemUI/res/values/integers.xml +++ b/packages/SystemUI/res/values/integers.xml @@ -22,17 +22,6 @@ <integer name="qs_footer_actions_width">0</integer> <integer name="qs_footer_actions_weight">1</integer> - <!-- Maximum number of bubbles to render and animate at one time. While the animations used are - lightweight translation animations, this number can be reduced on lower end devices if any - performance issues arise. --> - <integer name="bubbles_max_rendered">5</integer> - - <!-- Number of columns in bubble overflow. --> - <integer name="bubbles_overflow_columns">4</integer> - - <!-- Maximum number of bubbles we allow in overflow before we dismiss the oldest one. --> - <integer name="bubbles_max_overflow">16</integer> - <integer name="magnification_default_scale">2</integer> <!-- The position of the volume dialog on the screen. diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index d5c98233b952..d0e8d701192d 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -646,9 +646,6 @@ <!-- Content description to tell the user a notification has been removed from the notification shade --> <string name="accessibility_notification_dismissed">Notification dismissed.</string> - <!-- Content description to tell the user a bubble has been dismissed. --> - <string name="accessibility_bubble_dismissed">Bubble dismissed.</string> - <!-- Content description for the notification shade panel (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_desc_notification_shade">Notification shade.</string> <!-- Content description for the quick settings panel (not shown on the screen). [CHAR LIMIT=NONE] --> @@ -1846,9 +1843,6 @@ <string name="notification_alert_title">Default</string> <!-- [CHAR LIMIT=100] Notification Importance title --> - <string name="notification_bubble_title">Bubble</string> - - <!-- [CHAR LIMIT=100] Notification Importance title --> <string name="notification_automatic_title">Automatic</string> <!-- [CHAR LIMIT=150] Notification Importance title: low importance level summary --> @@ -1881,12 +1875,6 @@ <!-- Text shown in notification guts for conversation notifications that don't implement the full feature --> <string name="no_shortcut"><xliff:g id="app_name" example="YouTube">%1$s</xliff:g> doesn\u2019t support conversation features</string> - <!-- [CHAR LIMIT=NONE] Empty overflow title --> - <string name="bubble_overflow_empty_title">No recent bubbles</string> - - <!-- [CHAR LIMIT=NONE] Empty overflow subtitle --> - <string name="bubble_overflow_empty_subtitle">Recent bubbles and dismissed bubbles will appear here</string> - <!-- Notification: Control panel: Label that displays when the app's notifications cannot be blocked. --> <string name="notification_unblockable_desc">These notifications can\'t be modified.</string> @@ -2607,45 +2595,8 @@ <!-- Description of the restart button in the hint of size compatibility mode. [CHAR LIMIT=NONE] --> <string name="restart_button_description">Tap to restart this app and go full screen.</string> - <!-- Text used for content description of settings button in the header of expanded bubble - view. [CHAR_LIMIT=NONE] --> - <string name="bubbles_settings_button_description">Settings for <xliff:g id="app_name" example="YouTube">%1$s</xliff:g> bubbles</string> - <!-- Content description for button that shows bubble overflow on click [CHAR LIMIT=NONE] --> - <string name="bubble_overflow_button_content_description">Overflow</string> - <!-- Action to add overflow bubble back to stack. [CHAR LIMIT=NONE] --> - <string name="bubble_accessibility_action_add_back">Add back to stack</string> - <!-- The text for the manage bubbles link. [CHAR LIMIT=NONE] --> - <string name="manage_bubbles_text">Manage</string> - <!-- Content description when a bubble is focused. [CHAR LIMIT=NONE] --> - <string name="bubble_content_description_single"><xliff:g id="notification_title" example="some title">%1$s</xliff:g> from <xliff:g id="app_name" example="YouTube">%2$s</xliff:g></string> - <!-- Content description when the stack of bubbles is focused. [CHAR LIMIT=NONE] --> - <string name="bubble_content_description_stack"><xliff:g id="notification_title" example="some title">%1$s</xliff:g> from <xliff:g id="app_name" example="YouTube">%2$s</xliff:g> and <xliff:g id="bubble_count" example="4">%3$d</xliff:g> more</string> <!-- Action in accessibility menu to move the stack of bubbles [CHAR LIMIT=20] --> <string name="bubble_accessibility_action_move">Move</string> - <!-- Action in accessibility menu to move the stack of bubbles to the top left of the screen. [CHAR LIMIT=30] --> - <string name="bubble_accessibility_action_move_top_left">Move top left</string> - <!-- Action in accessibility menu to move the stack of bubbles to the top right of the screen. [CHAR LIMIT=30] --> - <string name="bubble_accessibility_action_move_top_right">Move top right</string> - <!-- Action in accessibility menu to move the stack of bubbles to the bottom left of the screen. [CHAR LIMIT=30]--> - <string name="bubble_accessibility_action_move_bottom_left">Move bottom left</string> - <!-- Action in accessibility menu to move the stack of bubbles to the bottom right of the screen. [CHAR LIMIT=30]--> - <string name="bubble_accessibility_action_move_bottom_right">Move bottom right</string> - <!-- Text used for the bubble dismiss area. Bubbles dragged to, or flung towards, this area will go away. [CHAR LIMIT=30] --> - <string name="bubble_dismiss_text">Dismiss bubble</string> - <!-- Button text to stop a conversation from bubbling [CHAR LIMIT=60]--> - <string name="bubbles_dont_bubble_conversation">Don\u2019t bubble conversation</string> - <!-- Title text for the bubbles feature education cling shown when a bubble is on screen for the first time. [CHAR LIMIT=60]--> - <string name="bubbles_user_education_title">Chat using bubbles</string> - <!-- Descriptive text for the bubble feature education cling shown when a bubble is on screen for the first time. [CHAR LIMIT=NONE] --> - <string name="bubbles_user_education_description">New conversations appear as floating icons, or bubbles. Tap to open bubble. Drag to move it.</string> - <!-- Title text for the bubble "manage" button tool tip highlighting where users can go to control bubble settings. [CHAR LIMIT=60]--> - <string name="bubbles_user_education_manage_title">Control bubbles anytime</string> - <!-- Descriptive text for the bubble "manage" button tool tip highlighting where users can go to control bubble settings. [CHAR LIMIT=80]--> - <string name="bubbles_user_education_manage">Tap Manage to turn off bubbles from this app</string> - <!-- Button text for dismissing the bubble "manage" button tool tip [CHAR LIMIT=20]--> - <string name="bubbles_user_education_got_it">Got it</string> - <!-- Label for the button that takes the user to the notification settings for the given app. --> - <string name="bubbles_app_settings"><xliff:g id="notification_title" example="Android Messages">%1$s</xliff:g> settings</string> <!-- Notification content text when the system navigation mode changes as a result of changing the default launcher [CHAR LIMIT=NONE] --> <string name="notification_content_system_nav_changed">System navigation updated. To make changes, go to Settings.</string> diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java index b30103ef9b59..17bb40e69e27 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java @@ -108,12 +108,14 @@ public class SystemUIFactory { .setPip(mWMComponent.getPip()) .setSplitScreen(mWMComponent.getSplitScreen()) .setOneHanded(mWMComponent.getOneHanded()) + .setBubbles(mWMComponent.getBubbles()) .setShellDump(mWMComponent.getShellDump()); } else { // TODO: Call on prepareSysUIComponentBuilder but not with real components. builder = builder.setPip(Optional.ofNullable(null)) .setSplitScreen(Optional.ofNullable(null)) .setOneHanded(Optional.ofNullable(null)) + .setBubbles(Optional.ofNullable(null)) .setShellDump(Optional.ofNullable(null)); } mSysUIComponent = builder diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java deleted file mode 100644 index ffb650d62064..000000000000 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.bubbles; - -import static android.app.Notification.EXTRA_MESSAGES; -import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC; -import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_MANIFEST; -import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED; - -import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_EXPERIMENTS; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; - -import android.app.Notification; -import android.app.PendingIntent; -import android.app.Person; -import android.content.Context; -import android.content.pm.LauncherApps; -import android.content.pm.ShortcutInfo; -import android.graphics.Color; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; -import android.graphics.drawable.Icon; -import android.os.Bundle; -import android.os.Parcelable; -import android.os.UserHandle; -import android.provider.Settings; -import android.util.Log; - -import com.android.internal.graphics.ColorUtils; -import com.android.internal.util.ArrayUtils; -import com.android.internal.util.ContrastColorUtil; -import com.android.systemui.statusbar.notification.collection.NotificationEntry; -import com.android.systemui.statusbar.notification.people.PeopleHubNotificationListenerKt; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * Common class for experiments controlled via secure settings. - */ -public class BubbleExperimentConfig { - private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleController" : TAG_BUBBLES; - - private static final int BUBBLE_HEIGHT = 10000; - - private static final String ALLOW_ANY_NOTIF_TO_BUBBLE = "allow_any_notif_to_bubble"; - private static final boolean ALLOW_ANY_NOTIF_TO_BUBBLE_DEFAULT = false; - - private static final String ALLOW_MESSAGE_NOTIFS_TO_BUBBLE = "allow_message_notifs_to_bubble"; - private static final boolean ALLOW_MESSAGE_NOTIFS_TO_BUBBLE_DEFAULT = false; - - private static final String ALLOW_SHORTCUTS_TO_BUBBLE = "allow_shortcuts_to_bubble"; - private static final boolean ALLOW_SHORTCUT_TO_BUBBLE_DEFAULT = false; - - private static final String WHITELISTED_AUTO_BUBBLE_APPS = "whitelisted_auto_bubble_apps"; - - /** - * When true, if a notification has the information necessary to bubble (i.e. valid - * contentIntent and an icon or image), then a {@link android.app.Notification.BubbleMetadata} - * object will be created by the system and added to the notification. - * <p> - * This does not produce a bubble, only adds the metadata based on the notification info. - */ - static boolean allowAnyNotifToBubble(Context context) { - return Settings.Secure.getInt(context.getContentResolver(), - ALLOW_ANY_NOTIF_TO_BUBBLE, - ALLOW_ANY_NOTIF_TO_BUBBLE_DEFAULT ? 1 : 0) != 0; - } - - /** - * Same as {@link #allowAnyNotifToBubble(Context)} except it filters for notifications that - * are using {@link Notification.MessagingStyle} and have remote input. - */ - static boolean allowMessageNotifsToBubble(Context context) { - return Settings.Secure.getInt(context.getContentResolver(), - ALLOW_MESSAGE_NOTIFS_TO_BUBBLE, - ALLOW_MESSAGE_NOTIFS_TO_BUBBLE_DEFAULT ? 1 : 0) != 0; - } - - /** - * When true, if the notification is able to bubble via {@link #allowAnyNotifToBubble(Context)} - * or {@link #allowMessageNotifsToBubble(Context)} or via normal BubbleMetadata, then a new - * BubbleMetadata object is constructed based on the shortcut info. - * <p> - * This does not produce a bubble, only adds the metadata based on shortcut info. - */ - static boolean useShortcutInfoToBubble(Context context) { - return Settings.Secure.getInt(context.getContentResolver(), - ALLOW_SHORTCUTS_TO_BUBBLE, - ALLOW_SHORTCUT_TO_BUBBLE_DEFAULT ? 1 : 0) != 0; - } - - /** - * Returns whether the provided package is whitelisted to bubble. - */ - static boolean isPackageWhitelistedToAutoBubble(Context context, String packageName) { - String unsplitList = Settings.Secure.getString(context.getContentResolver(), - WHITELISTED_AUTO_BUBBLE_APPS); - if (unsplitList != null) { - // We expect the list to be separated by commas and no white space (but we trim in case) - String[] packageList = unsplitList.split(","); - for (int i = 0; i < packageList.length; i++) { - if (packageList[i].trim().equals(packageName)) { - return true; - } - } - } - return false; - } - - /** - * If {@link #allowAnyNotifToBubble(Context)} is true, this method creates and adds - * {@link android.app.Notification.BubbleMetadata} to the notification entry as long as - * the notification has necessary info for BubbleMetadata. - * - * @return whether an adjustment was made. - */ - static boolean adjustForExperiments(Context context, NotificationEntry entry, - boolean previouslyUserCreated, boolean userBlocked) { - Notification.BubbleMetadata metadata = null; - boolean addedMetadata = false; - boolean whiteListedToAutoBubble = - isPackageWhitelistedToAutoBubble(context, entry.getSbn().getPackageName()); - - Notification notification = entry.getSbn().getNotification(); - boolean isMessage = Notification.MessagingStyle.class.equals( - notification.getNotificationStyle()); - boolean bubbleNotifForExperiment = (isMessage && allowMessageNotifsToBubble(context)) - || allowAnyNotifToBubble(context); - - boolean useShortcutInfo = useShortcutInfoToBubble(context); - String shortcutId = entry.getSbn().getNotification().getShortcutId(); - - boolean hasMetadata = entry.getBubbleMetadata() != null; - if ((!hasMetadata && (previouslyUserCreated || bubbleNotifForExperiment)) - || useShortcutInfo) { - if (DEBUG_EXPERIMENTS) { - Log.d(TAG, "Adjusting " + entry.getKey() + " for bubble experiment." - + " allowMessages=" + allowMessageNotifsToBubble(context) - + " isMessage=" + isMessage - + " allowNotifs=" + allowAnyNotifToBubble(context) - + " useShortcutInfo=" + useShortcutInfo - + " previouslyUserCreated=" + previouslyUserCreated); - } - } - - if (useShortcutInfo && shortcutId != null) { - // We don't actually get anything useful from ShortcutInfo so just check existence - ShortcutInfo info = getShortcutInfo(context, entry.getSbn().getPackageName(), - entry.getSbn().getUser(), shortcutId); - if (info != null) { - metadata = createForShortcut(shortcutId); - } - - // Replace existing metadata with shortcut, or we're bubbling for experiment - boolean shouldBubble = entry.getBubbleMetadata() != null - || bubbleNotifForExperiment - || previouslyUserCreated; - if (shouldBubble && metadata != null) { - if (DEBUG_EXPERIMENTS) { - Log.d(TAG, "Adding experimental shortcut bubble for: " + entry.getKey()); - } - entry.setBubbleMetadata(metadata); - addedMetadata = true; - } - } - - // Didn't get metadata from a shortcut & we're bubbling for experiment - if (entry.getBubbleMetadata() == null - && (bubbleNotifForExperiment || previouslyUserCreated)) { - metadata = createFromNotif(context, entry); - if (metadata != null) { - if (DEBUG_EXPERIMENTS) { - Log.d(TAG, "Adding experimental notification bubble for: " + entry.getKey()); - } - entry.setBubbleMetadata(metadata); - addedMetadata = true; - } - } - - boolean bubbleForWhitelist = !userBlocked - && whiteListedToAutoBubble - && (addedMetadata || hasMetadata); - if ((previouslyUserCreated && addedMetadata) || bubbleForWhitelist) { - // Update to a previous bubble (or new autobubble), set its flag now. - if (DEBUG_EXPERIMENTS) { - Log.d(TAG, "Setting FLAG_BUBBLE for: " + entry.getKey()); - } - entry.setFlagBubble(true); - return true; - } - return addedMetadata; - } - - static Notification.BubbleMetadata createFromNotif(Context context, NotificationEntry entry) { - Notification notification = entry.getSbn().getNotification(); - final PendingIntent intent = notification.contentIntent; - Icon icon = null; - // Use the icon of the person if available - List<Person> personList = getPeopleFromNotification(entry); - if (personList.size() > 0) { - final Person person = personList.get(0); - if (person != null) { - icon = person.getIcon(); - if (icon == null) { - // Lets try and grab the icon constructed by the layout - Drawable d = PeopleHubNotificationListenerKt.extractAvatarFromRow(entry); - if (d instanceof BitmapDrawable) { - icon = Icon.createWithBitmap(((BitmapDrawable) d).getBitmap()); - } - } - } - } - if (icon == null) { - boolean shouldTint = notification.getLargeIcon() == null; - icon = shouldTint - ? notification.getSmallIcon() - : notification.getLargeIcon(); - if (shouldTint) { - int notifColor = entry.getSbn().getNotification().color; - notifColor = ColorUtils.setAlphaComponent(notifColor, 255); - notifColor = ContrastColorUtil.findContrastColor(notifColor, Color.WHITE, - true /* findFg */, 3f); - icon.setTint(notifColor); - } - } - if (intent != null) { - return new Notification.BubbleMetadata.Builder(intent, icon) - .setDesiredHeight(BUBBLE_HEIGHT) - .build(); - } - return null; - } - - static Notification.BubbleMetadata createForShortcut(String shortcutId) { - return new Notification.BubbleMetadata.Builder(shortcutId) - .setDesiredHeight(BUBBLE_HEIGHT) - .build(); - } - - static ShortcutInfo getShortcutInfo(Context context, String packageName, UserHandle user, - String shortcutId) { - LauncherApps launcherAppService = - (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); - LauncherApps.ShortcutQuery query = new LauncherApps.ShortcutQuery(); - if (packageName != null) { - query.setPackage(packageName); - } - if (shortcutId != null) { - query.setShortcutIds(Arrays.asList(shortcutId)); - } - query.setQueryFlags(FLAG_MATCH_DYNAMIC | FLAG_MATCH_PINNED | FLAG_MATCH_MANIFEST); - List<ShortcutInfo> shortcuts = launcherAppService.getShortcuts(query, user); - return shortcuts != null && shortcuts.size() > 0 - ? shortcuts.get(0) - : null; - } - - static List<Person> getPeopleFromNotification(NotificationEntry entry) { - Bundle extras = entry.getSbn().getNotification().extras; - ArrayList<Person> personList = new ArrayList<>(); - if (extras == null) { - return personList; - } - - List<Person> p = extras.getParcelableArrayList(Notification.EXTRA_PEOPLE_LIST); - - if (p != null) { - personList.addAll(p); - } - - if (Notification.MessagingStyle.class.equals( - entry.getSbn().getNotification().getNotificationStyle())) { - final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); - if (!ArrayUtils.isEmpty(messages)) { - for (Notification.MessagingStyle.Message message : - Notification.MessagingStyle.Message - .getMessagesFromBundleArray(messages)) { - personList.add(message.getSenderPerson()); - } - } - } - return personList; - } -} diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/dagger/BubbleModule.java b/packages/SystemUI/src/com/android/systemui/bubbles/dagger/BubbleModule.java deleted file mode 100644 index 5a7e033607f8..000000000000 --- a/packages/SystemUI/src/com/android/systemui/bubbles/dagger/BubbleModule.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.bubbles.dagger; - -import android.app.INotificationManager; -import android.content.Context; -import android.content.pm.LauncherApps; -import android.os.Handler; -import android.view.WindowManager; - -import androidx.annotation.Nullable; - -import com.android.internal.logging.UiEventLogger; -import com.android.internal.statusbar.IStatusBarService; -import com.android.systemui.bubbles.BubbleController; -import com.android.systemui.bubbles.Bubbles; -import com.android.systemui.dagger.SysUISingleton; -import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.dump.DumpManager; -import com.android.systemui.model.SysUiState; -import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.statusbar.FeatureFlags; -import com.android.systemui.statusbar.NotificationLockscreenUserManager; -import com.android.systemui.statusbar.NotificationShadeWindowController; -import com.android.systemui.statusbar.notification.NotificationEntryManager; -import com.android.systemui.statusbar.notification.collection.NotifPipeline; -import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; -import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; -import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.policy.ConfigurationController; -import com.android.systemui.statusbar.policy.ZenModeController; -import com.android.systemui.wmshell.BubblesManager; -import com.android.wm.shell.ShellTaskOrganizer; -import com.android.wm.shell.WindowManagerShellWrapper; -import com.android.wm.shell.common.FloatingContentCoordinator; - -import java.util.Optional; - -import dagger.Module; -import dagger.Provides; - -/** */ -@Module -public interface BubbleModule { - - /** - */ - @SysUISingleton - @Provides - static Bubbles newBubbleController(Context context, - FloatingContentCoordinator floatingContentCoordinator, - IStatusBarService statusBarService, - WindowManager windowManager, - WindowManagerShellWrapper windowManagerShellWrapper, - LauncherApps launcherApps, - UiEventLogger uiEventLogger, - @Main Handler mainHandler, - ShellTaskOrganizer organizer) { - return BubbleController.create(context, null /* synchronizer */, floatingContentCoordinator, - statusBarService, windowManager, windowManagerShellWrapper, launcherApps, - uiEventLogger, mainHandler, organizer); - } - - /** Provides Optional of BubbleManager */ - @SysUISingleton - @Provides - static Optional<BubblesManager> provideBubblesManager(Context context, - Optional<Bubbles> bubblesOptional, - NotificationShadeWindowController notificationShadeWindowController, - StatusBarStateController statusBarStateController, ShadeController shadeController, - ConfigurationController configurationController, - @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, - NotificationInterruptStateProvider interruptionStateProvider, - ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, - NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, - NotifPipeline notifPipeline, SysUiState sysUiState, FeatureFlags featureFlags, - DumpManager dumpManager) { - return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, - notificationShadeWindowController, statusBarStateController, shadeController, - configurationController, statusBarService, notificationManager, - interruptionStateProvider, zenModeController, notifUserManager, - groupManager, entryManager, notifPipeline, sysUiState, featureFlags, dumpManager)); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java b/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java index 554d9cbb454f..53383d65e379 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java @@ -22,9 +22,7 @@ import android.util.DisplayMetrics; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLoggerImpl; import com.android.systemui.util.concurrency.GlobalConcurrencyModule; -import com.android.wm.shell.WindowManagerShellWrapper; import com.android.wm.shell.animation.FlingAnimationUtils; -import com.android.wm.shell.common.FloatingContentCoordinator; import javax.inject.Singleton; @@ -51,22 +49,6 @@ import dagger.Provides; GlobalConcurrencyModule.class}) public class GlobalModule { - // TODO(b/161980186): Currently only used by Bubbles, can move back to WMShellBaseModule once - // Bubbles has migrated over - @Singleton - @Provides - static FloatingContentCoordinator provideFloatingContentCoordinator() { - return new FloatingContentCoordinator(); - } - - // TODO(b/161980186): Currently only used by Bubbles, can move back to WMShellBaseModule once - // Bubbles has migrated over - @Singleton - @Provides - static WindowManagerShellWrapper provideWindowManagerShellWrapper() { - return new WindowManagerShellWrapper(); - } - // TODO(b/162923491): This should not be a singleton at all, the display metrics can change and // callers should be creating a new builder on demand @Singleton diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SysUIComponent.java b/packages/SystemUI/src/com/android/systemui/dagger/SysUIComponent.java index d73633e57c9b..b94a68b2441d 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SysUIComponent.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SysUIComponent.java @@ -27,6 +27,7 @@ import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.InjectionInflationController; import com.android.wm.shell.ShellDump; import com.android.wm.shell.ShellTaskOrganizer; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.onehanded.OneHanded; import com.android.wm.shell.pip.Pip; import com.android.wm.shell.splitscreen.SplitScreen; @@ -64,6 +65,9 @@ public interface SysUIComponent { Builder setOneHanded(Optional<OneHanded> o); @BindsInstance + Builder setBubbles(Optional<Bubbles> b); + + @BindsInstance Builder setInputConsumerController(InputConsumerController i); @BindsInstance diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java index 1f6288a94ad4..c0013d8cb981 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java @@ -24,7 +24,6 @@ import com.android.systemui.SystemUI; import com.android.systemui.accessibility.SystemActions; import com.android.systemui.accessibility.WindowMagnification; import com.android.systemui.biometrics.AuthController; -import com.android.systemui.bubbles.dagger.BubbleModule; import com.android.systemui.globalactions.GlobalActionsComponent; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.dagger.KeyguardModule; @@ -51,8 +50,7 @@ import dagger.multibindings.IntoMap; /** * SystemUI objects that are injectable should go here. */ -@Module(includes = {RecentsModule.class, StatusBarModule.class, BubbleModule.class, - KeyguardModule.class}) +@Module(includes = {RecentsModule.class, StatusBarModule.class, KeyguardModule.class}) public abstract class SystemUIBinder { /** Inject into AuthController. */ @Binds diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index a982ec5c0194..780bb5b01103 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -16,32 +16,49 @@ package com.android.systemui.dagger; +import android.app.INotificationManager; +import android.content.Context; + +import androidx.annotation.Nullable; + +import com.android.internal.statusbar.IStatusBarService; import com.android.keyguard.dagger.KeyguardBouncerComponent; import com.android.systemui.BootCompleteCache; import com.android.systemui.BootCompleteCacheImpl; import com.android.systemui.appops.dagger.AppOpsModule; import com.android.systemui.assist.AssistModule; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.controls.dagger.ControlsModule; import com.android.systemui.demomode.dagger.DemoModeModule; import com.android.systemui.doze.dagger.DozeComponent; +import com.android.systemui.dump.DumpManager; import com.android.systemui.fragments.FragmentService; import com.android.systemui.log.dagger.LogModule; import com.android.systemui.model.SysUiState; +import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.power.dagger.PowerModule; import com.android.systemui.recents.Recents; import com.android.systemui.screenshot.dagger.ScreenshotModule; import com.android.systemui.settings.dagger.SettingsModule; import com.android.systemui.statusbar.CommandQueue; +import com.android.systemui.statusbar.FeatureFlags; +import com.android.systemui.statusbar.NotificationLockscreenUserManager; +import com.android.systemui.statusbar.NotificationShadeWindowController; +import com.android.systemui.statusbar.notification.NotificationEntryManager; +import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinder; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl; +import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; +import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; import com.android.systemui.statusbar.notification.people.PeopleHubModule; import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; import com.android.systemui.statusbar.notification.row.dagger.NotificationRowComponent; import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent; +import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.HeadsUpManager; +import com.android.systemui.statusbar.policy.ZenModeController; import com.android.systemui.statusbar.policy.dagger.SmartRepliesInflationModule; import com.android.systemui.statusbar.policy.dagger.StatusBarPolicyModule; import com.android.systemui.tuner.dagger.TunerModule; @@ -53,6 +70,10 @@ import com.android.systemui.util.settings.SettingsUtilModule; import com.android.systemui.util.time.SystemClock; import com.android.systemui.util.time.SystemClockImpl; import com.android.systemui.volume.dagger.VolumeModule; +import com.android.systemui.wmshell.BubblesManager; +import com.android.wm.shell.bubbles.Bubbles; + +import java.util.Optional; import dagger.Binds; import dagger.BindsOptionalOf; @@ -126,10 +147,28 @@ public abstract class SystemUIModule { @BindsOptionalOf abstract StatusBar optionalStatusBar(); - @BindsOptionalOf - abstract Bubbles optionalBubbles(); - @SysUISingleton @Binds abstract SystemClock bindSystemClock(SystemClockImpl systemClock); + + /** Provides Optional of BubbleManager */ + @SysUISingleton + @Provides + static Optional<BubblesManager> provideBubblesManager(Context context, + Optional<Bubbles> bubblesOptional, + NotificationShadeWindowController notificationShadeWindowController, + StatusBarStateController statusBarStateController, ShadeController shadeController, + ConfigurationController configurationController, + @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, + NotificationInterruptStateProvider interruptionStateProvider, + ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, + NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, + NotifPipeline notifPipeline, SysUiState sysUiState, FeatureFlags featureFlags, + DumpManager dumpManager) { + return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, + notificationShadeWindowController, statusBarStateController, shadeController, + configurationController, statusBarService, notificationManager, + interruptionStateProvider, zenModeController, notifUserManager, + groupManager, entryManager, notifPipeline, sysUiState, featureFlags, dumpManager)); + } } diff --git a/packages/SystemUI/src/com/android/systemui/dagger/WMComponent.java b/packages/SystemUI/src/com/android/systemui/dagger/WMComponent.java index 66352860612b..8f3d8eaac2d3 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/WMComponent.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/WMComponent.java @@ -21,6 +21,7 @@ import com.android.systemui.wmshell.WMShellModule; import com.android.wm.shell.ShellDump; import com.android.wm.shell.ShellInit; import com.android.wm.shell.ShellTaskOrganizer; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.onehanded.OneHanded; import com.android.wm.shell.pip.Pip; import com.android.wm.shell.splitscreen.SplitScreen; @@ -64,13 +65,11 @@ public interface WMComponent { InputConsumerController getInputConsumerController(); // TODO(b/162923491): To be removed once Bubbles migrates over to the Shell - @WMSingleton ShellTaskOrganizer getShellTaskOrganizer(); // TODO(b/162923491): We currently pass the instances through to SysUI, but that may change // depending on the threading mechanism we go with - @WMSingleton Optional<OneHanded> getOneHanded(); @@ -79,4 +78,7 @@ public interface WMComponent { @WMSingleton Optional<SplitScreen> getSplitScreen(); + + @WMSingleton + Optional<Bubbles> getBubbles(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java index a92b9e4818b4..9bd34ad1937f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java @@ -26,7 +26,6 @@ import android.view.View; import android.view.ViewGroup; import com.android.systemui.R; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.dagger.StatusBarModule; @@ -43,6 +42,7 @@ import com.android.systemui.statusbar.notification.stack.ForegroundServiceSectio import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.util.Assert; +import com.android.wm.shell.bubbles.Bubbles; import java.util.ArrayList; import java.util.HashMap; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarDependenciesModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarDependenciesModule.java index cee9c70f53eb..efd0519d6608 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarDependenciesModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarDependenciesModule.java @@ -21,7 +21,6 @@ import android.content.Context; import android.os.Handler; import com.android.internal.statusbar.IStatusBarService; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.media.MediaDataManager; @@ -62,6 +61,7 @@ import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.android.systemui.tracing.ProtoTracer; import com.android.systemui.util.DeviceConfigProxy; import com.android.systemui.util.concurrency.DelayableExecutor; +import com.android.wm.shell.bubbles.Bubbles; import java.util.Optional; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java index 7d8979ca1129..aef01e9bd811 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java @@ -22,10 +22,10 @@ import android.util.Log; import android.view.View; import com.android.systemui.DejankUtils; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.phone.StatusBar; +import com.android.wm.shell.bubbles.Bubbles; import java.util.Optional; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java index 83a569bd6573..29a030f910a4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.notification.collection.coordinator; -import com.android.systemui.bubbles.BubbleController; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifPipeline; @@ -26,6 +24,8 @@ import com.android.systemui.statusbar.notification.collection.listbuilder.plugga import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifDismissInterceptor; import com.android.systemui.wmshell.BubblesManager; +import com.android.wm.shell.bubbles.BubbleController; +import com.android.wm.shell.bubbles.Bubbles; import java.util.HashSet; import java.util.Optional; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/NotificationGroupManagerLegacy.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/NotificationGroupManagerLegacy.java index 36adfac21bc3..3db544011700 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/NotificationGroupManagerLegacy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/NotificationGroupManagerLegacy.java @@ -22,7 +22,6 @@ import android.util.ArraySet; import android.util.Log; import com.android.systemui.Dumpable; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; @@ -34,6 +33,7 @@ import com.android.systemui.statusbar.notification.collection.render.GroupMember import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; +import com.android.wm.shell.bubbles.Bubbles; import java.io.FileDescriptor; import java.io.PrintWriter; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsController.kt index 049b471aa7cb..52b9b0606e81 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsController.kt @@ -17,13 +17,13 @@ package com.android.systemui.statusbar.notification.init import android.service.notification.StatusBarNotification -import com.android.systemui.bubbles.Bubbles import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption import com.android.systemui.statusbar.NotificationPresenter import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.statusbar.phone.StatusBar +import com.android.wm.shell.bubbles.Bubbles import java.io.FileDescriptor import java.io.PrintWriter import java.util.Optional diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt index 45a5d1044b9a..8f352ad55041 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification.init import android.service.notification.StatusBarNotification -import com.android.systemui.bubbles.Bubbles import com.android.systemui.dagger.SysUISingleton import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption import com.android.systemui.statusbar.FeatureFlags @@ -41,6 +40,7 @@ import com.android.systemui.statusbar.phone.StatusBar import com.android.systemui.statusbar.policy.DeviceProvisionedController import com.android.systemui.statusbar.policy.HeadsUpManager import com.android.systemui.statusbar.policy.RemoteInputUriController +import com.android.wm.shell.bubbles.Bubbles import dagger.Lazy import java.io.FileDescriptor import java.io.PrintWriter diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerStub.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerStub.kt index 7569c1bdbb73..d0e68bf75373 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerStub.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerStub.kt @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification.init import android.service.notification.StatusBarNotification -import com.android.systemui.bubbles.Bubbles import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption import com.android.systemui.statusbar.NotificationListener import com.android.systemui.statusbar.NotificationPresenter @@ -25,6 +24,7 @@ import com.android.systemui.statusbar.notification.NotificationActivityStarter import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.statusbar.phone.StatusBar +import com.android.wm.shell.bubbles.Bubbles import java.io.FileDescriptor import java.io.PrintWriter import java.util.Optional diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java index 71e1d12b610e..8dad6fb6bb54 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java @@ -1359,8 +1359,8 @@ public class NotificationContentView extends FrameLayout { && entry.getBubbleMetadata() != null; if (showButton) { Drawable d = mContext.getResources().getDrawable(entry.isBubble() - ? R.drawable.ic_stop_bubble - : R.drawable.ic_create_bubble); + ? R.drawable.bubble_ic_stop_bubble + : R.drawable.bubble_ic_create_bubble); mContainingNotification.updateNotificationColor(); final int tint = mContainingNotification.getNotificationColor(); d.setTint(tint); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java index f2ae3da73f5e..a1bc81aa466a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java @@ -19,7 +19,6 @@ import com.android.internal.util.ContrastColorUtil; import com.android.settingslib.Utils; import com.android.systemui.Interpolators; import com.android.systemui.R; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.demomode.DemoMode; import com.android.systemui.demomode.DemoModeController; @@ -36,6 +35,7 @@ import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.collection.ListEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntry; +import com.android.wm.shell.bubbles.Bubbles; import java.util.ArrayList; import java.util.List; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java index af2f3e55c9ce..a930a897c2dc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java @@ -22,13 +22,13 @@ import android.view.ViewTreeObserver; import android.view.WindowManager; import com.android.systemui.assist.AssistManager; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationPresenter; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.StatusBarState; +import com.android.wm.shell.bubbles.Bubbles; import java.util.ArrayList; import java.util.Optional; @@ -51,7 +51,7 @@ public class ShadeControllerImpl implements ShadeController { private final int mDisplayId; protected final Lazy<StatusBar> mStatusBarLazy; private final Lazy<AssistManager> mAssistManagerLazy; - private final Optional<Lazy<Bubbles>> mBubblesOptional; + private final Optional<Bubbles> mBubblesOptional; private final ArrayList<Runnable> mPostCollapseRunnables = new ArrayList<>(); @@ -64,7 +64,7 @@ public class ShadeControllerImpl implements ShadeController { WindowManager windowManager, Lazy<StatusBar> statusBarLazy, Lazy<AssistManager> assistManagerLazy, - Optional<Lazy<Bubbles>> bubblesOptional + Optional<Bubbles> bubblesOptional ) { mCommandQueue = commandQueue; mStatusBarStateController = statusBarStateController; @@ -135,7 +135,7 @@ public class ShadeControllerImpl implements ShadeController { getStatusBar().getNotificationShadeWindowViewController().cancelExpandHelper(); getStatusBarView().collapsePanel(true /* animate */, delayed, speedUpFactor); } else if (mBubblesOptional.isPresent()) { - mBubblesOptional.get().get().collapseStack(); + mBubblesOptional.get().collapseStack(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index a8d41046a1eb..5c7f54b4a9a9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -144,7 +144,6 @@ import com.android.systemui.R; import com.android.systemui.SystemUI; import com.android.systemui.assist.AssistManager; import com.android.systemui.broadcast.BroadcastDispatcher; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.charging.WirelessChargingAnimation; import com.android.systemui.classifier.FalsingLog; import com.android.systemui.colorextraction.SysuiColorExtractor; @@ -229,6 +228,7 @@ import com.android.systemui.statusbar.policy.UserInfoControllerImpl; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.volume.VolumeComponent; import com.android.systemui.wmshell.BubblesManager; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.splitscreen.SplitScreen; import java.io.FileDescriptor; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java index b69da859b3c8..13d5bf59fb4b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java @@ -31,7 +31,6 @@ import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.InitController; import com.android.systemui.assist.AssistManager; import com.android.systemui.broadcast.BroadcastDispatcher; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.UiBackground; @@ -98,6 +97,7 @@ import com.android.systemui.statusbar.policy.UserInfoControllerImpl; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.volume.VolumeComponent; import com.android.systemui.wmshell.BubblesManager; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.splitscreen.SplitScreen; import java.util.Optional; diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java index ad596c27ba97..844f12e0c43e 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java @@ -27,10 +27,10 @@ import static android.service.notification.NotificationListenerService.REASON_GR import static android.service.notification.NotificationStats.DISMISSAL_BUBBLE; import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEUTRAL; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; -import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.notification.NotificationEntryManager.UNDEFINED_DISMISS_REASON; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; +import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.app.INotificationManager; import android.app.Notification; @@ -53,8 +53,6 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.Dumpable; -import com.android.systemui.bubbles.BubbleEntry; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.model.SysUiState; @@ -80,6 +78,8 @@ import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ZenModeController; +import com.android.wm.shell.bubbles.BubbleEntry; +import com.android.wm.shell.bubbles.Bubbles; import java.io.FileDescriptor; import java.io.PrintWriter; diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java index 91ae08e07677..bdca503f40c1 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java @@ -18,21 +18,27 @@ package com.android.systemui.wmshell; import android.app.IActivityManager; import android.content.Context; +import android.content.pm.LauncherApps; import android.content.pm.PackageManager; import android.os.Handler; import android.view.IWindowManager; +import android.view.WindowManager; import com.android.internal.logging.UiEventLogger; -import com.android.systemui.bubbles.Bubbles; +import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.dagger.WMSingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.shared.system.InputConsumerController; import com.android.wm.shell.ShellDump; import com.android.wm.shell.ShellInit; import com.android.wm.shell.ShellTaskOrganizer; +import com.android.wm.shell.WindowManagerShellWrapper; +import com.android.wm.shell.bubbles.BubbleController; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.common.AnimationThread; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.DisplayImeController; +import com.android.wm.shell.common.FloatingContentCoordinator; import com.android.wm.shell.common.HandlerExecutor; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.SyncTransactionQueue; @@ -116,6 +122,18 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides + static FloatingContentCoordinator provideFloatingContentCoordinator() { + return new FloatingContentCoordinator(); + } + + @WMSingleton + @Provides + static WindowManagerShellWrapper provideWindowManagerShellWrapper() { + return new WindowManagerShellWrapper(); + } + + @WMSingleton + @Provides static PipAppOpsListener providePipAppOpsListener(Context context, IActivityManager activityManager, PipTouchHandler pipTouchHandler) { @@ -166,8 +184,21 @@ public abstract class WMShellBaseModule { @BindsOptionalOf abstract SplitScreen optionalSplitScreen(); - @BindsOptionalOf - abstract Bubbles optionalBubbles(); + @WMSingleton + @Provides + static Optional<Bubbles> provideBubbles(Context context, + FloatingContentCoordinator floatingContentCoordinator, + IStatusBarService statusBarService, + WindowManager windowManager, + WindowManagerShellWrapper windowManagerShellWrapper, + LauncherApps launcherApps, + UiEventLogger uiEventLogger, + @Main Handler mainHandler, + ShellTaskOrganizer organizer) { + return Optional.of(BubbleController.create(context, null /* synchronizer */, + floatingContentCoordinator, statusBarService, windowManager, + windowManagerShellWrapper, launcherApps, uiEventLogger, mainHandler, organizer)); + } @WMSingleton @Provides diff --git a/packages/SystemUI/tests/AndroidManifest.xml b/packages/SystemUI/tests/AndroidManifest.xml index e5847b08a4c5..f1c687ff3224 100644 --- a/packages/SystemUI/tests/AndroidManifest.xml +++ b/packages/SystemUI/tests/AndroidManifest.xml @@ -63,7 +63,7 @@ </intent-filter> </receiver> - <activity android:name="com.android.systemui.bubbles.BubblesTestActivity" + <activity android:name=".wmshell.BubblesTestActivity" android:allowEmbedded="true" android:documentLaunchMode="always" android:excludeFromRecents="true" diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/buttons/KeyButtonViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/buttons/KeyButtonViewTest.java index 3494bd61b656..fa29fd4f94ae 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/buttons/KeyButtonViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/buttons/KeyButtonViewTest.java @@ -49,7 +49,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.UiEventLogger; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.recents.OverviewProxyService; import org.junit.Before; @@ -66,7 +65,6 @@ public class KeyButtonViewTest extends SysuiTestCase { private KeyButtonView mKeyButtonView; private MetricsLogger mMetricsLogger; - private Bubbles mBubbles; private UiEventLogger mUiEventLogger; private InputManager mInputManager = mock(InputManager.class); @Captor @@ -76,7 +74,6 @@ public class KeyButtonViewTest extends SysuiTestCase { public void setup() throws Exception { MockitoAnnotations.initMocks(this); mMetricsLogger = mDependency.injectMockDependency(MetricsLogger.class); - mBubbles = mDependency.injectMockDependency(Bubbles.class); mDependency.injectMockDependency(OverviewProxyService.class); mUiEventLogger = mDependency.injectMockDependency(UiEventLogger.class); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java index 10eca00feec4..7fb7b8667a1b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationViewHierarchyManagerTest.java @@ -36,7 +36,6 @@ import android.widget.LinearLayout; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper; import com.android.systemui.statusbar.notification.AssistantFeedbackController; import com.android.systemui.statusbar.notification.DynamicChildBindController; @@ -54,6 +53,7 @@ import com.android.systemui.statusbar.notification.row.NotificationTestHelper; import com.android.systemui.statusbar.notification.stack.ForegroundServiceSectionController; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.phone.KeyguardBypassController; +import com.android.wm.shell.bubbles.Bubbles; import com.google.android.collect.Lists; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationFilterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationFilterTest.java index cd46dda772e3..05cf33a3729c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationFilterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationFilterTest.java @@ -42,7 +42,6 @@ import androidx.test.filters.SmallTest; import com.android.systemui.ForegroundServiceController; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.media.MediaFeatureFlag; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationLockscreenUserManager; @@ -54,6 +53,7 @@ import com.android.systemui.statusbar.notification.people.PeopleNotificationIden import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationTestHelper; import com.android.systemui.statusbar.phone.ShadeController; +import com.android.wm.shell.bubbles.Bubbles; import org.junit.After; import org.junit.Before; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java index 4698b8e50efb..f7dfe0b434a7 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java @@ -76,12 +76,12 @@ import com.android.settingslib.notification.ConversationIconFactory; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.BubblesTestActivity; import com.android.systemui.statusbar.SbnBuilder; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.wmshell.BubblesManager; +import com.android.systemui.wmshell.BubblesTestActivity; import org.junit.Before; import org.junit.Rule; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java index 48375e02f64f..323b069acc44 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java @@ -45,8 +45,6 @@ import android.widget.RemoteViews; import com.android.systemui.R; import com.android.systemui.TestableDependency; -import com.android.systemui.bubbles.Bubbles; -import com.android.systemui.bubbles.BubblesTestActivity; import com.android.systemui.media.MediaFeatureFlag; import com.android.systemui.media.dialog.MediaOutputDialogFactory; import com.android.systemui.plugins.FalsingManager; @@ -71,6 +69,8 @@ import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.policy.InflatedSmartReplies; import com.android.systemui.wmshell.BubblesManager; +import com.android.systemui.wmshell.BubblesTestActivity; +import com.android.wm.shell.bubbles.Bubbles; import org.mockito.ArgumentCaptor; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupAlertTransferHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupAlertTransferHelperTest.java index b0086ef1d4fb..7c8b413833eb 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupAlertTransferHelperTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupAlertTransferHelperTest.java @@ -37,7 +37,6 @@ import android.testing.TestableLooper; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; @@ -48,6 +47,7 @@ import com.android.systemui.statusbar.notification.row.NotifBindPipeline.BindCal import com.android.systemui.statusbar.notification.row.RowContentBindParams; import com.android.systemui.statusbar.notification.row.RowContentBindStage; import com.android.systemui.statusbar.policy.HeadsUpManager; +import com.android.wm.shell.bubbles.Bubbles; import org.junit.Before; import org.junit.Rule; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupManagerLegacyTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupManagerLegacyTest.java index f81672ab6a37..3e9fd5189129 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupManagerLegacyTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationGroupManagerLegacyTest.java @@ -30,12 +30,12 @@ import android.testing.TestableLooper; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; import com.android.systemui.statusbar.policy.HeadsUpManager; +import com.android.wm.shell.bubbles.Bubbles; import org.junit.Before; import org.junit.Rule; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java index a1d419cfb6c7..858227fe7129 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java @@ -27,7 +27,6 @@ import androidx.test.filters.SmallTest; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.demomode.DemoModeController; import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.plugins.statusbar.StatusBarStateController; @@ -35,6 +34,7 @@ import com.android.systemui.statusbar.NotificationListener; import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; +import com.android.wm.shell.bubbles.Bubbles; import org.junit.Before; import org.junit.Test; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java index 9f096dada6f2..2f9b6010b42d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java @@ -83,7 +83,6 @@ import com.android.systemui.R; import com.android.systemui.SysuiTestCase; import com.android.systemui.assist.AssistManager; import com.android.systemui.broadcast.BroadcastDispatcher; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.classifier.FalsingManagerFake; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.demomode.DemoModeController; @@ -146,6 +145,7 @@ import com.android.systemui.util.concurrency.FakeExecutor; import com.android.systemui.util.time.FakeSystemClock; import com.android.systemui.volume.VolumeComponent; import com.android.systemui.wmshell.BubblesManager; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.splitscreen.SplitScreen; import org.junit.Before; @@ -337,7 +337,7 @@ public class StatusBarTest extends SysuiTestCase { mShadeController = new ShadeControllerImpl(mCommandQueue, mStatusBarStateController, mNotificationShadeWindowController, mStatusBarKeyguardViewManager, mContext.getSystemService(WindowManager.class), - () -> mStatusBar, () -> mAssistManager, Optional.of(() -> mBubbles)); + () -> mStatusBar, () -> mAssistManager, Optional.of(mBubbles)); mStatusBar = new StatusBar( mContext, diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index 88d04011e738..a46e563a7c57 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -64,14 +64,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.colorextraction.ColorExtractor; import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.Bubble; -import com.android.systemui.bubbles.BubbleData; -import com.android.systemui.bubbles.BubbleDataRepository; -import com.android.systemui.bubbles.BubbleEntry; -import com.android.systemui.bubbles.BubbleLogger; -import com.android.systemui.bubbles.BubblePositioner; -import com.android.systemui.bubbles.BubbleStackView; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.KeyguardViewMediator; @@ -102,6 +94,14 @@ import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.WindowManagerShellWrapper; +import com.android.wm.shell.bubbles.Bubble; +import com.android.wm.shell.bubbles.BubbleData; +import com.android.wm.shell.bubbles.BubbleDataRepository; +import com.android.wm.shell.bubbles.BubbleEntry; +import com.android.wm.shell.bubbles.BubbleLogger; +import com.android.wm.shell.bubbles.BubblePositioner; +import com.android.wm.shell.bubbles.BubbleStackView; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.common.FloatingContentCoordinator; import com.google.common.collect.ImmutableList; diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubblesTestActivity.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTestActivity.java index 43d2ad1dfe0a..f4d96a123624 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubblesTestActivity.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTestActivity.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.systemui.bubbles; +package com.android.systemui.wmshell; import android.app.Activity; import android.content.Intent; @@ -27,8 +27,7 @@ import com.android.systemui.R; */ public class BubblesTestActivity extends Activity { - public static final String BUBBLE_ACTIVITY_OPENED = - "com.android.systemui.bubbles.BUBBLE_ACTIVITY_OPENED"; + public static final String BUBBLE_ACTIVITY_OPENED = "BUBBLE_ACTIVITY_OPENED"; @Override public void onCreate(Bundle savedInstanceState) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java index 99c8ca417778..d8033dbdd281 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java @@ -60,13 +60,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.colorextraction.ColorExtractor; import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.SysuiTestCase; -import com.android.systemui.bubbles.BubbleData; -import com.android.systemui.bubbles.BubbleDataRepository; -import com.android.systemui.bubbles.BubbleEntry; -import com.android.systemui.bubbles.BubbleLogger; -import com.android.systemui.bubbles.BubblePositioner; -import com.android.systemui.bubbles.BubbleStackView; -import com.android.systemui.bubbles.Bubbles; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dump.DumpManager; import com.android.systemui.keyguard.KeyguardViewMediator; @@ -95,6 +88,13 @@ import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.WindowManagerShellWrapper; +import com.android.wm.shell.bubbles.BubbleData; +import com.android.wm.shell.bubbles.BubbleDataRepository; +import com.android.wm.shell.bubbles.BubbleEntry; +import com.android.wm.shell.bubbles.BubbleLogger; +import com.android.wm.shell.bubbles.BubblePositioner; +import com.android.wm.shell.bubbles.BubbleStackView; +import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.common.FloatingContentCoordinator; import org.junit.Before; diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java index 2273bc48ce8b..fd39b6e5b1c8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/TestableBubbleController.java @@ -22,13 +22,13 @@ import android.os.Handler; import android.view.WindowManager; import com.android.internal.statusbar.IStatusBarService; -import com.android.systemui.bubbles.BubbleController; -import com.android.systemui.bubbles.BubbleData; -import com.android.systemui.bubbles.BubbleDataRepository; -import com.android.systemui.bubbles.BubbleLogger; -import com.android.systemui.bubbles.BubblePositioner; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.WindowManagerShellWrapper; +import com.android.wm.shell.bubbles.BubbleController; +import com.android.wm.shell.bubbles.BubbleData; +import com.android.wm.shell.bubbles.BubbleDataRepository; +import com.android.wm.shell.bubbles.BubbleLogger; +import com.android.wm.shell.bubbles.BubblePositioner; import com.android.wm.shell.common.FloatingContentCoordinator; /** |