Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 054de658 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Adds permission granting to ImsResolver

Uses new @hide PackageManager API to grant permissions to
ImsServices that they need for their IMS stacks.

Test: Run telephony unit tests for ImsResolver/ImsServiceController
Bug: 32460405
Change-Id: If54ce1a47ab2d3c3ababcdf8328e99499518d4f5
parent 84869eee
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -332,15 +332,14 @@ public class ImsServiceController {
    private void grantPermissionsToService() {
        Log.i(LOG_TAG, "Granting Runtime permissions to:" + getComponentName());
        String[] pkgToGrant = {mComponentName.getPackageName()};
        // Uncommented once changes to PackageManager go in (ims_resolver_3_3)
//        try {
//            if (mPackageManager != null) {
//                mPackageManager.grantDefaultPermissionsToEnabledImsServices(pkgToGrant,
//                        mContext.getUserId());
//            }
//        } catch (RemoteException e) {
//            Log.w(LOG_TAG, "Unable to grant permissions, binder died.");
//        }
        try {
            if (mPackageManager != null) {
                mPackageManager.grantDefaultPermissionsToEnabledImsServices(pkgToGrant,
                        mContext.getUserId());
            }
        } catch (RemoteException e) {
            Log.w(LOG_TAG, "Unable to grant permissions, binder died.");
        }
    }

    private void sendImsFeatureCreatedCallback(int slot, int feature) {