Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32e22084 authored by Galia Peycheva's avatar Galia Peycheva
Browse files

Fix Assistant always being called in primary user

Currently, when the remote control Assistant button is pressed within
the restricted profile, this triggers an Assistant session on the
UserHandle.myUserId() user. Since this call happens on the system
thread,
this always returns the primary user (0). As a result, the Assistant
session is not started immediately in the restricted profile, but when
the user exits the restricted profile and goes back into the primary
user.
This is highly unexpected behaviour.

In this CL, we correct that call to use mCurrentUserId,
which is the currently active user.

Bug: 131917139

Test: The primary user can control whether the Assistant is disabled in
the restricted profile. We want to test here from inside the restricted
profile that when the Assistant is disabled, no Assistant session is
started in any user and when it is enabled, the session is started in
the restricted profile user.

A. Test that no Assistant session is started when Assistant is disabled:
    1. Create restricted profile and enter it
        (Assistant is disabled by default)
    2. Press Assistant button (Assistant is not invoked)
    3. Exit restricted profile (Assistant is not invoked)
B. Test that Assistant session is started when Assistant is enabled:
    1. Create restricted profile
    2. In Allowed Apps, enable "Google"
    3. Enter restricted profile
    4. Press Assistant button (Assistant is invoked)
    5. Exit restricted profile (Assistant is not invoked)

Change-Id: I823200189f57ef748556b78b967750d1d7c7746f
parent 33562e9a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment