Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec79f3cc authored by Nan Wu's avatar Nan Wu Committed by Android (Google) Code Review
Browse files

Merge "Fix null pointer exception rendering cubes widget" into main

parents 79636464 51673bb4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -9216,7 +9216,13 @@ public class RemoteViews implements Parcelable, Filter {
        public static RemoteResponse fromFillInIntent(@NonNull Intent fillIntent) {
            RemoteResponse response = new RemoteResponse();
            response.mFillIntent = fillIntent;
            if (fillIntent != null) {
                // Although the parameter is marked as @NonNull, it is nullable. The method that
                // calls it (RemoteReviews.setOnClickFillInIntent()) passes its fillInIntent
                // parameter to this method and it does not guarantee that the fillInIntent is
                // non-null.
                fillIntent.collectExtraIntentKeys();
            }
            return response;
        }

+3 −0
Original line number Diff line number Diff line
@@ -1080,6 +1080,9 @@ public class RemoteViewsTest {
        rv.setOnClickFillInIntent(R.id.view, fillInIntent);
        assertNotEquals(0, fillInIntent.getExtendedFlags()
                & Intent.EXTENDED_FLAG_NESTED_INTENT_KEYS_COLLECTED);

        RemoteViews.RemoteResponse rr = RemoteViews.RemoteResponse.fromFillInIntent(null);
        assertNotNull(rr);
    }

    private static LayoutInflater.Factory2 createLayoutInflaterFactory(String viewTypeToReplace,