diff options
| author | Svet Ganov <svetoslavganov@google.com> | 2019-03-29 21:13:03 -0700 |
|---|---|---|
| committer | Svet Ganov <svetoslavganov@google.com> | 2019-03-29 21:13:07 -0700 |
| commit | 00a46ef45ce9f4c06af39b13771856793ca570dd (patch) | |
| tree | 2a73bfb0a53df115de553ec01668e548dcd7cc47 /core/java/android | |
| parent | f7a0b28443d8997f19892cc3806e6b7a94150aab (diff) | |
Add missing argument and return annotations
Test: manual
bug:128317336
Change-Id: I239b251b15dceb062e7be9ab602f4b0dce446987
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index 1066fc7598e9..383c06e5c08e 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -18,6 +18,7 @@ package android.app; import android.Manifest; import android.annotation.IntDef; +import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; @@ -3112,7 +3113,7 @@ public class AppOpsManager { * * @see #getUidOpsAt(int) */ - public int getUidCount() { + public @IntRange(from = 0) int getUidCount() { if (mHistoricalUidOps == null) { return 0; } @@ -3128,7 +3129,7 @@ public class AppOpsManager { * * @see #getUidCount() */ - public @NonNull HistoricalUidOps getUidOpsAt(int index) { + public @NonNull HistoricalUidOps getUidOpsAt(@IntRange(from = 0) int index) { if (mHistoricalUidOps == null) { throw new IndexOutOfBoundsException(); } @@ -3389,7 +3390,7 @@ public class AppOpsManager { * * @see #getPackageOpsAt(int) */ - public int getPackageCount() { + public @IntRange(from = 0) int getPackageCount() { if (mHistoricalPackageOps == null) { return 0; } @@ -3405,7 +3406,7 @@ public class AppOpsManager { * * @see #getPackageCount() */ - public @NonNull HistoricalPackageOps getPackageOpsAt(int index) { + public @NonNull HistoricalPackageOps getPackageOpsAt(@IntRange(from = 0) int index) { if (mHistoricalPackageOps == null) { throw new IndexOutOfBoundsException(); } @@ -3624,7 +3625,7 @@ public class AppOpsManager { * @return The number historical app ops. * @see #getOpAt(int) */ - public int getOpCount() { + public @IntRange(from = 0) int getOpCount() { if (mHistoricalOps == null) { return 0; } @@ -3638,7 +3639,7 @@ public class AppOpsManager { * @return The op at the given index. * @see #getOpCount() */ - public @NonNull HistoricalOp getOpAt(int index) { + public @NonNull HistoricalOp getOpAt(@IntRange(from = 0) int index) { if (mHistoricalOps == null) { throw new IndexOutOfBoundsException(); } |
