Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationActivityStarter.java +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification; import android.content.Intent; import android.service.notification.StatusBarNotification; import android.view.View; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading @@ -29,7 +28,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow */ public interface NotificationActivityStarter { /** Called when the user clicks on the surface of a notification. */ void onNotificationClicked(StatusBarNotification sbn, ExpandableNotificationRow row); void onNotificationClicked(NotificationEntry entry, ExpandableNotificationRow row); /** Called when the user clicks on a button in the notification guts which fires an intent. */ void startNotificationGutsIntent(Intent intent, int appUid, Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public final class NotificationClicker implements View.OnClickListener { mBubblesOptional.get().collapseStack(); } mNotificationActivityStarter.onNotificationClicked(entry.getSbn(), row); mNotificationActivityStarter.onNotificationClicked(entry, row); } private boolean isMenuVisible(ExpandableNotificationRow row) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClickerLogger.kt +5 −5 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class NotificationClickerLogger @Inject constructor( ) { fun logOnClick(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey str2 = entry.ranking.channel.id }, { "CLICK $str1 (channel=$str2)" Loading @@ -36,7 +36,7 @@ class NotificationClickerLogger @Inject constructor( fun logMenuVisible(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; menu is visible" }) Loading @@ -44,7 +44,7 @@ class NotificationClickerLogger @Inject constructor( fun logParentMenuVisible(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; parent menu is visible" }) Loading @@ -52,7 +52,7 @@ class NotificationClickerLogger @Inject constructor( fun logChildrenExpanded(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; children are expanded" }) Loading @@ -60,7 +60,7 @@ class NotificationClickerLogger @Inject constructor( fun logGutsExposed(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; guts are exposed" }) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +10 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,8 @@ import android.widget.ImageView; import com.android.internal.util.ContrastColorUtil; import com.android.systemui.R; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.ListEntry; import com.android.systemui.util.Compile; /** * A util class for various reusable functions Loading Loading @@ -74,13 +75,19 @@ public class NotificationUtils { return (int) (dimensionPixelSize * factor); } private static final boolean INCLUDE_HASH_CODE_IN_LIST_ENTRY_LOG_KEY = false; /** Get the notification key, reformatted for logging, for the (optional) entry */ public static String logKey(NotificationEntry entry) { public static String logKey(ListEntry entry) { if (entry == null) { return "null"; } if (Compile.IS_DEBUG && INCLUDE_HASH_CODE_IN_LIST_ENTRY_LOG_KEY) { return logKey(entry.getKey()) + "@" + Integer.toHexString(entry.hashCode()); } else { return logKey(entry.getKey()); } } /** Removes newlines from the notification key to prettify apps that have these in the tag */ public static String logKey(String key) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotifActivityLaunchEventsModule.java→packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.kt +31 −0 Original line number Diff line number Diff line Loading @@ -11,20 +11,21 @@ * 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. * limitations under the License */ package com.android.systemui.statusbar.phone; package com.android.systemui.statusbar.notification import com.android.systemui.dagger.SysUISingleton; import android.service.notification.StatusBarNotification import com.android.systemui.statusbar.notification.collection.ListEntry import dagger.Binds; import dagger.Module; /** Get the notification key, reformatted for logging, for the (optional) entry */ val ListEntry?.logKey: String? get() = this?.let { NotificationUtils.logKey(it) } /** Provides a {@link NotifActivityLaunchEvents} in {@link SysUISingleton} scope. */ @Module public abstract class NotifActivityLaunchEventsModule { @Binds abstract NotifActivityLaunchEvents bindLaunchEvents( StatusBarNotificationActivityStarter.LaunchEventsEmitter impl); } /** Get the notification key, reformatted for logging, for the (optional) sbn */ val StatusBarNotification?.logKey: String? get() = this?.key?.let { NotificationUtils.logKey(it) } /** Removes newlines from the notification key to prettify apps that have these in the tag */ fun logKey(key: String?): String? = NotificationUtils.logKey(key) No newline at end of file Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationActivityStarter.java +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification; import android.content.Intent; import android.service.notification.StatusBarNotification; import android.view.View; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading @@ -29,7 +28,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow */ public interface NotificationActivityStarter { /** Called when the user clicks on the surface of a notification. */ void onNotificationClicked(StatusBarNotification sbn, ExpandableNotificationRow row); void onNotificationClicked(NotificationEntry entry, ExpandableNotificationRow row); /** Called when the user clicks on a button in the notification guts which fires an intent. */ void startNotificationGutsIntent(Intent intent, int appUid, Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public final class NotificationClicker implements View.OnClickListener { mBubblesOptional.get().collapseStack(); } mNotificationActivityStarter.onNotificationClicked(entry.getSbn(), row); mNotificationActivityStarter.onNotificationClicked(entry, row); } private boolean isMenuVisible(ExpandableNotificationRow row) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClickerLogger.kt +5 −5 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class NotificationClickerLogger @Inject constructor( ) { fun logOnClick(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey str2 = entry.ranking.channel.id }, { "CLICK $str1 (channel=$str2)" Loading @@ -36,7 +36,7 @@ class NotificationClickerLogger @Inject constructor( fun logMenuVisible(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; menu is visible" }) Loading @@ -44,7 +44,7 @@ class NotificationClickerLogger @Inject constructor( fun logParentMenuVisible(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; parent menu is visible" }) Loading @@ -52,7 +52,7 @@ class NotificationClickerLogger @Inject constructor( fun logChildrenExpanded(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; children are expanded" }) Loading @@ -60,7 +60,7 @@ class NotificationClickerLogger @Inject constructor( fun logGutsExposed(entry: NotificationEntry) { buffer.log(TAG, LogLevel.DEBUG, { str1 = entry.key str1 = entry.logKey }, { "Ignoring click on $str1; guts are exposed" }) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +10 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,8 @@ import android.widget.ImageView; import com.android.internal.util.ContrastColorUtil; import com.android.systemui.R; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.ListEntry; import com.android.systemui.util.Compile; /** * A util class for various reusable functions Loading Loading @@ -74,13 +75,19 @@ public class NotificationUtils { return (int) (dimensionPixelSize * factor); } private static final boolean INCLUDE_HASH_CODE_IN_LIST_ENTRY_LOG_KEY = false; /** Get the notification key, reformatted for logging, for the (optional) entry */ public static String logKey(NotificationEntry entry) { public static String logKey(ListEntry entry) { if (entry == null) { return "null"; } if (Compile.IS_DEBUG && INCLUDE_HASH_CODE_IN_LIST_ENTRY_LOG_KEY) { return logKey(entry.getKey()) + "@" + Integer.toHexString(entry.hashCode()); } else { return logKey(entry.getKey()); } } /** Removes newlines from the notification key to prettify apps that have these in the tag */ public static String logKey(String key) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotifActivityLaunchEventsModule.java→packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.kt +31 −0 Original line number Diff line number Diff line Loading @@ -11,20 +11,21 @@ * 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. * limitations under the License */ package com.android.systemui.statusbar.phone; package com.android.systemui.statusbar.notification import com.android.systemui.dagger.SysUISingleton; import android.service.notification.StatusBarNotification import com.android.systemui.statusbar.notification.collection.ListEntry import dagger.Binds; import dagger.Module; /** Get the notification key, reformatted for logging, for the (optional) entry */ val ListEntry?.logKey: String? get() = this?.let { NotificationUtils.logKey(it) } /** Provides a {@link NotifActivityLaunchEvents} in {@link SysUISingleton} scope. */ @Module public abstract class NotifActivityLaunchEventsModule { @Binds abstract NotifActivityLaunchEvents bindLaunchEvents( StatusBarNotificationActivityStarter.LaunchEventsEmitter impl); } /** Get the notification key, reformatted for logging, for the (optional) sbn */ val StatusBarNotification?.logKey: String? get() = this?.key?.let { NotificationUtils.logKey(it) } /** Removes newlines from the notification key to prettify apps that have these in the tag */ fun logKey(key: String?): String? = NotificationUtils.logKey(key) No newline at end of file