OSDN Git Service

Don't use intent chooser
authorGuang Zhu <guangzhu@google.com>
Thu, 23 Aug 2012 23:09:04 +0000 (16:09 -0700)
committerThe Android Automerger <android-build@android.com>
Fri, 24 Aug 2012 00:55:53 +0000 (17:55 -0700)
Since it forces user to make selection, not offering an option to
remember the choice. Remove the new task flag, also adds an
explicit default category

Change-Id: I3834a8fa27782d14989e510c0756d36aaeeb2bab

bugmailer/src/com/android/commands/sendbug/SendBug.java

index 84a488d..9b693a0 100644 (file)
@@ -66,7 +66,6 @@ public class SendBug {
             final Uri screenshotUri = screenShot != null
                     ? Uri.fromFile(screenShot) : null;
             intent = getSendMailIntent(bugreportUri, screenshotUri);
-            intent = Intent.createChooser(intent, "Send Bugreport via");
         }
         if (intent != null) {
             final IActivityManager mAm = ActivityManagerNative.getDefault();
@@ -110,7 +109,7 @@ public class SendBug {
     private Intent getSendMailIntent(Uri bugreportUri, Uri screenshotUri) {
         final Account sendToAccount = findSendToAccount();
         final Intent intent = new Intent(Intent.ACTION_SEND);
-        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        intent.addCategory(Intent.CATEGORY_DEFAULT);
         intent.setType("application/octet-stream");
         intent.putExtra(Intent.EXTRA_SUBJECT, bugreportUri.getLastPathSegment());
         final StringBuilder sb = new StringBuilder();