diff options
| author | Hui Yu <huiyu@google.com> | 2020-03-16 18:56:21 -0700 |
|---|---|---|
| committer | Hui Yu <huiyu@google.com> | 2020-03-21 08:36:54 -0700 |
| commit | 3dc45fbc57c664539e97bc3031337aeb9643a90e (patch) | |
| tree | 2b5b2581eb96870bbcfdd77c381b2b75980331d0 /core/java/android/appwidget/AppWidgetManager.java | |
| parent | 4846c5e3a95d4221f3667d62110a717dd9796d9b (diff) | |
Update AppOps & UsageStats when app widget tapped.
When the app widget on the launcher is tapped on:
1. Update AppOps. AppOps treats the underlying app as foreground so the app can get while-in-use
permission.
2. Report a USER_INTERACTION event to UsageStats so UsageStats can
update mLastTimeUsed and mLastTimeVisible of this package.
Bug: 149043079
Test: manual test, tapped on a widget.
Change-Id: Ic8c91190881cf5dcf89f0f72cfd410b0c2e86bf6
Diffstat (limited to 'core/java/android/appwidget/AppWidgetManager.java')
| -rw-r--r-- | core/java/android/appwidget/AppWidgetManager.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java index 0d461f5fa32c..844128758d7c 100644 --- a/core/java/android/appwidget/AppWidgetManager.java +++ b/core/java/android/appwidget/AppWidgetManager.java @@ -1240,4 +1240,18 @@ public class AppWidgetManager { throw e.rethrowFromSystemServer(); } } + + /** + * Note an app widget is tapped on. + * @param uid App UID. + * @param packageName App package name. + * @hide + */ + public void noteAppWidgetTapped(int uid, @NonNull String packageName) { + try { + mService.noteAppWidgetTapped(uid, packageName); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } } |
