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

Commit bb017c0b authored by dhacker29's avatar dhacker29 Committed by Steve Kondik
Browse files

ShutdownThread: Use Theme_Leanback_Dialog_Alert for shutdown dialog on ATV

Make shutdown and reboot dialogs have a style more appropriate to television.

See commit 4c0cb8a5 for similar changes to boot
message dialogs.

Change-Id: Ie8d73b834265e1b85329949301229f73d3b0fd2a
parent a98ec263
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.media.AudioManager;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnCompletionListener;
@@ -995,8 +996,12 @@ public final class ShutdownThread extends Thread {
        Context uiContext = null;
        Context uiContext = null;
        if (context != null) {
        if (context != null) {
            uiContext = ThemeUtils.createUiContext(context);
            uiContext = ThemeUtils.createUiContext(context);
            if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION)) {
                uiContext.setTheme(com.android.internal.R.style.Theme_Leanback_Dialog_Alert);
            } else  {
                uiContext.setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
                uiContext.setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
            }
            }
        }
        return uiContext != null ? uiContext : context;
        return uiContext != null ? uiContext : context;
    }
    }
}
}