|
8 | 8 | * the carrier tethering-entitlement check, so it works with no SIM and |
9 | 9 | * no data plan. The reservation is process-bound: it stays up while this |
10 | 10 | * app process is alive and is torn down on close() or process death. |
11 | | - * API 26+ only; callers must gate on Build.VERSION and hold |
12 | | - * CHANGE_WIFI_STATE + ACCESS_FINE_LOCATION (with Location services on). |
| 11 | + * API 26+ only; callers must gate on Build.VERSION and hold CHANGE_WIFI_STATE |
| 12 | + * plus the hotspot permission from HotspotPermissions (NEARBY_WIFI_DEVICES on |
| 13 | + * API 33+, or ACCESS_FINE_LOCATION with Location services on 32 and below). |
13 | 14 | * |
14 | 15 | * V1 scope (ADFA-4520): manual opt-in from Advanced settings, plus a |
15 | 16 | * contextual recommendation surfaced only when BOTH conditions hold |
@@ -110,13 +111,15 @@ public boolean isOn() { |
110 | 111 | } |
111 | 112 |
|
112 | 113 | /** |
113 | | - * Starts a LocalOnlyHotspot. Caller must have already granted CHANGE_WIFI_STATE + |
114 | | - * ACCESS_FINE_LOCATION and enabled Location services; otherwise onFailed fires. |
| 114 | + * Starts a LocalOnlyHotspot. Caller must have already granted CHANGE_WIFI_STATE and the |
| 115 | + * hotspot permission (see HotspotPermissions); on API 32 and below that also needs Location |
| 116 | + * services on. Otherwise onFailed fires. |
115 | 117 | */ |
116 | 118 | // NewApi is suppressed because every API-26 reference below is protected by the |
117 | 119 | // explicit Build.VERSION.SDK_INT guard (lint cannot see through isSupported(), and |
118 | 120 | // @RequiresApi does not cover the anonymous callback class). MissingPermission is |
119 | | - // suppressed because CHANGE_WIFI_STATE + ACCESS_FINE_LOCATION are requested at runtime. |
| 121 | + // suppressed because CHANGE_WIFI_STATE and the hotspot permission (HotspotPermissions) are |
| 122 | + // requested at runtime. |
120 | 123 | @SuppressLint({"MissingPermission", "NewApi"}) |
121 | 124 | public void start(Context context) { |
122 | 125 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { |
|
0 commit comments