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

Commit 345cc0b7 authored by Michal Olech's avatar Michal Olech
Browse files

Add custom bug report app support for TV bug reports

Bug: 146052311
Test: built device image, ran and inspected log messages
Change-Id: Iea5c82ba08de8ee075f6b361939cba86838098c8
parent f472e23b
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -712,7 +712,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    accessibilityShortcutActivated();
                    accessibilityShortcutActivated();
                    break;
                    break;
                case MSG_BUGREPORT_TV:
                case MSG_BUGREPORT_TV:
                    requestFullBugreport();
                    requestFullBugreportOrLaunchHandlerApp();
                    break;
                    break;
                case MSG_ACCESSIBILITY_TV:
                case MSG_ACCESSIBILITY_TV:
                    if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) {
                    if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(false)) {
@@ -3122,12 +3122,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        return mAccessibilityTvScheduled;
        return mAccessibilityTvScheduled;
    }
    }


    private void requestFullBugreport() {
    private void requestFullBugreportOrLaunchHandlerApp() {
        if ("1".equals(SystemProperties.get("ro.debuggable"))
        if ("1".equals(SystemProperties.get("ro.debuggable"))
                || Settings.Global.getInt(mContext.getContentResolver(),
                || Settings.Global.getInt(mContext.getContentResolver(),
                        Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) {
                        Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) {
            try {
            try {
                if (!ActivityManager.getService().launchBugReportHandlerApp()) {
                    ActivityManager.getService().requestFullBugReport();
                    ActivityManager.getService().requestFullBugReport();
                }
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Slog.e(TAG, "Error taking bugreport", e);
                Slog.e(TAG, "Error taking bugreport", e);
            }
            }