1e41f4b71Sopenharmony_ci# Access Token Changelog 2e41f4b71Sopenharmony_ci## cl.access_token.1 Behavior Change When Location Permission Is Requested by requestPermissionsFromUser 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci**Access Level** 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciPublic 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci**Reason for Change** 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ciThis change is a non-compatible change. According to privacy protection requirements, the [ohos.permission.APPROXIMATELY_LOCATION](../../../application-dev/security/permission-list.md#ohospermissionapproximately_location) permission must be requested together with the [ohos.permission.LOCATION_IN_BACKGROUND](../../../application-dev/security/permission-list.md#ohospermissionlocation_in_background) or [ohos.permission.LOCATION](../../../application-dev/security/permission-list.md#ohospermissionlocation) permission. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**Change Impact** 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ciBefore the change, when [requestPermissionsFromUser](../../../application-dev/reference/apis/js-apis-abilityAccessCtrl.md#requestpermissionsfromuser9) is called to request the location permission, an authorization dialog box will be displayed in either of the following cases: 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci- The **ohos.permission.LOCATION_IN_BACKGROUND** permission is requested without the **ohos.permission.APPROXIMATELY_LOCATION** permission. 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci- The **ohos.permission.LOCATION_IN_BACKGROUND** and **ohos.permission.LOCATION** permissions are requested without the **ohos.permission.APPROXIMATELY_LOCATION** permission. 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciAfter the change, the authorization dialog box will not be displayed in the preceding two cases. The **ohos.permission.APPROXIMATELY_LOCATION** permission must be requested together with the **ohos.permission.LOCATION_IN_BACKGROUND** or **ohos.permission.LOCATION** permission. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci**Change Since** 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciOpenHarmony SDK 4.1.1.5 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci**Key API/Component Changes** 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ciThe **ohos.permission.APPROXIMATELY_LOCATION** permission must also be requested when the **ohos.permission.LOCATION_IN_BACKGROUND** or **ohos.permission.LOCATION** permission is requested by using **requestPermissionsFromUser** in @ohos.abilityAccessCtrl.d.ts. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci**Affected APIs** 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci| File| API| 34e41f4b71Sopenharmony_ci| -------- | -------- | 35e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.on('locationChange') | 36e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.off('locationChange') | 37e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.on('locationServiceState') | 38e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.off('locationServiceState') | 39e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.on('cachedGnssLocationsReporting') | 40e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.off('cachedGnssLocationsReporting') | 41e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.on('gnssStatusChange') | 42e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.off('gnssStatusChange') | 43e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.on('nmeaMessageChange') | 44e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.off('nmeaMessageChange') | 45e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.on('fenceStatusChange') | 46e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.off('fenceStatusChange') | 47e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.getCurrentLocation | 48e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.getLastLocation | 49e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.isLocationEnabled | 50e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.requestEnableLocation | 51e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.isGeoServiceAvailable | 52e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.getAddressesFromLocation | 53e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.getAddressesFromLocationName | 54e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.getCachedGnssLocationsSize | 55e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.flushCachedGnssLocations | 56e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | geolocation.sendCommand | 57e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | SatelliteStatusInfo | 58e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | CachedGnssLocationsRequest | 59e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | GeofenceRequest | 60e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | Geofence | 61e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | ReverseGeoCodeRequest | 62e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | GeoCodeRequest | 63e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | GeoAddress | 64e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | LocationRequest | 65e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | CurrentLocationRequest | 66e41f4b71Sopenharmony_ci| @ohos.geolocation.d.ts | Location | 67e41f4b71Sopenharmony_ci| @ohos.geoLocationManager.d.ts | geoLocationManager.on('nmeaMessage') | 68e41f4b71Sopenharmony_ci| @ohos.geoLocationManager.d.ts | geoLocationManager.off('nmeaMessage') | 69e41f4b71Sopenharmony_ci| @ohos.geoLocationManager.d.ts | geoLocationManager.on('locatingRequiredDataChange') | 70e41f4b71Sopenharmony_ci| @ohos.geoLocationManager.d.ts | geoLocationManager.off('locatingRequiredDataChange') | 71e41f4b71Sopenharmony_ci| @ohos.geoLocationManager.d.ts | geoLocationManager.getLocatingRequiredData | 72e41f4b71Sopenharmony_ci| @ohos.bluetooth.d.ts | bluetooth.startBluetoothDiscovery | 73e41f4b71Sopenharmony_ci| @ohos.bluetooth.d.ts | startBLEScan | 74e41f4b71Sopenharmony_ci| @ohos.bluetoothManager.d.ts | bluetoothManager.startBluetoothDiscovery | 75e41f4b71Sopenharmony_ci| @ohos.bluetoothManager.d.ts | startBLEScan | 76e41f4b71Sopenharmony_ci| @ohos.telephony.observer.d.ts | observer.on('cellInfoChange') | 77e41f4b71Sopenharmony_ci| @ohos.telephony.radio.d.ts | radio.sendUpdateCellLocationRequest | 78e41f4b71Sopenharmony_ci| @ohos.telephony.radio.d.ts | radio.getCellInformation | 79e41f4b71Sopenharmony_ci| @system.geolocation.d.ts | GetLocationOption | 80e41f4b71Sopenharmony_ci| @system.geolocation.d.ts | SubscribeLocationOption | 81e41f4b71Sopenharmony_ci| @system.geolocation.d.ts | geolocation.getLocation | 82e41f4b71Sopenharmony_ci| @system.geolocation.d.ts | geolocation.subscribe | 83e41f4b71Sopenharmony_ci| @system.geolocation.d.ts | geolocation.unsubscribe | 84e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.scan | 85e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.getScanInfos | 86e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.getDeviceConfigs | 87e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.getStations | 88e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.getCurrentGroup | 89e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.getP2pPeerDevices | 90e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.p2pConnect | 91e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.startDiscoverDevices | 92e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.on('p2pDeviceChange') | 93e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.off('p2pDeviceChange') | 94e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.on('p2pPeerDeviceChange') | 95e41f4b71Sopenharmony_ci| @ohos.wifi.d.ts | wifi.off('p2pPeerDeviceChange') | 96e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.scan | 97e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getScanResults | 98e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getScanResultsSync | 99e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getCandidateConfigs | 100e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getDeviceConfigs | 101e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getStations | 102e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getCurrentGroup | 103e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getP2pPeerDevices | 104e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.p2pConnect | 105e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.startDiscoverDevices | 106e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.getP2pGroups | 107e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.on('p2pDeviceChange') | 108e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.off('p2pDeviceChange') | 109e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.on('p2pPeerDeviceChange') | 110e41f4b71Sopenharmony_ci| @ohos.wifiManager.d.ts | wifiManager.off('p2pPeerDeviceChange') | 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ci**Adaptation Guide** 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ciRefer to [requestPermissionsFromUser](../../../application-dev/reference/apis/js-apis-abilityAccessCtrl.md#requestpermissionsfromuser9) when modifying **EntryAbility.ets** and importing **GlobalThis**. 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci```ts 117e41f4b71Sopenharmony_ci let context: common.UIAbilityContext = GlobalThis.getInstance().getContext('context'); 118e41f4b71Sopenharmony_ci atManager.requestPermissionsFromUser(context, ['ohos.permission.APPROXIMATELY_LOCATION', 'ohos.permission.LOCATION', 'ohos.permission.LOCATION_IN_BACKGROUND']).then((data) => { 119e41f4b71Sopenharmony_ci console.info('data:' + JSON.stringify(data)); 120e41f4b71Sopenharmony_ci }).catch((err: BusinessError) => { 121e41f4b71Sopenharmony_ci console.info('data:' + JSON.stringify(err)); 122e41f4b71Sopenharmony_ci }) 123e41f4b71Sopenharmony_ci``` 124