Allow plugins to override their own name using meta data (instead of the app name)
This commit is contained in:
parent
63e2d5cdac
commit
fced1bc14e
@ -2,7 +2,6 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.util.Log
|
|
||||||
import de.mm20.launcher2.crashreporter.CrashReporter
|
import de.mm20.launcher2.crashreporter.CrashReporter
|
||||||
import de.mm20.launcher2.plugin.Plugin
|
import de.mm20.launcher2.plugin.Plugin
|
||||||
import de.mm20.launcher2.plugin.PluginType
|
import de.mm20.launcher2.plugin.PluginType
|
||||||
@ -40,7 +39,8 @@ class PluginScanner(
|
|||||||
} ?: continue
|
} ?: continue
|
||||||
plugins.add(
|
plugins.add(
|
||||||
Plugin(
|
Plugin(
|
||||||
label = cr.loadLabel(context.packageManager).toString(),
|
label = providerInfo.metaData?.getString("de.mm20.launcher2.plugin.label")
|
||||||
|
?: cr.loadLabel(context.packageManager).toString(),
|
||||||
description = providerInfo.metaData?.getString("de.mm20.launcher2.plugin.description"),
|
description = providerInfo.metaData?.getString("de.mm20.launcher2.plugin.description"),
|
||||||
packageName = providerInfo.packageName,
|
packageName = providerInfo.packageName,
|
||||||
className = providerInfo.name,
|
className = providerInfo.name,
|
||||||
|
|||||||
@ -214,7 +214,8 @@ internal class PluginServiceImpl(
|
|||||||
val signature = getSignature(packageName)
|
val signature = getSignature(packageName)
|
||||||
PluginPackage(
|
PluginPackage(
|
||||||
packageName = packageName,
|
packageName = packageName,
|
||||||
label = appInfo.loadLabel(context.packageManager).toString(),
|
label = appInfo.metaData?.getString("de.mm20.launcher2.plugin.label")
|
||||||
|
?: appInfo.loadLabel(context.packageManager).toString(),
|
||||||
description = appInfo.metaData?.getString("de.mm20.launcher2.plugin.description"),
|
description = appInfo.metaData?.getString("de.mm20.launcher2.plugin.description"),
|
||||||
author = appInfo.metaData?.getString("de.mm20.launcher2.plugin.author"),
|
author = appInfo.metaData?.getString("de.mm20.launcher2.plugin.author"),
|
||||||
plugins = plugins,
|
plugins = plugins,
|
||||||
@ -248,7 +249,8 @@ internal class PluginServiceImpl(
|
|||||||
.map {
|
.map {
|
||||||
PluginPackage(
|
PluginPackage(
|
||||||
packageName = packageName,
|
packageName = packageName,
|
||||||
label = appInfo.loadLabel(context.packageManager).toString(),
|
label = appInfo.metaData?.getString("de.mm20.launcher2.plugin.label")
|
||||||
|
?: appInfo.loadLabel(context.packageManager).toString(),
|
||||||
description = appInfo.metaData?.getString("de.mm20.launcher2.plugin.description"),
|
description = appInfo.metaData?.getString("de.mm20.launcher2.plugin.description"),
|
||||||
author = appInfo.metaData?.getString("de.mm20.launcher2.plugin.author"),
|
author = appInfo.metaData?.getString("de.mm20.launcher2.plugin.author"),
|
||||||
plugins = it,
|
plugins = it,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user