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

Commit 02565c36 authored by Dave Langemak's avatar Dave Langemak Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'fix-notification-inflation-2' into mnc-dev

* changes:
  Make DateTimeView more robust to weird contexts.
  Make the RemoteViews context safe for Icons.
parents 410abcdb 4b677137
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.widget;

import android.app.ActivityThread;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -259,7 +260,7 @@ public class DateTimeView extends TextView {

        static final Context getApplicationContextIfAvailable(Context context) {
            final Context ac = context.getApplicationContext();
            return ac != null ? ac : context;
            return ac != null ? ac : ActivityThread.currentApplication().getApplicationContext();
        }

        void register(Context context) {
+4 −0
Original line number Diff line number Diff line
@@ -2746,6 +2746,10 @@ public class RemoteViews implements Parcelable, Filter {
            public Resources.Theme getTheme() {
                return contextForResources.getTheme();
            }
            @Override
            public String getPackageName() {
                return contextForResources.getPackageName();
            }
        };

        LayoutInflater inflater = (LayoutInflater)