Bug report handler app via Bug Report Shortcut
- Send intent (android.internal.intent.action.BUGREPORT_REQUESTED) to bug report handler app after pressing Bug Report Shortcut
- Add config "config_bugReportHandlerEnabled" to enable this feature
- Add config "config_defaultBugReportHandlerApp" to get the package of default bugreport handler app
- Add settings CUSTOM_BUGREPORT_HANDLER_APP to get the package of custom bugreport handler app
- Add settings CUSTOM_BUGREPORT_HANDLER_USER to get the user id of custom bugreport handler app
BUG:142921485
Test: After pressing Bug Report Shortcut in manual local test:
- the intent can be sent to bugreport handler app.
- the intent can be sent to Shell if the chosen and the default bugreport handler app can't handle it.
- the intent can be sent to system user profile's default bugreport handler app if the custom profile(like work profile) is removed.
Change-Id: Idc33b47f0cc65b90cbf648bda54a1d900fef007a
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index b5845947..63a7771 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -669,7 +669,10 @@
// Take an "interactive" bugreport.
MetricsLogger.action(mContext,
MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_INTERACTIVE);
- ActivityManager.getService().requestInteractiveBugReport();
+ if (!ActivityManager.getService().launchBugReportHandlerApp()) {
+ Log.w(TAG, "Bugreport handler could not be launched");
+ ActivityManager.getService().requestInteractiveBugReport();
+ }
} catch (RemoteException e) {
}
}