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

add active users limit toggle and show active users #16

Closed
wants to merge 2 commits into from

Conversation

inthewaves
Copy link
Member

@inthewaves inthewaves commented Sep 2, 2020

Closes GrapheneOS/os-issue-tracker#87
Review with: https://github.com/GrapheneOS/platform_frameworks_base/pull/32

Adds a toggle in Settings to control whether the number of active users is limited to 3. Also lets the admin user see the state of all the users. Switching to a user makes the user considered active, regardless of whether the user signs in

limit2 limit1

There's currently no option to adjust the limit; it's just an on or off toggle. The toggle is on by default, as that's the default Android behavior.

Tested on a Pixel 3a. Performance of the phone is heavily degraded if keeping all 17 (16 + guest) users active. It's somewhat acceptable if keeping 8 users active all with something like Vanadium open

Normally, the OS keeps the number of total running users to 3 by
managing a least recently used user list and stopping when over the
limit. This adds a toggle to disable that, so now it's possible to have
over 3 users active.

There are performance implications if you run an excessive amount of
users at once.
@inthewaves inthewaves changed the title add active users limit toggle add active users limit toggle and show user state information Sep 2, 2020
@inthewaves inthewaves changed the title add active users limit toggle and show user state information add active users limit toggle and show active users Sep 2, 2020
If the user navigates back to the Multiple users page before the least
recently used users are shutdown, they can see an outdated list. So, we
listen for Intent.ACTION_SHUTDOWN broadcasts that are sent when a
user shuts down to make sure the state of the list is updated. See the
method finishUserStopping in com.android.server.am.UserController for
where the Intent is broadcasted.
@thestinger
Copy link
Member

This is interesting but I'm not sure if I want to expose it like this. It doesn't really seem particularly useful this way.

@thestinger
Copy link
Member

They'd just be able to run jobs, etc. in the background but there isn't currently a way to see their notifications without switching anyway, so users remaining active doesn't seem very useful right now in general.

@inthewaves
Copy link
Member Author

Yeah, I'll try to look into GrapheneOS/os-issue-tracker#88 and then rethink this approach

@inthewaves
Copy link
Member Author

inthewaves commented Sep 5, 2020

@thestinger I've got censored notifications sending working now, set up as a per-user setting. I'll be testing it a bit more before I open a PR (though I know that a monthly update/migration to Android 11 is around the corner). (Edit: Ran into a snag with respecting the sender's do not disturb setting)

This is interesting but I'm not sure if I want to expose it like this. It doesn't really seem particularly useful this way.

Would this limit active users toggle be okay with you then if censored notification forwarding/sending from background users was available?

@inthewaves
Copy link
Member Author

Going to close this favor of a per-user setting

@inthewaves inthewaves closed this Sep 26, 2020
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.

add more direct control over whether user profiles are kept active when switching to another
2 participants