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

Commit 86f69db5 authored by Kristian Monsen's avatar Kristian Monsen Committed by Nandana Dutt
Browse files

Disable the buginfo dialog on AndroidTV

Bug: 113033835
Test: Tested manually on Atom
Change-Id: If65997e28db7c0100018145f9313549494e41a2a
Merged-In: If65997e28db7c0100018145f9313549494e41a2a
(cherry picked from commit cb68d29f03f14b188ccc02b877161173b631685d)
(cherry picked from commit 01badb78)
parent 6ef0182f
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@


package com.android.shell;
package com.android.shell;


import static android.content.pm.PackageManager.FEATURE_LEANBACK;
import static android.content.pm.PackageManager.FEATURE_TELEVISION;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;


import static com.android.shell.BugreportPrefs.STATE_HIDE;
import static com.android.shell.BugreportPrefs.STATE_HIDE;
@@ -235,6 +237,7 @@ public class BugreportProgressService extends Service {
    private static final Bundle sNotificationBundle = new Bundle();
    private static final Bundle sNotificationBundle = new Bundle();


    private boolean mIsWatch;
    private boolean mIsWatch;
    private boolean mIsTv;


    private int mLastProgressPercent;
    private int mLastProgressPercent;


@@ -255,6 +258,9 @@ public class BugreportProgressService extends Service {
        final Configuration conf = mContext.getResources().getConfiguration();
        final Configuration conf = mContext.getResources().getConfiguration();
        mIsWatch = (conf.uiMode & Configuration.UI_MODE_TYPE_MASK) ==
        mIsWatch = (conf.uiMode & Configuration.UI_MODE_TYPE_MASK) ==
                Configuration.UI_MODE_TYPE_WATCH;
                Configuration.UI_MODE_TYPE_WATCH;
        PackageManager packageManager = getPackageManager();
        mIsTv = packageManager.hasSystemFeature(FEATURE_LEANBACK)
                || packageManager.hasSystemFeature(FEATURE_TELEVISION);
        NotificationManager nm = NotificationManager.from(mContext);
        NotificationManager nm = NotificationManager.from(mContext);
        nm.createNotificationChannel(
        nm.createNotificationChannel(
                new NotificationChannel(NOTIFICATION_CHANNEL_ID,
                new NotificationChannel(NOTIFICATION_CHANNEL_ID,
@@ -500,8 +506,8 @@ public class BugreportProgressService extends Service {
                .setProgress(info.max, info.progress, false)
                .setProgress(info.max, info.progress, false)
                .setOngoing(true);
                .setOngoing(true);


        // Wear bugreport doesn't need the bug info dialog, screenshot and cancel action.
        // Wear and ATV bugreport doesn't need the bug info dialog, screenshot and cancel action.
        if (!mIsWatch) {
        if (!(mIsWatch || mIsTv)) {
            final Action cancelAction = new Action.Builder(null, mContext.getString(
            final Action cancelAction = new Action.Builder(null, mContext.getString(
                    com.android.internal.R.string.cancel), newCancelIntent(mContext, info)).build();
                    com.android.internal.R.string.cancel), newCancelIntent(mContext, info)).build();
            final Intent infoIntent = new Intent(mContext, BugreportProgressService.class);
            final Intent infoIntent = new Intent(mContext, BugreportProgressService.class);