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

Skip to content
Commit c1dad7f2 authored by Lee Shombert's avatar Lee Shombert
Browse files

Update ContentProvider counters outside AMS lock

Bug: 157136568

ContentProviderConnection has a set of reference counts that are mostly
updated within blocks guarded by the ActivityManagerService (AMS) lock.
The exception is refContentProvider(), which is using the AMS lock
solely to guard the reference count updates.  This change makes ref
count updates atomic under control of the local
ContentProviderConnection.

ContentProviderConnection reference counts are now private and must be
modified through accessor methods that enforce coherence.  The total
reference count is returned.  ActivityManagerService methods always
operate on the total reference count values that result from the
method's increment or decrement operation, as follows:
* A count of 1 means the object has just been created and must be
  initialized.
* A count of 0 means the object is no longer used and should be
  reclaimed.

Test: A/B comparisons between baseline and the changed image, with the
following atests:
 * FrameworksServicesTests:UserSystemPackageInstallerTest
 * PtsChreTestCases
 * FrameworksServicesTests:UserManagerServiceCreateProfileTest
 * FrameworksServicesTests:UserManagerServiceIdRecyclingTest
 * FrameworksServicesTests:UserManagerServiceUserInfoTest
 * FrameworksServicesTests:UserLifecycleTests
 * BluetoothInstrumentationTests
 * CtsCalendarProviderTestCases
 * CtsContactsProviderTestCases
 * CtsProviderTestCases
The change introduced no failures.

Change-Id: I688573ce7aee34d98ec510f432b9eb5cc5929670
parent 44aeb8e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment