summaryrefslogtreecommitdiff
path: root/core/java/android/widget/RemoteViews.java
diff options
context:
space:
mode:
authorHui Yu <huiyu@google.com>2020-04-10 14:18:51 -0700
committerHui Yu <huiyu@google.com>2020-04-15 22:06:12 -0700
commit48032682297d848754ded3b157044bbc4e22db71 (patch)
tree7a708dcee8b4b6b761bace7cd89c2c17598439e5 /core/java/android/widget/RemoteViews.java
parent4d7fb0b4c24d1e3be98b824497edc207498a0a81 (diff)
Move noteAppWidgetTapped call into AppWidgetHostView.
RemoteViews is public API used out of scope of widget. The correct place to call noteAppWidgetTapped is in AppWidgetHostView. Fix: 153676411 Test: manual test, tap a widget, "adb shell dumpsys usagestats | grep USER_INTERACTION" to oberserve USER_INTERACTION event sent to UsageStas, "adb shell dumpsys appops | grep appWidgetVisible" to observer appWidgetVisible flag. Change-Id: Ic473211b91fd952dbb81b09b1e1568d6f69a0dd8
Diffstat (limited to 'core/java/android/widget/RemoteViews.java')
-rw-r--r--core/java/android/widget/RemoteViews.java13
1 files changed, 1 insertions, 12 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 4a27d3a0e71d..7f6c0d2077f1 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -29,7 +29,6 @@ import android.app.Application;
import android.app.PendingIntent;
import android.app.RemoteInput;
import android.appwidget.AppWidgetHostView;
-import android.appwidget.AppWidgetManager;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.ContextWrapper;
@@ -4131,18 +4130,8 @@ public class RemoteViews implements Parcelable, Filter {
// The NEW_TASK flags are applied through the activity options and not as a part of
// the call to startIntentSender() to ensure that they are consistently applied to
// both mutable and immutable PendingIntents.
- final IntentSender intentSender = pendingIntent.getIntentSender();
- final int uid = intentSender.getCreatorUid();
- final String packageName = intentSender.getCreatorPackage();
- if (uid != -1 && packageName != null) {
- final AppWidgetManager appWidgetManager =
- context.getSystemService(AppWidgetManager.class);
- if (appWidgetManager != null) {
- appWidgetManager.noteAppWidgetTapped(uid, packageName);
- }
- }
context.startIntentSender(
- intentSender, options.first,
+ pendingIntent.getIntentSender(), options.first,
0, 0, 0, options.second.toBundle());
} catch (IntentSender.SendIntentException e) {
Log.e(LOG_TAG, "Cannot send pending intent: ", e);