This commit is contained in:
2025-08-13 10:17:00 +09:00
parent 81e4c77644
commit b8b088c1ab
16 changed files with 1052 additions and 46 deletions
@@ -4,6 +4,7 @@ import android.appwidget.AppWidgetManager
import android.appwidget.AppWidgetProviderInfo
import android.content.Context
import android.content.pm.LauncherApps
import android.os.Build
import androidx.core.content.getSystemService
import de.mm20.launcher2.widgets.CalendarWidget
import de.mm20.launcher2.widgets.FavoritesWidget
@@ -32,6 +33,14 @@ class WidgetsService(
for (profile in profiles) {
widgets.addAll(appWidgetManager.getInstalledProvidersForProfile(profile))
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// Ignore widgets that the launcher is not supposed to access
widgets.filter {
it.widgetFeatures and AppWidgetProviderInfo.WIDGET_FEATURE_HIDE_FROM_PICKER == 0
}
} else {
widgets
}
widgets
}