Fix IllegalStateException when creating context for work profile.
Currently, when we trying to create the work profile context to check
necessary permissions, we'll encounter IllegalStateException due to
com.android.phone won't be installed for secondary user. Change to use
AppOpsManager#checkPackage instead to check calling package to avoid
this exception.
Bug: 258316639
Test: atest PhoneSubInfoControllerTest, manually tested on device by
starting google play store in work profile
Change-Id: I57ccf58b285df10126fafb4945df144ad251b99d
1 file changed