fix: keep the default launcher entry named MainActivity so RedMagic Game Space keeps DroidDeck (#1345)

This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-10-22 20:54:12 +00:00
1 parent 7b7c978edd
commit 22eac0831d
9 files changed
+66 -25

No files matched your search

@@ -8,7 +8,7 @@ object LauncherIcon {
const val DARK = "dark"
const val LIGHT = "light"
private val aliases = linkedMapOf(DARK to "com.droiddeck.launcher.LauncherDark", LIGHT to "com.droiddeck.launcher.LauncherLight")
private val aliases = linkedMapOf(DARK to "com.droiddeck.launcher.MainActivity", LIGHT to "com.droiddeck.launcher.LauncherLight")
val options: List<Pair<String, Int>> = listOf(
DARK to R.string.setup_launcher_icon_dark,
@@ -29,6 +29,12 @@ object LauncherIcon {
fun activity(context: Context): ComponentName = component(context, current(context))
fun repair(context: Context, launchedFrom: ComponentName?) {
if (!enabled(context, DARK) || !enabled(context, LIGHT) || launchedFrom == component(context, DARK)) return
context.packageManager.setComponentEnabledSetting(component(context, DARK),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
}
fun set(context: Context, style: String) {
if (style !in aliases || style == current(context)) return
val pm = context.packageManager