diff options
author | Jeff Sharkey <jsharkey@android.com> | 2021-04-20 12:30:37 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2021-04-21 12:59:38 -0600 |
commit | f459828358a7079d1e3bc67bb39d5d0c8be3e02c (patch) | |
tree | 200e96548fff5eb8a6433c09da67f168ff420bbd /errorprone/tests/res/android/content/Context.java | |
parent | 1eb043a982c864ea83081cca500cf948c1cb05ff (diff) |
Annotations for Bluetooth broadcast intents.
Recent work has been using Error Prone rules and annotations to
reflect the current state of permission enforcement across the
Bluetooth stack, and we're now in a position were we can add new
permission enforcement that had been missing.
We've currently standardized on saying that APIs that return device
or Bluetooth state information (without sharing details about any
particular remote Bluetooth device) do not need to be permission
protected.
Bug: 183626724
Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true
Change-Id: I53ac7a4fe1dea57316048c3cac4fa237b6ba3d38
Diffstat (limited to 'errorprone/tests/res/android/content/Context.java')
-rw-r--r-- | errorprone/tests/res/android/content/Context.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/errorprone/tests/res/android/content/Context.java b/errorprone/tests/res/android/content/Context.java index 323b8dd46e8f..efc4fb122435 100644 --- a/errorprone/tests/res/android/content/Context.java +++ b/errorprone/tests/res/android/content/Context.java @@ -18,9 +18,22 @@ package android.content; public class Context { public int getUserId() { - return 0; + throw new UnsupportedOperationException(); } public void enforceCallingOrSelfPermission(String permission, String message) { + throw new UnsupportedOperationException(); + } + + public void sendBroadcast(Intent intent) { + throw new UnsupportedOperationException(); + } + + public void sendBroadcast(Intent intent, String receiverPermission) { + throw new UnsupportedOperationException(); + } + + public void sendBroadcastWithMultiplePermissions(Intent intent, String[] receiverPermissions) { + throw new UnsupportedOperationException(); } } |