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

Commit bb1a0d83 authored by Olawale Ogunwale's avatar Olawale Ogunwale Committed by Android Git Automerger
Browse files

am 27d86295: Merge "Also restart provider if there is external handle." into mnc-dev

* commit '27d86295':
  Also restart provider if there is external handle.
parents 72fd6186 27d86295
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15089,7 +15089,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            ContentProviderRecord cpr = app.pubProviders.valueAt(i);
            final boolean always = app.bad || !allowRestart;
            boolean inLaunching = removeDyingProviderLocked(app, cpr, always);
            if ((inLaunching || always) && !cpr.connections.isEmpty()) {
            if ((inLaunching || always) && cpr.hasConnectionOrHandle()) {
                // We left the provider in the launching list, need to
                // restart it.
                restart = true;
@@ -15233,7 +15233,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        for (int i = mLaunchingProviders.size() - 1; i >= 0; i--) {
            ContentProviderRecord cpr = mLaunchingProviders.get(i);
            if (cpr.launchingApp == app) {
                if (!alwaysBad && !app.bad && !cpr.connections.isEmpty()) {
                if (!alwaysBad && !app.bad && cpr.hasConnectionOrHandle()) {
                    restart = true;
                } else {
                    removeDyingProviderLocked(app, cpr, true);
+4 −0
Original line number Diff line number Diff line
@@ -139,6 +139,10 @@ final class ContentProviderRecord {
        return (externalProcessTokenToHandle != null || externalProcessNoHandleCount > 0);
    }

    public boolean hasConnectionOrHandle() {
        return !connections.isEmpty() || hasExternalProcessHandles();
    }

    void dump(PrintWriter pw, String prefix, boolean full) {
        if (full) {
            pw.print(prefix); pw.print("package=");