Convert tonal palettes to MDC nomenclature

MDC was already included in sysui, but it was an implicit dependency,
now it's included in the Android.bp.

All Android dynamic palettes were renamed for clarity, so tones now
follow perceptual luminosity, from 0 to 100.

Test: m -j SystemUIGoogle
Test: make with AndroidStudio
Fixes: 220018210
Change-Id: I23bd9e71e3f2b7d949c04fd8ad78c85e3552b79f
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index b1cfb11..8cc9e00 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -112,6 +112,7 @@
         "androidx.dynamicanimation_dynamicanimation",
         "androidx-constraintlayout_constraintlayout",
         "androidx.exifinterface_exifinterface",
+        "com.google.android.material_material",
         "kotlinx_coroutines_android",
         "kotlinx_coroutines",
         "iconloader_base",
diff --git a/packages/SystemUI/res-keyguard/drawable/status_bar_user_chip_bg.xml b/packages/SystemUI/res-keyguard/drawable/status_bar_user_chip_bg.xml
index 9891156..a751f58 100644
--- a/packages/SystemUI/res-keyguard/drawable/status_bar_user_chip_bg.xml
+++ b/packages/SystemUI/res-keyguard/drawable/status_bar_user_chip_bg.xml
@@ -15,6 +15,6 @@
   -->
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="@android:color/system_neutral1_800" />
+    <solid android:color="@color/material_dynamic_neutral20" />
     <corners android:radius="@dimen/ongoing_call_chip_corner_radius" />
 </shape>
diff --git a/packages/SystemUI/res/drawable-nodpi/icon_bg.xml b/packages/SystemUI/res/drawable-nodpi/icon_bg.xml
index ff7cbae..f7b0982 100644
--- a/packages/SystemUI/res/drawable-nodpi/icon_bg.xml
+++ b/packages/SystemUI/res/drawable-nodpi/icon_bg.xml
@@ -14,5 +14,5 @@
     limitations under the License.
 -->
 <color xmlns:android="http://schemas.android.com/apk/res/android"
-    android:color="@android:color/system_accent1_500" />
+    android:color="@color/material_dynamic_primary50" />
 
diff --git a/packages/SystemUI/res/drawable/media_output_dialog_seekbar_background.xml b/packages/SystemUI/res/drawable/media_output_dialog_seekbar_background.xml
index 3a228d5..e1b99ce 100644
--- a/packages/SystemUI/res/drawable/media_output_dialog_seekbar_background.xml
+++ b/packages/SystemUI/res/drawable/media_output_dialog_seekbar_background.xml
@@ -30,7 +30,7 @@
                     android:radius="28dp"/>
                 <size
                     android:height="64dp"/>
-                <solid android:color="@*android:color/system_accent1_200" />
+                <solid android:color="@color/material_dynamic_primary80" />
             </shape>
         </clip>
     </item>
diff --git a/packages/SystemUI/res/layout/screen_record_dialog_audio_source.xml b/packages/SystemUI/res/layout/screen_record_dialog_audio_source.xml
index ab600b3..2567176 100644
--- a/packages/SystemUI/res/layout/screen_record_dialog_audio_source.xml
+++ b/packages/SystemUI/res/layout/screen_record_dialog_audio_source.xml
@@ -27,11 +27,11 @@
         android:layout_gravity="center_vertical"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:textSize="14sp"
-        android:textColor="@android:color/system_neutral1_900"/>
+        android:textColor="@color/material_dynamic_neutral10"/>
     <TextView
         android:id="@+id/screen_recording_dialog_source_description"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textColor="@android:color/system_neutral2_700"/>
+        android:textColor="@color/material_dynamic_neutral_variant30"/>
 </LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index f1e93c2..4b96d5d 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -33,7 +33,7 @@
     <!-- The color of the text inside a notification -->
     <color name="notification_primary_text_color">@*android:color/notification_primary_text_color_dark</color>
 
-    <color name="notif_pill_text">@android:color/system_neutral1_50</color>
+    <color name="notif_pill_text">@color/material_dynamic_neutral95</color>
 
     <color name="notification_guts_link_icon_tint">@color/GM2_grey_500</color>
     <color name="notification_guts_sub_text_color">@color/GM2_grey_300</color>
@@ -66,15 +66,15 @@
     <color name="media_divider">#85ffffff</color>
 
     <!-- media output dialog-->
-    <color name="media_dialog_background">@android:color/system_neutral1_900</color>
-    <color name="media_dialog_active_item_main_content">@android:color/system_neutral1_900</color>
-    <color name="media_dialog_inactive_item_main_content">@android:color/system_neutral1_900</color>
-    <color name="media_dialog_item_status">@android:color/system_neutral1_900</color>
-    <color name="media_dialog_item_background">@android:color/system_accent2_50</color>
+    <color name="media_dialog_background">@color/material_dynamic_neutral10</color>
+    <color name="media_dialog_active_item_main_content">@color/material_dynamic_neutral10</color>
+    <color name="media_dialog_inactive_item_main_content">@color/material_dynamic_neutral10</color>
+    <color name="media_dialog_item_status">@color/material_dynamic_neutral10</color>
+    <color name="media_dialog_item_background">@color/material_dynamic_secondary95</color>
 
     <!-- Biometric dialog colors -->
     <color name="biometric_dialog_gray">#ffcccccc</color>
-    <color name="biometric_dialog_accent">@android:color/system_accent1_300</color>
+    <color name="biometric_dialog_accent">@color/material_dynamic_primary70</color>
     <color name="biometric_dialog_error">#fff28b82</color> <!-- red 300 -->
 
     <!-- UDFPS colors -->
@@ -99,5 +99,5 @@
     <!-- Accessibility floating menu -->
     <color name="accessibility_floating_menu_background">#B3000000</color> <!-- 70% -->
 
-    <color name="people_tile_background">@android:color/system_accent2_800</color>
+    <color name="people_tile_background">@color/material_dynamic_secondary20</color>
 </resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index cbda439..f4e7cf3 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -87,7 +87,7 @@
     <color name="notification_section_clear_all_btn_color">@color/GM2_grey_700</color>
 
     <color name="keyguard_user_switcher_background_gradient_color">#77000000</color>
-    <color name="user_switcher_fullscreen_bg">@android:color/system_neutral1_900</color>
+    <color name="user_switcher_fullscreen_bg">@color/material_dynamic_neutral10</color>
     <color name="user_switcher_fullscreen_popup_item_tint">@*android:color/text_color_primary_device_default_dark</color>
 
     <!-- The color of the navigation bar icons. Need to be in sync with ic_sysbar_* -->
@@ -112,7 +112,7 @@
     <!-- Chosen so fill over background matches single tone -->
     <color name="dark_mode_qs_icon_color_dual_tone_fill">#99000000</color>
 
-    <color name="notif_pill_text">@android:color/system_neutral1_900</color>
+    <color name="notif_pill_text">@color/material_dynamic_neutral10</color>
 
     <!-- Keyboard shortcuts colors -->
     <color name="ksh_application_group_color">#fff44336</color>
@@ -131,7 +131,7 @@
     <!-- Biometric dialog colors -->
     <color name="biometric_dialog_dim_color">#80000000</color>              <!-- 50% black -->
     <color name="biometric_dialog_gray">#ff757575</color>
-    <color name="biometric_dialog_accent">@android:color/system_accent1_600</color>
+    <color name="biometric_dialog_accent">@color/material_dynamic_primary40</color>
     <color name="biometric_dialog_error">#ffd93025</color>                  <!-- red 600 -->
 
     <!-- UDFPS colors -->
@@ -175,11 +175,11 @@
     <color name="media_seamless_border">?android:attr/colorAccent</color>
 
     <!-- media output dialog-->
-    <color name="media_dialog_background" android:lstar="98">@android:color/system_neutral1_100</color>
-    <color name="media_dialog_active_item_main_content">@android:color/system_accent1_900</color>
-    <color name="media_dialog_inactive_item_main_content">@android:color/system_accent1_600</color>
-    <color name="media_dialog_item_status">@android:color/system_accent1_900</color>
-    <color name="media_dialog_item_background">@android:color/system_accent2_50</color>
+    <color name="media_dialog_background" android:lstar="98">@color/material_dynamic_neutral90</color>
+    <color name="media_dialog_active_item_main_content">@color/material_dynamic_primary10</color>
+    <color name="media_dialog_inactive_item_main_content">@color/material_dynamic_primary40</color>
+    <color name="media_dialog_item_status">@color/material_dynamic_primary10</color>
+    <color name="media_dialog_item_background">@color/material_dynamic_secondary95</color>
 
     <!-- controls -->
     <color name="control_primary_text">#E6FFFFFF</color>
@@ -214,7 +214,7 @@
     <!-- Wallet screen -->
     <color name="wallet_card_border">#33FFFFFF</color>
 
-    <color name="people_tile_background">@android:color/system_accent2_50</color>
+    <color name="people_tile_background">@color/material_dynamic_secondary95</color>
 
     <!-- Internet Dialog -->
     <!-- Material next state on color-->
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 09ae3f9..9d65c38 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -296,7 +296,7 @@
         <item name="darkIconTheme">@style/DualToneDarkTheme</item>
         <item name="wallpaperTextColor">@*android:color/primary_text_material_dark</item>
         <item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_dark</item>
-        <item name="wallpaperTextColorAccent">@*android:color/system_accent1_100</item>
+        <item name="wallpaperTextColorAccent">@color/material_dynamic_primary90</item>
         <item name="android:colorError">@*android:color/error_color_material_dark</item>
         <item name="*android:lockPatternStyle">@style/LockPatternStyle</item>
         <item name="passwordStyle">@style/PasswordTheme</item>
@@ -312,7 +312,7 @@
     <style name="Theme.SystemUI.LightWallpaper">
         <item name="wallpaperTextColor">@*android:color/primary_text_material_light</item>
         <item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_light</item>
-        <item name="wallpaperTextColorAccent">@*android:color/system_accent2_600</item>
+        <item name="wallpaperTextColorAccent">@color/material_dynamic_secondary40</item>
         <item name="android:colorError">@*android:color/error_color_material_light</item>
         <item name="shadowRadius">0</item>
 
@@ -353,9 +353,9 @@
         <item name="android:colorError">@*android:color/error_color_material_dark</item>
         <item name="android:windowIsFloating">true</item>
         <item name="android:homeAsUpIndicator">@drawable/ic_arrow_back</item>
-        <item name="offStateColor">@android:color/system_neutral1_800</item>
-        <item name="underSurfaceColor">@android:color/system_neutral1_1000</item>
-        <item name="android:colorBackground">@android:color/system_neutral1_900</item>
+        <item name="offStateColor">@color/material_dynamic_neutral20</item>
+        <item name="underSurfaceColor">@color/material_dynamic_neutral0</item>
+        <item name="android:colorBackground">@color/material_dynamic_neutral10</item>
         <item name="android:itemTextAppearance">@style/Control.MenuItem</item>
     </style>
 
@@ -578,7 +578,7 @@
     <!-- Media controls always have light background -->
     <style name="MediaPlayer" parent="@*android:style/Theme.DeviceDefault.Light">
         <item name="android:textColor">?android:attr/textColorPrimary</item>
-        <item name="android:backgroundTint">@android:color/system_accent2_50</item>
+        <item name="android:backgroundTint">@color/material_dynamic_secondary95</item>
     </style>
 
     <style name="MediaPlayer.ProgressBar" parent="@android:style/Widget.ProgressBar.Horizontal">
@@ -887,8 +887,8 @@
     </style>
 
     <style name="Wallet.Theme" parent="@android:style/Theme.DeviceDefault">
-      <item name="android:colorBackground">@android:color/system_neutral1_900</item>
-      <item name="android:itemBackground">@android:color/system_neutral1_800</item>
+      <item name="android:colorBackground">@color/material_dynamic_neutral10</item>
+      <item name="android:itemBackground">@color/material_dynamic_neutral20</item>
       <!-- Setting a placeholder will avoid using the SystemUI icon on the splash screen.  -->
       <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_blank</item>
     </style>
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
index ecaa142..83ad027 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
@@ -540,14 +540,14 @@
     }
 
     private fun getBackgroundColor(): Int {
-        return context.getColor(android.R.color.system_accent2_50)
+        return context.getColor(R.color.material_dynamic_secondary95)
     }
 
     private fun getForegroundColor(): Int {
         return if (mediaFlags.useMediaSessionLayout()) {
-            context.getColor(android.R.color.system_neutral2_200)
+            context.getColor(R.color.material_dynamic_neutral_variant80)
         } else {
-            context.getColor(android.R.color.system_accent2_900)
+            context.getColor(R.color.material_dynamic_secondary10)
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
index ce7a697..831a606 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
@@ -476,7 +476,7 @@
         appIconView.clearColorFilter();
         if (data.getAppIcon() != null && !data.getResumption()) {
             appIconView.setImageIcon(data.getAppIcon());
-            int color = mContext.getColor(android.R.color.system_accent2_900);
+            int color = mContext.getColor(R.color.material_dynamic_secondary10);
             appIconView.setColorFilter(color);
         } else {
             // Resume players use launcher icon
@@ -590,7 +590,7 @@
             } else {
                 appIconView.setImageResource(R.drawable.ic_music_note);
             }
-            int color = mContext.getColor(android.R.color.system_accent2_900);
+            int color = mContext.getColor(R.color.material_dynamic_secondary10);
             appIconView.setColorFilter(color);
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
index e1ff110..1d1a230 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
@@ -150,7 +150,7 @@
 
     private val themeText = com.android.settingslib.Utils.getColorAttr(context,
             com.android.internal.R.attr.textColorPrimary).defaultColor
-    private val bgColor = context.getColor(android.R.color.system_accent2_50)
+    private val bgColor = context.getColor(R.color.material_dynamic_secondary95)
 
     // Internal listeners are part of the internal pipeline. External listeners (those registered
     // with [MediaDeviceManager.addListener]) receive events after they have propagated through
diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java
index 5e9bae9..d2142dc 100644
--- a/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java
+++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/DotIndicatorDecoration.java
@@ -48,8 +48,8 @@
                         R.dimen.card_carousel_dot_selected_radius);
         mDotMargin = context.getResources().getDimensionPixelSize(R.dimen.card_carousel_dot_margin);
 
-        mUnselectedColor = context.getColor(com.android.internal.R.color.system_neutral1_300);
-        mSelectedColor = context.getColor(com.android.internal.R.color.system_neutral1_0);
+        mUnselectedColor = context.getColor(R.color.material_dynamic_neutral70);
+        mSelectedColor = context.getColor(R.color.material_dynamic_neutral100);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java
index 9917777..92e7f2d 100644
--- a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java
@@ -278,7 +278,7 @@
 
     private Drawable getHomeIndicatorDrawable() {
         Drawable drawable = getDrawable(R.drawable.ic_close);
-        drawable.setTint(getColor(com.android.internal.R.color.system_neutral1_300));
+        drawable.setTint(getColor(R.color.material_dynamic_neutral70));
         return drawable;
     }
 }