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

Commit c541144f authored by Svet Ganov's avatar Svet Ganov Committed by android-build-merger
Browse files

Merge "Don't allow acccess to uninstalled system providers" into pi-dev am: bf47ae31

am: a2f46f1e

Change-Id: Ibb8fa84c01deb85f555e2d7464e6a574670e4b0f
parents ef9198be a2f46f1e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1267,6 +1267,8 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    boolean mSystemProvidersInstalled;
    CoreSettingsObserver mCoreSettingsObserver;
    FontScaleSettingObserver mFontScaleSettingObserver;
@@ -12114,6 +12116,14 @@ public class ActivityManagerService extends IActivityManager.Stub
                            "Attempt to launch content provider before system ready");
                }
                // If system providers are not installed yet we aggressively crash to avoid
                // creating multiple instance of these providers and then bad things happen!
                if (!mSystemProvidersInstalled && cpi.applicationInfo.isSystemApp()
                        && "system".equals(cpi.processName)) {
                    throw new IllegalStateException("Cannot access system provider: '"
                            + cpi.authority + "' before system providers are installed!");
                }
                // Make sure that the user who owns this provider is running.  If not,
                // we don't want to allow it to run.
                if (!mUserController.isUserRunning(userId, 0)) {
@@ -12667,6 +12677,10 @@ public class ActivityManagerService extends IActivityManager.Stub
            mSystemThread.installSystemProviders(providers);
        }
        synchronized (this) {
            mSystemProvidersInstalled = true;
        }
        mConstants.start(mContext.getContentResolver());
        mCoreSettingsObserver = new CoreSettingsObserver(this);
        mFontScaleSettingObserver = new FontScaleSettingObserver();