Merge "Merge "Delete media feature flag" into rvc-dev am: 9b01b8510a am: 03edb83f56" into rvc-d1-dev-plus-aosp am: b1a75b7f66

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12108974

Change-Id: I541df011c1d6a5a4e9ab2ffa687fd8434d26e691
diff --git a/res/layout/bubble_preference.xml b/res/layout/bubble_preference.xml
index 8a64716..08f25b4 100644
--- a/res/layout/bubble_preference.xml
+++ b/res/layout/bubble_preference.xml
@@ -44,7 +44,7 @@
             android:id="@+id/bubble_all_icon"
             android:src="@drawable/ic_bubble_all"
             android:background="@android:color/transparent"
-            android:layout_gravity="center"
+            android:layout_centerVertical="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:clickable="false"
@@ -53,6 +53,7 @@
             android:id="@+id/bubble_all_label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
             android:ellipsize="end"
             android:maxLines="2"
             android:clickable="false"
@@ -75,7 +76,7 @@
             android:id="@+id/bubble_selected_icon"
             android:src="@drawable/ic_bubble_selected"
             android:background="@android:color/transparent"
-            android:layout_gravity="center"
+            android:layout_centerVertical="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:clickable="false"
@@ -84,6 +85,7 @@
             android:id="@+id/bubble_selected_label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
             android:ellipsize="end"
             android:maxLines="2"
             android:clickable="false"
@@ -106,7 +108,7 @@
             android:id="@+id/bubble_none_icon"
             android:src="@drawable/ic_bubble_none"
             android:background="@android:color/transparent"
-            android:layout_gravity="center"
+            android:layout_centerVertical="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:clickable="false"
@@ -115,6 +117,7 @@
             android:id="@+id/bubble_none_label"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
             android:ellipsize="end"
             android:maxLines="2"
             android:clickable="false"
@@ -125,4 +128,4 @@
             android:text="@string/bubble_app_setting_none"/>
     </com.android.settings.notification.NotificationButtonRelativeLayout>
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/notification_history_app_layout.xml b/res/layout/notification_history_app_layout.xml
index a1b3be7..481253a 100644
--- a/res/layout/notification_history_app_layout.xml
+++ b/res/layout/notification_history_app_layout.xml
@@ -24,6 +24,7 @@
         android:id="@+id/app_header"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
+        android:background="@drawable/button_ripple_radius"
         android:paddingTop="12dp"
         android:paddingBottom="12dp"
         android:paddingStart="16dp">
@@ -58,13 +59,14 @@
                 android:paddingTop="8dp"
                 android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Notification.Title"/>
         </LinearLayout>
-        <ImageButton
+        <ImageView
             android:id="@+id/expand"
             android:layout_alignParentEnd="true"
             android:layout_centerVertical="true"
             android:layout_height="48dp"
             android:layout_width="48dp"
-            android:background="@drawable/button_ripple_radius"
+            android:scaleType="center"
+            android:contentDescription="@null"
             android:src="@*android:drawable/ic_expand_more"/>
     </RelativeLayout>
 
diff --git a/src/com/android/settings/notification/app/BubblePreference.java b/src/com/android/settings/notification/app/BubblePreference.java
index 7e071ff..f0046d7 100644
--- a/src/com/android/settings/notification/app/BubblePreference.java
+++ b/src/com/android/settings/notification/app/BubblePreference.java
@@ -45,8 +45,6 @@
     private int mSelectedPreference;
 
     private Context mContext;
-    private Drawable mSelectedBackground;
-    private Drawable mUnselectedBackground;
 
     private ButtonViewHolder mBubbleAllButton;
     private ButtonViewHolder mBubbleSelectedButton;
@@ -72,8 +70,6 @@
         mHelper = new RestrictedPreferenceHelper(context, this, attrs);
         mHelper.useAdminDisabledSummary(true);
         mContext = context;
-        mSelectedBackground = mContext.getDrawable(R.drawable.button_border_selected);
-        mUnselectedBackground = mContext.getDrawable(R.drawable.button_border_unselected);
         setLayoutResource(R.layout.bubble_preference);
     }
 
@@ -167,7 +163,9 @@
         }
 
         void setSelected(Context context, boolean selected) {
-            mView.setBackground(selected ?  mSelectedBackground : mUnselectedBackground);
+            mView.setBackground(mContext.getDrawable(selected
+                ? R.drawable.button_border_selected
+                : R.drawable.button_border_unselected));
             mView.setSelected(selected);
 
             ColorStateList stateList = selected
diff --git a/src/com/android/settings/notification/history/NotificationHistoryActivity.java b/src/com/android/settings/notification/history/NotificationHistoryActivity.java
index 7635a4f..b184740 100644
--- a/src/com/android/settings/notification/history/NotificationHistoryActivity.java
+++ b/src/com/android/settings/notification/history/NotificationHistoryActivity.java
@@ -155,21 +155,22 @@
 
             final View container = viewForPackage.findViewById(R.id.notification_list);
             container.setVisibility(View.GONE);
-            ImageButton expand = viewForPackage.findViewById(R.id.expand);
-            expand.setContentDescription(container.getVisibility() == View.VISIBLE
+            View header = viewForPackage.findViewById(R.id.app_header);
+            ImageView expand = viewForPackage.findViewById(R.id.expand);
+            header.setStateDescription(container.getVisibility() == View.VISIBLE
                     ? getString(R.string.condition_expand_hide)
                     : getString(R.string.condition_expand_show));
             int finalI = i;
-            expand.setOnClickListener(v -> {
+            header.setOnClickListener(v -> {
                 container.setVisibility(container.getVisibility() == View.VISIBLE
                         ? View.GONE : View.VISIBLE);
                 expand.setImageResource(container.getVisibility() == View.VISIBLE
                         ? R.drawable.ic_expand_less
                         : com.android.internal.R.drawable.ic_expand_more);
-                expand.setContentDescription(container.getVisibility() == View.VISIBLE
+                header.setStateDescription(container.getVisibility() == View.VISIBLE
                         ? getString(R.string.condition_expand_hide)
                         : getString(R.string.condition_expand_show));
-                expand.sendAccessibilityEvent(TYPE_VIEW_ACCESSIBILITY_FOCUSED);
+                header.sendAccessibilityEvent(TYPE_VIEW_ACCESSIBILITY_FOCUSED);
                 mUiEventLogger.logWithPosition(
                         (container.getVisibility() == View.VISIBLE)
                             ? NotificationHistoryEvent.NOTIFICATION_HISTORY_PACKAGE_HISTORY_OPEN