Retrieve packages for the specified user.

DefaultDialerManager#setDefaultDialerApplication is meant to execute on
the current user. However it retreives packages for the user specified
in the context --  which can be different than the user specified in the
method call. As a result, calls to setDefaultDialerApplication can be
successful even if the component is disabled in the current (secondary)
user.

bug: 121094764
Test: via CTS
adb shell am switch-user 10
cts-tradefed run cts-dev -a arm64-v8a -m CtsTelecomTestCases -t android.telecom.cts.DefaultDialerOpest#testSetDefaultDialerNoDialIntent_notSupported

adb shell am switch-user 0
cts-tradefed run cts-dev -a arm64-v8a -m CtsTelecomTestCases -t android.telecom.cts.DefaultDialerOpest#testSetDefaultDialerNoDialIntent_notSupported

Change-Id: I0992594f8791791eacba43e03ca1c293832eddcf
1 file changed