This document describes several restrictions placed on accessing camera and connectivity information. These changes help protect users' privacy.
Some of these changes affect all apps running on Android Q while other changes affect only apps that target Android Q.
Changes affecting all apps
The following change affects all apps running on Android Q, even if they target Android 9 (API level 28) or lower.
Access to all camera information requires permission
Android Q changes the breadth of information that the
getCameraCharacteristics()
method returns by default. In particular, your app must have the
CAMERA permission in order to
access potentially device-specific metadata that is included in this method's
return value.
If your app doesn't have the CAMERA permission, it cannot access the following
fields:
ANDROID_LENS_POSE_ROTATIONANDROID_LENS_POSE_TRANSLATIONANDROID_LENS_INTRINSIC_CALIBRATIONANDROID_LENS_RADIAL_DISTORTIONANDROID_LENS_POSE_REFERENCEANDROID_LENS_DISTORTIONANDROID_LENS_INFO_HYPERFOCAL_DISTANCEANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCEANDROID_SENSOR_REFERENCE_ILLUMINANT1ANDROID_SENSOR_REFERENCE_ILLUMINANT2ANDROID_SENSOR_CALIBRATION_TRANSFORM1ANDROID_SENSOR_CALIBRATION_TRANSFORM2ANDROID_SENSOR_COLOR_TRANSFORM1ANDROID_SENSOR_COLOR_TRANSFORM2ANDROID_SENSOR_FORWARD_MATRIX1ANDROID_SENSOR_FORWARD_MATRIX2
Changes affecting apps targeting Android Q
The following changes affect apps only if they target Android Q.
Restriction on enabling and disabling Wi-Fi
Apps targeting Android Q cannot enable or disable Wi-Fi. The
WifiManager.setWifiEnabled() method always returns false.
If needed, use a settings panel to prompt users to enable and disable Wi-Fi.
Wi-Fi network configuration restrictions
To protect user privacy, manual configuration of the list of Wi-Fi networks is now restricted to system apps and device policy controllers (DPCs). A given DPC can be either the device owner or the profile owner.
If your app doesn't fall into one of these categories and targets Android Q, the following methods no longer return useful data:
- The
getConfiguredNetworks()method always returns an empty list. - Each network operation method that returns an integer value—
addNetwork()andupdateNetwork()—always returns -1. - Each network operation that returns a boolean value—
removeNetwork(),reassociate(),enableNetwork(),disableNetwork(),reconnect(), anddisconnect()—always returnsfalse.
If your app needs to connect to Wi-Fi networks, use the following alternative methods:
- To trigger an instant local connection to a Wi-Fi network, use
WifiNetworkSpecifierin a standardNetworkRequestobject. - To add Wi-Fi networks for consideration for providing internet access to the
user, work with
WifiNetworkSuggestionobjects. You can add and remove networks that appear in the auto-connect network selection dialog by callingaddNetworkSuggestions()andremoveNetworkSuggestions(), respectively. These methods don't require any location permissions.
Fine location permission needed for telephony, Wi-Fi, Bluetooth APIs
Unless your app has the
ACCESS_FINE_LOCATION
permission, your app cannot use several methods within the Wi-Fi, Wi-Fi Aware,
or Bluetooth APIs when running on Android Q. The following list shows the
affected methods.
Telephony
TelephonyManagergetCellLocation()getAllCellInfo()requestNetworkScan()requestCellInfoUpdate()getAvailableNetworks()getServiceStateForSubscribergetServiceState()
TelephonyScanManagerrequestNetworkScan()
TelephonyScanManager.NetworkScanCallbackonResults()
PhoneStateListeneronCellLocationChanged()onCellInfoChanged()onServiceStateChanged()
Wi-Fi
WifiManagerstartScan()getScanResults()getConnectionInfo()getConfiguredNetworks()
WifiAwareManagerWifiP2pManagerWifiRttManager
Bluetooth
BluetoothAdapterstartDiscovery()startLeScan()LeScanCallback()