diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/appwidget/AppWidgetManagerInternal.java | 14 | ||||
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 19 |
2 files changed, 33 insertions, 0 deletions
diff --git a/core/java/android/appwidget/AppWidgetManagerInternal.java b/core/java/android/appwidget/AppWidgetManagerInternal.java index 5694ca860453..266e33af0e22 100644 --- a/core/java/android/appwidget/AppWidgetManagerInternal.java +++ b/core/java/android/appwidget/AppWidgetManagerInternal.java @@ -19,6 +19,8 @@ package android.appwidget; import android.annotation.Nullable; import android.util.ArraySet; +import java.util.Set; + /** * App widget manager local system service interface. * @@ -42,4 +44,16 @@ public abstract class AppWidgetManagerInternal { * @param userId The user that is being unlocked. */ public abstract void unlockUser(int userId); + + /** + * Updates all widgets, applying changes to Runtime Resource Overlay affecting the specified + * target packages. + * + * @param packageNames The names of all target packages for which an overlay was modified + * @param userId The user for which overlay modifications occurred. + * @param updateFrameworkRes Whether or not an overlay affected the values of framework + * resources. + */ + public abstract void applyResourceOverlaysToWidgets(Set<String> packageNames, int userId, + boolean updateFrameworkRes); } diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index e827f0a31bfd..91fc5a56d979 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -5824,6 +5824,25 @@ public class RemoteViews implements Parcelable, Filter { return false; } + /** @hide */ + public void updateAppInfo(@NonNull ApplicationInfo info) { + if (mApplication != null && mApplication.sourceDir.equals(info.sourceDir)) { + // Overlay paths are generated against a particular version of an application. + // The overlays paths of a newly upgraded application are incompatible with the + // old version of the application. + mApplication = info; + } + if (hasSizedRemoteViews()) { + for (RemoteViews layout : mSizedRemoteViews) { + layout.updateAppInfo(info); + } + } + if (hasLandscapeAndPortraitLayouts()) { + mLandscape.updateAppInfo(info); + mPortrait.updateAppInfo(info); + } + } + private Context getContextForResources(Context context) { if (mApplication != null) { if (context.getUserId() == UserHandle.getUserId(mApplication.uid) |
