Fix bug in warning activity intent.
Intents are no longer allowed to trigger without the NEW_TASK flag. This
old code path rotted and was never retrofitted to reflect this change.
By adding the flag in, this code path works again.
Bug: 122461924
Test: Manual
Change-Id: Idc825ebfedb795c02aefd61a202aefbea5bcd190
diff --git a/src/com/android/storagemanager/automatic/NotificationController.java b/src/com/android/storagemanager/automatic/NotificationController.java
index 58c99d8..18e4533 100644
--- a/src/com/android/storagemanager/automatic/NotificationController.java
+++ b/src/com/android/storagemanager/automatic/NotificationController.java
@@ -98,12 +98,14 @@
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case INTENT_ACTION_ACTIVATE_ASM:
- Settings.Secure.putInt(context.getContentResolver(),
+ Settings.Secure.putInt(
+ context.getContentResolver(),
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED,
1);
// Provide a warning if storage manager is not defaulted on.
if (!SystemProperties.getBoolean(STORAGE_MANAGER_PROPERTY, false)) {
Intent warningIntent = new Intent(context, WarningDialogActivity.class);
+ warningIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(warningIntent);
}
break;