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

Unverified Commit 2a30e8dc authored by basamaryan's avatar basamaryan Committed by Michael Bestas
Browse files

ThemePicker: Fix hardcoded launcher package name

Change-Id: I2950245901634e2e0d69436bb67ab53fc5c8747d
parent 78101bd6
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -159,10 +159,13 @@ constructor(
    }

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