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

Commit 7d21001e authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Move permission grant to bind instead of complete

We need to grant the package the correct permissions
before the service is bound to prevent race conditions
where the ImsService needs permissions in initialization.

Bug: 76102874
Test: Manual
Change-Id: I7eafd91407998ecbe823bc7a69e52b58de1e32f7
parent 7cc9aaf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,6 @@ public class ImsServiceController {
            synchronized (mLock) {
                mIsBound = true;
                mIsBinding = false;
                grantPermissionsToService();
                Log.d(LOG_TAG, "ImsService(" + name + "): onServiceConnected with binder: "
                        + service);
                if (service != null) {
@@ -346,6 +345,7 @@ public class ImsServiceController {
            if (!mIsBound && !mIsBinding) {
                mIsBinding = true;
                mImsFeatures = imsFeatureSet;
                grantPermissionsToService();
                Intent imsServiceIntent = new Intent(getServiceInterface()).setComponent(
                        mComponentName);
                mImsServiceConnection = new ImsServiceConnection();
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ public class ImsResolverTest extends ImsTestBase {
        features.add(ImsResolver.METADATA_MMTEL_FEATURE);
        features.add(ImsResolver.METADATA_RCS_FEATURE);
        setupPackageQuery(TEST_DEVICE_DEFAULT_NAME, features, true);
        setupController();

        // Complete package manager lookup and cache.
        startBind();