Merge the android-9.0.0_r55 release tag
Android 9.0.0 Release 55 (6197209)
* tag 'android-9.0.0_r55':
AOSP/UnifiedEmail - bug fix: do not allow composing message with hidden private data attachments - Switch intent filtering to be blacklist based rather than whitelist based.
AOSP/UnifiedEmail - Secure UPDATE_WIDGET receiver with a new permission
Change-Id: I9ce5cafa808daba53daaa3392228051094e596d8
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 608acdb..f2501c3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -26,6 +26,13 @@
<string name="app_name" translatable="false">Unified Email</string>
+ <!-- The name of the permission to get widget update notifications. -->
+ <string name="permission_update_widget" translatable="false">com.android.email.permission.GET_WIDGET_UPDATE</string>
+ <!-- Permission label for receiving updates for the widget. -->
+ <string name="permission_update_widget_label">Update widget</string>
+ <!-- Permission description for receiving updates for the widget. -->
+ <string name="permission_update_widget_desc">Allows the app to receive notifications when the widget should be refreshed, including the account name and folder name.</string>
+
<!-- Compose -->
<!-- Shown in Compose; the sender of the message [CHAR LIMIT=10] -->
<string name="from">From</string>
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 644ded1..b4805f6 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -247,7 +247,7 @@
private static final String EXTRA_IN_REFERENCE_TO_MESSAGE = "in-reference-to-message";
// If this is a reply/forward then this extra will hold a uri we must query
// to get the original message.
- protected static final String EXTRA_IN_REFERENCE_TO_MESSAGE_URI = "in-reference-to-message-uri";
+ public static final String EXTRA_IN_REFERENCE_TO_MESSAGE_URI = "in-reference-to-message-uri";
// If this is an action to edit an existing draft message, this extra will hold the
// draft message
private static final String ORIGINAL_DRAFT_MESSAGE = "original-draft-message";
diff --git a/src/com/android/mail/widget/BaseWidgetProvider.java b/src/com/android/mail/widget/BaseWidgetProvider.java
index bbfe1cc..4a18989 100644
--- a/src/com/android/mail/widget/BaseWidgetProvider.java
+++ b/src/com/android/mail/widget/BaseWidgetProvider.java
@@ -308,10 +308,18 @@
updateWidgetIntent.putExtra(EXTRA_FOLDER_TYPE, folderType);
updateWidgetIntent.putExtra(EXTRA_FOLDER_CAPABILITIES, folderCapabilities);
updateWidgetIntent.putExtra(EXTRA_FOLDER_URI, folderUri);
- updateWidgetIntent.putExtra(EXTRA_FOLDER_CONVERSATION_LIST_URI, folderConversationListUri);
- updateWidgetIntent.putExtra(EXTRA_FOLDER_DISPLAY_NAME, folderDisplayName);
- context.sendBroadcast(updateWidgetIntent);
+ if (folderConversationListUri != null) {
+ updateWidgetIntent.putExtra(EXTRA_FOLDER_CONVERSATION_LIST_URI,
+ folderConversationListUri);
+ }
+ if (folderDisplayName != null) {
+ updateWidgetIntent.putExtra(EXTRA_FOLDER_DISPLAY_NAME, folderDisplayName);
+ }
+ updateWidgetIntent.setPackage(context.getPackageName());
+
+ context.sendBroadcast(updateWidgetIntent,
+ context.getString(R.string.permission_update_widget));
}
public static void validateAllWidgets(Context context, String accountMimeType) {