Skip to content

[Issue #4] Bug in the implementation of Api.GetApps() leading to users with id 0 getting ignored.#1339

Closed
amaa-99 wants to merge 1 commit intoukanth:betafrom
amaa-99:4-bug-in-the-implementation-of-apigetapps-leading-to-users-with-id-0-getting-ignored
Closed

[Issue #4] Bug in the implementation of Api.GetApps() leading to users with id 0 getting ignored.#1339
amaa-99 wants to merge 1 commit intoukanth:betafrom
amaa-99:4-bug-in-the-implementation-of-apigetapps-leading-to-users-with-id-0-getting-ignored

Conversation

@amaa-99
Copy link

@amaa-99 amaa-99 commented Jul 25, 2023

Fixed a bug in the implementation of Api.getApps() leading to users with id 0 getting ignored and subsequently to the returned apps list being empty.

if (m.find() && m.groupCount() > 0) {
int id = Integer.parseInt(m.group(1));
if (id > 0) {
if (id >= 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uid 0 is root . That's handled separately. We don't need to add it here.

Copy link
Author

@amaa-99 amaa-99 Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the issue that at least in one of my (rooted) dev devices (I believe the one running LineageOS 18.1 (i.e. Android 11)) the only user reported at that point is the one with id 0...
If the user with id 0 is intended to be handled elsewhere, then probably the problem lies there.
Could you point me in that direction?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.s. I've dropped the other commits (there are individual pulls for each of those).

Copy link
Owner

@ukanth ukanth Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the affected devices the listOfUids will always be empty, and therefore the packagesForUser list will empty too:

            if(G.supportDual()) {
                packagesForUser  = getPackagesForUser(listOfUids);
            }

…ers with id 0 getting ignored.

Fixed a bug in the implementation of Api.getApps() leading to users with id 0 getting ignored and subsequently to the returned apps list being empty.
@amaa-99 amaa-99 force-pushed the 4-bug-in-the-implementation-of-apigetapps-leading-to-users-with-id-0-getting-ignored branch from 3fc3b49 to 6b97d84 Compare July 28, 2023 20:18
@ukanth ukanth closed this Aug 14, 2023
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

Successfully merging this pull request may close these issues.

2 participants