Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -57055,7 +57055,7 @@ package android.widget { method public int describeContents(); method public int getLayoutId(); method public String getPackage(); method public boolean onLoadClass(Class); method @Deprecated public boolean onLoadClass(Class); method public void reapply(android.content.Context, android.view.View); method public void removeAllViews(int); method public void setAccessibilityTraversalAfter(int, int); core/java/android/app/Notification.java +10 −0 Original line number Diff line number Diff line Loading @@ -10410,6 +10410,16 @@ public class Notification implements Parcelable p.recycle(); return brv; } /** * Override and return true, since {@link RemoteViews#onLoadClass(Class)} is not overridden. * * @see RemoteViews#shouldUseStaticFilter() */ @Override protected boolean shouldUseStaticFilter() { return true; } } /** Loading core/java/android/widget/RemoteViews.java +25 −2 Original line number Diff line number Diff line Loading @@ -201,6 +201,14 @@ public class RemoteViews implements Parcelable, Filter { */ public static final int FLAG_USE_LIGHT_BACKGROUND_LAYOUT = 4; /** * Used to restrict the views which can be inflated * * @see android.view.LayoutInflater.Filter#onLoadClass(java.lang.Class) */ private static final LayoutInflater.Filter INFLATER_FILTER = (clazz) -> clazz.isAnnotationPresent(RemoteViews.RemoteView.class); /** * Application that hosts the remote views. * Loading Loading @@ -3413,12 +3421,23 @@ public class RemoteViews implements Parcelable, Filter { // Clone inflater so we load resources from correct context and // we don't add a filter to the static version returned by getSystemService. inflater = inflater.cloneInContext(inflationContext); inflater.setFilter(this); inflater.setFilter(shouldUseStaticFilter() ? INFLATER_FILTER : this); View v = inflater.inflate(rv.getLayoutId(), parent, false); v.setTagInternal(R.id.widget_frame, rv.getLayoutId()); return v; } /** * A static filter is much lighter than RemoteViews itself. It's optimized here only for * RemoteVies class. Subclasses should always override this and return true if not overriding * {@link this#onLoadClass(Class)}. * * @hide */ protected boolean shouldUseStaticFilter() { return this.getClass().equals(RemoteViews.class); } /** * Implement this interface to receive a callback when * {@link #applyAsync} or {@link #reapplyAsync} is finished. Loading Loading @@ -3686,11 +3705,15 @@ public class RemoteViews implements Parcelable, Filter { return (mActions == null) ? 0 : mActions.size(); } /* (non-Javadoc) /** * Used to restrict the views which can be inflated * * @see android.view.LayoutInflater.Filter#onLoadClass(java.lang.Class) * @deprecated Used by system to enforce safe inflation of {@link RemoteViews}. Apps should not * override this method. Changing of this method will NOT affect the process where RemoteViews * is rendered. */ @Deprecated public boolean onLoadClass(Class clazz) { return clazz.isAnnotationPresent(RemoteView.class); } Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -57055,7 +57055,7 @@ package android.widget { method public int describeContents(); method public int getLayoutId(); method public String getPackage(); method public boolean onLoadClass(Class); method @Deprecated public boolean onLoadClass(Class); method public void reapply(android.content.Context, android.view.View); method public void removeAllViews(int); method public void setAccessibilityTraversalAfter(int, int);
core/java/android/app/Notification.java +10 −0 Original line number Diff line number Diff line Loading @@ -10410,6 +10410,16 @@ public class Notification implements Parcelable p.recycle(); return brv; } /** * Override and return true, since {@link RemoteViews#onLoadClass(Class)} is not overridden. * * @see RemoteViews#shouldUseStaticFilter() */ @Override protected boolean shouldUseStaticFilter() { return true; } } /** Loading
core/java/android/widget/RemoteViews.java +25 −2 Original line number Diff line number Diff line Loading @@ -201,6 +201,14 @@ public class RemoteViews implements Parcelable, Filter { */ public static final int FLAG_USE_LIGHT_BACKGROUND_LAYOUT = 4; /** * Used to restrict the views which can be inflated * * @see android.view.LayoutInflater.Filter#onLoadClass(java.lang.Class) */ private static final LayoutInflater.Filter INFLATER_FILTER = (clazz) -> clazz.isAnnotationPresent(RemoteViews.RemoteView.class); /** * Application that hosts the remote views. * Loading Loading @@ -3413,12 +3421,23 @@ public class RemoteViews implements Parcelable, Filter { // Clone inflater so we load resources from correct context and // we don't add a filter to the static version returned by getSystemService. inflater = inflater.cloneInContext(inflationContext); inflater.setFilter(this); inflater.setFilter(shouldUseStaticFilter() ? INFLATER_FILTER : this); View v = inflater.inflate(rv.getLayoutId(), parent, false); v.setTagInternal(R.id.widget_frame, rv.getLayoutId()); return v; } /** * A static filter is much lighter than RemoteViews itself. It's optimized here only for * RemoteVies class. Subclasses should always override this and return true if not overriding * {@link this#onLoadClass(Class)}. * * @hide */ protected boolean shouldUseStaticFilter() { return this.getClass().equals(RemoteViews.class); } /** * Implement this interface to receive a callback when * {@link #applyAsync} or {@link #reapplyAsync} is finished. Loading Loading @@ -3686,11 +3705,15 @@ public class RemoteViews implements Parcelable, Filter { return (mActions == null) ? 0 : mActions.size(); } /* (non-Javadoc) /** * Used to restrict the views which can be inflated * * @see android.view.LayoutInflater.Filter#onLoadClass(java.lang.Class) * @deprecated Used by system to enforce safe inflation of {@link RemoteViews}. Apps should not * override this method. Changing of this method will NOT affect the process where RemoteViews * is rendered. */ @Deprecated public boolean onLoadClass(Class clazz) { return clazz.isAnnotationPresent(RemoteView.class); } Loading