Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / aosp-stubs / src / main / java / android / nearby / NearbyManager.java
NearbyManager.java47 lines · 1.8 KiBRaw
| 1 | package android.nearby; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | /** |
| 6 | * Compile-only stub. See the module's build.gradle.kts. |
| 7 | * |
| 8 | * <p>Mirrors the powered-off finding surface of the real @SystemApi class. Behaviour notes that |
| 9 | * are NOT visible from these signatures but that callers must handle, taken from the AOSP source: |
| 10 | * |
| 11 | * <ul> |
| 12 | * <li>Every method below throws {@link UnsupportedOperationException} when neither |
| 13 | * {@code ro.bluetooth.finder.supported} nor {@code persist.bluetooth.finder.supported} is |
| 14 | * true. There is no public predicate for this — the real |
| 15 | * {@code isPoweredOffFindingSupported()} is {@code private}. |
| 16 | * <li>All three require {@code android.permission.BLUETOOTH_PRIVILEGED} |
| 17 | * (signature|privileged), including the getter. |
| 18 | * <li>{@link #setPoweredOffFindingEphemeralIds} throws {@link IllegalArgumentException} unless |
| 19 | * every EID is exactly 20 bytes. |
| 20 | * <li>{@link #setPoweredOffFindingMode} throws {@link IllegalStateException} when called with |
| 21 | * {@link #POWERED_OFF_FINDING_MODE_ENABLED} while Bluetooth or location services are off. |
| 22 | * </ul> |
| 23 | */ |
| 24 | public class NearbyManager { |
| 25 | |
| 26 | public static final int POWERED_OFF_FINDING_MODE_UNSUPPORTED = 0; |
| 27 | |
| 28 | public static final int POWERED_OFF_FINDING_MODE_DISABLED = 1; |
| 29 | |
| 30 | public static final int POWERED_OFF_FINDING_MODE_ENABLED = 2; |
| 31 | |
| 32 | private NearbyManager() { |
| 33 | throw new UnsupportedOperationException("stub"); |
| 34 | } |
| 35 | |
| 36 | public void setPoweredOffFindingEphemeralIds(List<byte[]> eids) { |
| 37 | throw new UnsupportedOperationException("stub"); |
| 38 | } |
| 39 | |
| 40 | public void setPoweredOffFindingMode(int poweredOffFindingMode) { |
| 41 | throw new UnsupportedOperationException("stub"); |
| 42 | } |
| 43 | |
| 44 | public int getPoweredOffFindingMode() { |
| 45 | throw new UnsupportedOperationException("stub"); |
| 46 | } |
| 47 | } |