Support SubscriptionManager.canManagerSubscription for HSUM

SM.canManageSubscription depends on the user context created from the
SubscriptionManager object to query packages. The user context was
system user within OpportunisticNetworkService and thus only system user was supported.

The change supports secondary users (e.g. Main User in HSUM) by creating
a current user context before getting the SubscriptionManager object.

Bug: 371452139
Test: atest OpportunisticNetworkServiceTest FrameworksTelephonyTests
Flag: com.android.internal.telephony.flags.hsum_package_manager
Change-Id: I57f32af9b093992e6ccaa8dc70ebe9a22ed328b0
1 file changed