@@ -53,7 +53,7 @@ public class PerAppThemeFragment extends Fragment {
53
53
@ Override
54
54
public void onReceive (Context context , Intent intent ) {
55
55
AppType appType = AppType .values ()[
56
- RPrefs .getInt (APP_LIST_FILTER_METHOD , AppType .BOTH .ordinal ())
56
+ RPrefs .getInt (APP_LIST_FILTER_METHOD , AppType .ALL .ordinal ())
57
57
];
58
58
59
59
initAppList (appType );
@@ -107,7 +107,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
107
107
binding .searchBox .filter .setOnClickListener (v -> showFilterDialog ());
108
108
109
109
AppType appType = AppType .values ()[
110
- RPrefs .getInt (APP_LIST_FILTER_METHOD , AppType .BOTH .ordinal ())
110
+ RPrefs .getInt (APP_LIST_FILTER_METHOD , AppType .ALL .ordinal ())
111
111
];
112
112
113
113
initAppList (appType );
@@ -186,8 +186,16 @@ private static List<AppInfoModel> getAllInstalledApps(Context context, AppType a
186
186
List <ApplicationInfo > applications = packageManager .getInstalledApplications (PackageManager .GET_META_DATA );
187
187
188
188
for (ApplicationInfo appInfo : applications ) {
189
- String appName = appInfo .loadLabel (packageManager ).toString ();
190
189
String packageName = appInfo .packageName ;
190
+
191
+ if (appType == AppType .LAUNCHABLE ) {
192
+ Intent launchIntent = packageManager .getLaunchIntentForPackage (packageName );
193
+ if (launchIntent == null ) {
194
+ continue ;
195
+ }
196
+ }
197
+
198
+ String appName = appInfo .loadLabel (packageManager ).toString ();
191
199
Drawable appIcon = appInfo .loadIcon (packageManager );
192
200
boolean isSelected = OverlayManager .isOverlayEnabled (
193
201
String .format (FABRICATED_OVERLAY_NAME_APPS , packageName )
@@ -198,7 +206,7 @@ private static List<AppInfoModel> getAllInstalledApps(Context context, AppType a
198
206
boolean includeApp = switch (appType ) {
199
207
case SYSTEM -> isSystemApp ;
200
208
case USER -> !isSystemApp ;
201
- case BOTH -> true ;
209
+ case LAUNCHABLE , ALL -> true ;
202
210
};
203
211
204
212
if (includeApp ) {
@@ -234,10 +242,11 @@ private void showFilterDialog() {
234
242
String [] items = {
235
243
getString (R .string .filter_system_apps ),
236
244
getString (R .string .filter_user_apps ),
237
- getString (R .string .filter_both )
245
+ getString (R .string .filter_launchable_apps ),
246
+ getString (R .string .filter_all )
238
247
};
239
248
240
- int selectedFilterIndex = RPrefs .getInt (APP_LIST_FILTER_METHOD , AppType .BOTH .ordinal ());
249
+ int selectedFilterIndex = RPrefs .getInt (APP_LIST_FILTER_METHOD , AppType .ALL .ordinal ());
241
250
242
251
new MaterialAlertDialogBuilder (requireContext ())
243
252
.setTitle (getString (R .string .filter_app_category ))
0 commit comments