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

Skip to content
Commit 5e74fe5e authored by Eric Biggers's avatar Eric Biggers
Browse files

StorageManagerService: address some errorprone warnings

Address all of the following classes of errorprone warnings in
StorageManagerService.java:

  * [GuardedBy] Use the correct locks when accessing mVolumes and
    mFuseMountedUser.  Both of these appear to have been actual bugs.
    Also add a @GuardedBy annotation in a place that needs it.

  * [UnusedMethod] Remove getLastAccessTime(), shouldBenchmark(),
    findVolumeIdForPathOrThrow(), and killMediaProvider().

  * [UnusedVariable] Remove reset, mPackagesLock, DEBUG_EVENTS,
    ALL_STORAGE_PERMISSIONS, mResolver, and oldState.

  * [ClassCanBeStatic] Make WatchedLockedUsers and ObbAction static.

  * [AndroidFrameworkEfficientCollections] For maps with user ID keys,
    use SparseArray or SparseIntArray instead of ArrayMap or HashMap.

  * [FallThrough] Add an explicit continue.

  * [AndroidFrameworkBinderIdentity] Move a statement into a try block.

  * [JdkObsolete] Use ArrayList instead of LinkedList.

The remaining warning classes were *not* addressed for now: EmptyCatch,
AndroidFrameworkRequiresPermission, StaticAssignmentInConstructor,
AndroidFrameworkEfficientStrings.

Test: m services RUN_ERROR_PRONE=true
Change-Id: I6bc72a8435486f1dd47baa1047e3efa651057364
parent 02afd842
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