diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-02-13 22:46:52 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-02-13 22:46:52 +0000 |
| commit | 4e21e319cdf514b6c5a4f5a02eadd5ccd9445772 (patch) | |
| tree | b44117032db482180b4c8bd3abd7c7f0b5c93a54 /core/java/android | |
| parent | d2dc4ccad13be16015805d414ed1dd34537d7cfd (diff) | |
| parent | 0cbb6b63ee696f156499ed8873efc95602c01440 (diff) | |
Merge "Obfuscate visibility of notification-related events."
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/usage/UsageEvents.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/core/java/android/app/usage/UsageEvents.java b/core/java/android/app/usage/UsageEvents.java index ab71e73fd58c..0f999ad68a62 100644 --- a/core/java/android/app/usage/UsageEvents.java +++ b/core/java/android/app/usage/UsageEvents.java @@ -41,6 +41,43 @@ public final class UsageEvents implements Parcelable { /** @hide */ public static final String INSTANT_APP_CLASS_NAME = "android.instant_class"; + /** @hide */ + public static final String OBFUSCATED_NOTIFICATION_CHANNEL_ID = "unknown_channel_id"; + + /** + * Flag: indicates to not obfuscate or hide any usage event data when being queried. + * @hide + */ + public static final int SHOW_ALL_EVENT_DATA = 0x00000000; + + /** + * Flag: indicates to obfuscate package and class names for instant apps when querying usage + * events. + * @hide + */ + public static final int OBFUSCATE_INSTANT_APPS = 0x00000001; + + /** + * Flag: indicates to hide all {@link Event#SHORTCUT_INVOCATION} events when querying usage + * events. + * @hide + */ + public static final int HIDE_SHORTCUT_EVENTS = 0x00000002; + + /** + * Flag: indicates to obfuscate the notification channel id for all notification events, + * such as {@link Event#NOTIFICATION_SEEN} and {@link Event#NOTIFICATION_INTERRUPTION} events, + * when querying usage events. + * @hide + */ + public static final int OBFUSCATE_NOTIFICATION_EVENTS = 0x00000004; + + /** + * Flag: indicates to hide all {@link Event#LOCUS_ID_SET} events when querying usage events. + * @hide + */ + public static final int HIDE_LOCUS_EVENTS = 0x00000008; + /** * An event representing a state change for a component. */ @@ -627,6 +664,13 @@ public final class UsageEvents implements Parcelable { return ret; } + /** @hide */ + public Event getObfuscatedNotificationEvent() { + final Event ret = new Event(this); + ret.mNotificationChannelId = OBFUSCATED_NOTIFICATION_CHANNEL_ID; + return ret; + } + /** * Returns the locusId for this event if the event is of type {@link #LOCUS_ID_SET}, * otherwise it returns null. |
