Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server-start error due to multiple profiles #30

Open
kunalkapoor opened this issue Nov 11, 2024 · 5 comments
Open

server-start error due to multiple profiles #30

kunalkapoor opened this issue Nov 11, 2024 · 5 comments

Comments

@kunalkapoor
Copy link

Reopening issue #29

We should reopen the above issue which was closed as the author did not give details. I see the same issue because I have a work profile installed on my phone so I have multiple users. Doing a "pm list packages" tries to list all packages from all users and adb doesn't have permissions to the work profile.

> adb shell pm list packages
Exception occurred while executing 'list':
java.lang.SecurityException: Shell does not have permission to access user 11
 com.android.server.am.ActivityManagerService.handleIncomingUser:15970 android.app.ActivityManager.handleIncomingUser:5152 com.android.server.pm.PackageManagerShellCommand.translateUserId:3733
        at com.android.server.am.UserController.handleIncomingUser(UserController.java:2892)
        at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:15970)
        at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:5152)
        at com.android.server.pm.PackageManagerShellCommand.translateUserId(PackageManagerShellCommand.java:3733)
        at com.android.server.pm.PackageManagerShellCommand.runListPackages(PackageManagerShellCommand.java:1074)
        at com.android.server.pm.PackageManagerShellCommand.runListPackages(PackageManagerShellCommand.java:960)
        at com.android.server.pm.PackageManagerShellCommand.runList(PackageManagerShellCommand.java:800)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:237)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:7136)
        at android.os.Binder.shellCommand(Binder.java:1104)
        at android.os.Binder.onTransact(Binder.java:914)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4905)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:7120)
        at android.os.Binder.execTransactInternal(Binder.java:1380)
        at android.os.Binder.execTransact(Binder.java:1311)
> adb shell pm list users
Users:
        UserInfo{0:Kunal Kapoor:4c13} running
        UserInfo{11:Work profile:1030} running
        UserInfo{150:Secure Folder:10061030} running

The solution to this is to use the default user explicitly. This cannot be done in the adb daemon directly (atleast I don't know how).

> adb shell pm list packages --user 0
@dtmilano
Copy link
Owner

Thanks for the detailed info.
Will take a look.

@dtmilano
Copy link
Owner

Try it and let me know.

@cwke
Copy link

cwke commented Nov 17, 2024

Try it and let me know.

Had the same issue, the commit 1a2079e fixes it 👍🏻

@dtmilano
Copy link
Owner

Great. Will merge to master after some additional testing.

@kunalkapoor
Copy link
Author

+1. The above commit fixes the issue for me too. Thanks for fixing it.

dtmilano added a commit that referenced this issue Nov 18, 2024
server-start error due to multiple profiles #30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants