Loading packages/SystemUI/res/layout/ongoing_activity_chip.xml +6 −5 Original line number Diff line number Diff line Loading @@ -23,7 +23,8 @@ android:layout_gravity="center_vertical|start" android:layout_marginStart="5dp" > <!-- TODO(b/354930838): Fix these paddings for the new screen chips. --> <!-- TODO(b/332662551): Update this content description when this supports more than just phone calls. --> <com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer android:id="@+id/ongoing_activity_chip_background" android:layout_width="wrap_content" Loading @@ -31,8 +32,9 @@ android:layout_gravity="center_vertical" android:gravity="center" android:background="@drawable/ongoing_activity_chip_bg" android:paddingStart="@dimen/ongoing_activity_chip_side_padding_with_notif_icon" android:paddingEnd="@dimen/ongoing_activity_chip_side_padding_with_notif_icon" android:paddingStart="@dimen/ongoing_activity_chip_side_padding" android:paddingEnd="@dimen/ongoing_activity_chip_side_padding" android:contentDescription="@string/ongoing_phone_call_content_description" android:minWidth="@dimen/min_clickable_item_size" > Loading @@ -42,7 +44,6 @@ android:layout_width="@dimen/ongoing_activity_chip_icon_size" android:layout_height="@dimen/ongoing_activity_chip_icon_size" android:tint="?android:attr/colorPrimary" android:visibility="gone" /> <com.android.systemui.statusbar.chips.ui.view.ChipChronometer Loading @@ -51,7 +52,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:gravity="center|start" android:paddingEnd="@dimen/ongoing_activity_chip_text_end_padding_with_notif_icon" android:paddingStart="@dimen/ongoing_activity_chip_icon_text_padding" android:textAppearance="@android:style/TextAppearance.Material.Small" android:fontFamily="@*android:string/config_headlineFontFamily" android:textColor="?android:attr/colorPrimary" Loading packages/SystemUI/res/values/dimens.xml +0 −6 Original line number Diff line number Diff line Loading @@ -1727,15 +1727,9 @@ <!-- Ongoing activity chip --> <dimen name="ongoing_activity_chip_side_padding">12dp</dimen> <!-- The start padding to use on the activity chip if the icon comes from the notification's smallIcon field (the small notif icons embed their own padding, so the chip itself can have less padding) --> <dimen name="ongoing_activity_chip_side_padding_with_notif_icon">6dp</dimen> <dimen name="ongoing_activity_chip_icon_size">16dp</dimen> <!-- The size to use for the icon in the ongoing activity chip if the icon comes from the notification's smallIcon field --> <dimen name="ongoing_activity_chip_notif_icon_size">22dp</dimen> <!-- The padding between the icon and the text. --> <dimen name="ongoing_activity_chip_icon_text_padding">4dp</dimen> <dimen name="ongoing_activity_chip_text_end_padding_with_notif_icon">6dp</dimen> <dimen name="ongoing_activity_chip_corner_radius">28dp</dimen> <!-- Status bar user chip --> Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt +1 −11 Original line number Diff line number Diff line Loading @@ -123,8 +123,6 @@ constructor( // Construct the status bar icon view. val sbIcon = iconBuilder.createIconView(entry) sbIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE val sbChipIcon = iconBuilder.createIconView(entry) sbChipIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE // Construct the shelf icon view. val shelfIcon = iconBuilder.createIconView(entry) Loading @@ -141,17 +139,9 @@ constructor( try { setIcon(entry, normalIconDescriptor, sbIcon) setIcon(entry, normalIconDescriptor, sbChipIcon) setIcon(entry, sensitiveIconDescriptor, shelfIcon) setIcon(entry, sensitiveIconDescriptor, aodIcon) entry.icons = IconPack.buildPack( sbIcon, sbChipIcon, shelfIcon, aodIcon, entry.icons, ) entry.icons = IconPack.buildPack(sbIcon, shelfIcon, aodIcon, entry.icons) } catch (e: InflationException) { entry.icons = IconPack.buildEmptyPack(entry.icons) throw e Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java +2 −18 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ public final class IconPack { private final boolean mAreIconsAvailable; @Nullable private final StatusBarIconView mStatusBarIcon; @Nullable private final StatusBarIconView mStatusBarChipIcon; @Nullable private final StatusBarIconView mShelfIcon; @Nullable private final StatusBarIconView mAodIcon; Loading @@ -44,7 +43,7 @@ public final class IconPack { * haven't been inflated yet or there was an error while inflating them). */ public static IconPack buildEmptyPack(@Nullable IconPack fromSource) { return new IconPack(false, null, null, null, null, fromSource); return new IconPack(false, null, null, null, fromSource); } /** Loading @@ -52,24 +51,20 @@ public final class IconPack { */ public static IconPack buildPack( @NonNull StatusBarIconView statusBarIcon, @NonNull StatusBarIconView statusBarChipIcon, @NonNull StatusBarIconView shelfIcon, @NonNull StatusBarIconView aodIcon, @Nullable IconPack source) { return new IconPack( true, statusBarIcon, statusBarChipIcon, shelfIcon, aodIcon, source); return new IconPack(true, statusBarIcon, shelfIcon, aodIcon, source); } private IconPack( boolean areIconsAvailable, @Nullable StatusBarIconView statusBarIcon, @Nullable StatusBarIconView statusBarChipIcon, @Nullable StatusBarIconView shelfIcon, @Nullable StatusBarIconView aodIcon, @Nullable IconPack source) { mAreIconsAvailable = areIconsAvailable; mStatusBarIcon = statusBarIcon; mStatusBarChipIcon = statusBarChipIcon; mShelfIcon = shelfIcon; mAodIcon = aodIcon; if (source != null) { Loading @@ -83,17 +78,6 @@ public final class IconPack { return mStatusBarIcon; } /** * The version of the notification icon that appears inside a chip within the status bar. * * Separate from {@link #getStatusBarIcon()} so that we don't have to worry about detaching and * re-attaching the same view when the chip appears and hides. */ @Nullable public StatusBarIconView getStatusBarChipIcon() { return mStatusBarChipIcon; } /** * The version of the icon that appears in the "shelf" at the bottom of the notification shade. * In general, this icon also appears somewhere on the notification and is "sucked" into the Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +4 −56 Original line number Diff line number Diff line Loading @@ -25,12 +25,8 @@ import android.app.UidObserver import android.content.Context import android.util.Log import android.view.View import android.view.ViewGroup import android.widget.FrameLayout import androidx.annotation.IdRes import androidx.annotation.VisibleForTesting import com.android.internal.jank.InteractionJankMonitor import com.android.settingslib.Utils import com.android.systemui.CoreStartable import com.android.systemui.Dumpable import com.android.systemui.Flags Loading @@ -41,7 +37,6 @@ import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import com.android.systemui.statusbar.StatusBarIconView import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer import com.android.systemui.statusbar.chips.ui.view.ChipChronometer import com.android.systemui.statusbar.data.repository.StatusBarModeRepositoryStore Loading Loading @@ -119,7 +114,6 @@ constructor( Notification.EXTRA_CALL_TYPE, -1 ) == CALL_TYPE_ONGOING, entry.icons.statusBarChipIcon, statusBarSwipedAway = callNotificationInfo?.statusBarSwipedAway ?: false ) if (newOngoingCallInfo == callNotificationInfo) { Loading Loading @@ -162,7 +156,8 @@ constructor( fun setChipView(chipView: View) { tearDownChipView() this.chipView = chipView val backgroundView: ChipBackgroundContainer? = chipView.getBackgroundView() val backgroundView: ChipBackgroundContainer? = chipView.findViewById(R.id.ongoing_activity_chip_background) backgroundView?.maxHeightFetcher = { statusBarWindowController.statusBarHeight } if (hasOngoingCall()) { updateChip() Loading Loading @@ -241,8 +236,6 @@ constructor( timeView.setShouldHideText(true) timeView.stop() } updateChipIcon(currentCallNotificationInfo, currentChipView) updateChipClickListener() } Loading @@ -268,38 +261,6 @@ constructor( } } private fun updateChipIcon(callInfo: CallNotificationInfo, currentChipView: View) { val backgroundView = currentChipView.getBackgroundView() ?: return backgroundView.removeView(currentChipView.getIconView()) val iconView = callInfo.iconView ?: return with(iconView) { id = ICON_ID imageTintList = Utils.getColorAttr(context, android.R.attr.colorPrimary) // TODO(b/354930838): Update the content description to not include "phone". contentDescription = context.resources.getString(R.string.ongoing_phone_call_content_description) } val currentParent = iconView.parent as? ViewGroup // If we're reinflating the view, we may need to detach the icon view from the // old chip before we reattach it to the new one. // See also: NotificationIconContainerViewBinder#bindIcons. if (currentParent != null && currentParent != backgroundView) { currentParent.removeView(iconView) currentParent.removeTransientView(iconView) } backgroundView.addView(iconView, /* index= */ 0, generateIconLayoutParams()) } private fun generateIconLayoutParams(): FrameLayout.LayoutParams { return FrameLayout.LayoutParams(iconSize, iconSize) } private val iconSize: Int get() = context.resources.getDimensionPixelSize(R.dimen.ongoing_activity_chip_notif_icon_size) private fun updateChipClickListener() { if (Flags.statusBarScreenSharingChips()) { return Loading @@ -309,7 +270,8 @@ constructor( return } val currentChipView = chipView val backgroundView = currentChipView?.getBackgroundView() val backgroundView = currentChipView?.findViewById<View>(R.id.ongoing_activity_chip_background) val intent = callNotificationInfo?.intent if (currentChipView != null && backgroundView != null && intent != null) { currentChipView.setOnClickListener { Loading Loading @@ -362,14 +324,6 @@ constructor( return this.findViewById(R.id.ongoing_activity_chip_time) } private fun View.getBackgroundView(): ChipBackgroundContainer? { return this.findViewById(R.id.ongoing_activity_chip_background) } private fun View.getIconView(): View? { return this.findViewById(ICON_ID) } /** * If there's an active ongoing call, then we will force the status bar to always show, even if * the user is in immersive mode. However, we also want to give users the ability to swipe away Loading Loading @@ -399,8 +353,6 @@ constructor( val uid: Int, /** True if the call is currently ongoing (as opposed to incoming, screening, etc.). */ val isOngoing: Boolean, /** The view that contains the icon to display in the chip. */ val iconView: StatusBarIconView?, /** True if the user has swiped away the status bar while in this phone call. */ val statusBarSwipedAway: Boolean ) { Loading Loading @@ -485,10 +437,6 @@ constructor( } } } companion object { @IdRes private val ICON_ID = R.id.ongoing_activity_chip_icon } } private fun isCallNotification(entry: NotificationEntry): Boolean { Loading Loading
packages/SystemUI/res/layout/ongoing_activity_chip.xml +6 −5 Original line number Diff line number Diff line Loading @@ -23,7 +23,8 @@ android:layout_gravity="center_vertical|start" android:layout_marginStart="5dp" > <!-- TODO(b/354930838): Fix these paddings for the new screen chips. --> <!-- TODO(b/332662551): Update this content description when this supports more than just phone calls. --> <com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer android:id="@+id/ongoing_activity_chip_background" android:layout_width="wrap_content" Loading @@ -31,8 +32,9 @@ android:layout_gravity="center_vertical" android:gravity="center" android:background="@drawable/ongoing_activity_chip_bg" android:paddingStart="@dimen/ongoing_activity_chip_side_padding_with_notif_icon" android:paddingEnd="@dimen/ongoing_activity_chip_side_padding_with_notif_icon" android:paddingStart="@dimen/ongoing_activity_chip_side_padding" android:paddingEnd="@dimen/ongoing_activity_chip_side_padding" android:contentDescription="@string/ongoing_phone_call_content_description" android:minWidth="@dimen/min_clickable_item_size" > Loading @@ -42,7 +44,6 @@ android:layout_width="@dimen/ongoing_activity_chip_icon_size" android:layout_height="@dimen/ongoing_activity_chip_icon_size" android:tint="?android:attr/colorPrimary" android:visibility="gone" /> <com.android.systemui.statusbar.chips.ui.view.ChipChronometer Loading @@ -51,7 +52,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:gravity="center|start" android:paddingEnd="@dimen/ongoing_activity_chip_text_end_padding_with_notif_icon" android:paddingStart="@dimen/ongoing_activity_chip_icon_text_padding" android:textAppearance="@android:style/TextAppearance.Material.Small" android:fontFamily="@*android:string/config_headlineFontFamily" android:textColor="?android:attr/colorPrimary" Loading
packages/SystemUI/res/values/dimens.xml +0 −6 Original line number Diff line number Diff line Loading @@ -1727,15 +1727,9 @@ <!-- Ongoing activity chip --> <dimen name="ongoing_activity_chip_side_padding">12dp</dimen> <!-- The start padding to use on the activity chip if the icon comes from the notification's smallIcon field (the small notif icons embed their own padding, so the chip itself can have less padding) --> <dimen name="ongoing_activity_chip_side_padding_with_notif_icon">6dp</dimen> <dimen name="ongoing_activity_chip_icon_size">16dp</dimen> <!-- The size to use for the icon in the ongoing activity chip if the icon comes from the notification's smallIcon field --> <dimen name="ongoing_activity_chip_notif_icon_size">22dp</dimen> <!-- The padding between the icon and the text. --> <dimen name="ongoing_activity_chip_icon_text_padding">4dp</dimen> <dimen name="ongoing_activity_chip_text_end_padding_with_notif_icon">6dp</dimen> <dimen name="ongoing_activity_chip_corner_radius">28dp</dimen> <!-- Status bar user chip --> Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt +1 −11 Original line number Diff line number Diff line Loading @@ -123,8 +123,6 @@ constructor( // Construct the status bar icon view. val sbIcon = iconBuilder.createIconView(entry) sbIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE val sbChipIcon = iconBuilder.createIconView(entry) sbChipIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE // Construct the shelf icon view. val shelfIcon = iconBuilder.createIconView(entry) Loading @@ -141,17 +139,9 @@ constructor( try { setIcon(entry, normalIconDescriptor, sbIcon) setIcon(entry, normalIconDescriptor, sbChipIcon) setIcon(entry, sensitiveIconDescriptor, shelfIcon) setIcon(entry, sensitiveIconDescriptor, aodIcon) entry.icons = IconPack.buildPack( sbIcon, sbChipIcon, shelfIcon, aodIcon, entry.icons, ) entry.icons = IconPack.buildPack(sbIcon, shelfIcon, aodIcon, entry.icons) } catch (e: InflationException) { entry.icons = IconPack.buildEmptyPack(entry.icons) throw e Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java +2 −18 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ public final class IconPack { private final boolean mAreIconsAvailable; @Nullable private final StatusBarIconView mStatusBarIcon; @Nullable private final StatusBarIconView mStatusBarChipIcon; @Nullable private final StatusBarIconView mShelfIcon; @Nullable private final StatusBarIconView mAodIcon; Loading @@ -44,7 +43,7 @@ public final class IconPack { * haven't been inflated yet or there was an error while inflating them). */ public static IconPack buildEmptyPack(@Nullable IconPack fromSource) { return new IconPack(false, null, null, null, null, fromSource); return new IconPack(false, null, null, null, fromSource); } /** Loading @@ -52,24 +51,20 @@ public final class IconPack { */ public static IconPack buildPack( @NonNull StatusBarIconView statusBarIcon, @NonNull StatusBarIconView statusBarChipIcon, @NonNull StatusBarIconView shelfIcon, @NonNull StatusBarIconView aodIcon, @Nullable IconPack source) { return new IconPack( true, statusBarIcon, statusBarChipIcon, shelfIcon, aodIcon, source); return new IconPack(true, statusBarIcon, shelfIcon, aodIcon, source); } private IconPack( boolean areIconsAvailable, @Nullable StatusBarIconView statusBarIcon, @Nullable StatusBarIconView statusBarChipIcon, @Nullable StatusBarIconView shelfIcon, @Nullable StatusBarIconView aodIcon, @Nullable IconPack source) { mAreIconsAvailable = areIconsAvailable; mStatusBarIcon = statusBarIcon; mStatusBarChipIcon = statusBarChipIcon; mShelfIcon = shelfIcon; mAodIcon = aodIcon; if (source != null) { Loading @@ -83,17 +78,6 @@ public final class IconPack { return mStatusBarIcon; } /** * The version of the notification icon that appears inside a chip within the status bar. * * Separate from {@link #getStatusBarIcon()} so that we don't have to worry about detaching and * re-attaching the same view when the chip appears and hides. */ @Nullable public StatusBarIconView getStatusBarChipIcon() { return mStatusBarChipIcon; } /** * The version of the icon that appears in the "shelf" at the bottom of the notification shade. * In general, this icon also appears somewhere on the notification and is "sucked" into the Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +4 −56 Original line number Diff line number Diff line Loading @@ -25,12 +25,8 @@ import android.app.UidObserver import android.content.Context import android.util.Log import android.view.View import android.view.ViewGroup import android.widget.FrameLayout import androidx.annotation.IdRes import androidx.annotation.VisibleForTesting import com.android.internal.jank.InteractionJankMonitor import com.android.settingslib.Utils import com.android.systemui.CoreStartable import com.android.systemui.Dumpable import com.android.systemui.Flags Loading @@ -41,7 +37,6 @@ import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import com.android.systemui.statusbar.StatusBarIconView import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer import com.android.systemui.statusbar.chips.ui.view.ChipChronometer import com.android.systemui.statusbar.data.repository.StatusBarModeRepositoryStore Loading Loading @@ -119,7 +114,6 @@ constructor( Notification.EXTRA_CALL_TYPE, -1 ) == CALL_TYPE_ONGOING, entry.icons.statusBarChipIcon, statusBarSwipedAway = callNotificationInfo?.statusBarSwipedAway ?: false ) if (newOngoingCallInfo == callNotificationInfo) { Loading Loading @@ -162,7 +156,8 @@ constructor( fun setChipView(chipView: View) { tearDownChipView() this.chipView = chipView val backgroundView: ChipBackgroundContainer? = chipView.getBackgroundView() val backgroundView: ChipBackgroundContainer? = chipView.findViewById(R.id.ongoing_activity_chip_background) backgroundView?.maxHeightFetcher = { statusBarWindowController.statusBarHeight } if (hasOngoingCall()) { updateChip() Loading Loading @@ -241,8 +236,6 @@ constructor( timeView.setShouldHideText(true) timeView.stop() } updateChipIcon(currentCallNotificationInfo, currentChipView) updateChipClickListener() } Loading @@ -268,38 +261,6 @@ constructor( } } private fun updateChipIcon(callInfo: CallNotificationInfo, currentChipView: View) { val backgroundView = currentChipView.getBackgroundView() ?: return backgroundView.removeView(currentChipView.getIconView()) val iconView = callInfo.iconView ?: return with(iconView) { id = ICON_ID imageTintList = Utils.getColorAttr(context, android.R.attr.colorPrimary) // TODO(b/354930838): Update the content description to not include "phone". contentDescription = context.resources.getString(R.string.ongoing_phone_call_content_description) } val currentParent = iconView.parent as? ViewGroup // If we're reinflating the view, we may need to detach the icon view from the // old chip before we reattach it to the new one. // See also: NotificationIconContainerViewBinder#bindIcons. if (currentParent != null && currentParent != backgroundView) { currentParent.removeView(iconView) currentParent.removeTransientView(iconView) } backgroundView.addView(iconView, /* index= */ 0, generateIconLayoutParams()) } private fun generateIconLayoutParams(): FrameLayout.LayoutParams { return FrameLayout.LayoutParams(iconSize, iconSize) } private val iconSize: Int get() = context.resources.getDimensionPixelSize(R.dimen.ongoing_activity_chip_notif_icon_size) private fun updateChipClickListener() { if (Flags.statusBarScreenSharingChips()) { return Loading @@ -309,7 +270,8 @@ constructor( return } val currentChipView = chipView val backgroundView = currentChipView?.getBackgroundView() val backgroundView = currentChipView?.findViewById<View>(R.id.ongoing_activity_chip_background) val intent = callNotificationInfo?.intent if (currentChipView != null && backgroundView != null && intent != null) { currentChipView.setOnClickListener { Loading Loading @@ -362,14 +324,6 @@ constructor( return this.findViewById(R.id.ongoing_activity_chip_time) } private fun View.getBackgroundView(): ChipBackgroundContainer? { return this.findViewById(R.id.ongoing_activity_chip_background) } private fun View.getIconView(): View? { return this.findViewById(ICON_ID) } /** * If there's an active ongoing call, then we will force the status bar to always show, even if * the user is in immersive mode. However, we also want to give users the ability to swipe away Loading Loading @@ -399,8 +353,6 @@ constructor( val uid: Int, /** True if the call is currently ongoing (as opposed to incoming, screening, etc.). */ val isOngoing: Boolean, /** The view that contains the icon to display in the chip. */ val iconView: StatusBarIconView?, /** True if the user has swiped away the status bar while in this phone call. */ val statusBarSwipedAway: Boolean ) { Loading Loading @@ -485,10 +437,6 @@ constructor( } } } companion object { @IdRes private val ICON_ID = R.id.ongoing_activity_chip_icon } } private fun isCallNotification(entry: NotificationEntry): Boolean { Loading