Loading core/java/android/app/Notification.java +4 −8 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.app.admin.DevicePolicyResources.Drawables.WORK_PROFILE_ICO import static android.app.admin.DevicePolicyResources.UNDEFINED; import static android.graphics.drawable.Icon.TYPE_URI; import static android.graphics.drawable.Icon.TYPE_URI_ADAPTIVE_BITMAP; import static android.app.Flags.evenlyDividedCallStyleActionLayout; import static java.util.Objects.requireNonNull; Loading Loading @@ -5954,7 +5955,7 @@ public class Notification implements Parcelable // there is enough space to do so (and fall back to the left edge if not). big.setInt(R.id.actions, "setCollapsibleIndentDimen", R.dimen.call_notification_collapsible_indent); if (CallStyle.USE_NEW_ACTION_LAYOUT) { if (evenlyDividedCallStyleActionLayout()) { if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { Log.d(TAG, "setting evenly divided mode on action list"); } Loading Loading @@ -6436,7 +6437,7 @@ public class Notification implements Parcelable title = ContrastColorUtil.ensureColorSpanContrast(title, buttonFillColor); } final CharSequence label = ensureColorSpanContrast(title, p); if (p.mCallStyleActions && CallStyle.USE_NEW_ACTION_LAYOUT) { if (p.mCallStyleActions && evenlyDividedCallStyleActionLayout()) { if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { Log.d(TAG, "new action layout enabled, gluing instead of setting text"); } Loading @@ -6460,7 +6461,7 @@ public class Notification implements Parcelable button.setColorStateList(R.id.action0, "setButtonBackground", ColorStateList.valueOf(buttonFillColor)); if (p.mCallStyleActions) { if (CallStyle.USE_NEW_ACTION_LAYOUT) { if (evenlyDividedCallStyleActionLayout()) { if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { Log.d(TAG, "new action layout enabled, gluing instead of setting icon"); } Loading Loading @@ -9594,11 +9595,6 @@ public class Notification implements Parcelable * </pre> */ public static class CallStyle extends Style { /** * @hide */ public static final boolean USE_NEW_ACTION_LAYOUT = false; /** * @hide */ Loading core/java/android/app/notification.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -57,3 +57,13 @@ flag { description: "This flag enables the API to allow setting VibrationEffect for NotificationChannels" bug: "241732519" } flag { name: "evenly_divided_call_style_action_layout" namespace: "systemui" description: "Evenly divides horizontal space for action buttons in CallStyle notifications." bug: "268733030" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file core/java/com/android/internal/widget/EmphasizedNotificationButton.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package com.android.internal.widget; import static android.app.Flags.evenlyDividedCallStyleActionLayout; import static android.app.Notification.CallStyle.DEBUG_NEW_ACTION_LAYOUT; import static android.app.Notification.CallStyle.USE_NEW_ACTION_LAYOUT; import static android.text.style.DynamicDrawableSpan.ALIGN_CENTER; import android.annotation.NonNull; Loading Loading @@ -166,7 +166,7 @@ public class EmphasizedNotificationButton extends Button { } private void setIconToGlue(@Nullable Drawable icon) { if (!USE_NEW_ACTION_LAYOUT) { if (!evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "glueIcon: new action layout disabled; doing nothing"); return; } Loading Loading @@ -207,7 +207,7 @@ public class EmphasizedNotificationButton extends Button { } private void setLabelToGlue(@Nullable CharSequence label) { if (!USE_NEW_ACTION_LAYOUT) { if (!evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "glueLabel: new action layout disabled; doing nothing"); return; } Loading Loading @@ -255,7 +255,7 @@ public class EmphasizedNotificationButton extends Button { return; } if (!USE_NEW_ACTION_LAYOUT) { if (!evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "glueIconAndLabelIfNeeded: new action layout disabled; doing nothing"); return; } Loading core/java/com/android/internal/widget/NotificationActionListLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.internal.widget; import static android.app.Notification.CallStyle.DEBUG_NEW_ACTION_LAYOUT; import static android.app.Notification.CallStyle.USE_NEW_ACTION_LAYOUT; import static android.app.Flags.evenlyDividedCallStyleActionLayout; import android.annotation.DimenRes; import android.app.Notification; Loading Loading @@ -410,7 +410,7 @@ public class NotificationActionListLayout extends LinearLayout { */ @RemotableViewMethod public void setEvenlyDividedMode(boolean evenlyDividedMode) { if (evenlyDividedMode && !USE_NEW_ACTION_LAYOUT) { if (evenlyDividedMode && !evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "setEvenlyDividedMode(true) called with new action layout disabled; " + "leaving evenly divided mode disabled"); return; Loading Loading
core/java/android/app/Notification.java +4 −8 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.app.admin.DevicePolicyResources.Drawables.WORK_PROFILE_ICO import static android.app.admin.DevicePolicyResources.UNDEFINED; import static android.graphics.drawable.Icon.TYPE_URI; import static android.graphics.drawable.Icon.TYPE_URI_ADAPTIVE_BITMAP; import static android.app.Flags.evenlyDividedCallStyleActionLayout; import static java.util.Objects.requireNonNull; Loading Loading @@ -5954,7 +5955,7 @@ public class Notification implements Parcelable // there is enough space to do so (and fall back to the left edge if not). big.setInt(R.id.actions, "setCollapsibleIndentDimen", R.dimen.call_notification_collapsible_indent); if (CallStyle.USE_NEW_ACTION_LAYOUT) { if (evenlyDividedCallStyleActionLayout()) { if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { Log.d(TAG, "setting evenly divided mode on action list"); } Loading Loading @@ -6436,7 +6437,7 @@ public class Notification implements Parcelable title = ContrastColorUtil.ensureColorSpanContrast(title, buttonFillColor); } final CharSequence label = ensureColorSpanContrast(title, p); if (p.mCallStyleActions && CallStyle.USE_NEW_ACTION_LAYOUT) { if (p.mCallStyleActions && evenlyDividedCallStyleActionLayout()) { if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { Log.d(TAG, "new action layout enabled, gluing instead of setting text"); } Loading @@ -6460,7 +6461,7 @@ public class Notification implements Parcelable button.setColorStateList(R.id.action0, "setButtonBackground", ColorStateList.valueOf(buttonFillColor)); if (p.mCallStyleActions) { if (CallStyle.USE_NEW_ACTION_LAYOUT) { if (evenlyDividedCallStyleActionLayout()) { if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { Log.d(TAG, "new action layout enabled, gluing instead of setting icon"); } Loading Loading @@ -9594,11 +9595,6 @@ public class Notification implements Parcelable * </pre> */ public static class CallStyle extends Style { /** * @hide */ public static final boolean USE_NEW_ACTION_LAYOUT = false; /** * @hide */ Loading
core/java/android/app/notification.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -57,3 +57,13 @@ flag { description: "This flag enables the API to allow setting VibrationEffect for NotificationChannels" bug: "241732519" } flag { name: "evenly_divided_call_style_action_layout" namespace: "systemui" description: "Evenly divides horizontal space for action buttons in CallStyle notifications." bug: "268733030" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file
core/java/com/android/internal/widget/EmphasizedNotificationButton.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package com.android.internal.widget; import static android.app.Flags.evenlyDividedCallStyleActionLayout; import static android.app.Notification.CallStyle.DEBUG_NEW_ACTION_LAYOUT; import static android.app.Notification.CallStyle.USE_NEW_ACTION_LAYOUT; import static android.text.style.DynamicDrawableSpan.ALIGN_CENTER; import android.annotation.NonNull; Loading Loading @@ -166,7 +166,7 @@ public class EmphasizedNotificationButton extends Button { } private void setIconToGlue(@Nullable Drawable icon) { if (!USE_NEW_ACTION_LAYOUT) { if (!evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "glueIcon: new action layout disabled; doing nothing"); return; } Loading Loading @@ -207,7 +207,7 @@ public class EmphasizedNotificationButton extends Button { } private void setLabelToGlue(@Nullable CharSequence label) { if (!USE_NEW_ACTION_LAYOUT) { if (!evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "glueLabel: new action layout disabled; doing nothing"); return; } Loading Loading @@ -255,7 +255,7 @@ public class EmphasizedNotificationButton extends Button { return; } if (!USE_NEW_ACTION_LAYOUT) { if (!evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "glueIconAndLabelIfNeeded: new action layout disabled; doing nothing"); return; } Loading
core/java/com/android/internal/widget/NotificationActionListLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.internal.widget; import static android.app.Notification.CallStyle.DEBUG_NEW_ACTION_LAYOUT; import static android.app.Notification.CallStyle.USE_NEW_ACTION_LAYOUT; import static android.app.Flags.evenlyDividedCallStyleActionLayout; import android.annotation.DimenRes; import android.app.Notification; Loading Loading @@ -410,7 +410,7 @@ public class NotificationActionListLayout extends LinearLayout { */ @RemotableViewMethod public void setEvenlyDividedMode(boolean evenlyDividedMode) { if (evenlyDividedMode && !USE_NEW_ACTION_LAYOUT) { if (evenlyDividedMode && !evenlyDividedCallStyleActionLayout()) { Log.e(TAG, "setEvenlyDividedMode(true) called with new action layout disabled; " + "leaving evenly divided mode disabled"); return; Loading