Loading core/java/android/widget/RemoteViews.java +25 −14 Original line number Diff line number Diff line Loading @@ -413,6 +413,30 @@ public class RemoteViews implements Parcelable, Filter { recalculateMemoryUsage(); } private static class RemoteViewsContextWrapper extends ContextWrapper { private final Context mContextForResources; RemoteViewsContextWrapper(Context context, Context contextForResources) { super(context); mContextForResources = contextForResources; } @Override public Resources getResources() { return mContextForResources.getResources(); } @Override public Resources.Theme getTheme() { return mContextForResources.getTheme(); } @Override public String getPackageName() { return mContextForResources.getPackageName(); } } private class SetEmptyView extends Action { int viewId; int emptyViewId; Loading Loading @@ -3240,20 +3264,7 @@ public class RemoteViews implements Parcelable, Filter { // still returns the current users userId so settings like data / time formats // are loaded without requiring cross user persmissions. final Context contextForResources = getContextForResources(context); Context inflationContext = new ContextWrapper(context) { @Override public Resources getResources() { return contextForResources.getResources(); } @Override public Resources.Theme getTheme() { return contextForResources.getTheme(); } @Override public String getPackageName() { return contextForResources.getPackageName(); } }; Context inflationContext = new RemoteViewsContextWrapper(context, contextForResources); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); Loading Loading
core/java/android/widget/RemoteViews.java +25 −14 Original line number Diff line number Diff line Loading @@ -413,6 +413,30 @@ public class RemoteViews implements Parcelable, Filter { recalculateMemoryUsage(); } private static class RemoteViewsContextWrapper extends ContextWrapper { private final Context mContextForResources; RemoteViewsContextWrapper(Context context, Context contextForResources) { super(context); mContextForResources = contextForResources; } @Override public Resources getResources() { return mContextForResources.getResources(); } @Override public Resources.Theme getTheme() { return mContextForResources.getTheme(); } @Override public String getPackageName() { return mContextForResources.getPackageName(); } } private class SetEmptyView extends Action { int viewId; int emptyViewId; Loading Loading @@ -3240,20 +3264,7 @@ public class RemoteViews implements Parcelable, Filter { // still returns the current users userId so settings like data / time formats // are loaded without requiring cross user persmissions. final Context contextForResources = getContextForResources(context); Context inflationContext = new ContextWrapper(context) { @Override public Resources getResources() { return contextForResources.getResources(); } @Override public Resources.Theme getTheme() { return contextForResources.getTheme(); } @Override public String getPackageName() { return contextForResources.getPackageName(); } }; Context inflationContext = new RemoteViewsContextWrapper(context, contextForResources); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); Loading