OSDN Git Service

Remove subtle dependencies
authorTodd Kennedy <toddke@google.com>
Wed, 13 Jul 2016 20:20:30 +0000 (13:20 -0700)
committerTodd Kennedy <toddke@google.com>
Wed, 13 Jul 2016 20:20:30 +0000 (13:20 -0700)
commit28c4e806ea6cb12b3b83af8447b6647471a15d38
tree2cc0e54664b4d3775461e92b2647db1834523e99
parent04918fe02715d330cbefa16d055d5766264273c3
Remove subtle dependencies

There was a very subtle dependency on the method used to allocate a session
id and how that session id was stored. If the session id wasn't stored
in the same synchronized block where the allocation method was called, it
could have been possible to duplicate session ids. Instead of requiring
callers of the allocation method to know that the value must be stored
in a particular way, maintain a separate set of allocated session ids
that is updated by the allocation method and prevents any potential race
conditions.

Change-Id: Ibd793b3851bf1a994e00d86f621180cac598b86e
Fixes: 30089638
services/core/java/com/android/server/pm/PackageInstallerService.java