Loading core/java/android/widget/RemoteViews.java +16 −43 Original line number Diff line number Diff line Loading @@ -83,7 +83,6 @@ import android.os.Parcelable; import android.os.Process; import android.os.RemoteException; import android.os.StrictMode; import android.os.Trace; import android.os.UserHandle; import android.system.Os; import android.text.TextUtils; Loading Loading @@ -6247,18 +6246,6 @@ public class RemoteViews implements Parcelable, Filter { private View inflateView(Context context, RemoteViews rv, @Nullable ViewGroup parent, @StyleRes int applyThemeResId, @Nullable ColorResources colorResources) { try { Trace.beginSection(rv.hasDrawInstructions() ? "RemoteViews#inflateViewWithDrawInstructions" : "RemoteViews#inflateView"); return inflateViewInternal(context, rv, parent, applyThemeResId, colorResources); } finally { Trace.endSection(); } } private View inflateViewInternal(Context context, RemoteViews rv, @Nullable ViewGroup parent, @StyleRes int applyThemeResId, @Nullable ColorResources colorResources) { // RemoteViews may be built by an application installed in another // user. So build a context that loads resources from that user but // still returns the current users userId so settings like data / time formats Loading Loading @@ -6397,7 +6384,7 @@ public class RemoteViews implements Parcelable, Filter { private View mResult; private ViewTree mTree; private List<Action> mActions; private Action[] mActions; private Exception mError; private AsyncApplyTask( Loading @@ -6424,20 +6411,11 @@ public class RemoteViews implements Parcelable, Filter { if (mRV.mActions != null) { int count = mRV.mActions.size(); mActions = new ArrayList<>(count); try { Trace.beginSection(hasDrawInstructions() ? "RemoteViews#initActionAsyncWithDrawInstructions" : "RemoteViews#initActionAsync"); for (Action action : mRV.mActions) { if (isCancelled()) { break; } mActions = new Action[count]; for (int i = 0; i < count && !isCancelled(); i++) { // TODO: check if isCancelled in nested views. mActions.add(action.initActionAsync(mTree, mParent, mApplyParams)); } } finally { Trace.endSection(); mActions[i] = mRV.mActions.get(i) .initActionAsync(mTree, mParent, mApplyParams); } } else { mActions = null; Loading @@ -6459,7 +6437,14 @@ public class RemoteViews implements Parcelable, Filter { try { if (mActions != null) { mRV.performApply(viewTree.mRoot, mParent, mApplyParams, mActions); ActionApplyParams applyParams = mApplyParams.clone(); if (applyParams.handler == null) { applyParams.handler = DEFAULT_INTERACTION_HANDLER; } for (Action a : mActions) { a.apply(viewTree.mRoot, mParent, applyParams); } } // If the parent of the view is has is a root, resolve the recycling. if (mTopLevel && mResult instanceof ViewGroup) { Loading Loading @@ -6635,11 +6620,6 @@ public class RemoteViews implements Parcelable, Filter { } private void performApply(View v, ViewGroup parent, ActionApplyParams params) { performApply(v, parent, params, mActions); } private void performApply( View v, ViewGroup parent, ActionApplyParams params, List<Action> actions) { params = params.clone(); if (params.handler == null) { params.handler = DEFAULT_INTERACTION_HANDLER; Loading @@ -6650,16 +6630,9 @@ public class RemoteViews implements Parcelable, Filter { } if (mActions != null) { final int count = mActions.size(); try { Trace.beginSection(hasDrawInstructions() ? "RemoteViews#applyActionsWithDrawInstructions" : "RemoteViews#applyActions"); for (int i = 0; i < count; i++) { mActions.get(i).apply(v, parent, params); } } finally { Trace.endSection(); } } } Loading Loading
core/java/android/widget/RemoteViews.java +16 −43 Original line number Diff line number Diff line Loading @@ -83,7 +83,6 @@ import android.os.Parcelable; import android.os.Process; import android.os.RemoteException; import android.os.StrictMode; import android.os.Trace; import android.os.UserHandle; import android.system.Os; import android.text.TextUtils; Loading Loading @@ -6247,18 +6246,6 @@ public class RemoteViews implements Parcelable, Filter { private View inflateView(Context context, RemoteViews rv, @Nullable ViewGroup parent, @StyleRes int applyThemeResId, @Nullable ColorResources colorResources) { try { Trace.beginSection(rv.hasDrawInstructions() ? "RemoteViews#inflateViewWithDrawInstructions" : "RemoteViews#inflateView"); return inflateViewInternal(context, rv, parent, applyThemeResId, colorResources); } finally { Trace.endSection(); } } private View inflateViewInternal(Context context, RemoteViews rv, @Nullable ViewGroup parent, @StyleRes int applyThemeResId, @Nullable ColorResources colorResources) { // RemoteViews may be built by an application installed in another // user. So build a context that loads resources from that user but // still returns the current users userId so settings like data / time formats Loading Loading @@ -6397,7 +6384,7 @@ public class RemoteViews implements Parcelable, Filter { private View mResult; private ViewTree mTree; private List<Action> mActions; private Action[] mActions; private Exception mError; private AsyncApplyTask( Loading @@ -6424,20 +6411,11 @@ public class RemoteViews implements Parcelable, Filter { if (mRV.mActions != null) { int count = mRV.mActions.size(); mActions = new ArrayList<>(count); try { Trace.beginSection(hasDrawInstructions() ? "RemoteViews#initActionAsyncWithDrawInstructions" : "RemoteViews#initActionAsync"); for (Action action : mRV.mActions) { if (isCancelled()) { break; } mActions = new Action[count]; for (int i = 0; i < count && !isCancelled(); i++) { // TODO: check if isCancelled in nested views. mActions.add(action.initActionAsync(mTree, mParent, mApplyParams)); } } finally { Trace.endSection(); mActions[i] = mRV.mActions.get(i) .initActionAsync(mTree, mParent, mApplyParams); } } else { mActions = null; Loading @@ -6459,7 +6437,14 @@ public class RemoteViews implements Parcelable, Filter { try { if (mActions != null) { mRV.performApply(viewTree.mRoot, mParent, mApplyParams, mActions); ActionApplyParams applyParams = mApplyParams.clone(); if (applyParams.handler == null) { applyParams.handler = DEFAULT_INTERACTION_HANDLER; } for (Action a : mActions) { a.apply(viewTree.mRoot, mParent, applyParams); } } // If the parent of the view is has is a root, resolve the recycling. if (mTopLevel && mResult instanceof ViewGroup) { Loading Loading @@ -6635,11 +6620,6 @@ public class RemoteViews implements Parcelable, Filter { } private void performApply(View v, ViewGroup parent, ActionApplyParams params) { performApply(v, parent, params, mActions); } private void performApply( View v, ViewGroup parent, ActionApplyParams params, List<Action> actions) { params = params.clone(); if (params.handler == null) { params.handler = DEFAULT_INTERACTION_HANDLER; Loading @@ -6650,16 +6630,9 @@ public class RemoteViews implements Parcelable, Filter { } if (mActions != null) { final int count = mActions.size(); try { Trace.beginSection(hasDrawInstructions() ? "RemoteViews#applyActionsWithDrawInstructions" : "RemoteViews#applyActions"); for (int i = 0; i < count; i++) { mActions.get(i).apply(v, parent, params); } } finally { Trace.endSection(); } } } Loading