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

Commit 174d9078 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am bfd15fa0: am 6b96e2f0: Merge "Two REMOVE_PROVIDER messages caused by race condition."

* commit 'bfd15fa0':
  Two REMOVE_PROVIDER messages caused by race condition.
parents f2b0fdb2 bfd15fa0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4533,6 +4533,8 @@ public final class ActivityThread {
                                + "snatched provider from the jaws of death");
                    }
                    prc.removePending = false;
                    // There is a race! It fails to remove the message, which
                    // will be handled in completeRemoveProvider().
                    mH.removeMessages(H.REMOVE_PROVIDER, prc);
                } else {
                    unstableDelta = 0;
@@ -4712,6 +4714,11 @@ public final class ActivityThread {
                return;
            }

            // More complicated race!! Some client managed to acquire the
            // provider and release it before the removal was completed.
            // Continue the removal, and abort the next remove message.
            prc.removePending = false;

            final IBinder jBinder = prc.holder.provider.asBinder();
            ProviderRefCount existingPrc = mProviderRefCountMap.get(jBinder);
            if (existingPrc == prc) {