Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d6e1759 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

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
parent d2638591
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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...
        if (useChooser) {
            sendShareIntent(mContext, notifIntent);
        } else {
            mContext.startActivity(notifIntent);
        }

        // ... and stop watching this process.
        stopProgress(id);