The function that sends the special code is sending intents to all
users, which is creating an activity for both the work profile and the
system user. Whichever intent is received last will be the activity on
top and displayed to the user, and since the work profile's hidden menu does not include the 'Phone
information' option it creates this 'randomness' observed with opening the menu.
This change ag/29101523 started sending the broadcast as UserHandle.ALL, instead of just from the current user causing the reception of more than one intent.
This fix checks for the work profile and returns out of the function without starting another TestingSettings activity.
Flag: EXEMPT bug fix
Bug: 406016005
Test: manual test opening hidden menu, and opening after reboots
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:170fcaf31628d3faf689ce1b525bfba33052d877)
Merged-In: I5a7937ba484afd3ba81c55e66bc53c217a778d18
Change-Id: I5a7937ba484afd3ba81c55e66bc53c217a778d18