From 1d6e1759d2337240627b9dd30d221390843cbb4d Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Tue, 30 May 2017 12:35:45 -0700 Subject: Fix #62169466 bug report sharing options empty Was caused by a new requirement to not offer to show non-exported intent handlers as options. For first time warning dialog, don't show a chooser activity. Change-Id: Ibada9a7a14b77ec0670bf35ba0944f369d42bf69 Fixes: 62169466 Test: manual Test: mmm -j32 frameworks/base/packages/Shell && adb install -r -g ${OUT}/data/app/ShellTests/ShellTests.apk && adb shell am instrument -e class com.android.shell.BugreportReceiverTest$1 -w com.android.shell.tests/android.support.test.runner.AndroidJUnitRunner --- .../Shell/src/com/android/shell/BugreportProgressService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/Shell/src') diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 1ddbcad8e844..348b02aeda4a 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -966,17 +966,24 @@ public class BugreportProgressService extends Service { } final Intent notifIntent; + boolean useChooser = true; // Send through warning dialog by default if (getWarningState(mContext, STATE_UNKNOWN) != STATE_HIDE) { notifIntent = buildWarningIntent(mContext, sendIntent); + // No need to show a chooser in this case. + useChooser = false; } else { notifIntent = sendIntent; } notifIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // Send the share intent... - sendShareIntent(mContext, notifIntent); + if (useChooser) { + sendShareIntent(mContext, notifIntent); + } else { + mContext.startActivity(notifIntent); + } // ... and stop watching this process. stopProgress(id); -- cgit v1.2.3-59-g8ed1b