Loading core/java/com/android/internal/util/CollectionUtils.java +0 −4 Original line number Diff line number Diff line Loading @@ -327,10 +327,6 @@ public class CollectionUtils { } } public static @NonNull <T> List<T> defeatNullable(@Nullable List<T> val) { return (val != null) ? val : Collections.emptyList(); } /** * @return the first element if not empty/null, null otherwise */ Loading services/core/java/com/android/server/StorageManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1706,8 +1706,8 @@ class StorageManagerService extends IStorageManager.Stub int uid, String packageName, int[] ops) { long maxTime = 0; final List<AppOpsManager.PackageOps> pkgs = manager.getOpsForPackage(uid, packageName, ops); for (AppOpsManager.PackageOps pkg : CollectionUtils.defeatNullable(pkgs)) { for (AppOpsManager.OpEntry op : CollectionUtils.defeatNullable(pkg.getOps())) { for (AppOpsManager.PackageOps pkg : CollectionUtils.emptyIfNull(pkgs)) { for (AppOpsManager.OpEntry op : CollectionUtils.emptyIfNull(pkg.getOps())) { maxTime = Math.max(maxTime, op.getLastAccessTime()); } } Loading Loading
core/java/com/android/internal/util/CollectionUtils.java +0 −4 Original line number Diff line number Diff line Loading @@ -327,10 +327,6 @@ public class CollectionUtils { } } public static @NonNull <T> List<T> defeatNullable(@Nullable List<T> val) { return (val != null) ? val : Collections.emptyList(); } /** * @return the first element if not empty/null, null otherwise */ Loading
services/core/java/com/android/server/StorageManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1706,8 +1706,8 @@ class StorageManagerService extends IStorageManager.Stub int uid, String packageName, int[] ops) { long maxTime = 0; final List<AppOpsManager.PackageOps> pkgs = manager.getOpsForPackage(uid, packageName, ops); for (AppOpsManager.PackageOps pkg : CollectionUtils.defeatNullable(pkgs)) { for (AppOpsManager.OpEntry op : CollectionUtils.defeatNullable(pkg.getOps())) { for (AppOpsManager.PackageOps pkg : CollectionUtils.emptyIfNull(pkgs)) { for (AppOpsManager.OpEntry op : CollectionUtils.emptyIfNull(pkg.getOps())) { maxTime = Math.max(maxTime, op.getLastAccessTime()); } } Loading