Skip to content

App list "loads forever" due to swallowed exception #1982

Description

@null-dev

Please check before submitting an issue

  • I know what my device, OS and App Manager versions are
  • I know how to take logs
  • I know that generating a report, in whole part or in part, using AI/LLM is prohibited
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

On phones with a private space, the app list can appear to load forever. However, actually there is an exception being thrown that is swallowed and not logged, terminating the list loading process.

To Reproduce

  1. Add a private space to your phone.
  2. Make the following change to MainViewModel.java:
    public void loadApplicationItems() {
        cancelIfRunning();
        mFilterResult = executor.submit(() -> {
+           try {
            List<ApplicationItem> updatedApplicationItems = PackageUtils
                    .getInstalledOrBackedUpApplicationsFromDb(getApplication(), true, true);
            synchronized (mApplicationItems) {
                mApplicationItems.clear();
                mApplicationItems.addAll(updatedApplicationItems);
                // select apps again
                for (ApplicationItem item : getSelectedApplicationItems()) {
                    select(item);
                }
                sortApplicationList(mSortBy, mReverseSort);
                filterItemsByFlags();
            }
+           } catch(Throwable e) { Log.e("ND-DEBUG", "Failed to load app list!", e); }
        });
    }
  1. Observe the following error is thrown after opening the application and the app list loads forever:
ND-DEBUG io....untashirakon.AppManager.debug  E  Failed to load app list!
                                                 java.lang.SecurityException: Permission Denial: isAppInactive asks to run as user 10 but is calling from uid u0a609; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS
                                                 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3370)
                                                 	at android.os.Parcel.createException(Parcel.java:3354)
                                                 	at android.os.Parcel.readException(Parcel.java:3337)
                                                 	at android.os.Parcel.readException(Parcel.java:3279)
                                                 	at android.app.usage.IUsageStatsManager$Stub$Proxy.isAppInactive(IUsageStatsManager.java:1128)
                                                 	at io.github.muntashirakon.AppManager.compat.UsageStatsManagerCompat.isAppInactive(UsageStatsManagerCompat.java:98)
                                                 	at io.github.muntashirakon.AppManager.main.ApplicationItem.generateOtherInfo(ApplicationItem.java:247)
                                                 	at io.github.muntashirakon.AppManager.utils.PackageUtils.getInstalledOrBackedUpApplicationsFromDb(PackageUtils.java:224)
                                                 	at io.github.muntashirakon.AppManager.main.MainViewModel.lambda$loadApplicationItems$3$io-github-muntashirakon-AppManager-main-MainViewModel(MainViewModel.java:364)
                                                 	at io.github.muntashirakon.AppManager.main.MainViewModel$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0)
                                                 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:520)
                                                 	at java.util.concurrent.FutureTask.run(FutureTask.java:328)
                                                 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1100)
                                                 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                                                 	at java.lang.Thread.run(Thread.java:1572)
                                                 Caused by: android.os.RemoteException: Remote stack trace:
                                                 	at com.android.server.wm.Session$$ExternalSyntheticBUOutline1.m(R8$$SyntheticClass:0)
                                                 	at com.android.server.am.UserController.handleIncomingUser(UserController.java:3470)
                                                 	at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:14054)
                                                 	at com.android.server.usage.UsageStatsService$BinderService.isAppInactive(UsageStatsService.java:2623)
                                                 	at android.app.usage.IUsageStatsManager$Stub.onTransact(IUsageStatsManager.java:535)

Device info

  • Device: Google Pixel 10 Pro Fold
  • OS Version: Android 16 (CP1A.260505.005)
  • App Manager Version: Built from source (133b5ac)
  • Mode: NonRoot, ADB (issue present in both)

Additional context

If you need more details, feel free to let me know!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions