am 02565c36: Merge changes from topic \'fix-notification-inflation-2\' into mnc-dev
* commit '02565c3622aa9007d3d5eb4612f200decd05b55c': Make DateTimeView more robust to weird contexts. Make the RemoteViews context safe for Icons.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user