Modify badge API
Pass searchable as argument instead of badgeKey which is now obsolete
This commit is contained in:
@@ -26,9 +26,6 @@ class AppInstallation(
|
||||
override val key: String
|
||||
get() = "installer://${session.installerPackageName}:${session.appPackageName}"
|
||||
|
||||
override val badgeKey: String
|
||||
get() = "app://${session.appPackageName}"
|
||||
|
||||
override fun getLaunchIntent(context: Context): Intent? {
|
||||
return session.createDetailsIntent()
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class AppShortcut(
|
||||
|
||||
|
||||
internal val userSerialNumber: Long = launcherShortcut.userHandle.getSerialNumber(context)
|
||||
private val isMainProfile = launcherShortcut.userHandle == Process.myUserHandle()
|
||||
val isMainProfile = launcherShortcut.userHandle == Process.myUserHandle()
|
||||
|
||||
override val key: String
|
||||
get() = if (isMainProfile) {
|
||||
@@ -41,11 +41,6 @@ class AppShortcut(
|
||||
"shortcut://${launcherShortcut.`package`}/${launcherShortcut.id}:${userSerialNumber}"
|
||||
}
|
||||
|
||||
override val badgeKey: String
|
||||
get() {
|
||||
return if (isMainProfile) "shortcut://${launcherShortcut.activity?.flattenToShortString()}" else "profile://$userSerialNumber"
|
||||
}
|
||||
|
||||
override fun getLaunchIntent(context: Context): Intent? {
|
||||
return launcherShortcut.intent
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ abstract class Application(
|
||||
val shortcuts: List<AppShortcut> = emptyList()
|
||||
) : Searchable() {
|
||||
|
||||
override val badgeKey: String
|
||||
get() = "app://${`package`}"
|
||||
|
||||
override fun serialize(): String {
|
||||
val json = JSONObject()
|
||||
json.put("package", `package`)
|
||||
|
||||
@@ -57,10 +57,7 @@ class LauncherApp(
|
||||
), KoinComponent {
|
||||
|
||||
internal val userSerialNumber: Long = launcherActivityInfo.user.getSerialNumber(context)
|
||||
private val isMainProfile = launcherActivityInfo.user == Process.myUserHandle()
|
||||
|
||||
override val badgeKey: String =
|
||||
if (isMainProfile) "app://${`package`}" else "profile://$userSerialNumber"
|
||||
val isMainProfile = launcherActivityInfo.user == Process.myUserHandle()
|
||||
|
||||
override val key: String
|
||||
get() = if (isMainProfile) "app://$`package`:$activity" else "app://$`package`:$activity:${userSerialNumber}"
|
||||
|
||||
Reference in New Issue
Block a user