Allow Carrier Privs on Any Sub for SubId Check
The ONS method to get the preferred Opportunistic
Data Subscription, like other Subscription methods,
is not subscription-specific. The permissions check
inside that method required carrier privileges on the
*default* subscription, which is incorrect in two ways.
First, the default subId is the "voice" subId on
voice-capable phones. Secondly, getting a subId is not
senstive, and so READ_PHONE_STATE on any subscription
is fine, regardless of whether that subscription is the
default for any specific service.
The net change is to allow carrier privilege check to pass
on ANY sub rather than just the DEFAULT (voice) sub.
Bug: 273568571
Test: atest
CarrierApiTest#testUpdateAvailableNetworksWithCarrierPrivilege
Test: atest TelephonyManagerReadPhoneStatePermissionTest
Test: atest
OpportunisticNetworkServiceTest#testGetPreferredDataSubscriptionId
Change-Id: I53d91acc76dc65689eb8738d5d56b1b24fc466a6
Change-Id: I4829d4a25fc43857d134447e9e1f43bb9c84729e
1 file changed