summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Langemak <dlangemak@google.com>2015-07-31 02:57:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-31 02:57:24 +0000
commitb880a036b12c8a8613fbd7fb41328ca93146bf85 (patch)
treef3d453494a15b8ab3b303ecd1e2dea783cfd6652
parent135c379115260f672fec023b0f9a020b8c51302b (diff)
parent02565c3622aa9007d3d5eb4612f200decd05b55c (diff)
downloadframeworks_base-b880a036b12c8a8613fbd7fb41328ca93146bf85.zip
frameworks_base-b880a036b12c8a8613fbd7fb41328ca93146bf85.tar.gz
frameworks_base-b880a036b12c8a8613fbd7fb41328ca93146bf85.tar.bz2
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.
-rw-r--r--core/java/android/widget/DateTimeView.java3
-rw-r--r--core/java/android/widget/RemoteViews.java4
2 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index dcb2437..d20b924 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -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) {
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index d158313..7ca3339 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -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)