Skip to content

Fix hotspot quick settings tile for secondary users - #445

Open
0xALUCARD wants to merge 1 commit into
GrapheneOS:17from
0xALUCARD:hotspot-tile-secondary-users
Open

0xALUCARD wants to merge 1 commit into
GrapheneOS:17from
0xALUCARD:hotspot-tile-secondary-users

Conversation

@0xALUCARD

Copy link
Copy Markdown

Hotspot is now available for secondary users so this check needs to be updated to allow the quick settings tile for them

Fixes GrapheneOS/os-issue-tracker#8123

public boolean isHotspotSupported() {
return mIsTetheringSupportedConfig && mIsTetheringSupported && mHasTetherableWifiRegexs
&& UserManager.get(mContext).isUserAdmin(mUserTracker.getUserId());
&& !UserManager.get(mContext).hasUserRestrictionForUser(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is this definitely enough? The settings themselves also gate:

        if (!WifiUtils.isWifiMultiuserEnabled()) {
            setIfOnlyAvailableForAdmins(true);
        }

on two aconfig flags AFAICT:

    public static boolean isWifiMultiuserEnabled() {
        return com.android.settings.connectivity.Flags.wifiMultiuser()
            || com.android.settings.flags.Flags.enableWifiMultiuser();
    }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Looking into it (GrapheneOS/platform_packages_apps_Settings@d8a9fc8), AFAICT this flag was only relevant during the system settings UI rollout for the recently added multi-user wifi support, as the wifi settings UI was gated for admin-only before it, the flag is set at build time to true in all current grapheneos build target configs and I don't see a scenario where it would be false except maybe upstream changes/rollbacks.
I can definitely add the check here if preferred though, your call.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Oh I have no idea, I was just looking into fixing this myself yesterday. Probably you're right the flags are obsolete.

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.

Expose Hotspot Quick Tile in secondary users.

3 participants