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

Commit 767c8bb9 authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Migrate Shell app to use the new bugreport API.

Add new calls to bugreport API, all the while keeping the previous code
and logic untouched.

Added feature flag in Settings which if untouched, runs the old dumpstate workflow
by default. To test the new workflow turn on the feature flag from UI or
`adb shell setprop settings_call_bugreport_api true`.

Add permission TRIGGER_SHELL_BUGREPORT so that not all can send
broadcasts to trigger bugreports.

Create new receiver BugreportRequestedReceiver for the new broadcast intent that the shell app will
use.

Whitelist Shell app to use the bugreport API.

Bug: 123617758

Test: manually built and flash to device. Turn on the feature flag, generate bugreports and check
the onProgress and onFinish notifications.
Test: Turn off the feature flag test old workflow.

Change-Id: I1c7c258a48815a0386d7d4771301cd76f9cae3d0
parent fffc4cca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class FeatureFlagUtils {
    static {
        DEFAULT_FLAGS = new HashMap<>();
        DEFAULT_FLAGS.put("settings_audio_switcher", "true");
        DEFAULT_FLAGS.put("settings_call_bugreport_api", "false");
        DEFAULT_FLAGS.put("settings_mobile_network_v2", "true");
        DEFAULT_FLAGS.put("settings_network_and_internet_v2", "true");
        DEFAULT_FLAGS.put("settings_systemui_theme", "true");
+7 −0
Original line number Diff line number Diff line
@@ -2807,6 +2807,13 @@
    <permission android:name="android.permission.STATUS_BAR"
        android:protectionLevel="signature|privileged" />

    <!-- Allows an application to trigger bugreport via shell using the bugreport API.
        <p>Not for use by third-party applications.
        @hide
    -->
    <permission android:name="android.permission.TRIGGER_SHELL_BUGREPORT"
        android:protectionLevel="signature" />

    <!-- Allows an application to be the status bar.  Currently used only by SystemUI.apk
    @hide -->
    <permission android:name="android.permission.STATUS_BAR_SERVICE"
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@
    <backup-transport-whitelisted-service
        service="com.android.localtransport/.LocalTransportService" />

    <!-- Whitelist Shell to use the bugreport API -->
    <bugreport-whitelisted package="com.android.shell" />

    <!-- Whitelist of bundled applications which all handle URLs to their websites by default -->
    <app-link package="com.android.carrierdefaultapp" />
</config>
+8 −0
Original line number Diff line number Diff line
@@ -249,6 +249,14 @@
            </intent-filter>
        </receiver>

        <receiver
            android:name=".BugreportRequestedReceiver"
            android:permission="android.permission.TRIGGER_SHELL_BUGREPORT">
            <intent-filter>
                <action android:name="com.android.internal.intent.action.BUGREPORT_REQUESTED" />
            </intent-filter>
        </receiver>

        <service
            android:name=".BugreportProgressService"
            android:exported="false"/>
+282 −97

File changed.

Preview size limit exceeded, changes collapsed.

Loading