Loading core/java/android/os/flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -308,6 +308,13 @@ flag { } } flag { name: "material_default_user_icon" namespace: "systemui" description: "Shows the material themed default user icon." bug: "424367031" } flag { name: "material_motion_tokens" namespace: "systemui" Loading core/java/com/android/internal/util/UserIcons.java +19 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Canvas; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.os.Flags; import android.os.UserHandle; import com.android.internal.R; Loading Loading @@ -94,9 +95,9 @@ public class UserIcons { * @param color the color used for the icon */ public static Drawable getDefaultUserIconInColor(Resources resources, @ColorInt int color) { Drawable icon = resources.getDrawable(R.drawable.ic_account_circle, null).mutate(); // Return icon as is if it's already styled by the overlay. Drawable icon = getBaseDefaultUserIcon(resources); if (icon instanceof LayerDrawable) { // Return icon as is if it's already styled by the overlay. return icon; } icon.setColorFilter(color, Mode.SRC_IN); Loading @@ -104,6 +105,22 @@ public class UserIcons { return icon; } /** * Returns the base default user icon drawable. * * <p>The specific drawable returned depends on the state of the * android.os.material_default_user_icon AConfig flag. * * @param resources resources object to fetch the user icon */ public static Drawable getBaseDefaultUserIcon(Resources resources) { if (Flags.materialDefaultUserIcon()) { return resources.getDrawable(R.drawable.material_ic_account_circle, null).mutate(); } return resources.getDrawable(R.drawable.ic_account_circle, null).mutate(); } /** * Returns an array containing colors to be used for default user icons. */ Loading core/res/res/drawable/material_ic_account_circle.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2025 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. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/background"> <shape android:shape="oval"> <solid android:color="@*android:color/materialColorSurfaceContainer" /> <size android:width="190dp" android:height="190dp" /> </shape> </item> <item android:id="@+id/user_icon" android:drawable="@drawable/material_ic_account_circle_user" android:gravity="center" android:width="114dp" android:height="114dp"/> </layer-list> core/res/res/drawable/material_ic_account_circle_user.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2025 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="48dp" android:height="48dp" android:viewportWidth="960" android:viewportHeight="960"> <path android:fillColor="@*android:color/materialColorOnSurfaceVariant" android:pathData="M480,479Q414,479 372,437Q330,395 330,329Q330,263 372,221Q414,179 480,179Q546,179 588,221Q630,263 630,329Q630,395 588,437Q546,479 480,479ZM160,740L160,706Q160,668 179,641Q198,614 228,600Q295,570 356.5,555Q418,540 480,540Q542,540 603,555.5Q664,571 731,600Q762,614 781,641Q800,668 800,706L800,740Q800,765 782.5,782.5Q765,800 740,800L220,800Q195,800 177.5,782.5Q160,765 160,740Z"/> </vector> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1574,6 +1574,7 @@ <java-symbol type="drawable" name="ic_feedback_downrank" /> <java-symbol type="drawable" name="ic_account_circle" /> <java-symbol type="drawable" name="material_ic_account_circle" /> <java-symbol type="drawable" name="ic_dual_screen" /> <java-symbol type="drawable" name="ic_thermostat" /> <java-symbol type="drawable" name="ic_security_privacy_notification_badge" /> Loading Loading
core/java/android/os/flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -308,6 +308,13 @@ flag { } } flag { name: "material_default_user_icon" namespace: "systemui" description: "Shows the material themed default user icon." bug: "424367031" } flag { name: "material_motion_tokens" namespace: "systemui" Loading
core/java/com/android/internal/util/UserIcons.java +19 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Canvas; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.os.Flags; import android.os.UserHandle; import com.android.internal.R; Loading Loading @@ -94,9 +95,9 @@ public class UserIcons { * @param color the color used for the icon */ public static Drawable getDefaultUserIconInColor(Resources resources, @ColorInt int color) { Drawable icon = resources.getDrawable(R.drawable.ic_account_circle, null).mutate(); // Return icon as is if it's already styled by the overlay. Drawable icon = getBaseDefaultUserIcon(resources); if (icon instanceof LayerDrawable) { // Return icon as is if it's already styled by the overlay. return icon; } icon.setColorFilter(color, Mode.SRC_IN); Loading @@ -104,6 +105,22 @@ public class UserIcons { return icon; } /** * Returns the base default user icon drawable. * * <p>The specific drawable returned depends on the state of the * android.os.material_default_user_icon AConfig flag. * * @param resources resources object to fetch the user icon */ public static Drawable getBaseDefaultUserIcon(Resources resources) { if (Flags.materialDefaultUserIcon()) { return resources.getDrawable(R.drawable.material_ic_account_circle, null).mutate(); } return resources.getDrawable(R.drawable.ic_account_circle, null).mutate(); } /** * Returns an array containing colors to be used for default user icons. */ Loading
core/res/res/drawable/material_ic_account_circle.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2025 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. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/background"> <shape android:shape="oval"> <solid android:color="@*android:color/materialColorSurfaceContainer" /> <size android:width="190dp" android:height="190dp" /> </shape> </item> <item android:id="@+id/user_icon" android:drawable="@drawable/material_ic_account_circle_user" android:gravity="center" android:width="114dp" android:height="114dp"/> </layer-list>
core/res/res/drawable/material_ic_account_circle_user.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2025 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="48dp" android:height="48dp" android:viewportWidth="960" android:viewportHeight="960"> <path android:fillColor="@*android:color/materialColorOnSurfaceVariant" android:pathData="M480,479Q414,479 372,437Q330,395 330,329Q330,263 372,221Q414,179 480,179Q546,179 588,221Q630,263 630,329Q630,395 588,437Q546,479 480,479ZM160,740L160,706Q160,668 179,641Q198,614 228,600Q295,570 356.5,555Q418,540 480,540Q542,540 603,555.5Q664,571 731,600Q762,614 781,641Q800,668 800,706L800,740Q800,765 782.5,782.5Q765,800 740,800L220,800Q195,800 177.5,782.5Q160,765 160,740Z"/> </vector>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1574,6 +1574,7 @@ <java-symbol type="drawable" name="ic_feedback_downrank" /> <java-symbol type="drawable" name="ic_account_circle" /> <java-symbol type="drawable" name="material_ic_account_circle" /> <java-symbol type="drawable" name="ic_dual_screen" /> <java-symbol type="drawable" name="ic_thermostat" /> <java-symbol type="drawable" name="ic_security_privacy_notification_badge" /> Loading