Remove FLAG_ACTIVITY_NEW_TASK from the VIEW intent.
Ruben Brunk [Mon, 24 Sep 2012 21:37:19 +0000 (14:37 -0700)]
Bug: 7164238
Bug: 7237908

Got rid of FLAG_ACTIVITY_NEW_TASK for proper back behavior

Change-Id: I50af9aeafb27d6079bda4f81f4a116b6bb600676

src/com/android/providers/downloads/DownloadReceiver.java
src/com/android/providers/downloads/OpenHelper.java

index aa165e4..7469508 100644 (file)
@@ -145,6 +145,7 @@ public class DownloadReceiver extends BroadcastReceiver {
     private void openDownload(Context context, Cursor cursor) {
         final long id = cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
         final Intent intent = OpenHelper.buildViewIntent(context, id);
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         try {
             context.startActivity(intent);
         } catch (ActivityNotFoundException ex) {
index 0151c8d..6424bcd 100644 (file)
@@ -49,7 +49,7 @@ public class OpenHelper {
             final String mimeType = getCursorString(cursor, COLUMN_MEDIA_TYPE);
 
             final Intent intent = new Intent(Intent.ACTION_VIEW);
-            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION);
+            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
 
             if ("application/vnd.android.package-archive".equals(mimeType)) {
                 // PackageInstaller doesn't like content URIs, so open file