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

Unverified Commit fd6492a2 authored by Michael Bestas's avatar Michael Bestas
Browse files

Revert "ThemePicker: Fix hardcoded launcher package name"

This reverts commit 2a30e8dc.

Reason for revert: Fixed in BP3A

Change-Id: I736c632119e8ac36fb9d311beb2b2c3bd1fb0077
parent 233dbdea
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -159,13 +159,10 @@ constructor(
    }
    }


    override fun getGridOptionDrawable(iconId: Int): Drawable? {
    override fun getGridOptionDrawable(iconId: Int): Drawable? {
        val pkgName = context.getString(
            com.android.themepicker.R.string.launcher_overlayable_package
        )
        try {
        try {
            val drawable =
            val drawable =
                ResourcesCompat.getDrawable(
                ResourcesCompat.getDrawable(
                    context.packageManager.getResourcesForApplication(pkgName),
                    context.packageManager.getResourcesForApplication(APP_RESOURCES_PACKAGE_NAME),
                    iconId,
                    iconId,
                    /* theme = */ null,
                    /* theme = */ null,
                )
                )
@@ -173,7 +170,7 @@ constructor(
        } catch (exception: Resources.NotFoundException) {
        } catch (exception: Resources.NotFoundException) {
            Log.w(
            Log.w(
                TAG,
                TAG,
                "Unable to find drawable resource from package $pkgName with resource ID $iconId",
                "Unable to find drawable resource from package $APP_RESOURCES_PACKAGE_NAME with resource ID $iconId",
            )
            )
            return null
            return null
        }
        }
@@ -195,5 +192,7 @@ constructor(
        const val COL_IS_DEFAULT: String = "is_default"
        const val COL_IS_DEFAULT: String = "is_default"
        const val COL_PATH: String = "path"
        const val COL_PATH: String = "path"
        const val KEY_GRID_ICON_ID: String = "grid_icon_id"
        const val KEY_GRID_ICON_ID: String = "grid_icon_id"
        private const val APP_RESOURCES_PACKAGE_NAME: String =
            "com.google.android.apps.nexuslauncher"
    }
    }
}
}