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
Loading
Please register or sign in to comment