summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]Android.bp24
-rwxr-xr-x[-rw-r--r--]Android.mk0
-rw-r--r--api/system-current.txt13777
-rw-r--r--api/system-lint-baseline.txt571
-rw-r--r--boot/Android.bp2
-rw-r--r--cmds/app_process/Android.bp1
-rw-r--r--cmds/app_process/app_main.cpp10
-rw-r--r--cmds/bootanimation/BootAnimation.cpp15
-rw-r--r--core/api/system-current.txt1
-rw-r--r--core/api/system-lint-baseline.txt7
-rw-r--r--core/api/test-lint-baseline.txt2
-rw-r--r--core/java/android/accounts/AccountManager.java24
-rw-r--r--core/java/android/app/ActivityManagerInternal.java3
-rw-r--r--core/java/android/app/ActivityThread.java43
-rw-r--r--core/java/android/app/Instrumentation.java6
-rw-r--r--core/java/android/app/PendingIntent.java3
-rw-r--r--core/java/android/app/WallpaperManager.java42
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java252
-rw-r--r--[-rwxr-xr-x]core/java/android/bluetooth/BluetoothClass.java5
-rw-r--r--core/java/android/bluetooth/BluetoothCodecConfig.java37
-rw-r--r--core/java/android/bluetooth/BluetoothDevice.java316
-rw-r--r--core/java/android/bluetooth/BluetoothDeviceGroup.java892
-rw-r--r--core/java/android/bluetooth/BluetoothDun.java296
-rw-r--r--core/java/android/bluetooth/BluetoothGatt.java40
-rw-r--r--core/java/android/bluetooth/BluetoothGroupCallback.java132
-rw-r--r--core/java/android/bluetooth/BluetoothHeadset.java175
-rw-r--r--core/java/android/bluetooth/BluetoothProfile.java54
-rw-r--r--core/java/android/bluetooth/BluetoothQualityReport.java1447
-rw-r--r--core/java/android/bluetooth/BluetoothSocket.java62
-rw-r--r--core/java/android/bluetooth/BluetoothUuid.java35
-rw-r--r--core/java/android/bluetooth/BluetoothVcp.java420
-rw-r--r--core/java/android/bluetooth/DeviceGroup.java177
-rw-r--r--core/java/android/bluetooth/le/AdvertiseData.java45
-rw-r--r--core/java/android/bluetooth/le/AdvertisingSetParameters.java15
-rw-r--r--core/java/android/bluetooth/le/BluetoothLeScanner.java22
-rw-r--r--core/java/android/bluetooth/le/BluetoothLeUtils.java41
-rw-r--r--core/java/android/bluetooth/le/PeriodicAdvertisingCallback.java9
-rw-r--r--core/java/android/bluetooth/le/PeriodicAdvertisingManager.java69
-rw-r--r--core/java/android/bluetooth/le/ScanFilter.java174
-rw-r--r--core/java/android/bluetooth/le/ScanRecord.java52
-rw-r--r--core/java/android/bluetooth/le/ScanResult.java51
-rw-r--r--core/java/android/bluetooth/le/ScanSettings.java9
-rw-r--r--core/java/android/content/ContentResolver.java3
-rw-r--r--core/java/android/content/Intent.java13
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java93
-rw-r--r--core/java/android/content/res/CompatibilityInfo.java41
-rw-r--r--core/java/android/hardware/Camera.java1540
-rw-r--r--core/java/android/hardware/SystemSensorManager.java2
-rw-r--r--core/java/android/hardware/camera2/CameraDevice.java4
-rw-r--r--core/java/android/hardware/camera2/CameraManager.java87
-rw-r--r--core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java3
-rw-r--r--core/java/android/hardware/camera2/impl/CameraConstrainedHighSpeedCaptureSessionImpl.java35
-rw-r--r--core/java/android/hardware/camera2/impl/CameraDeviceImpl.java43
-rw-r--r--core/java/android/hardware/camera2/utils/SurfaceUtils.java32
-rw-r--r--core/java/android/net/NetworkStats.java1
-rw-r--r--core/java/android/net/NetworkStatsHistory.java28
-rw-r--r--core/java/android/nfc/INfcAdapter.aidl6
-rw-r--r--core/java/android/nfc/cardemulation/AidGroup.java11
-rw-r--r--core/java/android/nfc/cardemulation/ApduServiceInfo.java23
-rw-r--r--core/java/android/nfc/tech/MifareClassic.java6
-rw-r--r--core/java/android/nfc/tech/NfcA.java13
-rw-r--r--core/java/android/os/Process.java25
-rw-r--r--core/java/android/os/storage/DiskInfo.java2
-rw-r--r--core/java/android/provider/Browser.java6
-rw-r--r--core/java/android/provider/CalendarContract.java8
-rw-r--r--core/java/android/provider/ContactsContract.java7
-rw-r--r--core/java/android/provider/Settings.java43
-rw-r--r--core/java/android/provider/Telephony.java51
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java2
-rw-r--r--core/java/android/speech/SpeechRecognizer.java1
-rw-r--r--core/java/android/util/BoostFramework.java794
-rw-r--r--core/java/android/util/FeatureFlagUtils.java7
-rw-r--r--core/java/android/util/NtpTrustedTime.java69
-rw-r--r--core/java/android/util/SeempLog.java754
-rw-r--r--core/java/android/util/SparseArrayMap.java2
-rw-r--r--core/java/android/util/TrustedTime.java6
-rw-r--r--core/java/android/util/apk/ApkSignatureVerifier.java150
-rw-r--r--core/java/android/view/Choreographer.java85
-rw-r--r--core/java/android/view/DisplayCutout.java7
-rw-r--r--core/java/android/view/InputEventReceiver.java14
-rw-r--r--core/java/android/view/SurfaceView.java20
-rw-r--r--core/java/android/view/View.java4
-rw-r--r--core/java/android/view/ViewRootImpl.java10
-rw-r--r--core/java/android/view/WindowManagerImpl.java2
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java20
-rw-r--r--core/java/android/webkit/WebChromeClient.java4
-rwxr-xr-x[-rw-r--r--]core/java/android/widget/AbsListView.java82
-rw-r--r--core/java/android/widget/OverScroller.java29
-rw-r--r--core/java/android/widget/Scroller.java3
-rw-r--r--core/java/com/android/ims/internal/uce/common/CapInfo.java6
-rw-r--r--core/java/com/android/internal/app/ActivityTrigger.java101
-rw-r--r--core/java/com/android/internal/os/BinderDeathDispatcher.java6
-rw-r--r--core/java/com/android/internal/os/TEST_MAPPING10
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java6
-rw-r--r--core/java/com/android/internal/widget/ILockSettings.aidl2
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java11
-rw-r--r--core/java/com/android/server/SystemConfig.java14
-rw-r--r--core/jni/Android.bp2
-rw-r--r--core/jni/AndroidRuntime.cpp6
-rw-r--r--core/jni/android_graphics_BLASTBufferQueue.cpp14
-rw-r--r--core/jni/android_hardware_Camera.cpp154
-rw-r--r--core/jni/android_hardware_input_InputWindowHandle.cpp1
-rw-r--r--core/jni/android_media_AudioFormat.h35
-rw-r--r--core/jni/android_util_Process.cpp98
-rw-r--r--core/jni/android_util_SeempLog.cpp218
-rw-r--r--core/jni/android_view_InputEventReceiver.cpp31
-rw-r--r--core/jni/com_android_internal_app_ActivityTrigger.cpp256
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp26
-rw-r--r--core/proto/android/providers/settings/global.proto2
-rw-r--r--core/res/AndroidManifest.xml39
-rw-r--r--core/res/res/drawable/ic_wifi_4_signal_0.xml41
-rw-r--r--core/res/res/drawable/ic_wifi_4_signal_1.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_4_signal_2.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_4_signal_3.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_4_signal_4.xml41
-rw-r--r--core/res/res/drawable/ic_wifi_5_signal_0.xml41
-rw-r--r--core/res/res/drawable/ic_wifi_5_signal_1.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_5_signal_2.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_5_signal_3.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_5_signal_4.xml41
-rw-r--r--core/res/res/drawable/ic_wifi_6_signal_0.xml41
-rw-r--r--core/res/res/drawable/ic_wifi_6_signal_1.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_6_signal_2.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_6_signal_3.xml44
-rw-r--r--core/res/res/drawable/ic_wifi_6_signal_4.xml41
-rw-r--r--core/res/res/values/bools.xml1
-rw-r--r--core/res/res/values/config.xml27
-rw-r--r--core/res/res/values/strings.xml2
-rw-r--r--core/res/res/values/symbols.xml29
-rw-r--r--core/tests/ConnectivityManagerTest/AndroidManifest.xml1
-rw-r--r--core/tests/coretests/src/com/android/internal/os/BinderDeathDispatcherTest.java62
-rwxr-xr-x[-rw-r--r--]data/etc/framework-sysconfig.xml4
-rw-r--r--graphics/java/android/graphics/BLASTBufferQueue.java16
-rw-r--r--location/java/android/location/LocationManager.java20
-rw-r--r--media/java/android/media/AudioFormat.java63
-rw-r--r--media/java/android/media/AudioManager.java60
-rw-r--r--media/java/android/media/AudioRecord.java11
-rw-r--r--media/java/android/media/AudioSystem.java25
-rwxr-xr-xmedia/java/android/media/IAudioService.aidl5
-rw-r--r--media/java/android/media/MediaCodecInfo.java32
-rw-r--r--media/java/android/media/MediaFile.java14
-rw-r--r--media/java/android/media/MediaRecorder.java14
-rw-r--r--media/jni/android_media_MediaPlayer.cpp2
-rw-r--r--mime/java-res/vendor.mime.types8
-rw-r--r--obex/javax/obex/ClientOperation.java12
-rw-r--r--obex/javax/obex/ClientSession.java2
-rw-r--r--obex/javax/obex/ObexHelper.java32
-rw-r--r--obex/javax/obex/ServerOperation.java9
-rw-r--r--obex/javax/obex/ServerSession.java44
-rw-r--r--opengl/java/android/opengl/GLSurfaceView.java4
-rw-r--r--packages/NetworkStack/src/android/net/dhcp/DhcpClient.java1149
-rw-r--r--packages/NetworkStack/src/android/net/dhcp/DhcpDiscoverPacket.java76
-rw-r--r--packages/NetworkStack/src/android/net/dhcp/DhcpPacket.java1428
-rw-r--r--packages/NetworkStack/src/android/net/ip/IpClient.java1795
-rw-r--r--packages/SettingsLib/Android.bp23
-rw-r--r--packages/SettingsLib/res/drawable/ic_5g_uwb_mobiledata.xml49
-rw-r--r--packages/SettingsLib/res/drawable/ic_adv_audio.xml76
-rw-r--r--packages/SettingsLib/res/drawable/ic_vowifi.xml51
-rw-r--r--packages/SettingsLib/res/drawable/ic_vowifi_calling.xml51
-rw-r--r--packages/SettingsLib/res/values-af/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-am/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ar/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-as/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-az/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-b+sr+Latn/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-be/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-bg/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-bn/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-bs/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ca/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-cs/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-da/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-de/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-el/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-en-rAU/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rCA/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rGB/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rIN/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rXC/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-es-rUS/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-es/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-et/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-eu/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-fa/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-fi/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-fr-rCA/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-fr/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-gl/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-gu/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-hi/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-hr/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-hu/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-hy/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-in/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-is/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-it/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-iw/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ja/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-ka/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-kk/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-km/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-kn/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ko/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-ky/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-lo/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-lt/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-lv/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-mk/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ml/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-mn/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-mr/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ms/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-my/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-nb/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ne/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-nl/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-or/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-pa/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-pl/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-pt-rBR/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-pt-rPT/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-pt/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ro/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ru/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-si/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-sk/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-sl/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-sq/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-sr/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-sv/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-sw/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ta/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-te/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-th/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-tl/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-tr/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-uk/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-ur/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-uz/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-vi/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-zh-rCN/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rHK/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rTW/arrays.xml6
-rw-r--r--packages/SettingsLib/res/values-zu/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values/arrays.xml10
-rw-r--r--packages/SettingsLib/res/values/config_qti.xml39
-rw-r--r--packages/SettingsLib/res/values/strings.xml23
-rw-r--r--packages/SettingsLib/res/values/strings_ba.xml43
-rwxr-xr-xpackages/SettingsLib/res/values/strings_qti.xml62
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/Utils.java66
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java50
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java58
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java194
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java208
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java10
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/DeviceGroupClientProfile.java377
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/DunServerProfile.java168
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java162
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/VcpProfile.java213
-rwxr-xr-x[-rw-r--r--]packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java5
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java5
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java25
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java3
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/TelephonyIcons.java78
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java5
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java125
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java42
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/wifi/WifiEntryPreference.java39
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java7
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java1
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java76
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java2
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/PowerAllowlistBackendTest.java1
-rw-r--r--packages/SettingsProvider/res/values/defaults.xml8
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java1
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java7
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java3
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java10
-rw-r--r--packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java4
-rw-r--r--packages/SystemUI/Android.bp22
-rw-r--r--packages/SystemUI/AndroidManifest.xml7
-rw-r--r--packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml8
-rw-r--r--packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml8
-rw-r--r--packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml8
-rw-r--r--packages/SystemUI/res-keyguard/values/strings.xml8
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_1.xml27
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_2.xml27
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_3.xml27
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_4.xml27
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_4_0.xml50
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_4_1.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_4_2.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_4_3.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_4_4.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_5_0.xml50
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_5_1.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_5_2.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_5_3.xml47
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_5_4.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_6_0.xml50
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_6_1.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_6_2.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_6_3.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_qs_wifi_6_4.xml46
-rw-r--r--packages/SystemUI/res/drawable/ic_volte.xml47
-rw-r--r--packages/SystemUI/res/drawable/ic_volte_no_voice.xml50
-rw-r--r--packages/SystemUI/res/drawable/ic_wifi_4_hotspot.xml44
-rw-r--r--packages/SystemUI/res/drawable/ic_wifi_5_hotspot.xml44
-rw-r--r--packages/SystemUI/res/drawable/ic_wifi_6_hotspot.xml44
-rw-r--r--packages/SystemUI/res/drawable/stat_sys_wifi_4_hotspot.xml48
-rw-r--r--packages/SystemUI/res/drawable/stat_sys_wifi_5_hotspot.xml48
-rw-r--r--packages/SystemUI/res/drawable/stat_sys_wifi_6_hotspot.xml48
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/res/layout/keyguard_bottom_area.xml9
-rw-r--r--packages/SystemUI/res/layout/media_smartspace_recommendations.xml2
-rw-r--r--packages/SystemUI/res/layout/mobile_signal_group.xml7
-rw-r--r--packages/SystemUI/res/layout/status_bar_mobile_signal_group.xml10
-rw-r--r--packages/SystemUI/res/values/config.xml6
-rw-r--r--packages/SystemUI/src/com/android/keyguard/CarrierTextController.java2
-rw-r--r--packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java125
-rw-r--r--packages/SystemUI/src/com/android/keyguard/EmergencyButton.java17
-rw-r--r--packages/SystemUI/src/com/android/keyguard/EmergencyButtonController.java53
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java1
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java1
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/keyguard/KeyguardConstants.java0
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java1
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java6
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java1
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java46
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java43
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java12
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java130
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/ScreenDecorations.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/assist/ui/DisplayUtils.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollHelper.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java55
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java49
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java34
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java421
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileState.kt35
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/connectivity/SignalCallback.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiIcons.java69
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiSignalController.java82
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiState.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java7
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java0
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java18
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java28
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/FiveGServiceClient.java354
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotController.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java241
-rwxr-xr-x[-rw-r--r--]packages/SystemUI/src/com/android/systemui/util/sensors/AsyncSensorManager.java10
-rw-r--r--packages/SystemUI/tests/Android.mk4
-rw-r--r--packages/SystemUI/tests/AndroidManifest.xml1
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java22
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/qs/carrier/QSCarrierGroupControllerTest.java2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/CallbackHandlerTest.java2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FiveGServiceClientTest.java145
-rw-r--r--packages/Tethering/src/com/android/networkstack/tethering/Tethering.java2429
-rw-r--r--packages/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java616
-rw-r--r--services/core/Android.bp7
-rw-r--r--services/core/java/com/android/server/ActivityTriggerService.java106
-rw-r--r--services/core/java/com/android/server/BluetoothManagerService.java624
-rw-r--r--services/core/java/com/android/server/BluetoothModeChangeHelper.java7
-rw-r--r--services/core/java/com/android/server/NetPluginDelegate.java161
-rw-r--r--services/core/java/com/android/server/NetworkManagementService.java2
-rw-r--r--services/core/java/com/android/server/NetworkTimeUpdateService.java2
-rw-r--r--services/core/java/com/android/server/StorageManagerService.java35
-rw-r--r--services/core/java/com/android/server/TelephonyRegistry.java20
-rw-r--r--services/core/java/com/android/server/Watchdog.java173
-rw-r--r--services/core/java/com/android/server/WiredAccessoryManager.java322
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java7
-rw-r--r--services/core/java/com/android/server/am/ActiveServices.java191
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerConstants.java65
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java129
-rw-r--r--services/core/java/com/android/server/am/AnrHelper.java41
-rw-r--r--services/core/java/com/android/server/am/AppProfiler.java5
-rw-r--r--services/core/java/com/android/server/am/CachedAppOptimizer.java115
-rw-r--r--services/core/java/com/android/server/am/OomAdjuster.java130
-rw-r--r--services/core/java/com/android/server/am/ProcessErrorStateRecord.java106
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java16
-rw-r--r--services/core/java/com/android/server/am/ProcessRecord.java39
-rw-r--r--services/core/java/com/android/server/am/trace/BinderTransactions.java204
-rw-r--r--services/core/java/com/android/server/am/trace/SmartTraceUtils.java172
-rw-r--r--services/core/java/com/android/server/audio/AudioDeviceBroker.java47
-rw-r--r--services/core/java/com/android/server/audio/AudioDeviceInventory.java128
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java108
-rw-r--r--services/core/java/com/android/server/audio/BtHelper.java422
-rw-r--r--services/core/java/com/android/server/display/DisplayManagerService.java28
-rw-r--r--services/core/java/com/android/server/display/DisplayModeDirector.java2
-rw-r--r--services/core/java/com/android/server/display/DisplayPowerController.java20
-rw-r--r--services/core/java/com/android/server/display/DisplayPowerState.java24
-rw-r--r--services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java163
-rw-r--r--services/core/java/com/android/server/display/LocalDisplayAdapter.java34
-rw-r--r--services/core/java/com/android/server/display/LogicalDisplayMapper.java2
-rw-r--r--services/core/java/com/android/server/display/RampAnimator.java8
-rw-r--r--services/core/java/com/android/server/display/WifiDisplayController.java264
-rw-r--r--services/core/java/com/android/server/display/layout/Layout.java14
-rw-r--r--services/core/java/com/android/server/location/LocationManagerService.java12
-rw-r--r--services/core/java/com/android/server/locksettings/LockSettingsService.java52
-rw-r--r--services/core/java/com/android/server/media/BluetoothRouteProvider.java6
-rw-r--r--services/core/java/com/android/server/net/IpConfigStore.java7
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/om/OverlayManagerSettings.java0
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerService.java1
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/pm/PackageInstallerSession.java25
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java209
-rw-r--r--services/core/java/com/android/server/pm/PackageVerificationState.java35
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java18
-rw-r--r--services/core/java/com/android/server/power/ShutdownThread.java59
-rw-r--r--services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java6
-rw-r--r--services/core/java/com/android/server/statusbar/StatusBarManagerService.java1
-rw-r--r--services/core/java/com/android/server/wm/ActivityMetricsLogger.java42
-rw-r--r--services/core/java/com/android/server/wm/ActivityPluginDelegate.java174
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/wm/ActivityRecord.java136
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/wm/ActivityStarter.java44
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskManagerDebugConfig.java2
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskManagerService.java2
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskSupervisor.java180
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java3
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java154
-rw-r--r--services/core/java/com/android/server/wm/DisplayRotation.java75
-rwxr-xr-xservices/core/java/com/android/server/wm/ForceRefreshRatePackagelist.java154
-rw-r--r--services/core/java/com/android/server/wm/RecentTasks.java13
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/wm/RefreshRatePolicy.java14
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java116
-rw-r--r--services/core/java/com/android/server/wm/ScreenRotationAnimation.java15
-rw-r--r--services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java23
-rw-r--r--services/core/java/com/android/server/wm/Task.java16
-rwxr-xr-x[-rw-r--r--]services/core/java/com/android/server/wm/TaskDisplayArea.java0
-rw-r--r--services/core/java/com/android/server/wm/TaskFragment.java46
-rw-r--r--services/core/java/com/android/server/wm/TaskTapPointerEventListener.java31
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java34
-rw-r--r--services/core/jni/Android.bp1
-rw-r--r--services/core/jni/com_android_server_activityTriggerService.cpp95
-rw-r--r--services/core/jni/com_android_server_am_CachedAppOptimizer.cpp26
-rw-r--r--services/core/jni/onload.cpp2
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java2
-rw-r--r--services/java/com/android/server/SystemServer.java56
-rw-r--r--services/tests/servicestests/src/com/android/server/display/DisplayModeDirectorTest.java114
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java5
-rwxr-xr-x[-rw-r--r--]services/usb/java/com/android/server/usb/UsbDeviceManager.java9
-rw-r--r--services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerService.java1
-rwxr-xr-xtelecomm/java/android/telecom/Call.java12
-rw-r--r--telecomm/java/android/telecom/CallerInfo.java2
-rw-r--r--telecomm/java/android/telecom/Connection.java40
-rwxr-xr-xtelecomm/java/android/telecom/ConnectionService.java21
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java18
-rw-r--r--telephony/api/system-current.txt2073
-rw-r--r--telephony/java/android/service/carrier/CarrierIdentifier.java33
-rw-r--r--telephony/java/android/telephony/AccessNetworkConstants.java23
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java138
-rw-r--r--telephony/java/android/telephony/DisconnectCause.java210
-rw-r--r--telephony/java/android/telephony/ServiceState.java7
-rw-r--r--telephony/java/android/telephony/SmsManager.java5
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java35
-rw-r--r--telephony/java/android/telephony/data/ApnSetting.java4
-rw-r--r--telephony/java/android/telephony/ims/ImsCallProfile.java5
-rw-r--r--[-rwxr-xr-x]telephony/java/android/telephony/ims/ImsCallSession.java4
-rw-r--r--telephony/java/android/telephony/ims/ImsReasonInfo.java10
-rw-r--r--telephony/java/android/telephony/ims/stub/ImsUtImplBase.java16
-rw-r--r--telephony/java/com/android/ims/ImsConfig.java1
-rw-r--r--telephony/java/com/android/ims/ImsUtInterface.java6
-rw-r--r--telephony/java/com/android/ims/internal/IImsUt.aidl8
-rw-r--r--telephony/java/com/android/internal/telephony/DctConstants.java5
-rw-r--r--telephony/java/com/android/internal/telephony/ISmsSecurityAgent.aidl51
-rw-r--r--telephony/java/com/android/internal/telephony/ISmsSecurityService.aidl73
-rw-r--r--telephony/java/com/android/internal/telephony/RILConstants.java3
-rw-r--r--telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.aidl33
-rw-r--r--telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.java122
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyIntents.java20
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyProperties.java6
-rwxr-xr-x[-rw-r--r--]telephony/java/com/android/internal/telephony/cdma/SmsMessage.java0
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java1
-rw-r--r--telephony/java/com/android/internal/telephony/uicc/IccUtils.java3
-rw-r--r--tests/net/java/android/net/NetworkStatsHistoryTest.java620
-rw-r--r--wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java13
493 files changed, 48084 insertions, 972 deletions
diff --git a/Android.bp b/Android.bp
index a99cef879384..8e3874cf45b7 100644..100755
--- a/Android.bp
+++ b/Android.bp
@@ -283,9 +283,31 @@ filegroup {
visibility: ["//visibility:public"],
}
+soong_config_module_type_import {
+ from: "device/qcom/qssi/Android.bp",
+ module_types: [
+ "bredr_vs_btadva_java_defaults",
+ ],
+}
+
+bredr_vs_btadva_java_defaults {
+ name: "btadva_fwk_java_defaults",
+
+ soong_config_variables: {
+ bredr_or_btadva: {
+ btadva: {
+ srcs: [
+ ":framework-bluetooth-adva-srcs",
+ ":libbluetooth-binder-aidl-adva",
+ ],
+ }
+ }
+ }
+}
+
java_defaults {
name: "framework-minus-apex-defaults",
- defaults: ["framework-aidl-export-defaults"],
+ defaults: ["framework-aidl-export-defaults", "btadva_fwk_java_defaults"],
srcs: [
":framework-non-updatable-sources",
"core/java/**/*.logtags",
diff --git a/Android.mk b/Android.mk
index 46529eb64657..46529eb64657 100644..100755
--- a/Android.mk
+++ b/Android.mk
diff --git a/api/system-current.txt b/api/system-current.txt
new file mode 100644
index 000000000000..6d30669637b9
--- /dev/null
+++ b/api/system-current.txt
@@ -0,0 +1,13777 @@
+// Signature format: 2.0
+package android {
+
+ public static final class Manifest.permission {
+ field public static final String ACCESS_AMBIENT_LIGHT_STATS = "android.permission.ACCESS_AMBIENT_LIGHT_STATS";
+ field public static final String ACCESS_BROADCAST_RADIO = "android.permission.ACCESS_BROADCAST_RADIO";
+ field public static final String ACCESS_CACHE_FILESYSTEM = "android.permission.ACCESS_CACHE_FILESYSTEM";
+ field public static final String ACCESS_CONTEXT_HUB = "android.permission.ACCESS_CONTEXT_HUB";
+ field public static final String ACCESS_DRM_CERTIFICATES = "android.permission.ACCESS_DRM_CERTIFICATES";
+ field @Deprecated public static final String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO";
+ field public static final String ACCESS_INSTANT_APPS = "android.permission.ACCESS_INSTANT_APPS";
+ field public static final String ACCESS_LOCUS_ID_USAGE_STATS = "android.permission.ACCESS_LOCUS_ID_USAGE_STATS";
+ field public static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION";
+ field public static final String ACCESS_MTP = "android.permission.ACCESS_MTP";
+ field public static final String ACCESS_NETWORK_CONDITIONS = "android.permission.ACCESS_NETWORK_CONDITIONS";
+ field public static final String ACCESS_NOTIFICATIONS = "android.permission.ACCESS_NOTIFICATIONS";
+ field public static final String ACCESS_SHARED_LIBRARIES = "android.permission.ACCESS_SHARED_LIBRARIES";
+ field public static final String ACCESS_SHORTCUTS = "android.permission.ACCESS_SHORTCUTS";
+ field public static final String ACCESS_SURFACE_FLINGER = "android.permission.ACCESS_SURFACE_FLINGER";
+ field public static final String ACCESS_TV_DESCRAMBLER = "android.permission.ACCESS_TV_DESCRAMBLER";
+ field public static final String ACCESS_TV_TUNER = "android.permission.ACCESS_TV_TUNER";
+ field public static final String ACCESS_VIBRATOR_STATE = "android.permission.ACCESS_VIBRATOR_STATE";
+ field public static final String ACTIVITY_EMBEDDING = "android.permission.ACTIVITY_EMBEDDING";
+ field public static final String ADJUST_RUNTIME_PERMISSIONS_POLICY = "android.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY";
+ field public static final String ALLOCATE_AGGRESSIVE = "android.permission.ALLOCATE_AGGRESSIVE";
+ field public static final String ALLOW_ANY_CODEC_FOR_PLAYBACK = "android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK";
+ field public static final String AMBIENT_WALLPAPER = "android.permission.AMBIENT_WALLPAPER";
+ field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
+ field public static final String BACKUP = "android.permission.BACKUP";
+ field public static final String BIND_ATTENTION_SERVICE = "android.permission.BIND_ATTENTION_SERVICE";
+ field public static final String BIND_AUGMENTED_AUTOFILL_SERVICE = "android.permission.BIND_AUGMENTED_AUTOFILL_SERVICE";
+ field public static final String BIND_CELL_BROADCAST_SERVICE = "android.permission.BIND_CELL_BROADCAST_SERVICE";
+ field @Deprecated public static final String BIND_CONNECTION_SERVICE = "android.permission.BIND_CONNECTION_SERVICE";
+ field public static final String BIND_CONTENT_CAPTURE_SERVICE = "android.permission.BIND_CONTENT_CAPTURE_SERVICE";
+ field public static final String BIND_CONTENT_SUGGESTIONS_SERVICE = "android.permission.BIND_CONTENT_SUGGESTIONS_SERVICE";
+ field public static final String BIND_DIRECTORY_SEARCH = "android.permission.BIND_DIRECTORY_SEARCH";
+ field public static final String BIND_EUICC_SERVICE = "android.permission.BIND_EUICC_SERVICE";
+ field public static final String BIND_EXTERNAL_STORAGE_SERVICE = "android.permission.BIND_EXTERNAL_STORAGE_SERVICE";
+ field public static final String BIND_IMS_SERVICE = "android.permission.BIND_IMS_SERVICE";
+ field public static final String BIND_KEYGUARD_APPWIDGET = "android.permission.BIND_KEYGUARD_APPWIDGET";
+ field public static final String BIND_MUSIC_RECOGNITION_SERVICE = "android.permission.BIND_MUSIC_RECOGNITION_SERVICE";
+ field public static final String BIND_NETWORK_RECOMMENDATION_SERVICE = "android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE";
+ field public static final String BIND_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.BIND_NOTIFICATION_ASSISTANT_SERVICE";
+ field public static final String BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE = "android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE";
+ field public static final String BIND_PRINT_RECOMMENDATION_SERVICE = "android.permission.BIND_PRINT_RECOMMENDATION_SERVICE";
+ field public static final String BIND_RESOLVER_RANKER_SERVICE = "android.permission.BIND_RESOLVER_RANKER_SERVICE";
+ field public static final String BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE = "android.permission.BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE";
+ field public static final String BIND_SETTINGS_SUGGESTIONS_SERVICE = "android.permission.BIND_SETTINGS_SUGGESTIONS_SERVICE";
+ field public static final String BIND_SOUND_TRIGGER_DETECTION_SERVICE = "android.permission.BIND_SOUND_TRIGGER_DETECTION_SERVICE";
+ field public static final String BIND_TELEPHONY_DATA_SERVICE = "android.permission.BIND_TELEPHONY_DATA_SERVICE";
+ field public static final String BIND_TELEPHONY_NETWORK_SERVICE = "android.permission.BIND_TELEPHONY_NETWORK_SERVICE";
+ field public static final String BIND_TEXTCLASSIFIER_SERVICE = "android.permission.BIND_TEXTCLASSIFIER_SERVICE";
+ field public static final String BIND_TRUST_AGENT = "android.permission.BIND_TRUST_AGENT";
+ field public static final String BIND_TV_REMOTE_SERVICE = "android.permission.BIND_TV_REMOTE_SERVICE";
+ field public static final String BRICK = "android.permission.BRICK";
+ field public static final String BRIGHTNESS_SLIDER_USAGE = "android.permission.BRIGHTNESS_SLIDER_USAGE";
+ field @Deprecated public static final String BROADCAST_NETWORK_PRIVILEGED = "android.permission.BROADCAST_NETWORK_PRIVILEGED";
+ field public static final String CAMERA_DISABLE_TRANSMIT_LED = "android.permission.CAMERA_DISABLE_TRANSMIT_LED";
+ field public static final String CAPTURE_AUDIO_HOTWORD = "android.permission.CAPTURE_AUDIO_HOTWORD";
+ field public static final String CAPTURE_MEDIA_OUTPUT = "android.permission.CAPTURE_MEDIA_OUTPUT";
+ field public static final String CAPTURE_TV_INPUT = "android.permission.CAPTURE_TV_INPUT";
+ field public static final String CAPTURE_VOICE_COMMUNICATION_OUTPUT = "android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT";
+ field public static final String CHANGE_APP_IDLE_STATE = "android.permission.CHANGE_APP_IDLE_STATE";
+ field public static final String CHANGE_DEVICE_IDLE_TEMP_WHITELIST = "android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST";
+ field public static final String CLEAR_APP_USER_DATA = "android.permission.CLEAR_APP_USER_DATA";
+ field public static final String COMPANION_APPROVE_WIFI_CONNECTIONS = "android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS";
+ field public static final String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS";
+ field public static final String CONFIGURE_WIFI_DISPLAY = "android.permission.CONFIGURE_WIFI_DISPLAY";
+ field @Deprecated public static final String CONNECTIVITY_INTERNAL = "android.permission.CONNECTIVITY_INTERNAL";
+ field public static final String CONNECTIVITY_USE_RESTRICTED_NETWORKS = "android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS";
+ field public static final String CONTROL_DEVICE_LIGHTS = "android.permission.CONTROL_DEVICE_LIGHTS";
+ field public static final String CONTROL_DISPLAY_COLOR_TRANSFORMS = "android.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS";
+ field public static final String CONTROL_DISPLAY_SATURATION = "android.permission.CONTROL_DISPLAY_SATURATION";
+ field public static final String CONTROL_INCALL_EXPERIENCE = "android.permission.CONTROL_INCALL_EXPERIENCE";
+ field public static final String CONTROL_KEYGUARD_SECURE_NOTIFICATIONS = "android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS";
+ field public static final String CONTROL_VPN = "android.permission.CONTROL_VPN";
+ field public static final String CREATE_USERS = "android.permission.CREATE_USERS";
+ field public static final String CRYPT_KEEPER = "android.permission.CRYPT_KEEPER";
+ field public static final String DEVICE_POWER = "android.permission.DEVICE_POWER";
+ field public static final String DISPATCH_PROVISIONING_MESSAGE = "android.permission.DISPATCH_PROVISIONING_MESSAGE";
+ field public static final String ENTER_CAR_MODE_PRIORITIZED = "android.permission.ENTER_CAR_MODE_PRIORITIZED";
+ field public static final String EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS = "android.permission.EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS";
+ field public static final String FORCE_BACK = "android.permission.FORCE_BACK";
+ field public static final String FORCE_STOP_PACKAGES = "android.permission.FORCE_STOP_PACKAGES";
+ field public static final String GET_APP_OPS_STATS = "android.permission.GET_APP_OPS_STATS";
+ field public static final String GET_PROCESS_STATE_AND_OOM_SCORE = "android.permission.GET_PROCESS_STATE_AND_OOM_SCORE";
+ field public static final String GET_RUNTIME_PERMISSIONS = "android.permission.GET_RUNTIME_PERMISSIONS";
+ field public static final String GET_TOP_ACTIVITY_INFO = "android.permission.GET_TOP_ACTIVITY_INFO";
+ field @Deprecated public static final String GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS = "android.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS";
+ field public static final String GRANT_RUNTIME_PERMISSIONS = "android.permission.GRANT_RUNTIME_PERMISSIONS";
+ field public static final String GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS = "android.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS";
+ field public static final String HANDLE_CAR_MODE_CHANGES = "android.permission.HANDLE_CAR_MODE_CHANGES";
+ field public static final String HARDWARE_TEST = "android.permission.HARDWARE_TEST";
+ field public static final String HDMI_CEC = "android.permission.HDMI_CEC";
+ field public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
+ field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
+ field public static final String INSTALL_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM";
+ field public static final String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS";
+ field public static final String INSTALL_LOCATION_TIME_ZONE_PROVIDER = "android.permission.INSTALL_LOCATION_TIME_ZONE_PROVIDER";
+ field public static final String INSTALL_PACKAGE_UPDATES = "android.permission.INSTALL_PACKAGE_UPDATES";
+ field public static final String INSTALL_SELF_UPDATES = "android.permission.INSTALL_SELF_UPDATES";
+ field public static final String INTENT_FILTER_VERIFICATION_AGENT = "android.permission.INTENT_FILTER_VERIFICATION_AGENT";
+ field public static final String INTERACT_ACROSS_USERS = "android.permission.INTERACT_ACROSS_USERS";
+ field public static final String INTERACT_ACROSS_USERS_FULL = "android.permission.INTERACT_ACROSS_USERS_FULL";
+ field public static final String INTERNAL_SYSTEM_WINDOW = "android.permission.INTERNAL_SYSTEM_WINDOW";
+ field public static final String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP";
+ field public static final String KILL_UID = "android.permission.KILL_UID";
+ field public static final String LOCAL_MAC_ADDRESS = "android.permission.LOCAL_MAC_ADDRESS";
+ field public static final String LOCK_DEVICE = "android.permission.LOCK_DEVICE";
+ field public static final String LOOP_RADIO = "android.permission.LOOP_RADIO";
+ field public static final String MANAGE_ACCESSIBILITY = "android.permission.MANAGE_ACCESSIBILITY";
+ field @Deprecated public static final String MANAGE_ACTIVITY_STACKS = "android.permission.MANAGE_ACTIVITY_STACKS";
+ field public static final String MANAGE_ACTIVITY_TASKS = "android.permission.MANAGE_ACTIVITY_TASKS";
+ field public static final String MANAGE_APP_OPS_RESTRICTIONS = "android.permission.MANAGE_APP_OPS_RESTRICTIONS";
+ field public static final String MANAGE_APP_PREDICTIONS = "android.permission.MANAGE_APP_PREDICTIONS";
+ field public static final String MANAGE_APP_TOKENS = "android.permission.MANAGE_APP_TOKENS";
+ field public static final String MANAGE_AUTO_FILL = "android.permission.MANAGE_AUTO_FILL";
+ field public static final String MANAGE_CARRIER_OEM_UNLOCK_STATE = "android.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE";
+ field public static final String MANAGE_CA_CERTIFICATES = "android.permission.MANAGE_CA_CERTIFICATES";
+ field public static final String MANAGE_CONTENT_CAPTURE = "android.permission.MANAGE_CONTENT_CAPTURE";
+ field public static final String MANAGE_CONTENT_SUGGESTIONS = "android.permission.MANAGE_CONTENT_SUGGESTIONS";
+ field public static final String MANAGE_DEBUGGING = "android.permission.MANAGE_DEBUGGING";
+ field public static final String MANAGE_FACTORY_RESET_PROTECTION = "android.permission.MANAGE_FACTORY_RESET_PROTECTION";
+ field public static final String MANAGE_IPSEC_TUNNELS = "android.permission.MANAGE_IPSEC_TUNNELS";
+ field public static final String MANAGE_MUSIC_RECOGNITION = "android.permission.MANAGE_MUSIC_RECOGNITION";
+ field public static final String MANAGE_NOTIFICATION_LISTENERS = "android.permission.MANAGE_NOTIFICATION_LISTENERS";
+ field public static final String MANAGE_ONE_TIME_PERMISSION_SESSIONS = "android.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS";
+ field public static final String MANAGE_ROLE_HOLDERS = "android.permission.MANAGE_ROLE_HOLDERS";
+ field public static final String MANAGE_ROLLBACKS = "android.permission.MANAGE_ROLLBACKS";
+ field public static final String MANAGE_SENSOR_PRIVACY = "android.permission.MANAGE_SENSOR_PRIVACY";
+ field public static final String MANAGE_SOUND_TRIGGER = "android.permission.MANAGE_SOUND_TRIGGER";
+ field public static final String MANAGE_SUBSCRIPTION_PLANS = "android.permission.MANAGE_SUBSCRIPTION_PLANS";
+ field public static final String MANAGE_TIME_AND_ZONE_DETECTION = "android.permission.MANAGE_TIME_AND_ZONE_DETECTION";
+ field public static final String MANAGE_USB = "android.permission.MANAGE_USB";
+ field public static final String MANAGE_USERS = "android.permission.MANAGE_USERS";
+ field public static final String MANAGE_USER_OEM_UNLOCK_STATE = "android.permission.MANAGE_USER_OEM_UNLOCK_STATE";
+ field public static final String MODIFY_APPWIDGET_BIND_PERMISSIONS = "android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS";
+ field public static final String MODIFY_AUDIO_ROUTING = "android.permission.MODIFY_AUDIO_ROUTING";
+ field public static final String MODIFY_CELL_BROADCASTS = "android.permission.MODIFY_CELL_BROADCASTS";
+ field public static final String MODIFY_DAY_NIGHT_MODE = "android.permission.MODIFY_DAY_NIGHT_MODE";
+ field @Deprecated public static final String MODIFY_NETWORK_ACCOUNTING = "android.permission.MODIFY_NETWORK_ACCOUNTING";
+ field public static final String MODIFY_PARENTAL_CONTROLS = "android.permission.MODIFY_PARENTAL_CONTROLS";
+ field public static final String MODIFY_QUIET_MODE = "android.permission.MODIFY_QUIET_MODE";
+ field public static final String MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE = "android.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE";
+ field public static final String MOVE_PACKAGE = "android.permission.MOVE_PACKAGE";
+ field public static final String NETWORK_AIRPLANE_MODE = "android.permission.NETWORK_AIRPLANE_MODE";
+ field public static final String NETWORK_CARRIER_PROVISIONING = "android.permission.NETWORK_CARRIER_PROVISIONING";
+ field public static final String NETWORK_FACTORY = "android.permission.NETWORK_FACTORY";
+ field public static final String NETWORK_MANAGED_PROVISIONING = "android.permission.NETWORK_MANAGED_PROVISIONING";
+ field public static final String NETWORK_SCAN = "android.permission.NETWORK_SCAN";
+ field public static final String NETWORK_SETTINGS = "android.permission.NETWORK_SETTINGS";
+ field public static final String NETWORK_SETUP_WIZARD = "android.permission.NETWORK_SETUP_WIZARD";
+ field public static final String NETWORK_SIGNAL_STRENGTH_WAKEUP = "android.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP";
+ field public static final String NETWORK_STACK = "android.permission.NETWORK_STACK";
+ field public static final String NETWORK_STATS_PROVIDER = "android.permission.NETWORK_STATS_PROVIDER";
+ field public static final String NOTIFICATION_DURING_SETUP = "android.permission.NOTIFICATION_DURING_SETUP";
+ field public static final String NOTIFY_TV_INPUTS = "android.permission.NOTIFY_TV_INPUTS";
+ field public static final String OBSERVE_APP_USAGE = "android.permission.OBSERVE_APP_USAGE";
+ field public static final String OBSERVE_NETWORK_POLICY = "android.permission.OBSERVE_NETWORK_POLICY";
+ field public static final String OBSERVE_ROLE_HOLDERS = "android.permission.OBSERVE_ROLE_HOLDERS";
+ field public static final String OPEN_ACCESSIBILITY_DETAILS_SETTINGS = "android.permission.OPEN_ACCESSIBILITY_DETAILS_SETTINGS";
+ field public static final String OVERRIDE_WIFI_CONFIG = "android.permission.OVERRIDE_WIFI_CONFIG";
+ field public static final String PACKAGE_VERIFICATION_AGENT = "android.permission.PACKAGE_VERIFICATION_AGENT";
+ field public static final String PACKET_KEEPALIVE_OFFLOAD = "android.permission.PACKET_KEEPALIVE_OFFLOAD";
+ field public static final String PEERS_MAC_ADDRESS = "android.permission.PEERS_MAC_ADDRESS";
+ field public static final String PERFORM_CDMA_PROVISIONING = "android.permission.PERFORM_CDMA_PROVISIONING";
+ field public static final String PERFORM_SIM_ACTIVATION = "android.permission.PERFORM_SIM_ACTIVATION";
+ field public static final String POWER_SAVER = "android.permission.POWER_SAVER";
+ field public static final String PROVIDE_RESOLVER_RANKER_SERVICE = "android.permission.PROVIDE_RESOLVER_RANKER_SERVICE";
+ field public static final String PROVIDE_TRUST_AGENT = "android.permission.PROVIDE_TRUST_AGENT";
+ field public static final String QUERY_TIME_ZONE_RULES = "android.permission.QUERY_TIME_ZONE_RULES";
+ field public static final String RADIO_SCAN_WITHOUT_LOCATION = "android.permission.RADIO_SCAN_WITHOUT_LOCATION";
+ field public static final String READ_ACTIVE_EMERGENCY_SESSION = "android.permission.READ_ACTIVE_EMERGENCY_SESSION";
+ field public static final String READ_CARRIER_APP_INFO = "android.permission.READ_CARRIER_APP_INFO";
+ field public static final String READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS";
+ field public static final String READ_CONTENT_RATING_SYSTEMS = "android.permission.READ_CONTENT_RATING_SYSTEMS";
+ field public static final String READ_DEVICE_CONFIG = "android.permission.READ_DEVICE_CONFIG";
+ field public static final String READ_DREAM_STATE = "android.permission.READ_DREAM_STATE";
+ field public static final String READ_INSTALL_SESSIONS = "android.permission.READ_INSTALL_SESSIONS";
+ field public static final String READ_NETWORK_USAGE_HISTORY = "android.permission.READ_NETWORK_USAGE_HISTORY";
+ field public static final String READ_OEM_UNLOCK_STATE = "android.permission.READ_OEM_UNLOCK_STATE";
+ field public static final String READ_PRINT_SERVICES = "android.permission.READ_PRINT_SERVICES";
+ field public static final String READ_PRINT_SERVICE_RECOMMENDATIONS = "android.permission.READ_PRINT_SERVICE_RECOMMENDATIONS";
+ field public static final String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE";
+ field public static final String READ_RUNTIME_PROFILES = "android.permission.READ_RUNTIME_PROFILES";
+ field public static final String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES";
+ field public static final String READ_SYSTEM_UPDATE_INFO = "android.permission.READ_SYSTEM_UPDATE_INFO";
+ field public static final String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL";
+ field public static final String READ_WIFI_CREDENTIAL = "android.permission.READ_WIFI_CREDENTIAL";
+ field public static final String REAL_GET_TASKS = "android.permission.REAL_GET_TASKS";
+ field public static final String RECEIVE_DATA_ACTIVITY_CHANGE = "android.permission.RECEIVE_DATA_ACTIVITY_CHANGE";
+ field public static final String RECEIVE_DEVICE_CUSTOMIZATION_READY = "android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY";
+ field public static final String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST";
+ field public static final String RECEIVE_WIFI_CREDENTIAL_CHANGE = "android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE";
+ field public static final String RECOVERY = "android.permission.RECOVERY";
+ field public static final String RECOVER_KEYSTORE = "android.permission.RECOVER_KEYSTORE";
+ field public static final String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
+ field public static final String REGISTER_CONNECTION_MANAGER = "android.permission.REGISTER_CONNECTION_MANAGER";
+ field public static final String REGISTER_SIM_SUBSCRIPTION = "android.permission.REGISTER_SIM_SUBSCRIPTION";
+ field public static final String REGISTER_STATS_PULL_ATOM = "android.permission.REGISTER_STATS_PULL_ATOM";
+ field public static final String REMOTE_DISPLAY_PROVIDER = "android.permission.REMOTE_DISPLAY_PROVIDER";
+ field public static final String REMOVE_DRM_CERTIFICATES = "android.permission.REMOVE_DRM_CERTIFICATES";
+ field public static final String REMOVE_TASKS = "android.permission.REMOVE_TASKS";
+ field public static final String REQUEST_NETWORK_SCORES = "android.permission.REQUEST_NETWORK_SCORES";
+ field public static final String REQUEST_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE";
+ field public static final String RESET_PASSWORD = "android.permission.RESET_PASSWORD";
+ field public static final String RESTORE_RUNTIME_PERMISSIONS = "android.permission.RESTORE_RUNTIME_PERMISSIONS";
+ field public static final String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
+ field public static final String RETRIEVE_WINDOW_CONTENT = "android.permission.RETRIEVE_WINDOW_CONTENT";
+ field public static final String REVIEW_ACCESSIBILITY_SERVICES = "android.permission.REVIEW_ACCESSIBILITY_SERVICES";
+ field public static final String REVOKE_RUNTIME_PERMISSIONS = "android.permission.REVOKE_RUNTIME_PERMISSIONS";
+ field public static final String SCORE_NETWORKS = "android.permission.SCORE_NETWORKS";
+ field public static final String SECURE_ELEMENT_PRIVILEGED_OPERATION = "android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION";
+ field public static final String SEND_CATEGORY_CAR_NOTIFICATIONS = "android.permission.SEND_CATEGORY_CAR_NOTIFICATIONS";
+ field public static final String SEND_DEVICE_CUSTOMIZATION_READY = "android.permission.SEND_DEVICE_CUSTOMIZATION_READY";
+ field public static final String SEND_SHOW_SUSPENDED_APP_DETAILS = "android.permission.SEND_SHOW_SUSPENDED_APP_DETAILS";
+ field public static final String SEND_SMS_NO_CONFIRMATION = "android.permission.SEND_SMS_NO_CONFIRMATION";
+ field public static final String SERIAL_PORT = "android.permission.SERIAL_PORT";
+ field public static final String SET_ACTIVITY_WATCHER = "android.permission.SET_ACTIVITY_WATCHER";
+ field public static final String SET_HARMFUL_APP_WARNINGS = "android.permission.SET_HARMFUL_APP_WARNINGS";
+ field public static final String SET_MEDIA_KEY_LISTENER = "android.permission.SET_MEDIA_KEY_LISTENER";
+ field public static final String SET_ORIENTATION = "android.permission.SET_ORIENTATION";
+ field public static final String SET_POINTER_SPEED = "android.permission.SET_POINTER_SPEED";
+ field public static final String SET_SCREEN_COMPATIBILITY = "android.permission.SET_SCREEN_COMPATIBILITY";
+ field public static final String SET_VOLUME_KEY_LONG_PRESS_LISTENER = "android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER";
+ field public static final String SET_WALLPAPER_COMPONENT = "android.permission.SET_WALLPAPER_COMPONENT";
+ field public static final String SHOW_KEYGUARD_MESSAGE = "android.permission.SHOW_KEYGUARD_MESSAGE";
+ field public static final String SHUTDOWN = "android.permission.SHUTDOWN";
+ field public static final String START_ACTIVITIES_FROM_BACKGROUND = "android.permission.START_ACTIVITIES_FROM_BACKGROUND";
+ field public static final String STATUS_BAR_SERVICE = "android.permission.STATUS_BAR_SERVICE";
+ field public static final String STOP_APP_SWITCHES = "android.permission.STOP_APP_SWITCHES";
+ field public static final String SUBSTITUTE_NOTIFICATION_APP_NAME = "android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME";
+ field public static final String SUBSTITUTE_SHARE_TARGET_APP_NAME_AND_ICON = "android.permission.SUBSTITUTE_SHARE_TARGET_APP_NAME_AND_ICON";
+ field public static final String SUSPEND_APPS = "android.permission.SUSPEND_APPS";
+ field public static final String SYSTEM_CAMERA = "android.permission.SYSTEM_CAMERA";
+ field public static final String TETHER_PRIVILEGED = "android.permission.TETHER_PRIVILEGED";
+ field public static final String TV_INPUT_HARDWARE = "android.permission.TV_INPUT_HARDWARE";
+ field public static final String TV_VIRTUAL_REMOTE_CONTROLLER = "android.permission.TV_VIRTUAL_REMOTE_CONTROLLER";
+ field public static final String UNLIMITED_SHORTCUTS_API_CALLS = "android.permission.UNLIMITED_SHORTCUTS_API_CALLS";
+ field public static final String UPDATE_APP_OPS_STATS = "android.permission.UPDATE_APP_OPS_STATS";
+ field public static final String UPDATE_LOCK = "android.permission.UPDATE_LOCK";
+ field public static final String UPDATE_TIME_ZONE_RULES = "android.permission.UPDATE_TIME_ZONE_RULES";
+ field public static final String UPGRADE_RUNTIME_PERMISSIONS = "android.permission.UPGRADE_RUNTIME_PERMISSIONS";
+ field public static final String USER_ACTIVITY = "android.permission.USER_ACTIVITY";
+ field public static final String USE_RESERVED_DISK = "android.permission.USE_RESERVED_DISK";
+ field public static final String WHITELIST_AUTO_REVOKE_PERMISSIONS = "android.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS";
+ field public static final String WHITELIST_RESTRICTED_PERMISSIONS = "android.permission.WHITELIST_RESTRICTED_PERMISSIONS";
+ field public static final String WIFI_SET_DEVICE_MOBILITY_STATE = "android.permission.WIFI_SET_DEVICE_MOBILITY_STATE";
+ field public static final String WIFI_UPDATE_USABILITY_STATS_SCORE = "android.permission.WIFI_UPDATE_USABILITY_STATS_SCORE";
+ field public static final String WRITE_DEVICE_CONFIG = "android.permission.WRITE_DEVICE_CONFIG";
+ field public static final String WRITE_DREAM_STATE = "android.permission.WRITE_DREAM_STATE";
+ field public static final String WRITE_EMBEDDED_SUBSCRIPTIONS = "android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS";
+ field @Deprecated public static final String WRITE_MEDIA_STORAGE = "android.permission.WRITE_MEDIA_STORAGE";
+ field public static final String WRITE_OBB = "android.permission.WRITE_OBB";
+ }
+
+ public static final class Manifest.permission_group {
+ field public static final String UNDEFINED = "android.permission-group.UNDEFINED";
+ }
+
+ public static final class R.array {
+ field public static final int config_keySystemUuidMapping = 17235973; // 0x1070005
+ }
+
+ public static final class R.attr {
+ field public static final int allowClearUserDataOnFailedRestore = 16844288; // 0x1010600
+ field public static final int isVrOnly = 16844152; // 0x1010578
+ field public static final int minExtensionVersion = 16844305; // 0x1010611
+ field public static final int requiredSystemPropertyName = 16844133; // 0x1010565
+ field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566
+ field public static final int sdkVersion = 16844304; // 0x1010610
+ field public static final int supportsAmbientMode = 16844173; // 0x101058d
+ field public static final int userRestriction = 16844164; // 0x1010584
+ }
+
+ public static final class R.bool {
+ field public static final int config_sendPackageName = 17891328; // 0x1110000
+ field public static final int config_showDefaultAssistant = 17891329; // 0x1110001
+ field public static final int config_showDefaultEmergency = 17891330; // 0x1110002
+ field public static final int config_showDefaultHome = 17891331; // 0x1110003
+ }
+
+ public static final class R.color {
+ field public static final int system_notification_accent_color = 17170460; // 0x106001c
+ }
+
+ public static final class R.dimen {
+ field public static final int config_restrictedIconSize = 17104903; // 0x1050007
+ }
+
+ public static final class R.drawable {
+ field public static final int ic_info = 17301684; // 0x10800b4
+ }
+
+ public static final class R.raw {
+ field public static final int loaderror = 17825792; // 0x1100000
+ field public static final int nodomain = 17825793; // 0x1100001
+ }
+
+ public static final class R.string {
+ field public static final int config_defaultAssistant = 17039393; // 0x1040021
+ field public static final int config_defaultBrowser = 17039394; // 0x1040022
+ field public static final int config_defaultCallRedirection = 17039397; // 0x1040025
+ field public static final int config_defaultCallScreening = 17039398; // 0x1040026
+ field public static final int config_defaultDialer = 17039395; // 0x1040023
+ field public static final int config_defaultSms = 17039396; // 0x1040024
+ field public static final int config_feedbackIntentExtraKey = 17039391; // 0x104001f
+ field public static final int config_feedbackIntentNameKey = 17039392; // 0x1040020
+ field public static final int config_helpIntentExtraKey = 17039389; // 0x104001d
+ field public static final int config_helpIntentNameKey = 17039390; // 0x104001e
+ field public static final int config_helpPackageNameKey = 17039387; // 0x104001b
+ field public static final int config_helpPackageNameValue = 17039388; // 0x104001c
+ field public static final int config_systemAutomotiveCluster = 17039400; // 0x1040028
+ field public static final int config_systemAutomotiveProjection = 17039402; // 0x104002a
+ field public static final int config_systemGallery = 17039399; // 0x1040027
+ field public static final int config_systemVideoCall = 17039401; // 0x1040029
+ }
+
+ public static final class R.style {
+ field public static final int Theme_DeviceDefault_DocumentsUI = 16974562; // 0x10302e2
+ field public static final int Theme_Leanback_FormWizard = 16974544; // 0x10302d0
+ }
+
+}
+
+package android.accounts {
+
+ public class AccountManager {
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public android.accounts.AccountManagerFuture<android.os.Bundle> finishSessionAsUser(android.os.Bundle, android.app.Activity, android.os.UserHandle, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
+ }
+
+}
+
+package android.app {
+
+ public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
+ method public void convertFromTranslucent();
+ method public boolean convertToTranslucent(android.app.Activity.TranslucentConversionListener, android.app.ActivityOptions);
+ method @Deprecated public boolean isBackgroundVisibleBehind();
+ method @Deprecated public void onBackgroundVisibleBehindChanged(boolean);
+ }
+
+ public static interface Activity.TranslucentConversionListener {
+ method public void onTranslucentConversionComplete(boolean);
+ }
+
+ public class ActivityManager {
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int);
+ method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void forceStopPackage(String);
+ method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public static int getCurrentUser();
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getPackageImportance(String);
+ method @NonNull public java.util.Collection<java.util.Locale> getSupportedLocales();
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getUidImportance(int);
+ method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void killProcessesWhenImperceptible(@NonNull int[], @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.KILL_UID) public void killUid(int, String);
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener);
+ method public void setDeviceLocales(@NonNull android.os.LocaleList);
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public static void setPersistentVrThread(int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean switchUser(@NonNull android.os.UserHandle);
+ }
+
+ public static interface ActivityManager.OnUidImportanceListener {
+ method public void onUidImportance(int, int);
+ }
+
+ public class AlarmManager {
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void set(int, long, long, long, android.app.PendingIntent, android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void set(int, long, long, long, android.app.AlarmManager.OnAlarmListener, android.os.Handler, android.os.WorkSource);
+ }
+
+ public class AppOpsManager {
+ method @Nullable @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public android.app.RuntimeAppOpAccessMessage collectRuntimeAppOpAccessMessage();
+ method @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public void getHistoricalOps(@NonNull android.app.AppOpsManager.HistoricalOpsRequest, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.AppOpsManager.HistoricalOps>);
+ method public static String[] getOpStrs();
+ method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getOpsForPackage(int, @NonNull String, @Nullable java.lang.String...);
+ method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getPackagesForOps(@Nullable String[]);
+ method public static int opToDefaultMode(@NonNull String);
+ method @Nullable public static String opToPermission(@NonNull String);
+ method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setMode(@NonNull String, int, @Nullable String, int);
+ method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setUidMode(@NonNull String, int, int);
+ field public static final String OPSTR_ACCEPT_HANDOVER = "android:accept_handover";
+ field public static final String OPSTR_ACCESS_ACCESSIBILITY = "android:access_accessibility";
+ field public static final String OPSTR_ACCESS_NOTIFICATIONS = "android:access_notifications";
+ field public static final String OPSTR_ACTIVATE_VPN = "android:activate_vpn";
+ field public static final String OPSTR_ASSIST_SCREENSHOT = "android:assist_screenshot";
+ field public static final String OPSTR_ASSIST_STRUCTURE = "android:assist_structure";
+ field public static final String OPSTR_AUDIO_ACCESSIBILITY_VOLUME = "android:audio_accessibility_volume";
+ field public static final String OPSTR_AUDIO_ALARM_VOLUME = "android:audio_alarm_volume";
+ field public static final String OPSTR_AUDIO_BLUETOOTH_VOLUME = "android:audio_bluetooth_volume";
+ field public static final String OPSTR_AUDIO_MASTER_VOLUME = "android:audio_master_volume";
+ field public static final String OPSTR_AUDIO_MEDIA_VOLUME = "android:audio_media_volume";
+ field public static final String OPSTR_AUDIO_NOTIFICATION_VOLUME = "android:audio_notification_volume";
+ field public static final String OPSTR_AUDIO_RING_VOLUME = "android:audio_ring_volume";
+ field public static final String OPSTR_AUDIO_VOICE_VOLUME = "android:audio_voice_volume";
+ field public static final String OPSTR_AUTO_REVOKE_MANAGED_BY_INSTALLER = "android:auto_revoke_managed_by_installer";
+ field public static final String OPSTR_AUTO_REVOKE_PERMISSIONS_IF_UNUSED = "android:auto_revoke_permissions_if_unused";
+ field public static final String OPSTR_BIND_ACCESSIBILITY_SERVICE = "android:bind_accessibility_service";
+ field public static final String OPSTR_CHANGE_WIFI_STATE = "android:change_wifi_state";
+ field public static final String OPSTR_GET_ACCOUNTS = "android:get_accounts";
+ field public static final String OPSTR_GPS = "android:gps";
+ field public static final String OPSTR_INSTANT_APP_START_FOREGROUND = "android:instant_app_start_foreground";
+ field public static final String OPSTR_INTERACT_ACROSS_PROFILES = "android:interact_across_profiles";
+ field public static final String OPSTR_LEGACY_STORAGE = "android:legacy_storage";
+ field public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";
+ field public static final String OPSTR_MANAGE_EXTERNAL_STORAGE = "android:manage_external_storage";
+ field public static final String OPSTR_MANAGE_IPSEC_TUNNELS = "android:manage_ipsec_tunnels";
+ field public static final String OPSTR_MANAGE_ONGOING_CALLS = "android:manage_ongoing_calls";
+ field public static final String OPSTR_MUTE_MICROPHONE = "android:mute_microphone";
+ field public static final String OPSTR_NEIGHBORING_CELLS = "android:neighboring_cells";
+ field public static final String OPSTR_PLAY_AUDIO = "android:play_audio";
+ field public static final String OPSTR_POST_NOTIFICATION = "android:post_notification";
+ field public static final String OPSTR_PROJECT_MEDIA = "android:project_media";
+ field public static final String OPSTR_READ_CLIPBOARD = "android:read_clipboard";
+ field public static final String OPSTR_READ_ICC_SMS = "android:read_icc_sms";
+ field public static final String OPSTR_READ_MEDIA_AUDIO = "android:read_media_audio";
+ field public static final String OPSTR_READ_MEDIA_IMAGES = "android:read_media_images";
+ field public static final String OPSTR_READ_MEDIA_VIDEO = "android:read_media_video";
+ field public static final String OPSTR_RECEIVE_EMERGENCY_BROADCAST = "android:receive_emergency_broadcast";
+ field public static final String OPSTR_REQUEST_DELETE_PACKAGES = "android:request_delete_packages";
+ field public static final String OPSTR_REQUEST_INSTALL_PACKAGES = "android:request_install_packages";
+ field public static final String OPSTR_RUN_ANY_IN_BACKGROUND = "android:run_any_in_background";
+ field public static final String OPSTR_RUN_IN_BACKGROUND = "android:run_in_background";
+ field public static final String OPSTR_START_FOREGROUND = "android:start_foreground";
+ field public static final String OPSTR_TAKE_AUDIO_FOCUS = "android:take_audio_focus";
+ field public static final String OPSTR_TAKE_MEDIA_BUTTONS = "android:take_media_buttons";
+ field public static final String OPSTR_TOAST_WINDOW = "android:toast_window";
+ field public static final String OPSTR_TURN_SCREEN_ON = "android:turn_screen_on";
+ field public static final String OPSTR_VIBRATE = "android:vibrate";
+ field public static final String OPSTR_WAKE_LOCK = "android:wake_lock";
+ field public static final String OPSTR_WIFI_SCAN = "android:wifi_scan";
+ field public static final String OPSTR_WRITE_CLIPBOARD = "android:write_clipboard";
+ field public static final String OPSTR_WRITE_ICC_SMS = "android:write_icc_sms";
+ field public static final String OPSTR_WRITE_MEDIA_AUDIO = "android:write_media_audio";
+ field public static final String OPSTR_WRITE_MEDIA_IMAGES = "android:write_media_images";
+ field public static final String OPSTR_WRITE_MEDIA_VIDEO = "android:write_media_video";
+ field public static final String OPSTR_WRITE_SMS = "android:write_sms";
+ field public static final String OPSTR_WRITE_WALLPAPER = "android:write_wallpaper";
+ field public static final int OP_FLAGS_ALL = 31; // 0x1f
+ field public static final int OP_FLAGS_ALL_TRUSTED = 13; // 0xd
+ field public static final int OP_FLAG_SELF = 1; // 0x1
+ field public static final int OP_FLAG_TRUSTED_PROXIED = 8; // 0x8
+ field public static final int OP_FLAG_TRUSTED_PROXY = 2; // 0x2
+ field public static final int OP_FLAG_UNTRUSTED_PROXIED = 16; // 0x10
+ field public static final int OP_FLAG_UNTRUSTED_PROXY = 4; // 0x4
+ field public static final int UID_STATE_BACKGROUND = 600; // 0x258
+ field public static final int UID_STATE_CACHED = 700; // 0x2bc
+ field public static final int UID_STATE_FOREGROUND = 500; // 0x1f4
+ field public static final int UID_STATE_FOREGROUND_SERVICE = 400; // 0x190
+ field @Deprecated public static final int UID_STATE_FOREGROUND_SERVICE_LOCATION = 300; // 0x12c
+ field public static final int UID_STATE_PERSISTENT = 100; // 0x64
+ field public static final int UID_STATE_TOP = 200; // 0xc8
+ }
+
+ public static final class AppOpsManager.AttributedHistoricalOps implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.app.AppOpsManager.HistoricalOp getOp(@NonNull String);
+ method @NonNull public android.app.AppOpsManager.HistoricalOp getOpAt(@IntRange(from=0) int);
+ method @IntRange(from=0) public int getOpCount();
+ method @Nullable public String getTag();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.AttributedHistoricalOps> CREATOR;
+ }
+
+ public static final class AppOpsManager.AttributedOpEntry implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getLastAccessBackgroundTime(int);
+ method public long getLastAccessForegroundTime(int);
+ method public long getLastAccessTime(int);
+ method public long getLastAccessTime(int, int, int);
+ method public long getLastBackgroundDuration(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
+ method public long getLastDuration(int);
+ method public long getLastDuration(int, int, int);
+ method public long getLastForegroundDuration(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
+ method public long getLastRejectBackgroundTime(int);
+ method public long getLastRejectForegroundTime(int);
+ method public long getLastRejectTime(int);
+ method public long getLastRejectTime(int, int, int);
+ method public boolean isRunning();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.AttributedOpEntry> CREATOR;
+ }
+
+ public static final class AppOpsManager.HistoricalOp implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getAccessCount(int, int, int);
+ method public long getAccessDuration(int, int, int);
+ method public long getBackgroundAccessCount(int);
+ method public long getBackgroundAccessDuration(int);
+ method public long getBackgroundRejectCount(int);
+ method public long getForegroundAccessCount(int);
+ method public long getForegroundAccessDuration(int);
+ method public long getForegroundRejectCount(int);
+ method @NonNull public String getOpName();
+ method public long getRejectCount(int, int, int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalOp> CREATOR;
+ }
+
+ public static final class AppOpsManager.HistoricalOps implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getBeginTimeMillis();
+ method public long getEndTimeMillis();
+ method @IntRange(from=0) public int getUidCount();
+ method @Nullable public android.app.AppOpsManager.HistoricalUidOps getUidOps(int);
+ method @NonNull public android.app.AppOpsManager.HistoricalUidOps getUidOpsAt(@IntRange(from=0) int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalOps> CREATOR;
+ }
+
+ public static final class AppOpsManager.HistoricalOpsRequest {
+ }
+
+ public static final class AppOpsManager.HistoricalOpsRequest.Builder {
+ ctor public AppOpsManager.HistoricalOpsRequest.Builder(long, long);
+ method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest build();
+ method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setAttributionTag(@Nullable String);
+ method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setFlags(int);
+ method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setOpNames(@Nullable java.util.List<java.lang.String>);
+ method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setPackageName(@Nullable String);
+ method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setUid(int);
+ }
+
+ public static final class AppOpsManager.HistoricalPackageOps implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.app.AppOpsManager.AttributedHistoricalOps getAttributedOps(@NonNull String);
+ method @NonNull public android.app.AppOpsManager.AttributedHistoricalOps getAttributedOpsAt(@IntRange(from=0) int);
+ method @IntRange(from=0) public int getAttributedOpsCount();
+ method @Nullable public android.app.AppOpsManager.HistoricalOp getOp(@NonNull String);
+ method @NonNull public android.app.AppOpsManager.HistoricalOp getOpAt(@IntRange(from=0) int);
+ method @IntRange(from=0) public int getOpCount();
+ method @NonNull public String getPackageName();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalPackageOps> CREATOR;
+ }
+
+ public static final class AppOpsManager.HistoricalUidOps implements android.os.Parcelable {
+ method public int describeContents();
+ method @IntRange(from=0) public int getPackageCount();
+ method @Nullable public android.app.AppOpsManager.HistoricalPackageOps getPackageOps(@NonNull String);
+ method @NonNull public android.app.AppOpsManager.HistoricalPackageOps getPackageOpsAt(@IntRange(from=0) int);
+ method public int getUid();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalUidOps> CREATOR;
+ }
+
+ public static final class AppOpsManager.OpEntry implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.Map<java.lang.String,android.app.AppOpsManager.AttributedOpEntry> getAttributedOpEntries();
+ method @Deprecated public long getDuration();
+ method public long getLastAccessBackgroundTime(int);
+ method public long getLastAccessForegroundTime(int);
+ method public long getLastAccessTime(int);
+ method public long getLastAccessTime(int, int, int);
+ method public long getLastBackgroundDuration(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
+ method public long getLastDuration(int);
+ method public long getLastDuration(int, int, int);
+ method public long getLastForegroundDuration(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
+ method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
+ method public long getLastRejectBackgroundTime(int);
+ method public long getLastRejectForegroundTime(int);
+ method public long getLastRejectTime(int);
+ method public long getLastRejectTime(int, int, int);
+ method public int getMode();
+ method @NonNull public String getOpStr();
+ method @Deprecated @Nullable public String getProxyPackageName();
+ method @Deprecated @Nullable public String getProxyPackageName(int, int);
+ method @Deprecated public int getProxyUid();
+ method @Deprecated public int getProxyUid(int, int);
+ method public boolean isRunning();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEntry> CREATOR;
+ }
+
+ public static final class AppOpsManager.OpEventProxyInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getAttributionTag();
+ method @Nullable public String getPackageName();
+ method @IntRange(from=0) public int getUid();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEventProxyInfo> CREATOR;
+ }
+
+ public static final class AppOpsManager.PackageOps implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.app.AppOpsManager.OpEntry> getOps();
+ method @NonNull public String getPackageName();
+ method public int getUid();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.PackageOps> CREATOR;
+ }
+
+ public class BroadcastOptions {
+ method public static android.app.BroadcastOptions makeBasic();
+ method @RequiresPermission(android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND) public void setBackgroundActivityStartsAllowed(boolean);
+ method public void setDontSendToRestrictedApps(boolean);
+ method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public void setTemporaryAppWhitelistDuration(long);
+ method public android.os.Bundle toBundle();
+ }
+
+ public class DownloadManager {
+ method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public void onMediaStoreDownloadsDeleted(@NonNull android.util.LongSparseArray<java.lang.String>);
+ field public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED";
+ }
+
+ public abstract class InstantAppResolverService extends android.app.Service {
+ ctor public InstantAppResolverService();
+ method public final void attachBaseContext(android.content.Context);
+ method public final android.os.IBinder onBind(android.content.Intent);
+ method @Deprecated public void onGetInstantAppIntentFilter(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @MainThread public void onGetInstantAppIntentFilter(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ method @MainThread public void onGetInstantAppResolveInfo(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
+ }
+
+ public static final class InstantAppResolverService.InstantAppResolutionCallback {
+ method public void onInstantAppResolveInfo(java.util.List<android.content.pm.InstantAppResolveInfo>);
+ }
+
+ public class KeyguardManager {
+ method public android.content.Intent createConfirmFactoryResetCredentialIntent(CharSequence, CharSequence, CharSequence);
+ method @RequiresPermission("android.permission.SET_INITIAL_LOCK") public int getMinLockLength(boolean, int);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS) public boolean getPrivateNotificationsAllowed();
+ method @RequiresPermission("android.permission.SET_INITIAL_LOCK") public boolean isValidLockPasswordComplexity(int, @NonNull byte[], int);
+ method @RequiresPermission(android.Manifest.permission.SHOW_KEYGUARD_MESSAGE) public void requestDismissKeyguard(@NonNull android.app.Activity, @Nullable CharSequence, @Nullable android.app.KeyguardManager.KeyguardDismissCallback);
+ method @RequiresPermission("android.permission.SET_INITIAL_LOCK") public boolean setLock(int, @NonNull byte[], int);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS) public void setPrivateNotificationsAllowed(boolean);
+ }
+
+ public class Notification implements android.os.Parcelable {
+ field public static final String CATEGORY_CAR_EMERGENCY = "car_emergency";
+ field public static final String CATEGORY_CAR_INFORMATION = "car_information";
+ field public static final String CATEGORY_CAR_WARNING = "car_warning";
+ field @RequiresPermission(android.Manifest.permission.NOTIFICATION_DURING_SETUP) public static final String EXTRA_ALLOW_DURING_SETUP = "android.allowDuringSetup";
+ field @RequiresPermission(android.Manifest.permission.SUBSTITUTE_NOTIFICATION_APP_NAME) public static final String EXTRA_SUBSTITUTE_APP_NAME = "android.substName";
+ field public static final int FLAG_AUTOGROUP_SUMMARY = 1024; // 0x400
+ }
+
+ public static final class Notification.TvExtender implements android.app.Notification.Extender {
+ ctor public Notification.TvExtender();
+ ctor public Notification.TvExtender(android.app.Notification);
+ method public android.app.Notification.Builder extend(android.app.Notification.Builder);
+ method public String getChannelId();
+ method public android.app.PendingIntent getContentIntent();
+ method public android.app.PendingIntent getDeleteIntent();
+ method public boolean getSuppressShowOverApps();
+ method public boolean isAvailableOnTv();
+ method public android.app.Notification.TvExtender setChannel(String);
+ method public android.app.Notification.TvExtender setChannelId(String);
+ method public android.app.Notification.TvExtender setContentIntent(android.app.PendingIntent);
+ method public android.app.Notification.TvExtender setDeleteIntent(android.app.PendingIntent);
+ method public android.app.Notification.TvExtender setSuppressShowOverApps(boolean);
+ }
+
+ public final class NotificationChannel implements android.os.Parcelable {
+ method public int getUserLockedFields();
+ method public boolean isDeleted();
+ method public void populateFromXml(org.xmlpull.v1.XmlPullParser);
+ method public void setBlockable(boolean);
+ method public org.json.JSONObject toJson() throws org.json.JSONException;
+ method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
+ field public static final int USER_LOCKED_SOUND = 32; // 0x20
+ }
+
+ public final class NotificationChannelGroup implements android.os.Parcelable {
+ method public org.json.JSONObject toJson() throws org.json.JSONException;
+ }
+
+ public class NotificationManager {
+ method @NonNull public java.util.List<java.lang.String> getAllowedAssistantAdjustments();
+ method @Nullable public android.content.ComponentName getAllowedNotificationAssistant();
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_NOTIFICATION_LISTENERS) public java.util.List<android.content.ComponentName> getEnabledNotificationListeners();
+ method public boolean isNotificationAssistantAccessGranted(@NonNull android.content.ComponentName);
+ method public void setNotificationAssistantAccessGranted(@Nullable android.content.ComponentName, boolean);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_NOTIFICATION_LISTENERS) public void setNotificationListenerAccessGranted(@NonNull android.content.ComponentName, boolean, boolean);
+ field @RequiresPermission(android.Manifest.permission.STATUS_BAR_SERVICE) public static final String ACTION_CLOSE_NOTIFICATION_HANDLER_PANEL = "android.app.action.CLOSE_NOTIFICATION_HANDLER_PANEL";
+ field @RequiresPermission(android.Manifest.permission.STATUS_BAR_SERVICE) public static final String ACTION_OPEN_NOTIFICATION_HANDLER_PANEL = "android.app.action.OPEN_NOTIFICATION_HANDLER_PANEL";
+ field @RequiresPermission(android.Manifest.permission.STATUS_BAR_SERVICE) public static final String ACTION_TOGGLE_NOTIFICATION_HANDLER_PANEL = "android.app.action.TOGGLE_NOTIFICATION_HANDLER_PANEL";
+ }
+
+ public final class RuntimeAppOpAccessMessage implements android.os.Parcelable {
+ ctor public RuntimeAppOpAccessMessage(@IntRange(from=0L) int, @IntRange(from=0L) int, @NonNull String, @Nullable String, @NonNull String, int);
+ method public int describeContents();
+ method @Nullable public String getAttributionTag();
+ method @NonNull public String getMessage();
+ method @NonNull public String getOp();
+ method @NonNull public String getPackageName();
+ method public int getSamplingStrategy();
+ method @IntRange(from=0L) public int getUid();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.RuntimeAppOpAccessMessage> CREATOR;
+ }
+
+ public class SearchManager implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
+ method public void launchAssist(@Nullable android.os.Bundle);
+ }
+
+ public final class StatsManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void addConfig(long, byte[]) throws android.app.StatsManager.StatsUnavailableException;
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean addConfiguration(long, byte[]);
+ method @RequiresPermission(android.Manifest.permission.REGISTER_STATS_PULL_ATOM) public void clearPullAtomCallback(int);
+ method @Deprecated @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getData(long);
+ method @Deprecated @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getMetadata();
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public long[] getRegisteredExperimentIds() throws android.app.StatsManager.StatsUnavailableException;
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getReports(long) throws android.app.StatsManager.StatsUnavailableException;
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getStatsMetadata() throws android.app.StatsManager.StatsUnavailableException;
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void removeConfig(long) throws android.app.StatsManager.StatsUnavailableException;
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean removeConfiguration(long);
+ method @NonNull @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public long[] setActiveConfigsChangedOperation(@Nullable android.app.PendingIntent) throws android.app.StatsManager.StatsUnavailableException;
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void setBroadcastSubscriber(android.app.PendingIntent, long, long) throws android.app.StatsManager.StatsUnavailableException;
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean setBroadcastSubscriber(long, long, android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean setDataFetchOperation(long, android.app.PendingIntent);
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void setFetchReportsOperation(android.app.PendingIntent, long) throws android.app.StatsManager.StatsUnavailableException;
+ method @RequiresPermission(android.Manifest.permission.REGISTER_STATS_PULL_ATOM) public void setPullAtomCallback(int, @Nullable android.app.StatsManager.PullAtomMetadata, @NonNull java.util.concurrent.Executor, @NonNull android.app.StatsManager.StatsPullAtomCallback);
+ field public static final String ACTION_STATSD_STARTED = "android.app.action.STATSD_STARTED";
+ field public static final String EXTRA_STATS_ACTIVE_CONFIG_KEYS = "android.app.extra.STATS_ACTIVE_CONFIG_KEYS";
+ field public static final String EXTRA_STATS_BROADCAST_SUBSCRIBER_COOKIES = "android.app.extra.STATS_BROADCAST_SUBSCRIBER_COOKIES";
+ field public static final String EXTRA_STATS_CONFIG_KEY = "android.app.extra.STATS_CONFIG_KEY";
+ field public static final String EXTRA_STATS_CONFIG_UID = "android.app.extra.STATS_CONFIG_UID";
+ field public static final String EXTRA_STATS_DIMENSIONS_VALUE = "android.app.extra.STATS_DIMENSIONS_VALUE";
+ field public static final String EXTRA_STATS_SUBSCRIPTION_ID = "android.app.extra.STATS_SUBSCRIPTION_ID";
+ field public static final String EXTRA_STATS_SUBSCRIPTION_RULE_ID = "android.app.extra.STATS_SUBSCRIPTION_RULE_ID";
+ field public static final int PULL_SKIP = 1; // 0x1
+ field public static final int PULL_SUCCESS = 0; // 0x0
+ }
+
+ public static class StatsManager.PullAtomMetadata {
+ method @Nullable public int[] getAdditiveFields();
+ method public long getCoolDownMillis();
+ method public long getTimeoutMillis();
+ }
+
+ public static class StatsManager.PullAtomMetadata.Builder {
+ ctor public StatsManager.PullAtomMetadata.Builder();
+ method @NonNull public android.app.StatsManager.PullAtomMetadata build();
+ method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setAdditiveFields(@NonNull int[]);
+ method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setCoolDownMillis(long);
+ method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setTimeoutMillis(long);
+ }
+
+ public static interface StatsManager.StatsPullAtomCallback {
+ method public int onPullAtom(int, @NonNull java.util.List<android.util.StatsEvent>);
+ }
+
+ public static class StatsManager.StatsUnavailableException extends android.util.AndroidException {
+ ctor public StatsManager.StatsUnavailableException(String);
+ ctor public StatsManager.StatsUnavailableException(String, Throwable);
+ }
+
+ public class StatusBarManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.STATUS_BAR) public android.app.StatusBarManager.DisableInfo getDisableInfo();
+ method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setDisabledForSetup(boolean);
+ }
+
+ public static final class StatusBarManager.DisableInfo {
+ method public boolean areAllComponentsEnabled();
+ method public boolean isNavigateToHomeDisabled();
+ method public boolean isNotificationPeekingDisabled();
+ method public boolean isRecentsDisabled();
+ method public boolean isSearchDisabled();
+ method public boolean isStatusBarExpansionDisabled();
+ }
+
+ public final class SystemServiceRegistry {
+ method public static <TServiceClass> void registerContextAwareService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.ContextAwareServiceProducerWithBinder<TServiceClass>);
+ method public static <TServiceClass> void registerContextAwareService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.ContextAwareServiceProducerWithoutBinder<TServiceClass>);
+ method public static <TServiceClass> void registerStaticService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.StaticServiceProducerWithBinder<TServiceClass>);
+ method public static <TServiceClass> void registerStaticService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.StaticServiceProducerWithoutBinder<TServiceClass>);
+ }
+
+ public static interface SystemServiceRegistry.ContextAwareServiceProducerWithBinder<TServiceClass> {
+ method @NonNull public TServiceClass createService(@NonNull android.content.Context, @NonNull android.os.IBinder);
+ }
+
+ public static interface SystemServiceRegistry.ContextAwareServiceProducerWithoutBinder<TServiceClass> {
+ method @NonNull public TServiceClass createService(@NonNull android.content.Context);
+ }
+
+ public static interface SystemServiceRegistry.StaticServiceProducerWithBinder<TServiceClass> {
+ method @NonNull public TServiceClass createService(@NonNull android.os.IBinder);
+ }
+
+ public static interface SystemServiceRegistry.StaticServiceProducerWithoutBinder<TServiceClass> {
+ method @NonNull public TServiceClass createService();
+ }
+
+ public class UiModeManager {
+ method @RequiresPermission(android.Manifest.permission.ENTER_CAR_MODE_PRIORITIZED) public void enableCarMode(@IntRange(from=0) int, int);
+ field public static final String ACTION_ENTER_CAR_MODE_PRIORITIZED = "android.app.action.ENTER_CAR_MODE_PRIORITIZED";
+ field public static final String ACTION_EXIT_CAR_MODE_PRIORITIZED = "android.app.action.EXIT_CAR_MODE_PRIORITIZED";
+ field public static final int DEFAULT_PRIORITY = 0; // 0x0
+ field public static final String EXTRA_CALLING_PACKAGE = "android.app.extra.CALLING_PACKAGE";
+ field public static final String EXTRA_PRIORITY = "android.app.extra.PRIORITY";
+ }
+
+ public final class Vr2dDisplayProperties implements android.os.Parcelable {
+ ctor public Vr2dDisplayProperties(int, int, int);
+ method public int describeContents();
+ method public void dump(@NonNull java.io.PrintWriter, @NonNull String);
+ method public int getAddedFlags();
+ method public int getDpi();
+ method public int getHeight();
+ method public int getRemovedFlags();
+ method public int getWidth();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.Vr2dDisplayProperties> CREATOR;
+ field public static final int FLAG_VIRTUAL_DISPLAY_ENABLED = 1; // 0x1
+ }
+
+ public static final class Vr2dDisplayProperties.Builder {
+ ctor public Vr2dDisplayProperties.Builder();
+ method @NonNull public android.app.Vr2dDisplayProperties.Builder addFlags(int);
+ method @NonNull public android.app.Vr2dDisplayProperties build();
+ method @NonNull public android.app.Vr2dDisplayProperties.Builder removeFlags(int);
+ method @NonNull public android.app.Vr2dDisplayProperties.Builder setDimensions(int, int, int);
+ method @NonNull public android.app.Vr2dDisplayProperties.Builder setEnabled(boolean);
+ }
+
+ public class VrManager {
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public int getVr2dDisplayId();
+ method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public boolean isPersistentVrModeEnabled();
+ method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public boolean isVrModeEnabled();
+ method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public void registerVrStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.app.VrStateCallback);
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setAndBindVrCompositor(android.content.ComponentName);
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setPersistentVrModeEnabled(boolean);
+ method @RequiresPermission("android.permission.ACCESS_VR_MANAGER") public void setStandbyEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setVr2dDisplayProperties(@NonNull android.app.Vr2dDisplayProperties);
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setVrInputMethod(@Nullable android.content.ComponentName);
+ method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public void unregisterVrStateCallback(@NonNull android.app.VrStateCallback);
+ }
+
+ public abstract class VrStateCallback {
+ ctor public VrStateCallback();
+ method public void onPersistentVrStateChanged(boolean);
+ method public void onVrStateChanged(boolean);
+ }
+
+ public final class WallpaperColors implements android.os.Parcelable {
+ ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color, int);
+ method public int getColorHints();
+ field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1
+ field public static final int HINT_SUPPORTS_DARK_THEME = 2; // 0x2
+ }
+
+ public final class WallpaperInfo implements android.os.Parcelable {
+ method public boolean supportsAmbientMode();
+ }
+
+ public class WallpaperManager {
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public void clearWallpaper(int, int);
+ method public void setDisplayOffset(android.os.IBinder, int, int);
+ method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_COMPONENT) public boolean setWallpaperComponent(android.content.ComponentName);
+ }
+
+}
+
+package android.app.admin {
+
+ public class DevicePolicyKeyguardService extends android.app.Service {
+ ctor public DevicePolicyKeyguardService();
+ method @Nullable public void dismiss();
+ method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent);
+ method @Nullable public android.view.SurfaceControlViewHost.SurfacePackage onCreateKeyguardSurface(@NonNull android.os.IBinder);
+ }
+
+ public class DevicePolicyManager {
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public boolean getBluetoothContactSharingDisabled(@NonNull android.os.UserHandle);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getDeviceOwner();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.content.ComponentName getDeviceOwnerComponentOnAnyUser();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getDeviceOwnerNameOnAnyUser();
+ method @Nullable public CharSequence getDeviceOwnerOrganizationName();
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getDeviceOwnerUser();
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<java.lang.String> getPermittedAccessibilityServices(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<java.lang.String> getPermittedInputMethodsForCurrentUser();
+ method @Nullable public android.content.ComponentName getProfileOwner() throws java.lang.IllegalArgumentException;
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getProfileOwnerNameAsUser(int) throws java.lang.IllegalArgumentException;
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public int getUserProvisioningState();
+ method public boolean isDeviceManaged();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isDeviceProvisioned();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isDeviceProvisioningConfigApplied();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isManagedKiosk();
+ method public boolean isSecondaryLockscreenEnabled(@NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isUnattendedManagedKiosk();
+ method @RequiresPermission("android.permission.NOTIFY_PENDING_SYSTEM_UPDATE") public void notifyPendingSystemUpdate(long);
+ method @RequiresPermission("android.permission.NOTIFY_PENDING_SYSTEM_UPDATE") public void notifyPendingSystemUpdate(long, boolean);
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public boolean packageHasActiveAdmins(String);
+ method @Deprecated @RequiresPermission("android.permission.MANAGE_DEVICE_ADMINS") public boolean setActiveProfileOwner(@NonNull android.content.ComponentName, String) throws java.lang.IllegalArgumentException;
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setDeviceProvisioningConfigApplied();
+ method @Deprecated @RequiresPermission(value=android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS, conditional=true) public void setProfileOwnerCanAccessDeviceIds(@NonNull android.content.ComponentName);
+ method public void setSecondaryLockscreenEnabled(@NonNull android.content.ComponentName, boolean);
+ field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_ALLOWED";
+ field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_DISALLOWED";
+ field public static final String ACTION_BIND_SECONDARY_LOCKSCREEN_SERVICE = "android.app.action.BIND_SECONDARY_LOCKSCREEN_SERVICE";
+ field public static final String ACTION_PROVISION_FINALIZATION = "android.app.action.PROVISION_FINALIZATION";
+ field public static final String ACTION_PROVISION_FINANCED_DEVICE = "android.app.action.PROVISION_FINANCED_DEVICE";
+ field public static final String ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE = "android.app.action.PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE";
+ field @RequiresPermission(android.Manifest.permission.MANAGE_FACTORY_RESET_PROTECTION) public static final String ACTION_RESET_PROTECTION_POLICY_CHANGED = "android.app.action.RESET_PROTECTION_POLICY_CHANGED";
+ field public static final String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER";
+ field public static final String ACTION_STATE_USER_SETUP_COMPLETE = "android.app.action.STATE_USER_SETUP_COMPLETE";
+ field public static final String EXTRA_PROFILE_OWNER_NAME = "android.app.extra.PROFILE_OWNER_NAME";
+ field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_ICON_URI = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_ICON_URI";
+ field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL";
+ field public static final String EXTRA_PROVISIONING_ORGANIZATION_NAME = "android.app.extra.PROVISIONING_ORGANIZATION_NAME";
+ field public static final String EXTRA_PROVISIONING_SUPPORT_URL = "android.app.extra.PROVISIONING_SUPPORT_URL";
+ field public static final String EXTRA_PROVISIONING_TRIGGER = "android.app.extra.PROVISIONING_TRIGGER";
+ field public static final String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
+ field public static final int PROVISIONING_TRIGGER_CLOUD_ENROLLMENT = 1; // 0x1
+ field public static final int PROVISIONING_TRIGGER_PERSISTENT_DEVICE_OWNER = 3; // 0x3
+ field public static final int PROVISIONING_TRIGGER_QR_CODE = 2; // 0x2
+ field public static final int PROVISIONING_TRIGGER_UNSPECIFIED = 0; // 0x0
+ field public static final int STATE_USER_PROFILE_COMPLETE = 4; // 0x4
+ field public static final int STATE_USER_PROFILE_FINALIZED = 5; // 0x5
+ field public static final int STATE_USER_SETUP_COMPLETE = 2; // 0x2
+ field public static final int STATE_USER_SETUP_FINALIZED = 3; // 0x3
+ field public static final int STATE_USER_SETUP_INCOMPLETE = 1; // 0x1
+ field public static final int STATE_USER_UNMANAGED = 0; // 0x0
+ }
+
+ public final class SystemUpdatePolicy implements android.os.Parcelable {
+ method public android.app.admin.SystemUpdatePolicy.InstallationOption getInstallationOptionAt(long);
+ field public static final int TYPE_PAUSE = 4; // 0x4
+ }
+
+ public static class SystemUpdatePolicy.InstallationOption {
+ method public long getEffectiveTime();
+ method public int getType();
+ }
+
+}
+
+package android.app.appsearch {
+
+ public class AppSearchManagerFrameworkInitializer {
+ method public static void initialize();
+ }
+
+}
+
+package android.app.assist {
+
+ public static class AssistStructure.ViewNode {
+ ctor public AssistStructure.ViewNode();
+ }
+
+}
+
+package android.app.backup {
+
+ public class BackupDataInput {
+ ctor public BackupDataInput(java.io.FileDescriptor);
+ }
+
+ public class BackupDataOutput {
+ ctor public BackupDataOutput(java.io.FileDescriptor);
+ ctor public BackupDataOutput(java.io.FileDescriptor, long);
+ }
+
+ public class BackupManager {
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void backupNow();
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public android.app.backup.RestoreSession beginRestoreSession();
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void cancelBackups();
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void excludeKeysFromRestore(@NonNull String, @NonNull java.util.List<java.lang.String>);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public long getAvailableRestoreToken(String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.Intent getConfigurationIntent(String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public String getCurrentTransport();
+ method @Nullable @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.ComponentName getCurrentTransportComponent();
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.Intent getDataManagementIntent(String);
+ method @Nullable @RequiresPermission(android.Manifest.permission.BACKUP) public CharSequence getDataManagementIntentLabel(@NonNull String);
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.BACKUP) public String getDataManagementLabel(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public String getDestinationString(String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public boolean isAppEligibleForBackup(String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public boolean isBackupEnabled();
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public boolean isBackupServiceActive(android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public String[] listAllTransports();
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public int requestBackup(String[], android.app.backup.BackupObserver);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public int requestBackup(String[], android.app.backup.BackupObserver, android.app.backup.BackupManagerMonitor, int);
+ method @Deprecated public int requestRestore(android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.BACKUP) public String selectBackupTransport(String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void selectBackupTransport(android.content.ComponentName, android.app.backup.SelectBackupTransportCallback);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void setAncestralSerialNumber(long);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void setAutoRestore(boolean);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void setBackupEnabled(boolean);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(@NonNull android.content.ComponentName, @NonNull String, @Nullable android.content.Intent, @NonNull String, @Nullable android.content.Intent, @Nullable String);
+ method @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(@NonNull android.content.ComponentName, @NonNull String, @Nullable android.content.Intent, @NonNull String, @Nullable android.content.Intent, @Nullable CharSequence);
+ field public static final int ERROR_AGENT_FAILURE = -1003; // 0xfffffc15
+ field public static final int ERROR_BACKUP_CANCELLED = -2003; // 0xfffff82d
+ field public static final int ERROR_BACKUP_NOT_ALLOWED = -2001; // 0xfffff82f
+ field public static final int ERROR_PACKAGE_NOT_FOUND = -2002; // 0xfffff82e
+ field public static final int ERROR_TRANSPORT_ABORTED = -1000; // 0xfffffc18
+ field public static final int ERROR_TRANSPORT_INVALID = -2; // 0xfffffffe
+ field public static final int ERROR_TRANSPORT_PACKAGE_REJECTED = -1002; // 0xfffffc16
+ field public static final int ERROR_TRANSPORT_QUOTA_EXCEEDED = -1005; // 0xfffffc13
+ field public static final int ERROR_TRANSPORT_UNAVAILABLE = -1; // 0xffffffff
+ field public static final int FLAG_NON_INCREMENTAL_BACKUP = 1; // 0x1
+ field public static final String PACKAGE_MANAGER_SENTINEL = "@pm@";
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
+ public class BackupManagerMonitor {
+ ctor public BackupManagerMonitor();
+ method public void onEvent(android.os.Bundle);
+ field public static final String EXTRA_LOG_CANCEL_ALL = "android.app.backup.extra.LOG_CANCEL_ALL";
+ field public static final String EXTRA_LOG_EVENT_CATEGORY = "android.app.backup.extra.LOG_EVENT_CATEGORY";
+ field public static final String EXTRA_LOG_EVENT_ID = "android.app.backup.extra.LOG_EVENT_ID";
+ field public static final String EXTRA_LOG_EVENT_PACKAGE_LONG_VERSION = "android.app.backup.extra.LOG_EVENT_PACKAGE_FULL_VERSION";
+ field public static final String EXTRA_LOG_EVENT_PACKAGE_NAME = "android.app.backup.extra.LOG_EVENT_PACKAGE_NAME";
+ field @Deprecated public static final String EXTRA_LOG_EVENT_PACKAGE_VERSION = "android.app.backup.extra.LOG_EVENT_PACKAGE_VERSION";
+ field public static final String EXTRA_LOG_EXCEPTION_FULL_BACKUP = "android.app.backup.extra.LOG_EXCEPTION_FULL_BACKUP";
+ field public static final String EXTRA_LOG_ILLEGAL_KEY = "android.app.backup.extra.LOG_ILLEGAL_KEY";
+ field public static final String EXTRA_LOG_MANIFEST_PACKAGE_NAME = "android.app.backup.extra.LOG_MANIFEST_PACKAGE_NAME";
+ field public static final String EXTRA_LOG_OLD_VERSION = "android.app.backup.extra.LOG_OLD_VERSION";
+ field public static final String EXTRA_LOG_POLICY_ALLOW_APKS = "android.app.backup.extra.LOG_POLICY_ALLOW_APKS";
+ field public static final String EXTRA_LOG_PREFLIGHT_ERROR = "android.app.backup.extra.LOG_PREFLIGHT_ERROR";
+ field public static final String EXTRA_LOG_RESTORE_ANYWAY = "android.app.backup.extra.LOG_RESTORE_ANYWAY";
+ field public static final String EXTRA_LOG_RESTORE_VERSION = "android.app.backup.extra.LOG_RESTORE_VERSION";
+ field public static final String EXTRA_LOG_WIDGET_PACKAGE_NAME = "android.app.backup.extra.LOG_WIDGET_PACKAGE_NAME";
+ field public static final int LOG_EVENT_CATEGORY_AGENT = 2; // 0x2
+ field public static final int LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY = 3; // 0x3
+ field public static final int LOG_EVENT_CATEGORY_TRANSPORT = 1; // 0x1
+ field public static final int LOG_EVENT_ID_APK_NOT_INSTALLED = 40; // 0x28
+ field public static final int LOG_EVENT_ID_APP_HAS_NO_AGENT = 28; // 0x1c
+ field public static final int LOG_EVENT_ID_BACKUP_DISABLED = 13; // 0xd
+ field public static final int LOG_EVENT_ID_CANNOT_RESTORE_WITHOUT_APK = 41; // 0x29
+ field public static final int LOG_EVENT_ID_CANT_FIND_AGENT = 30; // 0x1e
+ field public static final int LOG_EVENT_ID_CORRUPT_MANIFEST = 46; // 0x2e
+ field public static final int LOG_EVENT_ID_DEVICE_NOT_PROVISIONED = 14; // 0xe
+ field public static final int LOG_EVENT_ID_ERROR_PREFLIGHT = 16; // 0x10
+ field public static final int LOG_EVENT_ID_EXCEPTION_FULL_BACKUP = 19; // 0x13
+ field public static final int LOG_EVENT_ID_EXPECTED_DIFFERENT_PACKAGE = 43; // 0x2b
+ field public static final int LOG_EVENT_ID_FULL_BACKUP_CANCEL = 4; // 0x4
+ field public static final int LOG_EVENT_ID_FULL_RESTORE_ALLOW_BACKUP_FALSE = 39; // 0x27
+ field public static final int LOG_EVENT_ID_FULL_RESTORE_SIGNATURE_MISMATCH = 37; // 0x25
+ field public static final int LOG_EVENT_ID_FULL_RESTORE_TIMEOUT = 45; // 0x2d
+ field public static final int LOG_EVENT_ID_ILLEGAL_KEY = 5; // 0x5
+ field public static final int LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL = 21; // 0x15
+ field public static final int LOG_EVENT_ID_KEY_VALUE_RESTORE_TIMEOUT = 31; // 0x1f
+ field public static final int LOG_EVENT_ID_LOST_TRANSPORT = 25; // 0x19
+ field public static final int LOG_EVENT_ID_MISSING_SIGNATURE = 42; // 0x2a
+ field public static final int LOG_EVENT_ID_NO_DATA_TO_SEND = 7; // 0x7
+ field public static final int LOG_EVENT_ID_NO_PACKAGES = 49; // 0x31
+ field public static final int LOG_EVENT_ID_NO_PM_METADATA_RECEIVED = 23; // 0x17
+ field public static final int LOG_EVENT_ID_NO_RESTORE_METADATA_AVAILABLE = 22; // 0x16
+ field public static final int LOG_EVENT_ID_PACKAGE_INELIGIBLE = 9; // 0x9
+ field public static final int LOG_EVENT_ID_PACKAGE_KEY_VALUE_PARTICIPANT = 10; // 0xa
+ field public static final int LOG_EVENT_ID_PACKAGE_NOT_FOUND = 12; // 0xc
+ field public static final int LOG_EVENT_ID_PACKAGE_NOT_PRESENT = 26; // 0x1a
+ field public static final int LOG_EVENT_ID_PACKAGE_STOPPED = 11; // 0xb
+ field public static final int LOG_EVENT_ID_PACKAGE_TRANSPORT_NOT_PRESENT = 15; // 0xf
+ field public static final int LOG_EVENT_ID_PM_AGENT_HAS_NO_METADATA = 24; // 0x18
+ field public static final int LOG_EVENT_ID_QUOTA_HIT_PREFLIGHT = 18; // 0x12
+ field public static final int LOG_EVENT_ID_RESTORE_ANY_VERSION = 34; // 0x22
+ field public static final int LOG_EVENT_ID_RESTORE_VERSION_HIGHER = 27; // 0x1b
+ field public static final int LOG_EVENT_ID_SIGNATURE_MISMATCH = 29; // 0x1d
+ field public static final int LOG_EVENT_ID_SYSTEM_APP_NO_AGENT = 38; // 0x26
+ field public static final int LOG_EVENT_ID_TRANSPORT_IS_NULL = 50; // 0x32
+ field public static final int LOG_EVENT_ID_TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED = 51; // 0x33
+ field public static final int LOG_EVENT_ID_UNKNOWN_VERSION = 44; // 0x2c
+ field public static final int LOG_EVENT_ID_VERSIONS_MATCH = 35; // 0x23
+ field public static final int LOG_EVENT_ID_VERSION_OF_BACKUP_OLDER = 36; // 0x24
+ field public static final int LOG_EVENT_ID_WIDGET_METADATA_MISMATCH = 47; // 0x2f
+ field public static final int LOG_EVENT_ID_WIDGET_UNKNOWN_VERSION = 48; // 0x30
+ }
+
+ public abstract class BackupObserver {
+ ctor public BackupObserver();
+ method public void backupFinished(int);
+ method public void onResult(String, int);
+ method public void onUpdate(String, android.app.backup.BackupProgress);
+ }
+
+ public class BackupProgress implements android.os.Parcelable {
+ ctor public BackupProgress(long, long);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.backup.BackupProgress> CREATOR;
+ field public final long bytesExpected;
+ field public final long bytesTransferred;
+ }
+
+ public class BackupTransport {
+ ctor public BackupTransport();
+ method public int abortFullRestore();
+ method public void cancelFullBackup();
+ method public int checkFullBackupSize(long);
+ method public int clearBackupData(android.content.pm.PackageInfo);
+ method public android.content.Intent configurationIntent();
+ method public String currentDestinationString();
+ method public android.content.Intent dataManagementIntent();
+ method @Nullable public CharSequence dataManagementIntentLabel();
+ method @Deprecated @Nullable public String dataManagementLabel();
+ method public int finishBackup();
+ method public void finishRestore();
+ method public android.app.backup.RestoreSet[] getAvailableRestoreSets();
+ method public long getBackupQuota(String, boolean);
+ method public android.os.IBinder getBinder();
+ method public long getCurrentRestoreSet();
+ method public int getNextFullRestoreDataChunk(android.os.ParcelFileDescriptor);
+ method public int getRestoreData(android.os.ParcelFileDescriptor);
+ method public int getTransportFlags();
+ method public int initializeDevice();
+ method public boolean isAppEligibleForBackup(android.content.pm.PackageInfo, boolean);
+ method public String name();
+ method public android.app.backup.RestoreDescription nextRestorePackage();
+ method public int performBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor, int);
+ method public int performBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor);
+ method public int performFullBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor, int);
+ method public int performFullBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor);
+ method public long requestBackupTime();
+ method public long requestFullBackupTime();
+ method public int sendBackupData(int);
+ method public int startRestore(long, android.content.pm.PackageInfo[]);
+ method public String transportDirName();
+ field public static final int AGENT_ERROR = -1003; // 0xfffffc15
+ field public static final int AGENT_UNKNOWN = -1004; // 0xfffffc14
+ field public static final String EXTRA_TRANSPORT_REGISTRATION = "android.app.backup.extra.TRANSPORT_REGISTRATION";
+ field public static final int FLAG_DATA_NOT_CHANGED = 8; // 0x8
+ field public static final int FLAG_INCREMENTAL = 2; // 0x2
+ field public static final int FLAG_NON_INCREMENTAL = 4; // 0x4
+ field public static final int FLAG_USER_INITIATED = 1; // 0x1
+ field public static final int NO_MORE_DATA = -1; // 0xffffffff
+ field public static final int TRANSPORT_ERROR = -1000; // 0xfffffc18
+ field public static final int TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED = -1006; // 0xfffffc12
+ field public static final int TRANSPORT_NOT_INITIALIZED = -1001; // 0xfffffc17
+ field public static final int TRANSPORT_OK = 0; // 0x0
+ field public static final int TRANSPORT_PACKAGE_REJECTED = -1002; // 0xfffffc16
+ field public static final int TRANSPORT_QUOTA_EXCEEDED = -1005; // 0xfffffc13
+ }
+
+ public class RestoreDescription implements android.os.Parcelable {
+ ctor public RestoreDescription(String, int);
+ method public int describeContents();
+ method public int getDataType();
+ method public String getPackageName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.backup.RestoreDescription> CREATOR;
+ field public static final android.app.backup.RestoreDescription NO_MORE_PACKAGES;
+ field public static final int TYPE_FULL_STREAM = 2; // 0x2
+ field public static final int TYPE_KEY_VALUE = 1; // 0x1
+ }
+
+ public abstract class RestoreObserver {
+ method public void restoreSetsAvailable(android.app.backup.RestoreSet[]);
+ }
+
+ public class RestoreSession {
+ method public void endRestoreSession();
+ method public int getAvailableRestoreSets(android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
+ method public int getAvailableRestoreSets(android.app.backup.RestoreObserver);
+ method public int restoreAll(long, android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
+ method public int restoreAll(long, android.app.backup.RestoreObserver);
+ method public int restorePackage(String, android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
+ method public int restorePackage(String, android.app.backup.RestoreObserver);
+ method public int restorePackages(long, @Nullable android.app.backup.RestoreObserver, @NonNull java.util.Set<java.lang.String>, @Nullable android.app.backup.BackupManagerMonitor);
+ method public int restorePackages(long, @Nullable android.app.backup.RestoreObserver, @NonNull java.util.Set<java.lang.String>);
+ }
+
+ public class RestoreSet implements android.os.Parcelable {
+ ctor public RestoreSet();
+ ctor public RestoreSet(String, String, long);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.backup.RestoreSet> CREATOR;
+ field public String device;
+ field public String name;
+ field public long token;
+ }
+
+ public abstract class SelectBackupTransportCallback {
+ ctor public SelectBackupTransportCallback();
+ method public void onFailure(int);
+ method public void onSuccess(String);
+ }
+
+}
+
+package android.app.compat {
+
+ public final class CompatChanges {
+ method public static boolean isChangeEnabled(long);
+ method @RequiresPermission(allOf={"android.permission.READ_COMPAT_CHANGE_CONFIG", "android.permission.LOG_COMPAT_CHANGE"}) public static boolean isChangeEnabled(long, @NonNull String, @NonNull android.os.UserHandle);
+ method @RequiresPermission(allOf={"android.permission.READ_COMPAT_CHANGE_CONFIG", "android.permission.LOG_COMPAT_CHANGE"}) public static boolean isChangeEnabled(long, int);
+ }
+
+}
+
+package android.app.contentsuggestions {
+
+ public final class ClassificationsRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.os.Bundle getExtras();
+ method @NonNull public java.util.List<android.app.contentsuggestions.ContentSelection> getSelections();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ClassificationsRequest> CREATOR;
+ }
+
+ public static final class ClassificationsRequest.Builder {
+ ctor public ClassificationsRequest.Builder(@NonNull java.util.List<android.app.contentsuggestions.ContentSelection>);
+ method @NonNull public android.app.contentsuggestions.ClassificationsRequest build();
+ method @NonNull public android.app.contentsuggestions.ClassificationsRequest.Builder setExtras(@NonNull android.os.Bundle);
+ }
+
+ public final class ContentClassification implements android.os.Parcelable {
+ ctor public ContentClassification(@NonNull String, @NonNull android.os.Bundle);
+ method public int describeContents();
+ method @NonNull public android.os.Bundle getExtras();
+ method @NonNull public String getId();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ContentClassification> CREATOR;
+ }
+
+ public final class ContentSelection implements android.os.Parcelable {
+ ctor public ContentSelection(@NonNull String, @NonNull android.os.Bundle);
+ method public int describeContents();
+ method @NonNull public android.os.Bundle getExtras();
+ method @NonNull public String getId();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ContentSelection> CREATOR;
+ }
+
+ public final class ContentSuggestionsManager {
+ method public void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull java.util.concurrent.Executor, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback);
+ method public boolean isEnabled();
+ method public void notifyInteraction(@NonNull String, @NonNull android.os.Bundle);
+ method public void provideContextImage(@NonNull android.graphics.Bitmap, @NonNull android.os.Bundle);
+ method public void provideContextImage(int, @NonNull android.os.Bundle);
+ method public void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull java.util.concurrent.Executor, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback);
+ }
+
+ public static interface ContentSuggestionsManager.ClassificationsCallback {
+ method public void onContentClassificationsAvailable(int, @NonNull java.util.List<android.app.contentsuggestions.ContentClassification>);
+ }
+
+ public static interface ContentSuggestionsManager.SelectionsCallback {
+ method public void onContentSelectionsAvailable(int, @NonNull java.util.List<android.app.contentsuggestions.ContentSelection>);
+ }
+
+ public final class SelectionsRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.os.Bundle getExtras();
+ method @Nullable public android.graphics.Point getInterestPoint();
+ method public int getTaskId();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.SelectionsRequest> CREATOR;
+ }
+
+ public static final class SelectionsRequest.Builder {
+ ctor public SelectionsRequest.Builder(int);
+ method @NonNull public android.app.contentsuggestions.SelectionsRequest build();
+ method @NonNull public android.app.contentsuggestions.SelectionsRequest.Builder setExtras(@NonNull android.os.Bundle);
+ method @NonNull public android.app.contentsuggestions.SelectionsRequest.Builder setInterestPoint(@NonNull android.graphics.Point);
+ }
+
+}
+
+package android.app.job {
+
+ public abstract class JobScheduler {
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public abstract int scheduleAsPackage(@NonNull android.app.job.JobInfo, @NonNull String, int, String);
+ }
+
+ public class JobSchedulerFrameworkInitializer {
+ method public static void registerServiceWrappers();
+ }
+
+}
+
+package android.app.prediction {
+
+ public final class AppPredictionContext implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.os.Bundle getExtras();
+ method @NonNull public String getPackageName();
+ method @IntRange(from=0) public int getPredictedTargetCount();
+ method @NonNull public String getUiSurface();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppPredictionContext> CREATOR;
+ }
+
+ public static final class AppPredictionContext.Builder {
+ ctor public AppPredictionContext.Builder(@NonNull android.content.Context);
+ method @NonNull public android.app.prediction.AppPredictionContext build();
+ method @NonNull public android.app.prediction.AppPredictionContext.Builder setExtras(@Nullable android.os.Bundle);
+ method @NonNull public android.app.prediction.AppPredictionContext.Builder setPredictedTargetCount(@IntRange(from=0) int);
+ method @NonNull public android.app.prediction.AppPredictionContext.Builder setUiSurface(@NonNull String);
+ }
+
+ public final class AppPredictionManager {
+ method @NonNull public android.app.prediction.AppPredictor createAppPredictionSession(@NonNull android.app.prediction.AppPredictionContext);
+ }
+
+ public final class AppPredictionSessionId implements android.os.Parcelable {
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppPredictionSessionId> CREATOR;
+ }
+
+ public final class AppPredictor {
+ method public void destroy();
+ method public void notifyAppTargetEvent(@NonNull android.app.prediction.AppTargetEvent);
+ method public void notifyLaunchLocationShown(@NonNull String, @NonNull java.util.List<android.app.prediction.AppTargetId>);
+ method public void registerPredictionUpdates(@NonNull java.util.concurrent.Executor, @NonNull android.app.prediction.AppPredictor.Callback);
+ method public void requestPredictionUpdate();
+ method @Nullable public void sortTargets(@NonNull java.util.List<android.app.prediction.AppTarget>, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.util.List<android.app.prediction.AppTarget>>);
+ method public void unregisterPredictionUpdates(@NonNull android.app.prediction.AppPredictor.Callback);
+ }
+
+ public static interface AppPredictor.Callback {
+ method public void onTargetsAvailable(@NonNull java.util.List<android.app.prediction.AppTarget>);
+ }
+
+ public final class AppTarget implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getClassName();
+ method @NonNull public android.app.prediction.AppTargetId getId();
+ method @NonNull public String getPackageName();
+ method @IntRange(from=0) public int getRank();
+ method @Nullable public android.content.pm.ShortcutInfo getShortcutInfo();
+ method @NonNull public android.os.UserHandle getUser();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppTarget> CREATOR;
+ }
+
+ public static final class AppTarget.Builder {
+ ctor public AppTarget.Builder(@NonNull android.app.prediction.AppTargetId, @NonNull String, @NonNull android.os.UserHandle);
+ ctor public AppTarget.Builder(@NonNull android.app.prediction.AppTargetId, @NonNull android.content.pm.ShortcutInfo);
+ method @NonNull public android.app.prediction.AppTarget build();
+ method @NonNull public android.app.prediction.AppTarget.Builder setClassName(@NonNull String);
+ method @NonNull public android.app.prediction.AppTarget.Builder setRank(@IntRange(from=0) int);
+ }
+
+ public final class AppTargetEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAction();
+ method @Nullable public String getLaunchLocation();
+ method @Nullable public android.app.prediction.AppTarget getTarget();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int ACTION_DISMISS = 2; // 0x2
+ field public static final int ACTION_LAUNCH = 1; // 0x1
+ field public static final int ACTION_PIN = 3; // 0x3
+ field public static final int ACTION_UNPIN = 4; // 0x4
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppTargetEvent> CREATOR;
+ }
+
+ public static final class AppTargetEvent.Builder {
+ ctor public AppTargetEvent.Builder(@Nullable android.app.prediction.AppTarget, int);
+ method @NonNull public android.app.prediction.AppTargetEvent build();
+ method @NonNull public android.app.prediction.AppTargetEvent.Builder setLaunchLocation(@Nullable String);
+ }
+
+ public final class AppTargetId implements android.os.Parcelable {
+ ctor public AppTargetId(@NonNull String);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppTargetId> CREATOR;
+ }
+
+}
+
+package android.app.role {
+
+ public interface OnRoleHoldersChangedListener {
+ method public void onRoleHoldersChanged(@NonNull String, @NonNull android.os.UserHandle);
+ }
+
+ public abstract class RoleControllerService extends android.app.Service {
+ ctor public RoleControllerService();
+ method @WorkerThread public abstract boolean onAddRoleHolder(@NonNull String, @NonNull String, int);
+ method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent);
+ method @WorkerThread public abstract boolean onClearRoleHolders(@NonNull String, int);
+ method @WorkerThread public abstract boolean onGrantDefaultRoles();
+ method @Deprecated public abstract boolean onIsApplicationQualifiedForRole(@NonNull String, @NonNull String);
+ method public boolean onIsApplicationVisibleForRole(@NonNull String, @NonNull String);
+ method public abstract boolean onIsRoleVisible(@NonNull String);
+ method @WorkerThread public abstract boolean onRemoveRoleHolder(@NonNull String, @NonNull String, int);
+ field public static final String SERVICE_INTERFACE = "android.app.role.RoleControllerService";
+ }
+
+ public final class RoleManager {
+ method @RequiresPermission(android.Manifest.permission.OBSERVE_ROLE_HOLDERS) public void addOnRoleHoldersChangedListenerAsUser(@NonNull java.util.concurrent.Executor, @NonNull android.app.role.OnRoleHoldersChangedListener, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void addRoleHolderAsUser(@NonNull String, @NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public boolean addRoleHolderFromController(@NonNull String, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void clearRoleHoldersAsUser(@NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @NonNull @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public java.util.List<java.lang.String> getHeldRolesFromController(@NonNull String);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getRoleHolders(@NonNull String);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getRoleHoldersAsUser(@NonNull String, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.OBSERVE_ROLE_HOLDERS) public void removeOnRoleHoldersChangedListenerAsUser(@NonNull android.app.role.OnRoleHoldersChangedListener, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void removeRoleHolderAsUser(@NonNull String, @NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public boolean removeRoleHolderFromController(@NonNull String, @NonNull String);
+ method @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public void setRoleNamesFromController(@NonNull java.util.List<java.lang.String>);
+ field public static final int MANAGE_HOLDERS_FLAG_DONT_KILL_APP = 1; // 0x1
+ }
+
+}
+
+package android.app.time {
+
+ public final class TimeManager {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_TIME_AND_ZONE_DETECTION) public void addTimeZoneDetectorListener(@NonNull java.util.concurrent.Executor, @NonNull android.app.time.TimeManager.TimeZoneDetectorListener);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_TIME_AND_ZONE_DETECTION) public android.app.time.TimeZoneCapabilitiesAndConfig getTimeZoneCapabilitiesAndConfig();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_TIME_AND_ZONE_DETECTION) public void removeTimeZoneDetectorListener(@NonNull android.app.time.TimeManager.TimeZoneDetectorListener);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_TIME_AND_ZONE_DETECTION) public boolean updateTimeZoneConfiguration(@NonNull android.app.time.TimeZoneConfiguration);
+ }
+
+ @java.lang.FunctionalInterface public static interface TimeManager.TimeZoneDetectorListener {
+ method public void onChange();
+ }
+
+ public final class TimeZoneCapabilities implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getConfigureAutoDetectionEnabledCapability();
+ method public int getConfigureGeoDetectionEnabledCapability();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CAPABILITY_NOT_ALLOWED = 20; // 0x14
+ field public static final int CAPABILITY_NOT_APPLICABLE = 30; // 0x1e
+ field public static final int CAPABILITY_NOT_SUPPORTED = 10; // 0xa
+ field public static final int CAPABILITY_POSSESSED = 40; // 0x28
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.time.TimeZoneCapabilities> CREATOR;
+ }
+
+ public final class TimeZoneCapabilitiesAndConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.app.time.TimeZoneCapabilities getCapabilities();
+ method @NonNull public android.app.time.TimeZoneConfiguration getConfiguration();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.time.TimeZoneCapabilitiesAndConfig> CREATOR;
+ }
+
+ public final class TimeZoneConfiguration implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean isAutoDetectionEnabled();
+ method public boolean isGeoDetectionEnabled();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.time.TimeZoneConfiguration> CREATOR;
+ }
+
+ public static final class TimeZoneConfiguration.Builder {
+ ctor public TimeZoneConfiguration.Builder();
+ ctor public TimeZoneConfiguration.Builder(@NonNull android.app.time.TimeZoneConfiguration);
+ method @NonNull public android.app.time.TimeZoneConfiguration build();
+ method @NonNull public android.app.time.TimeZoneConfiguration.Builder setAutoDetectionEnabled(boolean);
+ method @NonNull public android.app.time.TimeZoneConfiguration.Builder setGeoDetectionEnabled(boolean);
+ }
+
+}
+
+package android.app.usage {
+
+ public final class CacheQuotaHint implements android.os.Parcelable {
+ ctor public CacheQuotaHint(@NonNull android.app.usage.CacheQuotaHint.Builder);
+ method public int describeContents();
+ method public long getQuota();
+ method public int getUid();
+ method @Nullable public android.app.usage.UsageStats getUsageStats();
+ method @Nullable public String getVolumeUuid();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.app.usage.CacheQuotaHint> CREATOR;
+ field public static final long QUOTA_NOT_SET = -1L; // 0xffffffffffffffffL
+ }
+
+ public static final class CacheQuotaHint.Builder {
+ ctor public CacheQuotaHint.Builder();
+ ctor public CacheQuotaHint.Builder(@NonNull android.app.usage.CacheQuotaHint);
+ method @NonNull public android.app.usage.CacheQuotaHint build();
+ method @NonNull public android.app.usage.CacheQuotaHint.Builder setQuota(long);
+ method @NonNull public android.app.usage.CacheQuotaHint.Builder setUid(int);
+ method @NonNull public android.app.usage.CacheQuotaHint.Builder setUsageStats(@Nullable android.app.usage.UsageStats);
+ method @NonNull public android.app.usage.CacheQuotaHint.Builder setVolumeUuid(@Nullable String);
+ }
+
+ public abstract class CacheQuotaService extends android.app.Service {
+ ctor public CacheQuotaService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method public abstract java.util.List<android.app.usage.CacheQuotaHint> onComputeCacheQuotaHints(java.util.List<android.app.usage.CacheQuotaHint>);
+ field public static final String SERVICE_INTERFACE = "android.app.usage.CacheQuotaService";
+ }
+
+ public class NetworkStatsManager {
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void registerNetworkStatsProvider(@NonNull String, @NonNull android.net.netstats.provider.NetworkStatsProvider);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void unregisterNetworkStatsProvider(@NonNull android.net.netstats.provider.NetworkStatsProvider);
+ }
+
+ public static final class UsageEvents.Event {
+ method public int getInstanceId();
+ method @Nullable public String getNotificationChannelId();
+ method @Nullable public String getTaskRootClassName();
+ method @Nullable public String getTaskRootPackageName();
+ method public boolean isInstantApp();
+ field public static final int NOTIFICATION_INTERRUPTION = 12; // 0xc
+ field public static final int NOTIFICATION_SEEN = 10; // 0xa
+ field public static final int SLICE_PINNED = 14; // 0xe
+ field public static final int SLICE_PINNED_PRIV = 13; // 0xd
+ field public static final int SYSTEM_INTERACTION = 6; // 0x6
+ }
+
+ public final class UsageStats implements android.os.Parcelable {
+ method public int getAppLaunchCount();
+ }
+
+ public final class UsageStatsManager {
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getAppStandbyBucket(String);
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public java.util.Map<java.lang.String,java.lang.Integer> getAppStandbyBuckets();
+ method public int getUsageSource();
+ method @RequiresPermission(android.Manifest.permission.BIND_CARRIER_SERVICES) public void onCarrierPrivilegedAppsChanged();
+ method @RequiresPermission(allOf={android.Manifest.permission.SUSPEND_APPS, android.Manifest.permission.OBSERVE_APP_USAGE}) public void registerAppUsageLimitObserver(int, @NonNull String[], @NonNull java.time.Duration, @NonNull java.time.Duration, @Nullable android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void registerAppUsageObserver(int, @NonNull String[], long, @NonNull java.util.concurrent.TimeUnit, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void registerUsageSessionObserver(int, @NonNull String[], @NonNull java.time.Duration, @NonNull java.time.Duration, @NonNull android.app.PendingIntent, @Nullable android.app.PendingIntent);
+ method public void reportUsageStart(@NonNull android.app.Activity, @NonNull String);
+ method public void reportUsageStart(@NonNull android.app.Activity, @NonNull String, long);
+ method public void reportUsageStop(@NonNull android.app.Activity, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.CHANGE_APP_IDLE_STATE) public void setAppStandbyBucket(String, int);
+ method @RequiresPermission(android.Manifest.permission.CHANGE_APP_IDLE_STATE) public void setAppStandbyBuckets(java.util.Map<java.lang.String,java.lang.Integer>);
+ method @RequiresPermission(allOf={android.Manifest.permission.SUSPEND_APPS, android.Manifest.permission.OBSERVE_APP_USAGE}) public void unregisterAppUsageLimitObserver(int);
+ method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterAppUsageObserver(int);
+ method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterUsageSessionObserver(int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public void whitelistAppTemporarily(String, long, android.os.UserHandle);
+ field public static final String EXTRA_OBSERVER_ID = "android.app.usage.extra.OBSERVER_ID";
+ field public static final String EXTRA_TIME_LIMIT = "android.app.usage.extra.TIME_LIMIT";
+ field public static final String EXTRA_TIME_USED = "android.app.usage.extra.TIME_USED";
+ field public static final int STANDBY_BUCKET_EXEMPTED = 5; // 0x5
+ field public static final int STANDBY_BUCKET_NEVER = 50; // 0x32
+ field public static final int USAGE_SOURCE_CURRENT_ACTIVITY = 2; // 0x2
+ field public static final int USAGE_SOURCE_TASK_ROOT_ACTIVITY = 1; // 0x1
+ }
+
+}
+
+package android.bluetooth {
+
+ public final class BluetoothA2dp implements android.bluetooth.BluetoothProfile {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ field public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; // 0x0
+ field public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; // 0x0
+ field public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; // 0x1
+ field public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; // 0xffffffff
+ field public static final int OPTIONAL_CODECS_SUPPORTED = 1; // 0x1
+ field public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public final class BluetoothA2dpSink implements android.bluetooth.BluetoothProfile {
+ method public void finalize();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAudioPlaying(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.a2dp-sink.profile.action.CONNECTION_STATE_CHANGED";
+ }
+
+ public final class BluetoothAdapter {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean addOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
+ method public boolean disableBLE();
+ method public boolean enableBLE();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean enableNoAutoConnect();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public long getDiscoveryEndMillis();
+ method public boolean isBleScanAlwaysAvailable();
+ method public boolean isLeEnabled();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeActiveDevice(int);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setActiveDevice(@NonNull android.bluetooth.BluetoothDevice, int);
+ field public static final String ACTION_BLE_STATE_CHANGED = "android.bluetooth.adapter.action.BLE_STATE_CHANGED";
+ field public static final String ACTION_REQUEST_BLE_SCAN_ALWAYS_AVAILABLE = "android.bluetooth.adapter.action.REQUEST_BLE_SCAN_ALWAYS_AVAILABLE";
+ field public static final int ACTIVE_DEVICE_ALL = 2; // 0x2
+ field public static final int ACTIVE_DEVICE_AUDIO = 0; // 0x0
+ field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
+ }
+
+ public static interface BluetoothAdapter.OnMetadataChangedListener {
+ method public void onMetadataChanged(@NonNull android.bluetooth.BluetoothDevice, int, @Nullable byte[]);
+ }
+
+ public final class BluetoothDevice implements android.os.Parcelable {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean cancelBondProcess();
+ method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public byte[] getMetadata(int);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getSimAccessPermission();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isConnected();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isEncrypted();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isInSilenceMode();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeBond();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setMessageAccessPermission(int);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setMetadata(int, @NonNull byte[]);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setPhonebookAccessPermission(int);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setSilenceMode(boolean);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setSimAccessPermission(int);
+ field public static final int ACCESS_ALLOWED = 1; // 0x1
+ field public static final int ACCESS_REJECTED = 2; // 0x2
+ field public static final int ACCESS_UNKNOWN = 0; // 0x0
+ field public static final String ACTION_SILENCE_MODE_CHANGED = "android.bluetooth.device.action.SILENCE_MODE_CHANGED";
+ field public static final int METADATA_COMPANION_APP = 4; // 0x4
+ field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10
+ field public static final int METADATA_HARDWARE_VERSION = 3; // 0x3
+ field public static final int METADATA_IS_UNTETHERED_HEADSET = 6; // 0x6
+ field public static final int METADATA_MAIN_ICON = 5; // 0x5
+ field public static final int METADATA_MANUFACTURER_NAME = 0; // 0x0
+ field public static final int METADATA_MAX_LENGTH = 2048; // 0x800
+ field public static final int METADATA_MODEL_NAME = 1; // 0x1
+ field public static final int METADATA_SOFTWARE_VERSION = 2; // 0x2
+ field public static final int METADATA_UNTETHERED_CASE_BATTERY = 12; // 0xc
+ field public static final int METADATA_UNTETHERED_CASE_CHARGING = 15; // 0xf
+ field public static final int METADATA_UNTETHERED_CASE_ICON = 9; // 0x9
+ field public static final int METADATA_UNTETHERED_LEFT_BATTERY = 10; // 0xa
+ field public static final int METADATA_UNTETHERED_LEFT_CHARGING = 13; // 0xd
+ field public static final int METADATA_UNTETHERED_LEFT_ICON = 7; // 0x7
+ field public static final int METADATA_UNTETHERED_RIGHT_BATTERY = 11; // 0xb
+ field public static final int METADATA_UNTETHERED_RIGHT_CHARGING = 14; // 0xe
+ field public static final int METADATA_UNTETHERED_RIGHT_ICON = 8; // 0x8
+ }
+
+ public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean connect(android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean disconnect(android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setPriority(android.bluetooth.BluetoothDevice, int);
+ }
+
+ public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public long getHiSyncId(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ }
+
+ public final class BluetoothHidDevice implements android.bluetooth.BluetoothProfile {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ }
+
+ public final class BluetoothHidHost implements android.bluetooth.BluetoothProfile {
+ method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED";
+ }
+
+ public final class BluetoothMap implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void close();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) protected void finalize();
+ method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.map.profile.action.CONNECTION_STATE_CHANGED";
+ }
+
+ public final class BluetoothPan implements android.bluetooth.BluetoothProfile {
+ method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isTetheringOn();
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setBluetoothTethering(boolean);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
+ field public static final String ACTION_TETHERING_STATE_CHANGED = "android.bluetooth.action.TETHERING_STATE_CHANGED";
+ field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
+ field public static final String EXTRA_TETHERING_STATE = "android.bluetooth.extra.TETHERING_STATE";
+ field public static final int LOCAL_NAP_ROLE = 1; // 0x1
+ field public static final int LOCAL_PANU_ROLE = 2; // 0x2
+ field public static final int PAN_ROLE_NONE = 0; // 0x0
+ field public static final int REMOTE_NAP_ROLE = 1; // 0x1
+ field public static final int REMOTE_PANU_ROLE = 2; // 0x2
+ field public static final int TETHERING_STATE_OFF = 1; // 0x1
+ field public static final int TETHERING_STATE_ON = 2; // 0x2
+ }
+
+ public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
+ field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED";
+ }
+
+ public interface BluetoothProfile {
+ field public static final int A2DP_SINK = 11; // 0xb
+ field public static final int AVRCP_CONTROLLER = 12; // 0xc
+ field public static final int CONNECTION_POLICY_ALLOWED = 100; // 0x64
+ field public static final int CONNECTION_POLICY_FORBIDDEN = 0; // 0x0
+ field public static final int CONNECTION_POLICY_UNKNOWN = -1; // 0xffffffff
+ field public static final int HEADSET_CLIENT = 16; // 0x10
+ field public static final int PAN = 5; // 0x5
+ field public static final int PBAP_CLIENT = 17; // 0x11
+ field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0
+ field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
+ }
+
+ public final class BluetoothUuid {
+ method public static boolean containsAnyUuid(@Nullable android.os.ParcelUuid[], @Nullable android.os.ParcelUuid[]);
+ method @NonNull public static android.os.ParcelUuid parseUuidFrom(@Nullable byte[]);
+ field @NonNull public static final android.os.ParcelUuid A2DP_SINK;
+ field @NonNull public static final android.os.ParcelUuid A2DP_SOURCE;
+ field @NonNull public static final android.os.ParcelUuid ADV_AUDIO_DIST;
+ field @NonNull public static final android.os.ParcelUuid AVRCP_CONTROLLER;
+ field @NonNull public static final android.os.ParcelUuid AVRCP_TARGET;
+ field @NonNull public static final android.os.ParcelUuid BASE_UUID;
+ field @NonNull public static final android.os.ParcelUuid BNEP;
+ field @NonNull public static final android.os.ParcelUuid HEARING_AID;
+ field @NonNull public static final android.os.ParcelUuid HFP;
+ field @NonNull public static final android.os.ParcelUuid HFP_AG;
+ field @NonNull public static final android.os.ParcelUuid HID;
+ field @NonNull public static final android.os.ParcelUuid HOGP;
+ field @NonNull public static final android.os.ParcelUuid HSP;
+ field @NonNull public static final android.os.ParcelUuid HSP_AG;
+ field @NonNull public static final android.os.ParcelUuid MAP;
+ field @NonNull public static final android.os.ParcelUuid MAS;
+ field @NonNull public static final android.os.ParcelUuid MNS;
+ field @NonNull public static final android.os.ParcelUuid NAP;
+ field @NonNull public static final android.os.ParcelUuid OBEX_OBJECT_PUSH;
+ field @NonNull public static final android.os.ParcelUuid PANU;
+ field @NonNull public static final android.os.ParcelUuid PBAP_PCE;
+ field @NonNull public static final android.os.ParcelUuid PBAP_PSE;
+ field @NonNull public static final android.os.ParcelUuid SAP;
+ field public static final int UUID_BYTES_128_BIT = 16; // 0x10
+ field public static final int UUID_BYTES_16_BIT = 2; // 0x2
+ field public static final int UUID_BYTES_32_BIT = 4; // 0x4
+ }
+
+}
+
+package android.bluetooth.le {
+
+ public final class BluetoothLeScanner {
+ method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(android.os.WorkSource, android.bluetooth.le.ScanCallback);
+ method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.os.WorkSource, android.bluetooth.le.ScanCallback);
+ method public void startTruncatedScan(java.util.List<android.bluetooth.le.TruncatedFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
+ }
+
+ public final class ResultStorageDescriptor implements android.os.Parcelable {
+ ctor public ResultStorageDescriptor(int, int, int);
+ method public int describeContents();
+ method public int getLength();
+ method public int getOffset();
+ method public int getType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ResultStorageDescriptor> CREATOR;
+ }
+
+ public final class ScanSettings implements android.os.Parcelable {
+ field public static final int SCAN_RESULT_TYPE_ABBREVIATED = 1; // 0x1
+ field public static final int SCAN_RESULT_TYPE_FULL = 0; // 0x0
+ }
+
+ public static final class ScanSettings.Builder {
+ method public android.bluetooth.le.ScanSettings.Builder setScanResultType(int);
+ }
+
+ public final class TruncatedFilter {
+ ctor public TruncatedFilter(android.bluetooth.le.ScanFilter, java.util.List<android.bluetooth.le.ResultStorageDescriptor>);
+ method public android.bluetooth.le.ScanFilter getFilter();
+ method public java.util.List<android.bluetooth.le.ResultStorageDescriptor> getStorageDescriptors();
+ }
+
+}
+
+package android.companion {
+
+ public final class CompanionDeviceManager {
+ method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public boolean isDeviceAssociatedForWifiConnection(@NonNull String, @NonNull android.net.MacAddress, @NonNull android.os.UserHandle);
+ }
+
+}
+
+package android.content {
+
+ public class ApexEnvironment {
+ method @NonNull public static android.content.ApexEnvironment getApexEnvironment(@NonNull String);
+ method @NonNull public java.io.File getCredentialProtectedDataDirForUser(@NonNull android.os.UserHandle);
+ method @NonNull public java.io.File getDeviceProtectedDataDir();
+ method @NonNull public java.io.File getDeviceProtectedDataDirForUser(@NonNull android.os.UserHandle);
+ }
+
+ public abstract class BroadcastReceiver {
+ method @NonNull public final android.os.UserHandle getSendingUser();
+ }
+
+ public abstract class ContentProvider implements android.content.ComponentCallbacks2 {
+ method public int checkUriPermission(@NonNull android.net.Uri, int, int);
+ }
+
+ public class ContentProviderClient implements java.lang.AutoCloseable {
+ method @RequiresPermission(android.Manifest.permission.REMOVE_TASKS) public void setDetectNotResponding(long);
+ }
+
+ public abstract class ContentResolver {
+ method public int checkUriPermission(@NonNull android.net.Uri, int, int);
+ method @NonNull public static android.net.Uri decodeFromFile(@NonNull java.io.File);
+ method @NonNull public static java.io.File encodeToFile(@NonNull android.net.Uri);
+ method @Nullable @RequiresPermission("android.permission.CACHE_CONTENT") public android.os.Bundle getCache(@NonNull android.net.Uri);
+ method @RequiresPermission("android.permission.CACHE_CONTENT") public void putCache(@NonNull android.net.Uri, @Nullable android.os.Bundle);
+ }
+
+ public abstract class Context {
+ method @NonNull public android.content.Context createContextAsUser(@NonNull android.os.UserHandle, int);
+ method public abstract android.content.Context createCredentialProtectedStorageContext();
+ method @NonNull public android.content.Context createPackageContextAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @Nullable public abstract java.io.File getPreloadsFileCache();
+ method public abstract boolean isCredentialProtectedStorage();
+ method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public android.content.Intent registerReceiverForAllUsers(@Nullable android.content.BroadcastReceiver, @NonNull android.content.IntentFilter, @Nullable String, @Nullable android.os.Handler);
+ method public abstract void sendBroadcast(android.content.Intent, @Nullable String, @Nullable android.os.Bundle);
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public abstract void sendBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle, @Nullable String, @Nullable android.os.Bundle);
+ method public abstract void sendOrderedBroadcast(@NonNull android.content.Intent, @Nullable String, @Nullable android.os.Bundle, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle);
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public void startActivityAsUser(@NonNull @RequiresPermission android.content.Intent, @NonNull android.os.UserHandle);
+ field public static final String APP_INTEGRITY_SERVICE = "app_integrity";
+ field public static final String APP_PREDICTION_SERVICE = "app_prediction";
+ field public static final String BACKUP_SERVICE = "backup";
+ field public static final String BATTERY_STATS_SERVICE = "batterystats";
+ field public static final int BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS = 1048576; // 0x100000
+ field public static final String BUGREPORT_SERVICE = "bugreport";
+ field public static final String CONTENT_SUGGESTIONS_SERVICE = "content_suggestions";
+ field public static final String CONTEXTHUB_SERVICE = "contexthub";
+ field public static final String ETHERNET_SERVICE = "ethernet";
+ field public static final String EUICC_CARD_SERVICE = "euicc_card";
+ field public static final String HDMI_CONTROL_SERVICE = "hdmi_control";
+ field public static final String MEDIA_TRANSCODING_SERVICE = "media_transcoding";
+ field public static final String NETD_SERVICE = "netd";
+ field public static final String NETWORK_SCORE_SERVICE = "network_score";
+ field public static final String OEM_LOCK_SERVICE = "oem_lock";
+ field public static final String PERMISSION_SERVICE = "permission";
+ field public static final String PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block";
+ field public static final String ROLLBACK_SERVICE = "rollback";
+ field public static final String SECURE_ELEMENT_SERVICE = "secure_element";
+ field public static final String STATS_MANAGER = "stats";
+ field public static final String STATUS_BAR_SERVICE = "statusbar";
+ field public static final String SYSTEM_CONFIG_SERVICE = "system_config";
+ field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
+ field public static final String TETHERING_SERVICE = "tethering";
+ field public static final String VR_SERVICE = "vrmanager";
+ field public static final String WIFI_NL80211_SERVICE = "wifinl80211";
+ field @Deprecated public static final String WIFI_RTT_SERVICE = "rttmanager";
+ field public static final String WIFI_SCANNING_SERVICE = "wifiscanner";
+ }
+
+ public class ContextWrapper extends android.content.Context {
+ method public android.content.Context createCredentialProtectedStorageContext();
+ method public java.io.File getPreloadsFileCache();
+ method public boolean isCredentialProtectedStorage();
+ method public void sendBroadcast(android.content.Intent, String, android.os.Bundle);
+ method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, String, android.os.Bundle);
+ method public void sendOrderedBroadcast(android.content.Intent, String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle);
+ }
+
+ public class Intent implements java.lang.Cloneable android.os.Parcelable {
+ field public static final String ACTION_BATTERY_LEVEL_CHANGED = "android.intent.action.BATTERY_LEVEL_CHANGED";
+ field public static final String ACTION_CALL_EMERGENCY = "android.intent.action.CALL_EMERGENCY";
+ field public static final String ACTION_CALL_PRIVILEGED = "android.intent.action.CALL_PRIVILEGED";
+ field public static final String ACTION_DEVICE_CUSTOMIZATION_READY = "android.intent.action.DEVICE_CUSTOMIZATION_READY";
+ field public static final String ACTION_DIAL_EMERGENCY = "android.intent.action.DIAL_EMERGENCY";
+ field public static final String ACTION_FACTORY_RESET = "android.intent.action.FACTORY_RESET";
+ field public static final String ACTION_GLOBAL_BUTTON = "android.intent.action.GLOBAL_BUTTON";
+ field public static final String ACTION_INCIDENT_REPORT_READY = "android.intent.action.INCIDENT_REPORT_READY";
+ field public static final String ACTION_INSTALL_INSTANT_APP_PACKAGE = "android.intent.action.INSTALL_INSTANT_APP_PACKAGE";
+ field public static final String ACTION_INSTANT_APP_RESOLVER_SETTINGS = "android.intent.action.INSTANT_APP_RESOLVER_SETTINGS";
+ field public static final String ACTION_INTENT_FILTER_NEEDS_VERIFICATION = "android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION";
+ field public static final String ACTION_LOAD_DATA = "android.intent.action.LOAD_DATA";
+ field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_MANAGE_APP_PERMISSION = "android.intent.action.MANAGE_APP_PERMISSION";
+ field public static final String ACTION_MANAGE_APP_PERMISSIONS = "android.intent.action.MANAGE_APP_PERMISSIONS";
+ field @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public static final String ACTION_MANAGE_DEFAULT_APP = "android.intent.action.MANAGE_DEFAULT_APP";
+ field public static final String ACTION_MANAGE_PERMISSIONS = "android.intent.action.MANAGE_PERMISSIONS";
+ field public static final String ACTION_MANAGE_PERMISSION_APPS = "android.intent.action.MANAGE_PERMISSION_APPS";
+ field @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public static final String ACTION_MANAGE_SPECIAL_APP_ACCESSES = "android.intent.action.MANAGE_SPECIAL_APP_ACCESSES";
+ field public static final String ACTION_MASTER_CLEAR_NOTIFICATION = "android.intent.action.MASTER_CLEAR_NOTIFICATION";
+ field public static final String ACTION_PACKAGE_NEEDS_INTEGRITY_VERIFICATION = "android.intent.action.PACKAGE_NEEDS_INTEGRITY_VERIFICATION";
+ field public static final String ACTION_PACKAGE_UNSUSPENDED_MANUALLY = "android.intent.action.PACKAGE_UNSUSPENDED_MANUALLY";
+ field public static final String ACTION_PENDING_INCIDENT_REPORTS_CHANGED = "android.intent.action.PENDING_INCIDENT_REPORTS_CHANGED";
+ field public static final String ACTION_PRE_BOOT_COMPLETED = "android.intent.action.PRE_BOOT_COMPLETED";
+ field public static final String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART";
+ field public static final String ACTION_RESOLVE_INSTANT_APP_PACKAGE = "android.intent.action.RESOLVE_INSTANT_APP_PACKAGE";
+ field @RequiresPermission(android.Manifest.permission.REVIEW_ACCESSIBILITY_SERVICES) public static final String ACTION_REVIEW_ACCESSIBILITY_SERVICES = "android.intent.action.REVIEW_ACCESSIBILITY_SERVICES";
+ field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_REVIEW_ONGOING_PERMISSION_USAGE = "android.intent.action.REVIEW_ONGOING_PERMISSION_USAGE";
+ field public static final String ACTION_REVIEW_PERMISSIONS = "android.intent.action.REVIEW_PERMISSIONS";
+ field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_REVIEW_PERMISSION_USAGE = "android.intent.action.REVIEW_PERMISSION_USAGE";
+ field public static final String ACTION_ROLLBACK_COMMITTED = "android.intent.action.ROLLBACK_COMMITTED";
+ field public static final String ACTION_SHOW_SUSPENDED_APP_DETAILS = "android.intent.action.SHOW_SUSPENDED_APP_DETAILS";
+ field @Deprecated public static final String ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED";
+ field public static final String ACTION_SPLIT_CONFIGURATION_CHANGED = "android.intent.action.SPLIT_CONFIGURATION_CHANGED";
+ field public static final String ACTION_UPGRADE_SETUP = "android.intent.action.UPGRADE_SETUP";
+ field public static final String ACTION_USER_ADDED = "android.intent.action.USER_ADDED";
+ field public static final String ACTION_USER_REMOVED = "android.intent.action.USER_REMOVED";
+ field public static final String ACTION_VOICE_ASSIST = "android.intent.action.VOICE_ASSIST";
+ field public static final String CATEGORY_LEANBACK_SETTINGS = "android.intent.category.LEANBACK_SETTINGS";
+ field public static final String EXTRA_CALLING_PACKAGE = "android.intent.extra.CALLING_PACKAGE";
+ field public static final String EXTRA_FORCE_FACTORY_RESET = "android.intent.extra.FORCE_FACTORY_RESET";
+ field public static final String EXTRA_INSTANT_APP_ACTION = "android.intent.extra.INSTANT_APP_ACTION";
+ field public static final String EXTRA_INSTANT_APP_BUNDLES = "android.intent.extra.INSTANT_APP_BUNDLES";
+ field public static final String EXTRA_INSTANT_APP_EXTRAS = "android.intent.extra.INSTANT_APP_EXTRAS";
+ field public static final String EXTRA_INSTANT_APP_FAILURE = "android.intent.extra.INSTANT_APP_FAILURE";
+ field public static final String EXTRA_INSTANT_APP_HOSTNAME = "android.intent.extra.INSTANT_APP_HOSTNAME";
+ field public static final String EXTRA_INSTANT_APP_SUCCESS = "android.intent.extra.INSTANT_APP_SUCCESS";
+ field public static final String EXTRA_INSTANT_APP_TOKEN = "android.intent.extra.INSTANT_APP_TOKEN";
+ field public static final String EXTRA_LONG_VERSION_CODE = "android.intent.extra.LONG_VERSION_CODE";
+ field public static final String EXTRA_ORIGINATING_UID = "android.intent.extra.ORIGINATING_UID";
+ field public static final String EXTRA_PACKAGES = "android.intent.extra.PACKAGES";
+ field public static final String EXTRA_PERMISSION_GROUP_NAME = "android.intent.extra.PERMISSION_GROUP_NAME";
+ field public static final String EXTRA_PERMISSION_NAME = "android.intent.extra.PERMISSION_NAME";
+ field public static final String EXTRA_REASON = "android.intent.extra.REASON";
+ field public static final String EXTRA_REMOTE_CALLBACK = "android.intent.extra.REMOTE_CALLBACK";
+ field public static final String EXTRA_RESULT_NEEDED = "android.intent.extra.RESULT_NEEDED";
+ field public static final String EXTRA_ROLE_NAME = "android.intent.extra.ROLE_NAME";
+ field public static final String EXTRA_UNKNOWN_INSTANT_APP = "android.intent.extra.UNKNOWN_INSTANT_APP";
+ field public static final String EXTRA_VERIFICATION_BUNDLE = "android.intent.extra.VERIFICATION_BUNDLE";
+ field public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 67108864; // 0x4000000
+ field public static final String METADATA_SETUP_VERSION = "android.SETUP_VERSION";
+ }
+
+ public class IntentFilter implements android.os.Parcelable {
+ method public final int getOrder();
+ method public final void setOrder(int);
+ }
+
+}
+
+package android.content.integrity {
+
+ public class AppIntegrityManager {
+ method @NonNull public String getCurrentRuleSetProvider();
+ method @NonNull public String getCurrentRuleSetVersion();
+ method public void updateRuleSet(@NonNull android.content.integrity.RuleSet, @NonNull android.content.IntentSender);
+ field public static final String EXTRA_STATUS = "android.content.integrity.extra.STATUS";
+ field public static final int STATUS_FAILURE = 1; // 0x1
+ field public static final int STATUS_SUCCESS = 0; // 0x0
+ }
+
+ public abstract class IntegrityFormula {
+ method @NonNull public static android.content.integrity.IntegrityFormula all(@NonNull android.content.integrity.IntegrityFormula...);
+ method @NonNull public static android.content.integrity.IntegrityFormula any(@NonNull android.content.integrity.IntegrityFormula...);
+ method @NonNull public static android.content.integrity.IntegrityFormula not(@NonNull android.content.integrity.IntegrityFormula);
+ }
+
+ public static final class IntegrityFormula.Application {
+ method @NonNull public static android.content.integrity.IntegrityFormula certificatesContain(@NonNull String);
+ method @NonNull public static android.content.integrity.IntegrityFormula isPreInstalled();
+ method @NonNull public static android.content.integrity.IntegrityFormula packageNameEquals(@NonNull String);
+ method @NonNull public static android.content.integrity.IntegrityFormula versionCodeEquals(@NonNull long);
+ method @NonNull public static android.content.integrity.IntegrityFormula versionCodeGreaterThan(@NonNull long);
+ method @NonNull public static android.content.integrity.IntegrityFormula versionCodeGreaterThanOrEqualTo(@NonNull long);
+ }
+
+ public static final class IntegrityFormula.Installer {
+ method @NonNull public static android.content.integrity.IntegrityFormula certificatesContain(@NonNull String);
+ method @NonNull public static android.content.integrity.IntegrityFormula notAllowedByManifest();
+ method @NonNull public static android.content.integrity.IntegrityFormula packageNameEquals(@NonNull String);
+ }
+
+ public static final class IntegrityFormula.SourceStamp {
+ method @NonNull public static android.content.integrity.IntegrityFormula notTrusted();
+ method @NonNull public static android.content.integrity.IntegrityFormula stampCertificateHashEquals(@NonNull String);
+ }
+
+ public final class Rule implements android.os.Parcelable {
+ ctor public Rule(@NonNull android.content.integrity.IntegrityFormula, int);
+ method public int describeContents();
+ method public int getEffect();
+ method @NonNull public android.content.integrity.IntegrityFormula getFormula();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.integrity.Rule> CREATOR;
+ field public static final int DENY = 0; // 0x0
+ field public static final int FORCE_ALLOW = 1; // 0x1
+ }
+
+ public class RuleSet {
+ method @NonNull public java.util.List<android.content.integrity.Rule> getRules();
+ method @NonNull public String getVersion();
+ }
+
+ public static class RuleSet.Builder {
+ ctor public RuleSet.Builder();
+ method @NonNull public android.content.integrity.RuleSet.Builder addRules(@NonNull java.util.List<android.content.integrity.Rule>);
+ method @NonNull public android.content.integrity.RuleSet build();
+ method @NonNull public android.content.integrity.RuleSet.Builder setVersion(@NonNull String);
+ }
+
+}
+
+package android.content.om {
+
+ public final class OverlayInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getCategory();
+ method @NonNull public String getPackageName();
+ method @Nullable public String getTargetOverlayableName();
+ method @NonNull public String getTargetPackageName();
+ method public int getUserId();
+ method public boolean isEnabled();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.om.OverlayInfo> CREATOR;
+ }
+
+ public class OverlayManager {
+ method @Nullable public android.content.om.OverlayInfo getOverlayInfo(@NonNull String, @NonNull android.os.UserHandle);
+ method @NonNull @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public java.util.List<android.content.om.OverlayInfo> getOverlayInfosForTarget(@NonNull String, @NonNull android.os.UserHandle);
+ method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public void setEnabled(@NonNull String, boolean, @NonNull android.os.UserHandle) throws java.lang.IllegalStateException, java.lang.SecurityException;
+ method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public void setEnabledExclusiveInCategory(@NonNull String, @NonNull android.os.UserHandle) throws java.lang.IllegalStateException, java.lang.SecurityException;
+ }
+
+}
+
+package android.content.pm {
+
+ public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
+ method public boolean isEncryptionAware();
+ method public boolean isInstantApp();
+ field public String credentialProtectedDataDir;
+ field public int targetSandboxVersion;
+ }
+
+ public class CrossProfileApps {
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_PROFILES) public void startActivity(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
+ }
+
+ public class DataLoaderParams {
+ method @NonNull public static final android.content.pm.DataLoaderParams forIncremental(@NonNull android.content.ComponentName, @NonNull String);
+ method @NonNull public static final android.content.pm.DataLoaderParams forStreaming(@NonNull android.content.ComponentName, @NonNull String);
+ method @NonNull public final String getArguments();
+ method @NonNull public final android.content.ComponentName getComponentName();
+ method @NonNull public final int getType();
+ }
+
+ public final class InstallationFile {
+ method public long getLengthBytes();
+ method public int getLocation();
+ method @Nullable public byte[] getMetadata();
+ method @NonNull public String getName();
+ method @Nullable public byte[] getSignature();
+ }
+
+ public final class InstantAppInfo implements android.os.Parcelable {
+ ctor public InstantAppInfo(android.content.pm.ApplicationInfo, String[], String[]);
+ ctor public InstantAppInfo(String, CharSequence, String[], String[]);
+ method public int describeContents();
+ method @Nullable public android.content.pm.ApplicationInfo getApplicationInfo();
+ method @Nullable public String[] getGrantedPermissions();
+ method @NonNull public String getPackageName();
+ method @Nullable public String[] getRequestedPermissions();
+ method @NonNull public android.graphics.drawable.Drawable loadIcon(@NonNull android.content.pm.PackageManager);
+ method @NonNull public CharSequence loadLabel(@NonNull android.content.pm.PackageManager);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppInfo> CREATOR;
+ }
+
+ public final class InstantAppIntentFilter implements android.os.Parcelable {
+ ctor public InstantAppIntentFilter(@Nullable String, @NonNull java.util.List<android.content.IntentFilter>);
+ method public int describeContents();
+ method public java.util.List<android.content.IntentFilter> getFilters();
+ method public String getSplitName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppIntentFilter> CREATOR;
+ }
+
+ public final class InstantAppRequestInfo implements android.os.Parcelable {
+ ctor public InstantAppRequestInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, boolean, @NonNull String);
+ method public int describeContents();
+ method @Nullable public int[] getHostDigestPrefix();
+ method @NonNull public android.content.Intent getIntent();
+ method @NonNull public String getToken();
+ method @NonNull public android.os.UserHandle getUserHandle();
+ method public boolean isRequesterInstantApp();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppRequestInfo> CREATOR;
+ }
+
+ public final class InstantAppResolveInfo implements android.os.Parcelable {
+ ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, int);
+ ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, long, @Nullable android.os.Bundle);
+ ctor public InstantAppResolveInfo(@NonNull String, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>);
+ ctor public InstantAppResolveInfo(@Nullable android.os.Bundle);
+ method public int describeContents();
+ method public byte[] getDigestBytes();
+ method public int getDigestPrefix();
+ method @Nullable public android.os.Bundle getExtras();
+ method public java.util.List<android.content.pm.InstantAppIntentFilter> getIntentFilters();
+ method public long getLongVersionCode();
+ method public String getPackageName();
+ method @Deprecated public int getVersionCode();
+ method public boolean shouldLetInstallerDecide();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppResolveInfo> CREATOR;
+ }
+
+ public static final class InstantAppResolveInfo.InstantAppDigest implements android.os.Parcelable {
+ ctor public InstantAppResolveInfo.InstantAppDigest(@NonNull String);
+ method public int describeContents();
+ method public byte[][] getDigestBytes();
+ method public int[] getDigestPrefix();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppResolveInfo.InstantAppDigest> CREATOR;
+ field public static final android.content.pm.InstantAppResolveInfo.InstantAppDigest UNDEFINED;
+ }
+
+ public final class IntentFilterVerificationInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public java.util.Set<java.lang.String> getDomains();
+ method public String getPackageName();
+ method public int getStatus();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.IntentFilterVerificationInfo> CREATOR;
+ }
+
+ public class LauncherApps {
+ method @Nullable public android.content.pm.LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String, @NonNull android.os.UserHandle);
+ }
+
+ public static final class LauncherApps.AppUsageLimit implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getTotalUsageLimit();
+ method public long getUsageRemaining();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR;
+ }
+
+ public class PackageInstaller {
+ method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
+ field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2
+ field public static final int DATA_LOADER_TYPE_NONE = 0; // 0x0
+ field public static final int DATA_LOADER_TYPE_STREAMING = 1; // 0x1
+ field public static final String EXTRA_DATA_LOADER_TYPE = "android.content.pm.extra.DATA_LOADER_TYPE";
+ field public static final int LOCATION_DATA_APP = 0; // 0x0
+ field public static final int LOCATION_MEDIA_DATA = 2; // 0x2
+ field public static final int LOCATION_MEDIA_OBB = 1; // 0x1
+ }
+
+ public static class PackageInstaller.Session implements java.io.Closeable {
+ method @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public void addFile(int, @NonNull String, long, @NonNull byte[], @Nullable byte[]);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender);
+ method @Nullable @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public android.content.pm.DataLoaderParams getDataLoaderParams();
+ method @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public void removeFile(int, @NonNull String);
+ }
+
+ public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
+ method public boolean getAllocateAggressive();
+ method @Deprecated public boolean getAllowDowngrade();
+ method public int getAutoRevokePermissionsMode();
+ method public boolean getDontKillApp();
+ method public boolean getEnableRollback();
+ method @Nullable public String[] getGrantedRuntimePermissions();
+ method public boolean getInstallAsFullApp(boolean);
+ method public boolean getInstallAsInstantApp(boolean);
+ method public boolean getInstallAsVirtualPreload();
+ method public boolean getRequestDowngrade();
+ method public int getRollbackDataPolicy();
+ method @NonNull public java.util.Set<java.lang.String> getWhitelistedRestrictedPermissions();
+ }
+
+ public static class PackageInstaller.SessionParams implements android.os.Parcelable {
+ method @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public void setAllocateAggressive(boolean);
+ method @Deprecated public void setAllowDowngrade(boolean);
+ method @RequiresPermission(allOf={android.Manifest.permission.INSTALL_PACKAGES, "com.android.permission.USE_INSTALLER_V2"}) public void setDataLoaderParams(@NonNull android.content.pm.DataLoaderParams);
+ method public void setDontKillApp(boolean);
+ method public void setEnableRollback(boolean);
+ method public void setEnableRollback(boolean, int);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS) public void setGrantedRuntimePermissions(String[]);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setInstallAsApex();
+ method public void setInstallAsInstantApp(boolean);
+ method public void setInstallAsVirtualPreload();
+ method public void setRequestDowngrade(boolean);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setStaged();
+ }
+
+ public class PackageItemInfo {
+ method public static void forceSafeLabels();
+ method @Deprecated @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager);
+ method @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager, @FloatRange(from=0) float, int);
+ }
+
+ public abstract class PackageManager {
+ method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void addOnPermissionsChangeListener(@NonNull android.content.pm.PackageManager.OnPermissionsChangedListener);
+ method public abstract boolean arePermissionsIndividuallyControlled();
+ method @NonNull public abstract java.util.List<android.content.IntentFilter> getAllIntentFilters(@NonNull String);
+ method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.pm.ApplicationInfo getApplicationInfoAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @NonNull public android.content.pm.dex.ArtManager getArtManager();
+ method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_SHARED_LIBRARIES) public java.util.List<android.content.pm.SharedLibraryInfo> getDeclaredSharedLibraries(@NonNull String, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract String getDefaultBrowserPackageNameAsUser(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public CharSequence getHarmfulAppWarning(@NonNull String);
+ method @Nullable public String getIncidentReportApproverPackageName();
+ method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract java.util.List<android.content.pm.PackageInfo> getInstalledPackagesAsUser(int, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_INSTANT_APPS) public abstract android.graphics.drawable.Drawable getInstantAppIcon(String);
+ method @Nullable public abstract android.content.ComponentName getInstantAppInstallerComponent();
+ method @Nullable public abstract android.content.ComponentName getInstantAppResolverSettingsComponent();
+ method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_INSTANT_APPS) public abstract java.util.List<android.content.pm.InstantAppInfo> getInstantApps();
+ method @NonNull public abstract java.util.List<android.content.pm.IntentFilterVerificationInfo> getIntentFilterVerifications(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract int getIntentVerificationStatusAsUser(@NonNull String, int);
+ method @android.content.pm.PackageManager.PermissionFlags @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS, android.Manifest.permission.GET_RUNTIME_PERMISSIONS}) public abstract int getPermissionFlags(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
+ method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] getUnsuspendablePackages(@NonNull String[]);
+ method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public abstract void grantRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
+ method @Deprecated public abstract int installExistingPackage(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @Deprecated public abstract int installExistingPackage(@NonNull String, int) throws android.content.pm.PackageManager.NameNotFoundException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceiversAsUser(@NonNull android.content.Intent, int, android.os.UserHandle);
+ method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryIntentActivitiesAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle);
+ method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProvidersAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle);
+ method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryIntentServicesAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle);
+ method public abstract void registerDexModule(@NonNull String, @Nullable android.content.pm.PackageManager.DexModuleRegisterCallback);
+ method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void removeOnPermissionsChangeListener(@NonNull android.content.pm.PackageManager.OnPermissionsChangedListener);
+ method public void replacePreferredActivity(@NonNull android.content.IntentFilter, int, @NonNull java.util.List<android.content.ComponentName>, @NonNull android.content.ComponentName);
+ method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public abstract void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle, @NonNull String);
+ method public void sendDeviceCustomizationReadyBroadcast();
+ method @RequiresPermission(allOf={android.Manifest.permission.SET_PREFERRED_APPLICATIONS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public abstract boolean setDefaultBrowserPackageNameAsUser(@Nullable String, int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setDistractingPackageRestrictions(@NonNull String[], int);
+ method @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public void setHarmfulAppWarning(@NonNull String, @Nullable CharSequence);
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable String);
+ method @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable android.content.pm.SuspendDialogInfo);
+ method @RequiresPermission(value=android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE, conditional=true) public void setSyntheticAppDetailsActivityEnabled(@NonNull String, boolean);
+ method public void setSystemAppState(@NonNull String, int);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public abstract void setUpdateAvailable(@NonNull String, boolean);
+ method @RequiresPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) public abstract boolean updateIntentVerificationStatusAsUser(@NonNull String, int, int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS}) public abstract void updatePermissionFlags(@NonNull String, @NonNull String, @android.content.pm.PackageManager.PermissionFlags int, @android.content.pm.PackageManager.PermissionFlags int, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT) public abstract void verifyIntentFilter(int, int, @NonNull java.util.List<java.lang.String>);
+ field public static final String ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS";
+ field public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES";
+ field public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS";
+ field public static final String FEATURE_BROADCAST_RADIO = "android.hardware.broadcastradio";
+ field public static final String FEATURE_CONTEXT_HUB = "android.hardware.context_hub";
+ field public static final String FEATURE_INCREMENTAL_DELIVERY = "android.software.incremental_delivery";
+ field public static final String FEATURE_REBOOT_ESCROW = "android.hardware.reboot_escrow";
+ field public static final String FEATURE_TELEPHONY_CARRIERLOCK = "android.hardware.telephony.carrierlock";
+ field public static final int FLAGS_PERMISSION_RESERVED_PERMISSION_CONTROLLER = -268435456; // 0xf0000000
+ field public static final int FLAG_PERMISSION_APPLY_RESTRICTION = 16384; // 0x4000
+ field public static final int FLAG_PERMISSION_AUTO_REVOKED = 131072; // 0x20000
+ field public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 32; // 0x20
+ field public static final int FLAG_PERMISSION_GRANTED_BY_ROLE = 32768; // 0x8000
+ field public static final int FLAG_PERMISSION_ONE_TIME = 65536; // 0x10000
+ field public static final int FLAG_PERMISSION_POLICY_FIXED = 4; // 0x4
+ field public static final int FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT = 2048; // 0x800
+ field public static final int FLAG_PERMISSION_RESTRICTION_ROLE_EXEMPT = 262144; // 0x40000
+ field public static final int FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT = 4096; // 0x1000
+ field public static final int FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT = 8192; // 0x2000
+ field public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 64; // 0x40
+ field public static final int FLAG_PERMISSION_REVOKED_COMPAT = 8; // 0x8
+ field @Deprecated public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 8; // 0x8
+ field public static final int FLAG_PERMISSION_SYSTEM_FIXED = 16; // 0x10
+ field public static final int FLAG_PERMISSION_USER_FIXED = 2; // 0x2
+ field public static final int FLAG_PERMISSION_USER_SENSITIVE_WHEN_DENIED = 512; // 0x200
+ field public static final int FLAG_PERMISSION_USER_SENSITIVE_WHEN_GRANTED = 256; // 0x100
+ field public static final int FLAG_PERMISSION_USER_SET = 1; // 0x1
+ field public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; // 0xffffffff
+ field public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; // 0xfffffff3
+ field public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; // 0xffffffee
+ field public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; // 0xfffffff0
+ field public static final int INSTALL_FAILED_DEXOPT = -11; // 0xfffffff5
+ field public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; // 0xfffffffb
+ field public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; // 0xfffffffc
+ field public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; // 0xffffff92
+ field public static final int INSTALL_FAILED_INVALID_APK = -2; // 0xfffffffe
+ field public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; // 0xffffffed
+ field public static final int INSTALL_FAILED_INVALID_URI = -3; // 0xfffffffd
+ field public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; // 0xffffffec
+ field public static final int INSTALL_FAILED_MISSING_FEATURE = -17; // 0xffffffef
+ field public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; // 0xfffffff7
+ field public static final int INSTALL_FAILED_NEWER_SDK = -14; // 0xfffffff2
+ field public static final int INSTALL_FAILED_NO_SHARED_USER = -6; // 0xfffffffa
+ field public static final int INSTALL_FAILED_OLDER_SDK = -12; // 0xfffffff4
+ field public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; // 0xffffffe9
+ field public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; // 0xffffffe6
+ field public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; // 0xfffffff6
+ field public static final int INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE = -27; // 0xffffffe5
+ field public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; // 0xfffffff8
+ field public static final int INSTALL_FAILED_TEST_ONLY = -15; // 0xfffffff1
+ field public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; // 0xfffffff9
+ field public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; // 0xffffffea
+ field public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; // 0xffffffeb
+ field public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; // 0xffffff9b
+ field public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; // 0xffffff96
+ field public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; // 0xffffff95
+ field public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; // 0xffffff97
+ field public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; // 0xffffff98
+ field public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; // 0xffffff93
+ field public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; // 0xffffff94
+ field public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; // 0xffffff9c
+ field public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; // 0xffffff99
+ field public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; // 0xffffff9a
+ field public static final int INSTALL_SUCCEEDED = 1; // 0x1
+ field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; // 0x2
+ field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; // 0x4
+ field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; // 0x1
+ field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; // 0x3
+ field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; // 0x0
+ field public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; // 0xffffffff
+ field public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; // 0x1
+ field @Deprecated public static final int MASK_PERMISSION_FLAGS = 255; // 0xff
+ field public static final int MATCH_ANY_USER = 4194304; // 0x400000
+ field public static final int MATCH_FACTORY_ONLY = 2097152; // 0x200000
+ field public static final int MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS = 536870912; // 0x20000000
+ field public static final int MATCH_INSTANT = 8388608; // 0x800000
+ field public static final int MODULE_APEX_NAME = 1; // 0x1
+ field public static final int RESTRICTION_HIDE_FROM_SUGGESTIONS = 1; // 0x1
+ field public static final int RESTRICTION_HIDE_NOTIFICATIONS = 2; // 0x2
+ field public static final int RESTRICTION_NONE = 0; // 0x0
+ field public static final int SYSTEM_APP_STATE_HIDDEN_UNTIL_INSTALLED_HIDDEN = 0; // 0x0
+ field public static final int SYSTEM_APP_STATE_HIDDEN_UNTIL_INSTALLED_VISIBLE = 1; // 0x1
+ field public static final int SYSTEM_APP_STATE_INSTALLED = 2; // 0x2
+ field public static final int SYSTEM_APP_STATE_UNINSTALLED = 3; // 0x3
+ }
+
+ public abstract static class PackageManager.DexModuleRegisterCallback {
+ ctor public PackageManager.DexModuleRegisterCallback();
+ method public abstract void onDexModuleRegistered(String, boolean, String);
+ }
+
+ public static interface PackageManager.OnPermissionsChangedListener {
+ method public void onPermissionsChanged(int);
+ }
+
+ @IntDef(prefix={"FLAG_PERMISSION_"}, value={android.content.pm.PackageManager.FLAG_PERMISSION_USER_SET, android.content.pm.PackageManager.FLAG_PERMISSION_USER_FIXED, android.content.pm.PackageManager.FLAG_PERMISSION_POLICY_FIXED, android.content.pm.PackageManager.FLAG_PERMISSION_REVOKE_ON_UPGRADE, android.content.pm.PackageManager.FLAG_PERMISSION_SYSTEM_FIXED, android.content.pm.PackageManager.FLAG_PERMISSION_GRANTED_BY_DEFAULT, android.content.pm.PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_GRANTED, android.content.pm.PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_DENIED, android.content.pm.PackageManager.FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT, android.content.pm.PackageManager.FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT, android.content.pm.PackageManager.FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT, android.content.pm.PackageManager.FLAG_PERMISSION_APPLY_RESTRICTION, android.content.pm.PackageManager.FLAG_PERMISSION_GRANTED_BY_ROLE, android.content.pm.PackageManager.FLAG_PERMISSION_REVOKED_COMPAT, android.content.pm.PackageManager.FLAG_PERMISSION_ONE_TIME, android.content.pm.PackageManager.FLAG_PERMISSION_AUTO_REVOKED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PackageManager.PermissionFlags {
+ }
+
+ public class PermissionGroupInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
+ field @StringRes public final int backgroundRequestDetailResourceId;
+ field @StringRes public final int backgroundRequestResourceId;
+ field @StringRes public final int requestDetailResourceId;
+ field @StringRes public int requestRes;
+ }
+
+ public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
+ field public static final int FLAG_REMOVED = 2; // 0x2
+ field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000
+ field public static final int PROTECTION_FLAG_COMPANION = 8388608; // 0x800000
+ field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000
+ field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000
+ field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000
+ field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000
+ field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000
+ field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000
+ field public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000
+ field @Nullable public final String backgroundPermission;
+ field @StringRes public int requestRes;
+ }
+
+ public class ResolveInfo implements android.os.Parcelable {
+ field public boolean handleAllWebDataURI;
+ }
+
+ public final class ShortcutInfo implements android.os.Parcelable {
+ method @Nullable public android.app.Person[] getPersons();
+ }
+
+ public class ShortcutManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_APP_PREDICTIONS) public java.util.List<android.content.pm.ShortcutManager.ShareShortcutInfo> getShareTargets(@NonNull android.content.IntentFilter);
+ method public boolean hasShareTargets(@NonNull String);
+ }
+
+ public static final class ShortcutManager.ShareShortcutInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.content.pm.ShortcutInfo getShortcutInfo();
+ method @NonNull public android.content.ComponentName getTargetComponent();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.ShortcutManager.ShareShortcutInfo> CREATOR;
+ }
+
+ public final class SuspendDialogInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int BUTTON_ACTION_MORE_DETAILS = 0; // 0x0
+ field public static final int BUTTON_ACTION_UNSUSPEND = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.SuspendDialogInfo> CREATOR;
+ }
+
+ public static final class SuspendDialogInfo.Builder {
+ ctor public SuspendDialogInfo.Builder();
+ method @NonNull public android.content.pm.SuspendDialogInfo build();
+ method @NonNull public android.content.pm.SuspendDialogInfo.Builder setIcon(@DrawableRes int);
+ method @NonNull public android.content.pm.SuspendDialogInfo.Builder setMessage(@NonNull String);
+ method @NonNull public android.content.pm.SuspendDialogInfo.Builder setMessage(@StringRes int);
+ method @NonNull public android.content.pm.SuspendDialogInfo.Builder setNeutralButtonAction(int);
+ method @NonNull public android.content.pm.SuspendDialogInfo.Builder setNeutralButtonText(@StringRes int);
+ method @NonNull public android.content.pm.SuspendDialogInfo.Builder setTitle(@StringRes int);
+ }
+
+}
+
+package android.content.pm.dex {
+
+ public class ArtManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.READ_RUNTIME_PROFILES, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean isRuntimeProfilingEnabled(int);
+ method @RequiresPermission(allOf={android.Manifest.permission.READ_RUNTIME_PROFILES, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void snapshotRuntimeProfile(int, @Nullable String, @Nullable String, @NonNull java.util.concurrent.Executor, @NonNull android.content.pm.dex.ArtManager.SnapshotRuntimeProfileCallback);
+ field public static final int PROFILE_APPS = 0; // 0x0
+ field public static final int PROFILE_BOOT_IMAGE = 1; // 0x1
+ field public static final int SNAPSHOT_FAILED_CODE_PATH_NOT_FOUND = 1; // 0x1
+ field public static final int SNAPSHOT_FAILED_INTERNAL_ERROR = 2; // 0x2
+ field public static final int SNAPSHOT_FAILED_PACKAGE_NOT_FOUND = 0; // 0x0
+ }
+
+ public abstract static class ArtManager.SnapshotRuntimeProfileCallback {
+ ctor public ArtManager.SnapshotRuntimeProfileCallback();
+ method public abstract void onError(int);
+ method public abstract void onSuccess(android.os.ParcelFileDescriptor);
+ }
+
+}
+
+package android.content.pm.permission {
+
+ @Deprecated public final class RuntimePermissionPresentationInfo implements android.os.Parcelable {
+ ctor @Deprecated public RuntimePermissionPresentationInfo(CharSequence, boolean, boolean);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public CharSequence getLabel();
+ method @Deprecated public boolean isGranted();
+ method @Deprecated public boolean isStandard();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.content.pm.permission.RuntimePermissionPresentationInfo> CREATOR;
+ }
+
+}
+
+package android.content.rollback {
+
+ public final class PackageRollbackInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public String getPackageName();
+ method @NonNull public android.content.pm.VersionedPackage getVersionRolledBackFrom();
+ method @NonNull public android.content.pm.VersionedPackage getVersionRolledBackTo();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.rollback.PackageRollbackInfo> CREATOR;
+ }
+
+ public final class RollbackInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.content.pm.VersionedPackage> getCausePackages();
+ method public int getCommittedSessionId();
+ method @NonNull public java.util.List<android.content.rollback.PackageRollbackInfo> getPackages();
+ method public int getRollbackId();
+ method public boolean isStaged();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.content.rollback.RollbackInfo> CREATOR;
+ }
+
+ public final class RollbackManager {
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_ROLLBACKS, "android.permission.TEST_MANAGE_ROLLBACKS"}) public void commitRollback(int, @NonNull java.util.List<android.content.pm.VersionedPackage>, @NonNull android.content.IntentSender);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_ROLLBACKS, "android.permission.TEST_MANAGE_ROLLBACKS"}) public java.util.List<android.content.rollback.RollbackInfo> getAvailableRollbacks();
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_ROLLBACKS, "android.permission.TEST_MANAGE_ROLLBACKS"}) public java.util.List<android.content.rollback.RollbackInfo> getRecentlyCommittedRollbacks();
+ field public static final String EXTRA_STATUS = "android.content.rollback.extra.STATUS";
+ field public static final String EXTRA_STATUS_MESSAGE = "android.content.rollback.extra.STATUS_MESSAGE";
+ field public static final int STATUS_FAILURE = 1; // 0x1
+ field public static final int STATUS_FAILURE_INSTALL = 3; // 0x3
+ field public static final int STATUS_FAILURE_ROLLBACK_UNAVAILABLE = 2; // 0x2
+ field public static final int STATUS_SUCCESS = 0; // 0x0
+ }
+
+}
+
+package android.debug {
+
+ public class AdbManager {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiQrSupported();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiSupported();
+ }
+
+}
+
+package android.hardware {
+
+ public final class Sensor {
+ method public java.util.UUID getUuid();
+ method public boolean isDataInjectionSupported();
+ field public static final String STRING_TYPE_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta";
+ field public static final String STRING_TYPE_WRIST_TILT_GESTURE = "android.sensor.wrist_tilt_gesture";
+ field public static final int TYPE_DYNAMIC_SENSOR_META = 32; // 0x20
+ field public static final int TYPE_WRIST_TILT_GESTURE = 26; // 0x1a
+ }
+
+ public abstract class SensorManager {
+ method public boolean initDataInjection(boolean);
+ method public boolean injectSensorData(android.hardware.Sensor, float[], int, long);
+ }
+
+}
+
+package android.hardware.biometrics {
+
+ public static interface BiometricManager.Authenticators {
+ field @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static final int BIOMETRIC_CONVENIENCE = 4095; // 0xfff
+ field @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static final int EMPTY_SET = 0; // 0x0
+ }
+
+}
+
+package android.hardware.camera2 {
+
+ public abstract class CameraDevice implements java.lang.AutoCloseable {
+ method @Deprecated public abstract void createCustomCaptureSession(android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, int, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
+ field public static final int SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED = 1; // 0x1
+ field public static final int SESSION_OPERATION_MODE_NORMAL = 0; // 0x0
+ field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
+ }
+
+}
+
+package android.hardware.camera2.params {
+
+ public final class OutputConfiguration implements android.os.Parcelable {
+ ctor public OutputConfiguration(@NonNull android.view.Surface, int);
+ ctor public OutputConfiguration(int, @NonNull android.view.Surface, int);
+ method public int getRotation();
+ field public static final int ROTATION_0 = 0; // 0x0
+ field public static final int ROTATION_180 = 2; // 0x2
+ field public static final int ROTATION_270 = 3; // 0x3
+ field public static final int ROTATION_90 = 1; // 0x1
+ }
+
+}
+
+package android.hardware.display {
+
+ public final class AmbientBrightnessDayStats implements android.os.Parcelable {
+ method public int describeContents();
+ method public float[] getBucketBoundaries();
+ method public java.time.LocalDate getLocalDate();
+ method public float[] getStats();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.AmbientBrightnessDayStats> CREATOR;
+ }
+
+ public final class BrightnessChangeEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessChangeEvent> CREATOR;
+ field public final float batteryLevel;
+ field public final float brightness;
+ field public final long colorSampleDuration;
+ field public final int colorTemperature;
+ field @Nullable public final long[] colorValueBuckets;
+ field public final boolean isDefaultBrightnessConfig;
+ field public final boolean isUserSetBrightness;
+ field public final float lastBrightness;
+ field public final long[] luxTimestamps;
+ field public final float[] luxValues;
+ field public final boolean nightMode;
+ field public final String packageName;
+ field public final float powerBrightnessFactor;
+ field public final long timeStamp;
+ }
+
+ public final class BrightnessConfiguration implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.hardware.display.BrightnessCorrection getCorrectionByCategory(int);
+ method @Nullable public android.hardware.display.BrightnessCorrection getCorrectionByPackageName(@NonNull String);
+ method public android.util.Pair<float[],float[]> getCurve();
+ method public float getShortTermModelLowerLuxMultiplier();
+ method public long getShortTermModelTimeoutMillis();
+ method public float getShortTermModelUpperLuxMultiplier();
+ method public boolean shouldCollectColorSamples();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessConfiguration> CREATOR;
+ field public static final long SHORT_TERM_TIMEOUT_UNSET = -1L; // 0xffffffffffffffffL
+ }
+
+ public static class BrightnessConfiguration.Builder {
+ ctor public BrightnessConfiguration.Builder(float[], float[]);
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder addCorrectionByCategory(int, @NonNull android.hardware.display.BrightnessCorrection);
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder addCorrectionByPackageName(@NonNull String, @NonNull android.hardware.display.BrightnessCorrection);
+ method @NonNull public android.hardware.display.BrightnessConfiguration build();
+ method public int getMaxCorrectionsByCategory();
+ method public int getMaxCorrectionsByPackageName();
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setDescription(@Nullable String);
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShortTermModelLowerLuxMultiplier(@FloatRange(from=0.0f) float);
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShortTermModelTimeoutMillis(long);
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShortTermModelUpperLuxMultiplier(@FloatRange(from=0.0f) float);
+ method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShouldCollectColorSamples(boolean);
+ }
+
+ public final class BrightnessCorrection implements android.os.Parcelable {
+ method @FloatRange(from=0.0) public float apply(@FloatRange(from=0.0) float);
+ method @NonNull public static android.hardware.display.BrightnessCorrection createScaleAndTranslateLog(float, float);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessCorrection> CREATOR;
+ }
+
+ public final class ColorDisplayManager {
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public int getNightDisplayAutoMode();
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public int getTransformCapabilities();
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setAppSaturationLevel(@NonNull String, @IntRange(from=0, to=100) int);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setNightDisplayAutoMode(int);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setNightDisplayCustomEndTime(@NonNull java.time.LocalTime);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setNightDisplayCustomStartTime(@NonNull java.time.LocalTime);
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setSaturationLevel(@IntRange(from=0, to=100) int);
+ field public static final int AUTO_MODE_CUSTOM_TIME = 1; // 0x1
+ field public static final int AUTO_MODE_DISABLED = 0; // 0x0
+ field public static final int AUTO_MODE_TWILIGHT = 2; // 0x2
+ field public static final int CAPABILITY_HARDWARE_ACCELERATION_GLOBAL = 2; // 0x2
+ field public static final int CAPABILITY_HARDWARE_ACCELERATION_PER_APP = 4; // 0x4
+ field public static final int CAPABILITY_NONE = 0; // 0x0
+ field public static final int CAPABILITY_PROTECTED_CONTENT = 1; // 0x1
+ }
+
+ public final class DisplayManager {
+ method @RequiresPermission(android.Manifest.permission.ACCESS_AMBIENT_LIGHT_STATS) public java.util.List<android.hardware.display.AmbientBrightnessDayStats> getAmbientBrightnessStats();
+ method @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public android.hardware.display.BrightnessConfiguration getBrightnessConfiguration();
+ method @RequiresPermission(android.Manifest.permission.BRIGHTNESS_SLIDER_USAGE) public java.util.List<android.hardware.display.BrightnessChangeEvent> getBrightnessEvents();
+ method @Nullable @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public android.hardware.display.BrightnessConfiguration getDefaultBrightnessConfiguration();
+ method public android.util.Pair<float[],float[]> getMinimumBrightnessCurve();
+ method public android.graphics.Point getStableDisplaySize();
+ method @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public void setBrightnessConfiguration(android.hardware.display.BrightnessConfiguration);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_SATURATION) public void setSaturationLevel(float);
+ }
+
+}
+
+package android.hardware.hdmi {
+
+ public abstract class HdmiClient {
+ method public android.hardware.hdmi.HdmiDeviceInfo getActiveSource();
+ method public void sendKeyEvent(int, boolean);
+ method public void sendVendorCommand(int, byte[], boolean);
+ method public void setVendorCommandListener(@NonNull android.hardware.hdmi.HdmiControlManager.VendorCommandListener);
+ }
+
+ public final class HdmiControlManager {
+ method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void addHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
+ method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void addHotplugEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
+ method @Nullable public android.hardware.hdmi.HdmiClient getClient(int);
+ method @NonNull public java.util.List<android.hardware.hdmi.HdmiDeviceInfo> getConnectedDevices();
+ method public int getPhysicalAddress();
+ method @Nullable public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient();
+ method @Nullable public android.hardware.hdmi.HdmiSwitchClient getSwitchClient();
+ method @Nullable public android.hardware.hdmi.HdmiTvClient getTvClient();
+ method public boolean isDeviceConnected(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
+ method public void powerOffDevice(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
+ method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void removeHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
+ method public void setActiveSource(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
+ method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setStandbyMode(boolean);
+ field public static final String ACTION_OSD_MESSAGE = "android.hardware.hdmi.action.OSD_MESSAGE";
+ field public static final int AVR_VOLUME_MUTED = 101; // 0x65
+ field public static final int CLEAR_TIMER_STATUS_CEC_DISABLE = 162; // 0xa2
+ field public static final int CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION = 160; // 0xa0
+ field public static final int CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE = 161; // 0xa1
+ field public static final int CLEAR_TIMER_STATUS_TIMER_CLEARED = 128; // 0x80
+ field public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_INFO_AVAILABLE = 2; // 0x2
+ field public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_MATCHING = 1; // 0x1
+ field public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_RECORDING = 0; // 0x0
+ field public static final int CONTROL_STATE_CHANGED_REASON_SETTING = 1; // 0x1
+ field public static final int CONTROL_STATE_CHANGED_REASON_STANDBY = 3; // 0x3
+ field public static final int CONTROL_STATE_CHANGED_REASON_START = 0; // 0x0
+ field public static final int CONTROL_STATE_CHANGED_REASON_WAKEUP = 2; // 0x2
+ field public static final int DEVICE_EVENT_ADD_DEVICE = 1; // 0x1
+ field public static final int DEVICE_EVENT_REMOVE_DEVICE = 2; // 0x2
+ field public static final int DEVICE_EVENT_UPDATE_DEVICE = 3; // 0x3
+ field public static final String EXTRA_MESSAGE_EXTRA_PARAM1 = "android.hardware.hdmi.extra.MESSAGE_EXTRA_PARAM1";
+ field public static final String EXTRA_MESSAGE_ID = "android.hardware.hdmi.extra.MESSAGE_ID";
+ field public static final int ONE_TOUCH_RECORD_ALREADY_RECORDING = 18; // 0x12
+ field public static final int ONE_TOUCH_RECORD_CEC_DISABLED = 51; // 0x33
+ field public static final int ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION = 49; // 0x31
+ field public static final int ONE_TOUCH_RECORD_DISALLOW_TO_COPY = 13; // 0xd
+ field public static final int ONE_TOUCH_RECORD_DISALLOW_TO_FUTHER_COPIES = 14; // 0xe
+ field public static final int ONE_TOUCH_RECORD_FAIL_TO_RECORD_DISPLAYED_SCREEN = 50; // 0x32
+ field public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PHYSICAL_ADDRESS = 10; // 0xa
+ field public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PLUG_NUMBER = 9; // 0x9
+ field public static final int ONE_TOUCH_RECORD_MEDIA_PROBLEM = 21; // 0x15
+ field public static final int ONE_TOUCH_RECORD_MEDIA_PROTECTED = 19; // 0x13
+ field public static final int ONE_TOUCH_RECORD_NOT_ENOUGH_SPACE = 22; // 0x16
+ field public static final int ONE_TOUCH_RECORD_NO_MEDIA = 16; // 0x10
+ field public static final int ONE_TOUCH_RECORD_NO_OR_INSUFFICIENT_CA_ENTITLEMENTS = 12; // 0xc
+ field public static final int ONE_TOUCH_RECORD_NO_SOURCE_SIGNAL = 20; // 0x14
+ field public static final int ONE_TOUCH_RECORD_OTHER_REASON = 31; // 0x1f
+ field public static final int ONE_TOUCH_RECORD_PARENT_LOCK_ON = 23; // 0x17
+ field public static final int ONE_TOUCH_RECORD_PLAYING = 17; // 0x11
+ field public static final int ONE_TOUCH_RECORD_PREVIOUS_RECORDING_IN_PROGRESS = 48; // 0x30
+ field public static final int ONE_TOUCH_RECORD_RECORDING_ALREADY_TERMINATED = 27; // 0x1b
+ field public static final int ONE_TOUCH_RECORD_RECORDING_ANALOGUE_SERVICE = 3; // 0x3
+ field public static final int ONE_TOUCH_RECORD_RECORDING_CURRENTLY_SELECTED_SOURCE = 1; // 0x1
+ field public static final int ONE_TOUCH_RECORD_RECORDING_DIGITAL_SERVICE = 2; // 0x2
+ field public static final int ONE_TOUCH_RECORD_RECORDING_EXTERNAL_INPUT = 4; // 0x4
+ field public static final int ONE_TOUCH_RECORD_RECORDING_TERMINATED_NORMALLY = 26; // 0x1a
+ field public static final int ONE_TOUCH_RECORD_UNABLE_ANALOGUE_SERVICE = 6; // 0x6
+ field public static final int ONE_TOUCH_RECORD_UNABLE_DIGITAL_SERVICE = 5; // 0x5
+ field public static final int ONE_TOUCH_RECORD_UNABLE_SELECTED_SERVICE = 7; // 0x7
+ field public static final int ONE_TOUCH_RECORD_UNSUPPORTED_CA = 11; // 0xb
+ field public static final int OSD_MESSAGE_ARC_CONNECTED_INVALID_PORT = 1; // 0x1
+ field public static final int OSD_MESSAGE_AVR_VOLUME_CHANGED = 2; // 0x2
+ field public static final int POWER_STATUS_ON = 0; // 0x0
+ field public static final int POWER_STATUS_STANDBY = 1; // 0x1
+ field public static final int POWER_STATUS_TRANSIENT_TO_ON = 2; // 0x2
+ field public static final int POWER_STATUS_TRANSIENT_TO_STANDBY = 3; // 0x3
+ field public static final int POWER_STATUS_UNKNOWN = -1; // 0xffffffff
+ field @Deprecated public static final int RESULT_ALREADY_IN_PROGRESS = 4; // 0x4
+ field public static final int RESULT_COMMUNICATION_FAILED = 7; // 0x7
+ field public static final int RESULT_EXCEPTION = 5; // 0x5
+ field public static final int RESULT_INCORRECT_MODE = 6; // 0x6
+ field public static final int RESULT_SOURCE_NOT_AVAILABLE = 2; // 0x2
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final int RESULT_TARGET_NOT_AVAILABLE = 3; // 0x3
+ field public static final int RESULT_TIMEOUT = 1; // 0x1
+ field public static final int TIMER_RECORDING_RESULT_EXTRA_CEC_DISABLED = 3; // 0x3
+ field public static final int TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION = 1; // 0x1
+ field public static final int TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE = 2; // 0x2
+ field public static final int TIMER_RECORDING_RESULT_EXTRA_NO_ERROR = 0; // 0x0
+ field public static final int TIMER_RECORDING_TYPE_ANALOGUE = 2; // 0x2
+ field public static final int TIMER_RECORDING_TYPE_DIGITAL = 1; // 0x1
+ field public static final int TIMER_RECORDING_TYPE_EXTERNAL = 3; // 0x3
+ field public static final int TIMER_STATUS_MEDIA_INFO_NOT_PRESENT = 2; // 0x2
+ field public static final int TIMER_STATUS_MEDIA_INFO_PRESENT_NOT_PROTECTED = 0; // 0x0
+ field public static final int TIMER_STATUS_MEDIA_INFO_PRESENT_PROTECTED = 1; // 0x1
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_CA_NOT_SUPPORTED = 6; // 0x6
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_CLOCK_FAILURE = 10; // 0xa
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_DATE_OUT_OF_RANGE = 2; // 0x2
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_DUPLICATED = 14; // 0xe
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PHYSICAL_NUMBER = 5; // 0x5
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PLUG_NUMBER = 4; // 0x4
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_SEQUENCE = 3; // 0x3
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_NO_CA_ENTITLEMENTS = 7; // 0x7
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_NO_FREE_TIME = 1; // 0x1
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_PARENTAL_LOCK_ON = 9; // 0x9
+ field public static final int TIMER_STATUS_NOT_PROGRAMMED_UNSUPPORTED_RESOLUTION = 8; // 0x8
+ field public static final int TIMER_STATUS_PROGRAMMED_INFO_ENOUGH_SPACE = 8; // 0x8
+ field public static final int TIMER_STATUS_PROGRAMMED_INFO_MIGHT_NOT_ENOUGH_SPACE = 11; // 0xb
+ field public static final int TIMER_STATUS_PROGRAMMED_INFO_NOT_ENOUGH_SPACE = 9; // 0x9
+ field public static final int TIMER_STATUS_PROGRAMMED_INFO_NO_MEDIA_INFO = 10; // 0xa
+ }
+
+ @IntDef({android.hardware.hdmi.HdmiControlManager.RESULT_SUCCESS, android.hardware.hdmi.HdmiControlManager.RESULT_TIMEOUT, android.hardware.hdmi.HdmiControlManager.RESULT_SOURCE_NOT_AVAILABLE, android.hardware.hdmi.HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE, android.hardware.hdmi.HdmiControlManager.RESULT_ALREADY_IN_PROGRESS, android.hardware.hdmi.HdmiControlManager.RESULT_EXCEPTION, android.hardware.hdmi.HdmiControlManager.RESULT_INCORRECT_MODE, android.hardware.hdmi.HdmiControlManager.RESULT_COMMUNICATION_FAILED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface HdmiControlManager.ControlCallbackResult {
+ }
+
+ public static interface HdmiControlManager.HotplugEventListener {
+ method public void onReceived(android.hardware.hdmi.HdmiHotplugEvent);
+ }
+
+ public static interface HdmiControlManager.VendorCommandListener {
+ method public void onControlStateChanged(boolean, int);
+ method public void onReceived(int, int, byte[], boolean);
+ }
+
+ public class HdmiDeviceInfo implements android.os.Parcelable {
+ ctor public HdmiDeviceInfo();
+ method public int describeContents();
+ method public int getAdopterId();
+ method public int getDeviceId();
+ method public int getDevicePowerStatus();
+ method public int getDeviceType();
+ method public String getDisplayName();
+ method public int getId();
+ method public int getLogicalAddress();
+ method public int getPhysicalAddress();
+ method public int getPortId();
+ method public int getVendorId();
+ method public static int idForCecDevice(int);
+ method public static int idForHardware(int);
+ method public static int idForMhlDevice(int);
+ method public boolean isCecDevice();
+ method public boolean isInactivated();
+ method public boolean isMhlDevice();
+ method public boolean isSourceType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int ADDR_INTERNAL = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiDeviceInfo> CREATOR;
+ field public static final int DEVICE_AUDIO_SYSTEM = 5; // 0x5
+ field public static final int DEVICE_INACTIVE = -1; // 0xffffffff
+ field public static final int DEVICE_PLAYBACK = 4; // 0x4
+ field public static final int DEVICE_RECORDER = 1; // 0x1
+ field public static final int DEVICE_RESERVED = 2; // 0x2
+ field public static final int DEVICE_TUNER = 3; // 0x3
+ field public static final int DEVICE_TV = 0; // 0x0
+ field public static final int ID_INVALID = 65535; // 0xffff
+ field public static final android.hardware.hdmi.HdmiDeviceInfo INACTIVE_DEVICE;
+ field public static final int PATH_INTERNAL = 0; // 0x0
+ field public static final int PATH_INVALID = 65535; // 0xffff
+ field public static final int PORT_INVALID = -1; // 0xffffffff
+ }
+
+ public final class HdmiHotplugEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getPort();
+ method public boolean isConnected();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiHotplugEvent> CREATOR;
+ }
+
+ public final class HdmiPlaybackClient extends android.hardware.hdmi.HdmiClient {
+ method public int getDeviceType();
+ method public void oneTouchPlay(android.hardware.hdmi.HdmiPlaybackClient.OneTouchPlayCallback);
+ method public void queryDisplayStatus(android.hardware.hdmi.HdmiPlaybackClient.DisplayStatusCallback);
+ method public void sendStandby();
+ }
+
+ public static interface HdmiPlaybackClient.DisplayStatusCallback {
+ method public void onComplete(int);
+ }
+
+ public static interface HdmiPlaybackClient.OneTouchPlayCallback {
+ method public void onComplete(int);
+ }
+
+ public final class HdmiPortInfo implements android.os.Parcelable {
+ ctor public HdmiPortInfo(int, int, int, boolean, boolean, boolean);
+ method public int describeContents();
+ method public int getAddress();
+ method public int getId();
+ method public int getType();
+ method public boolean isArcSupported();
+ method public boolean isCecSupported();
+ method public boolean isMhlSupported();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiPortInfo> CREATOR;
+ field public static final int PORT_INPUT = 0; // 0x0
+ field public static final int PORT_OUTPUT = 1; // 0x1
+ }
+
+ public abstract class HdmiRecordListener {
+ ctor public HdmiRecordListener();
+ method public void onClearTimerRecordingResult(int, int);
+ method public void onOneTouchRecordResult(int, int);
+ method public abstract android.hardware.hdmi.HdmiRecordSources.RecordSource onOneTouchRecordSourceRequested(int);
+ method public void onTimerRecordingResult(int, android.hardware.hdmi.HdmiRecordListener.TimerStatusData);
+ }
+
+ public static class HdmiRecordListener.TimerStatusData {
+ method public int getDurationHour();
+ method public int getDurationMinute();
+ method public int getExtraError();
+ method public int getMediaInfo();
+ method public int getNotProgammedError();
+ method public int getProgrammedInfo();
+ method public boolean isOverlapped();
+ method public boolean isProgrammed();
+ }
+
+ public final class HdmiRecordSources {
+ method public static boolean checkRecordSource(byte[]);
+ method public static android.hardware.hdmi.HdmiRecordSources.OwnSource ofOwnSource();
+ }
+
+ public static final class HdmiRecordSources.AnalogueServiceSource extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
+ }
+
+ public static final class HdmiRecordSources.DigitalServiceSource extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
+ }
+
+ public static final class HdmiRecordSources.ExternalPhysicalAddress extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
+ }
+
+ public static final class HdmiRecordSources.ExternalPlugData extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
+ }
+
+ public static final class HdmiRecordSources.OwnSource extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
+ }
+
+ public abstract static class HdmiRecordSources.RecordSource {
+ }
+
+ public class HdmiSwitchClient extends android.hardware.hdmi.HdmiClient {
+ method public int getDeviceType();
+ method @NonNull public java.util.List<android.hardware.hdmi.HdmiPortInfo> getPortInfo();
+ method public void selectPort(int, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
+ method public void selectPort(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
+ }
+
+ public static interface HdmiSwitchClient.OnSelectListener {
+ method public void onSelect(@android.hardware.hdmi.HdmiControlManager.ControlCallbackResult int);
+ }
+
+ public class HdmiTimerRecordSources {
+ method public static boolean checkTimerRecordSource(int, byte[]);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.Duration durationOf(int, int);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofAnalogueSource(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.AnalogueServiceSource);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofDigitalSource(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.DigitalServiceSource);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofExternalPhysicalAddress(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.ExternalPhysicalAddress);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofExternalPlug(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.ExternalPlugData);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.Time timeOf(int, int);
+ method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo timerInfoOf(int, int, android.hardware.hdmi.HdmiTimerRecordSources.Time, android.hardware.hdmi.HdmiTimerRecordSources.Duration, int);
+ field public static final int RECORDING_SEQUENCE_REPEAT_FRIDAY = 32; // 0x20
+ field public static final int RECORDING_SEQUENCE_REPEAT_MONDAY = 2; // 0x2
+ field public static final int RECORDING_SEQUENCE_REPEAT_ONCE_ONLY = 0; // 0x0
+ field public static final int RECORDING_SEQUENCE_REPEAT_SATUREDAY = 64; // 0x40
+ field public static final int RECORDING_SEQUENCE_REPEAT_SUNDAY = 1; // 0x1
+ field public static final int RECORDING_SEQUENCE_REPEAT_THURSDAY = 16; // 0x10
+ field public static final int RECORDING_SEQUENCE_REPEAT_TUESDAY = 4; // 0x4
+ field public static final int RECORDING_SEQUENCE_REPEAT_WEDNESDAY = 8; // 0x8
+ }
+
+ public static final class HdmiTimerRecordSources.Duration {
+ }
+
+ public static final class HdmiTimerRecordSources.Time {
+ }
+
+ public static final class HdmiTimerRecordSources.TimerInfo {
+ }
+
+ public static final class HdmiTimerRecordSources.TimerRecordSource {
+ }
+
+ public final class HdmiTvClient extends android.hardware.hdmi.HdmiClient {
+ method public void clearTimerRecording(int, int, android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource);
+ method public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback);
+ method public java.util.List<android.hardware.hdmi.HdmiDeviceInfo> getDeviceList();
+ method public int getDeviceType();
+ method public void portSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback);
+ method public void sendMhlVendorCommand(int, int, int, byte[]);
+ method public void sendStandby(int);
+ method public void setHdmiMhlVendorCommandListener(android.hardware.hdmi.HdmiTvClient.HdmiMhlVendorCommandListener);
+ method public void setInputChangeListener(android.hardware.hdmi.HdmiTvClient.InputChangeListener);
+ method public void setRecordListener(@NonNull android.hardware.hdmi.HdmiRecordListener);
+ method public void setSystemAudioMode(boolean, android.hardware.hdmi.HdmiTvClient.SelectCallback);
+ method public void setSystemAudioMute(boolean);
+ method public void setSystemAudioVolume(int, int, int);
+ method public void startOneTouchRecord(int, @NonNull android.hardware.hdmi.HdmiRecordSources.RecordSource);
+ method public void startTimerRecording(int, int, android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource);
+ method public void stopOneTouchRecord(int);
+ field public static final int VENDOR_DATA_SIZE = 16; // 0x10
+ }
+
+ public static interface HdmiTvClient.HdmiMhlVendorCommandListener {
+ method public void onReceived(int, int, int, byte[]);
+ }
+
+ public static interface HdmiTvClient.InputChangeListener {
+ method public void onChanged(android.hardware.hdmi.HdmiDeviceInfo);
+ }
+
+ public static interface HdmiTvClient.SelectCallback {
+ method public void onComplete(int);
+ }
+
+}
+
+package android.hardware.lights {
+
+ public final class Light implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getId();
+ method public int getOrdinal();
+ method public int getType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.lights.Light> CREATOR;
+ }
+
+ public final class LightState implements android.os.Parcelable {
+ ctor public LightState(@ColorInt int);
+ method public int describeContents();
+ method @ColorInt public int getColor();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.lights.LightState> CREATOR;
+ }
+
+ public final class LightsManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public java.util.List<android.hardware.lights.Light> getLights();
+ method @NonNull @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public android.hardware.lights.LightsManager.LightsSession openSession();
+ field public static final int LIGHT_TYPE_MICROPHONE = 8; // 0x8
+ }
+
+ public final class LightsManager.LightsSession implements java.lang.AutoCloseable {
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void close();
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void requestLights(@NonNull android.hardware.lights.LightsRequest);
+ }
+
+ public final class LightsRequest {
+ }
+
+ public static final class LightsRequest.Builder {
+ ctor public LightsRequest.Builder();
+ method @NonNull public android.hardware.lights.LightsRequest build();
+ method @NonNull public android.hardware.lights.LightsRequest.Builder clearLight(@NonNull android.hardware.lights.Light);
+ method @NonNull public android.hardware.lights.LightsRequest.Builder setLight(@NonNull android.hardware.lights.Light, @NonNull android.hardware.lights.LightState);
+ }
+
+}
+
+package android.hardware.location {
+
+ public class ContextHubClient implements java.io.Closeable {
+ method public void close();
+ method @NonNull public android.hardware.location.ContextHubInfo getAttachedHub();
+ method @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int sendMessageToNanoApp(@NonNull android.hardware.location.NanoAppMessage);
+ }
+
+ public class ContextHubClientCallback {
+ ctor public ContextHubClientCallback();
+ method public void onHubReset(android.hardware.location.ContextHubClient);
+ method public void onMessageFromNanoApp(android.hardware.location.ContextHubClient, android.hardware.location.NanoAppMessage);
+ method public void onNanoAppAborted(android.hardware.location.ContextHubClient, long, int);
+ method public void onNanoAppDisabled(android.hardware.location.ContextHubClient, long);
+ method public void onNanoAppEnabled(android.hardware.location.ContextHubClient, long);
+ method public void onNanoAppLoaded(android.hardware.location.ContextHubClient, long);
+ method public void onNanoAppUnloaded(android.hardware.location.ContextHubClient, long);
+ }
+
+ public class ContextHubInfo implements android.os.Parcelable {
+ ctor public ContextHubInfo();
+ method public int describeContents();
+ method public byte getChreApiMajorVersion();
+ method public byte getChreApiMinorVersion();
+ method public short getChrePatchVersion();
+ method public long getChrePlatformId();
+ method public int getId();
+ method public int getMaxPacketLengthBytes();
+ method public android.hardware.location.MemoryRegion[] getMemoryRegions();
+ method public String getName();
+ method public float getPeakMips();
+ method public float getPeakPowerDrawMw();
+ method public int getPlatformVersion();
+ method public float getSleepPowerDrawMw();
+ method public int getStaticSwVersion();
+ method public float getStoppedPowerDrawMw();
+ method public int[] getSupportedSensors();
+ method public String getToolchain();
+ method public int getToolchainVersion();
+ method public String getVendor();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubInfo> CREATOR;
+ }
+
+ public class ContextHubIntentEvent {
+ method @NonNull public static android.hardware.location.ContextHubIntentEvent fromIntent(@NonNull android.content.Intent);
+ method @NonNull public android.hardware.location.ContextHubInfo getContextHubInfo();
+ method public int getEventType();
+ method public int getNanoAppAbortCode();
+ method public long getNanoAppId();
+ method @NonNull public android.hardware.location.NanoAppMessage getNanoAppMessage();
+ }
+
+ public final class ContextHubManager {
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback, @NonNull java.util.concurrent.Executor);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.app.PendingIntent, long);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> disableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> enableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
+ method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int[] findNanoAppOnHub(int, @NonNull android.hardware.location.NanoAppFilter);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int[] getContextHubHandles();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubInfo getContextHubInfo(int);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public java.util.List<android.hardware.location.ContextHubInfo> getContextHubs();
+ method @Deprecated @Nullable @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int loadNanoApp(int, @NonNull android.hardware.location.NanoApp);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> loadNanoApp(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.NanoAppBinary);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.util.List<android.hardware.location.NanoAppState>> queryNanoApps(@NonNull android.hardware.location.ContextHubInfo);
+ method @Deprecated public int registerCallback(@NonNull android.hardware.location.ContextHubManager.Callback);
+ method @Deprecated public int registerCallback(android.hardware.location.ContextHubManager.Callback, android.os.Handler);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int sendMessage(int, int, @NonNull android.hardware.location.ContextHubMessage);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int unloadNanoApp(int);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> unloadNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
+ method @Deprecated public int unregisterCallback(@NonNull android.hardware.location.ContextHubManager.Callback);
+ field public static final int EVENT_HUB_RESET = 6; // 0x6
+ field public static final int EVENT_NANOAPP_ABORTED = 4; // 0x4
+ field public static final int EVENT_NANOAPP_DISABLED = 3; // 0x3
+ field public static final int EVENT_NANOAPP_ENABLED = 2; // 0x2
+ field public static final int EVENT_NANOAPP_LOADED = 0; // 0x0
+ field public static final int EVENT_NANOAPP_MESSAGE = 5; // 0x5
+ field public static final int EVENT_NANOAPP_UNLOADED = 1; // 0x1
+ field public static final String EXTRA_CONTEXT_HUB_INFO = "android.hardware.location.extra.CONTEXT_HUB_INFO";
+ field public static final String EXTRA_EVENT_TYPE = "android.hardware.location.extra.EVENT_TYPE";
+ field public static final String EXTRA_MESSAGE = "android.hardware.location.extra.MESSAGE";
+ field public static final String EXTRA_NANOAPP_ABORT_CODE = "android.hardware.location.extra.NANOAPP_ABORT_CODE";
+ field public static final String EXTRA_NANOAPP_ID = "android.hardware.location.extra.NANOAPP_ID";
+ }
+
+ @Deprecated public abstract static class ContextHubManager.Callback {
+ ctor @Deprecated protected ContextHubManager.Callback();
+ method @Deprecated public abstract void onMessageReceipt(int, int, @NonNull android.hardware.location.ContextHubMessage);
+ }
+
+ @Deprecated public class ContextHubMessage implements android.os.Parcelable {
+ ctor @Deprecated public ContextHubMessage(int, int, byte[]);
+ method @Deprecated public int describeContents();
+ method @Deprecated public byte[] getData();
+ method @Deprecated public int getMsgType();
+ method @Deprecated public int getVersion();
+ method @Deprecated public void setMsgData(byte[]);
+ method @Deprecated public void setMsgType(int);
+ method @Deprecated public void setVersion(int);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubMessage> CREATOR;
+ }
+
+ public class ContextHubTransaction<T> {
+ method public int getType();
+ method public void setOnCompleteListener(@NonNull android.hardware.location.ContextHubTransaction.OnCompleteListener<T>, @NonNull java.util.concurrent.Executor);
+ method public void setOnCompleteListener(@NonNull android.hardware.location.ContextHubTransaction.OnCompleteListener<T>);
+ method public static String typeToString(int, boolean);
+ method public android.hardware.location.ContextHubTransaction.Response<T> waitForResponse(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
+ field public static final int RESULT_FAILED_AT_HUB = 5; // 0x5
+ field public static final int RESULT_FAILED_BAD_PARAMS = 2; // 0x2
+ field public static final int RESULT_FAILED_BUSY = 4; // 0x4
+ field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8
+ field public static final int RESULT_FAILED_SERVICE_INTERNAL_FAILURE = 7; // 0x7
+ field public static final int RESULT_FAILED_TIMEOUT = 6; // 0x6
+ field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3
+ field public static final int RESULT_FAILED_UNKNOWN = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final int TYPE_DISABLE_NANOAPP = 3; // 0x3
+ field public static final int TYPE_ENABLE_NANOAPP = 2; // 0x2
+ field public static final int TYPE_LOAD_NANOAPP = 0; // 0x0
+ field public static final int TYPE_QUERY_NANOAPPS = 4; // 0x4
+ field public static final int TYPE_UNLOAD_NANOAPP = 1; // 0x1
+ }
+
+ @java.lang.FunctionalInterface public static interface ContextHubTransaction.OnCompleteListener<L> {
+ method public void onComplete(android.hardware.location.ContextHubTransaction<L>, android.hardware.location.ContextHubTransaction.Response<L>);
+ }
+
+ public static class ContextHubTransaction.Response<R> {
+ method public R getContents();
+ method public int getResult();
+ }
+
+ public final class GeofenceHardware {
+ method public boolean addGeofence(int, int, android.hardware.location.GeofenceHardwareRequest, android.hardware.location.GeofenceHardwareCallback);
+ method public int[] getMonitoringTypes();
+ method public int getStatusOfMonitoringType(int);
+ method public boolean pauseGeofence(int, int);
+ method public boolean registerForMonitorStateChangeCallback(int, android.hardware.location.GeofenceHardwareMonitorCallback);
+ method public boolean removeGeofence(int, int);
+ method public boolean resumeGeofence(int, int, int);
+ method public boolean unregisterForMonitorStateChangeCallback(int, android.hardware.location.GeofenceHardwareMonitorCallback);
+ field public static final int GEOFENCE_ENTERED = 1; // 0x1
+ field public static final int GEOFENCE_ERROR_ID_EXISTS = 2; // 0x2
+ field public static final int GEOFENCE_ERROR_ID_UNKNOWN = 3; // 0x3
+ field public static final int GEOFENCE_ERROR_INSUFFICIENT_MEMORY = 6; // 0x6
+ field public static final int GEOFENCE_ERROR_INVALID_TRANSITION = 4; // 0x4
+ field public static final int GEOFENCE_ERROR_TOO_MANY_GEOFENCES = 1; // 0x1
+ field public static final int GEOFENCE_EXITED = 2; // 0x2
+ field public static final int GEOFENCE_FAILURE = 5; // 0x5
+ field public static final int GEOFENCE_SUCCESS = 0; // 0x0
+ field public static final int GEOFENCE_UNCERTAIN = 4; // 0x4
+ field public static final int MONITORING_TYPE_FUSED_HARDWARE = 1; // 0x1
+ field public static final int MONITORING_TYPE_GPS_HARDWARE = 0; // 0x0
+ field public static final int MONITOR_CURRENTLY_AVAILABLE = 0; // 0x0
+ field public static final int MONITOR_CURRENTLY_UNAVAILABLE = 1; // 0x1
+ field public static final int MONITOR_UNSUPPORTED = 2; // 0x2
+ field public static final int SOURCE_TECHNOLOGY_BLUETOOTH = 16; // 0x10
+ field public static final int SOURCE_TECHNOLOGY_CELL = 8; // 0x8
+ field public static final int SOURCE_TECHNOLOGY_GNSS = 1; // 0x1
+ field public static final int SOURCE_TECHNOLOGY_SENSORS = 4; // 0x4
+ field public static final int SOURCE_TECHNOLOGY_WIFI = 2; // 0x2
+ }
+
+ public abstract class GeofenceHardwareCallback {
+ ctor public GeofenceHardwareCallback();
+ method public void onGeofenceAdd(int, int);
+ method public void onGeofencePause(int, int);
+ method public void onGeofenceRemove(int, int);
+ method public void onGeofenceResume(int, int);
+ method public void onGeofenceTransition(int, int, android.location.Location, long, int);
+ }
+
+ public abstract class GeofenceHardwareMonitorCallback {
+ ctor public GeofenceHardwareMonitorCallback();
+ method @Deprecated public void onMonitoringSystemChange(int, boolean, android.location.Location);
+ method public void onMonitoringSystemChange(android.hardware.location.GeofenceHardwareMonitorEvent);
+ }
+
+ public class GeofenceHardwareMonitorEvent implements android.os.Parcelable {
+ ctor public GeofenceHardwareMonitorEvent(int, int, int, android.location.Location);
+ method public int describeContents();
+ method public android.location.Location getLocation();
+ method public int getMonitoringStatus();
+ method public int getMonitoringType();
+ method public int getSourceTechnologies();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.GeofenceHardwareMonitorEvent> CREATOR;
+ }
+
+ public final class GeofenceHardwareRequest {
+ ctor public GeofenceHardwareRequest();
+ method public static android.hardware.location.GeofenceHardwareRequest createCircularGeofence(double, double, double);
+ method public int getLastTransition();
+ method public double getLatitude();
+ method public double getLongitude();
+ method public int getMonitorTransitions();
+ method public int getNotificationResponsiveness();
+ method public double getRadius();
+ method public int getSourceTechnologies();
+ method public int getUnknownTimer();
+ method public void setLastTransition(int);
+ method public void setMonitorTransitions(int);
+ method public void setNotificationResponsiveness(int);
+ method public void setSourceTechnologies(int);
+ method public void setUnknownTimer(int);
+ }
+
+ public class MemoryRegion implements android.os.Parcelable {
+ ctor public MemoryRegion(android.os.Parcel);
+ method public int describeContents();
+ method public int getCapacityBytes();
+ method public int getFreeCapacityBytes();
+ method public boolean isExecutable();
+ method public boolean isReadable();
+ method public boolean isWritable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.MemoryRegion> CREATOR;
+ }
+
+ @Deprecated public class NanoApp implements android.os.Parcelable {
+ ctor @Deprecated public NanoApp();
+ ctor @Deprecated public NanoApp(int, byte[]);
+ ctor @Deprecated public NanoApp(long, byte[]);
+ method @Deprecated public int describeContents();
+ method @Deprecated public byte[] getAppBinary();
+ method @Deprecated public long getAppId();
+ method @Deprecated public int getAppVersion();
+ method @Deprecated public String getName();
+ method @Deprecated public int getNeededExecMemBytes();
+ method @Deprecated public int getNeededReadMemBytes();
+ method @Deprecated public int[] getNeededSensors();
+ method @Deprecated public int getNeededWriteMemBytes();
+ method @Deprecated public int[] getOutputEvents();
+ method @Deprecated public String getPublisher();
+ method @Deprecated public void setAppBinary(byte[]);
+ method @Deprecated public void setAppId(long);
+ method @Deprecated public void setAppVersion(int);
+ method @Deprecated public void setName(String);
+ method @Deprecated public void setNeededExecMemBytes(int);
+ method @Deprecated public void setNeededReadMemBytes(int);
+ method @Deprecated public void setNeededSensors(int[]);
+ method @Deprecated public void setNeededWriteMemBytes(int);
+ method @Deprecated public void setOutputEvents(int[]);
+ method @Deprecated public void setPublisher(String);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.NanoApp> CREATOR;
+ }
+
+ public final class NanoAppBinary implements android.os.Parcelable {
+ ctor public NanoAppBinary(byte[]);
+ method public int describeContents();
+ method public byte[] getBinary();
+ method public byte[] getBinaryNoHeader();
+ method public int getFlags();
+ method public int getHeaderVersion();
+ method public long getHwHubType();
+ method public long getNanoAppId();
+ method public int getNanoAppVersion();
+ method public byte getTargetChreApiMajorVersion();
+ method public byte getTargetChreApiMinorVersion();
+ method public boolean hasValidHeader();
+ method public boolean isEncrypted();
+ method public boolean isSigned();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppBinary> CREATOR;
+ }
+
+ @Deprecated public class NanoAppFilter implements android.os.Parcelable {
+ ctor @Deprecated public NanoAppFilter(long, int, int, long);
+ method @Deprecated public int describeContents();
+ method @Deprecated public boolean testMatch(android.hardware.location.NanoAppInstanceInfo);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated public static final int APP_ANY = -1; // 0xffffffff
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppFilter> CREATOR;
+ field @Deprecated public static final int FLAGS_VERSION_ANY = -1; // 0xffffffff
+ field @Deprecated public static final int FLAGS_VERSION_GREAT_THAN = 2; // 0x2
+ field @Deprecated public static final int FLAGS_VERSION_LESS_THAN = 4; // 0x4
+ field @Deprecated public static final int FLAGS_VERSION_STRICTLY_EQUAL = 8; // 0x8
+ field @Deprecated public static final int HUB_ANY = -1; // 0xffffffff
+ field @Deprecated public static final int VENDOR_ANY = -1; // 0xffffffff
+ }
+
+ @Deprecated public class NanoAppInstanceInfo implements android.os.Parcelable {
+ ctor @Deprecated public NanoAppInstanceInfo();
+ method @Deprecated public int describeContents();
+ method @Deprecated public long getAppId();
+ method @Deprecated public int getAppVersion();
+ method @Deprecated public int getContexthubId();
+ method @Deprecated public int getHandle();
+ method @Deprecated public String getName();
+ method @Deprecated public int getNeededExecMemBytes();
+ method @Deprecated public int getNeededReadMemBytes();
+ method @Deprecated @NonNull public int[] getNeededSensors();
+ method @Deprecated public int getNeededWriteMemBytes();
+ method @Deprecated @NonNull public int[] getOutputEvents();
+ method @Deprecated public String getPublisher();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppInstanceInfo> CREATOR;
+ }
+
+ public final class NanoAppMessage implements android.os.Parcelable {
+ method public static android.hardware.location.NanoAppMessage createMessageFromNanoApp(long, int, byte[], boolean);
+ method public static android.hardware.location.NanoAppMessage createMessageToNanoApp(long, int, byte[]);
+ method public int describeContents();
+ method public byte[] getMessageBody();
+ method public int getMessageType();
+ method public long getNanoAppId();
+ method public boolean isBroadcastMessage();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppMessage> CREATOR;
+ }
+
+ public final class NanoAppState implements android.os.Parcelable {
+ ctor public NanoAppState(long, int, boolean);
+ method public int describeContents();
+ method public long getNanoAppId();
+ method public long getNanoAppVersion();
+ method public boolean isEnabled();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppState> CREATOR;
+ }
+
+}
+
+package android.hardware.radio {
+
+ public final class Announcement implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.hardware.radio.ProgramSelector getSelector();
+ method public int getType();
+ method @NonNull public java.util.Map<java.lang.String,java.lang.String> getVendorInfo();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.Announcement> CREATOR;
+ field public static final int TYPE_EMERGENCY = 1; // 0x1
+ field public static final int TYPE_EVENT = 6; // 0x6
+ field public static final int TYPE_MISC = 8; // 0x8
+ field public static final int TYPE_NEWS = 5; // 0x5
+ field public static final int TYPE_SPORT = 7; // 0x7
+ field public static final int TYPE_TRAFFIC = 3; // 0x3
+ field public static final int TYPE_WARNING = 2; // 0x2
+ field public static final int TYPE_WEATHER = 4; // 0x4
+ }
+
+ public static interface Announcement.OnListUpdatedListener {
+ method public void onListUpdated(java.util.Collection<android.hardware.radio.Announcement>);
+ }
+
+ public final class ProgramList implements java.lang.AutoCloseable {
+ method public void addOnCompleteListener(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.radio.ProgramList.OnCompleteListener);
+ method public void addOnCompleteListener(@NonNull android.hardware.radio.ProgramList.OnCompleteListener);
+ method public void close();
+ method @Nullable public android.hardware.radio.RadioManager.ProgramInfo get(@NonNull android.hardware.radio.ProgramSelector.Identifier);
+ method public void registerListCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.radio.ProgramList.ListCallback);
+ method public void registerListCallback(@NonNull android.hardware.radio.ProgramList.ListCallback);
+ method public void removeOnCompleteListener(@NonNull android.hardware.radio.ProgramList.OnCompleteListener);
+ method @NonNull public java.util.List<android.hardware.radio.RadioManager.ProgramInfo> toList();
+ method public void unregisterListCallback(@NonNull android.hardware.radio.ProgramList.ListCallback);
+ }
+
+ public static final class ProgramList.Filter implements android.os.Parcelable {
+ ctor public ProgramList.Filter(@NonNull java.util.Set<java.lang.Integer>, @NonNull java.util.Set<android.hardware.radio.ProgramSelector.Identifier>, boolean, boolean);
+ method public boolean areCategoriesIncluded();
+ method public boolean areModificationsExcluded();
+ method public int describeContents();
+ method @NonNull public java.util.Set<java.lang.Integer> getIdentifierTypes();
+ method @NonNull public java.util.Set<android.hardware.radio.ProgramSelector.Identifier> getIdentifiers();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramList.Filter> CREATOR;
+ }
+
+ public abstract static class ProgramList.ListCallback {
+ ctor public ProgramList.ListCallback();
+ method public void onItemChanged(@NonNull android.hardware.radio.ProgramSelector.Identifier);
+ method public void onItemRemoved(@NonNull android.hardware.radio.ProgramSelector.Identifier);
+ }
+
+ public static interface ProgramList.OnCompleteListener {
+ method public void onComplete();
+ }
+
+ public final class ProgramSelector implements android.os.Parcelable {
+ ctor public ProgramSelector(@android.hardware.radio.ProgramSelector.ProgramType int, @NonNull android.hardware.radio.ProgramSelector.Identifier, @Nullable android.hardware.radio.ProgramSelector.Identifier[], @Nullable long[]);
+ method @NonNull public static android.hardware.radio.ProgramSelector createAmFmSelector(@android.hardware.radio.RadioManager.Band int, int);
+ method @NonNull public static android.hardware.radio.ProgramSelector createAmFmSelector(@android.hardware.radio.RadioManager.Band int, int, int);
+ method public int describeContents();
+ method @NonNull public android.hardware.radio.ProgramSelector.Identifier[] getAllIds(@android.hardware.radio.ProgramSelector.IdentifierType int);
+ method public long getFirstId(@android.hardware.radio.ProgramSelector.IdentifierType int);
+ method @NonNull public android.hardware.radio.ProgramSelector.Identifier getPrimaryId();
+ method @Deprecated @android.hardware.radio.ProgramSelector.ProgramType public int getProgramType();
+ method @NonNull public android.hardware.radio.ProgramSelector.Identifier[] getSecondaryIds();
+ method @Deprecated @NonNull public long[] getVendorIds();
+ method @NonNull public android.hardware.radio.ProgramSelector withSecondaryPreferred(@NonNull android.hardware.radio.ProgramSelector.Identifier);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramSelector> CREATOR;
+ field public static final int IDENTIFIER_TYPE_AMFM_FREQUENCY = 1; // 0x1
+ field public static final int IDENTIFIER_TYPE_DAB_ENSEMBLE = 6; // 0x6
+ field public static final int IDENTIFIER_TYPE_DAB_FREQUENCY = 8; // 0x8
+ field public static final int IDENTIFIER_TYPE_DAB_SCID = 7; // 0x7
+ field public static final int IDENTIFIER_TYPE_DAB_SIDECC = 5; // 0x5
+ field public static final int IDENTIFIER_TYPE_DAB_SID_EXT = 5; // 0x5
+ field public static final int IDENTIFIER_TYPE_DRMO_FREQUENCY = 10; // 0xa
+ field @Deprecated public static final int IDENTIFIER_TYPE_DRMO_MODULATION = 11; // 0xb
+ field public static final int IDENTIFIER_TYPE_DRMO_SERVICE_ID = 9; // 0x9
+ field public static final int IDENTIFIER_TYPE_HD_STATION_ID_EXT = 3; // 0x3
+ field public static final int IDENTIFIER_TYPE_HD_STATION_NAME = 10004; // 0x2714
+ field @Deprecated public static final int IDENTIFIER_TYPE_HD_SUBCHANNEL = 4; // 0x4
+ field public static final int IDENTIFIER_TYPE_INVALID = 0; // 0x0
+ field public static final int IDENTIFIER_TYPE_RDS_PI = 2; // 0x2
+ field public static final int IDENTIFIER_TYPE_SXM_CHANNEL = 13; // 0xd
+ field public static final int IDENTIFIER_TYPE_SXM_SERVICE_ID = 12; // 0xc
+ field public static final int IDENTIFIER_TYPE_VENDOR_END = 1999; // 0x7cf
+ field @Deprecated public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_END = 1999; // 0x7cf
+ field @Deprecated public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_START = 1000; // 0x3e8
+ field public static final int IDENTIFIER_TYPE_VENDOR_START = 1000; // 0x3e8
+ field @Deprecated public static final int PROGRAM_TYPE_AM = 1; // 0x1
+ field @Deprecated public static final int PROGRAM_TYPE_AM_HD = 3; // 0x3
+ field @Deprecated public static final int PROGRAM_TYPE_DAB = 5; // 0x5
+ field @Deprecated public static final int PROGRAM_TYPE_DRMO = 6; // 0x6
+ field @Deprecated public static final int PROGRAM_TYPE_FM = 2; // 0x2
+ field @Deprecated public static final int PROGRAM_TYPE_FM_HD = 4; // 0x4
+ field @Deprecated public static final int PROGRAM_TYPE_INVALID = 0; // 0x0
+ field @Deprecated public static final int PROGRAM_TYPE_SXM = 7; // 0x7
+ field @Deprecated public static final int PROGRAM_TYPE_VENDOR_END = 1999; // 0x7cf
+ field @Deprecated public static final int PROGRAM_TYPE_VENDOR_START = 1000; // 0x3e8
+ }
+
+ public static final class ProgramSelector.Identifier implements android.os.Parcelable {
+ ctor public ProgramSelector.Identifier(@android.hardware.radio.ProgramSelector.IdentifierType int, long);
+ method public int describeContents();
+ method @android.hardware.radio.ProgramSelector.IdentifierType public int getType();
+ method public long getValue();
+ method public boolean isCategoryType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramSelector.Identifier> CREATOR;
+ }
+
+ @IntDef(prefix={"IDENTIFIER_TYPE_"}, value={android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_INVALID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_AMFM_FREQUENCY, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_RDS_PI, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_HD_STATION_ID_EXT, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_HD_SUBCHANNEL, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_HD_STATION_NAME, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_SID_EXT, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_SIDECC, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_ENSEMBLE, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_SCID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_FREQUENCY, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DRMO_SERVICE_ID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DRMO_FREQUENCY, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DRMO_MODULATION, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_SXM_SERVICE_ID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_SXM_CHANNEL}) @IntRange(from=android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_VENDOR_START, to=android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_VENDOR_END) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ProgramSelector.IdentifierType {
+ }
+
+ @Deprecated @IntDef(prefix={"PROGRAM_TYPE_"}, value={android.hardware.radio.ProgramSelector.PROGRAM_TYPE_INVALID, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_AM, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_FM, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_AM_HD, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_FM_HD, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_DAB, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_DRMO, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_SXM}) @IntRange(from=android.hardware.radio.ProgramSelector.PROGRAM_TYPE_VENDOR_START, to=android.hardware.radio.ProgramSelector.PROGRAM_TYPE_VENDOR_END) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ProgramSelector.ProgramType {
+ }
+
+ public class RadioManager {
+ method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public void addAnnouncementListener(@NonNull java.util.Set<java.lang.Integer>, @NonNull android.hardware.radio.Announcement.OnListUpdatedListener);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public void addAnnouncementListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.Set<java.lang.Integer>, @NonNull android.hardware.radio.Announcement.OnListUpdatedListener);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public int listModules(java.util.List<android.hardware.radio.RadioManager.ModuleProperties>);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public android.hardware.radio.RadioTuner openTuner(int, android.hardware.radio.RadioManager.BandConfig, boolean, android.hardware.radio.RadioTuner.Callback, android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public void removeAnnouncementListener(@NonNull android.hardware.radio.Announcement.OnListUpdatedListener);
+ field public static final int BAND_AM = 0; // 0x0
+ field public static final int BAND_AM_HD = 3; // 0x3
+ field public static final int BAND_FM = 1; // 0x1
+ field public static final int BAND_FM_HD = 2; // 0x2
+ field public static final int BAND_INVALID = -1; // 0xffffffff
+ field public static final int CLASS_AM_FM = 0; // 0x0
+ field public static final int CLASS_DT = 2; // 0x2
+ field public static final int CLASS_SAT = 1; // 0x1
+ field public static final int CONFIG_DAB_DAB_LINKING = 6; // 0x6
+ field public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; // 0x8
+ field public static final int CONFIG_DAB_FM_LINKING = 7; // 0x7
+ field public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; // 0x9
+ field public static final int CONFIG_FORCE_ANALOG = 2; // 0x2
+ field public static final int CONFIG_FORCE_DIGITAL = 3; // 0x3
+ field public static final int CONFIG_FORCE_MONO = 1; // 0x1
+ field public static final int CONFIG_RDS_AF = 4; // 0x4
+ field public static final int CONFIG_RDS_REG = 5; // 0x5
+ field public static final int REGION_ITU_1 = 0; // 0x0
+ field public static final int REGION_ITU_2 = 1; // 0x1
+ field public static final int REGION_JAPAN = 3; // 0x3
+ field public static final int REGION_KOREA = 4; // 0x4
+ field public static final int REGION_OIRT = 2; // 0x2
+ field public static final int STATUS_BAD_VALUE = -22; // 0xffffffea
+ field public static final int STATUS_DEAD_OBJECT = -32; // 0xffffffe0
+ field public static final int STATUS_ERROR = -2147483648; // 0x80000000
+ field public static final int STATUS_INVALID_OPERATION = -38; // 0xffffffda
+ field public static final int STATUS_NO_INIT = -19; // 0xffffffed
+ field public static final int STATUS_OK = 0; // 0x0
+ field public static final int STATUS_PERMISSION_DENIED = -1; // 0xffffffff
+ field public static final int STATUS_TIMED_OUT = -110; // 0xffffff92
+ }
+
+ public static class RadioManager.AmBandConfig extends android.hardware.radio.RadioManager.BandConfig {
+ method public boolean getStereo();
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.AmBandConfig> CREATOR;
+ }
+
+ public static class RadioManager.AmBandConfig.Builder {
+ ctor public RadioManager.AmBandConfig.Builder(android.hardware.radio.RadioManager.AmBandDescriptor);
+ ctor public RadioManager.AmBandConfig.Builder(android.hardware.radio.RadioManager.AmBandConfig);
+ method public android.hardware.radio.RadioManager.AmBandConfig build();
+ method public android.hardware.radio.RadioManager.AmBandConfig.Builder setStereo(boolean);
+ }
+
+ public static class RadioManager.AmBandDescriptor extends android.hardware.radio.RadioManager.BandDescriptor {
+ method public boolean isStereoSupported();
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.AmBandDescriptor> CREATOR;
+ }
+
+ @IntDef(prefix={"BAND_"}, value={android.hardware.radio.RadioManager.BAND_INVALID, android.hardware.radio.RadioManager.BAND_AM, android.hardware.radio.RadioManager.BAND_FM, android.hardware.radio.RadioManager.BAND_AM_HD, android.hardware.radio.RadioManager.BAND_FM_HD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RadioManager.Band {
+ }
+
+ public static class RadioManager.BandConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getLowerLimit();
+ method public int getRegion();
+ method public int getSpacing();
+ method public int getType();
+ method public int getUpperLimit();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.BandConfig> CREATOR;
+ }
+
+ public static class RadioManager.BandDescriptor implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getLowerLimit();
+ method public int getRegion();
+ method public int getSpacing();
+ method public int getType();
+ method public int getUpperLimit();
+ method public boolean isAmBand();
+ method public boolean isFmBand();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.BandDescriptor> CREATOR;
+ }
+
+ public static class RadioManager.FmBandConfig extends android.hardware.radio.RadioManager.BandConfig {
+ method public boolean getAf();
+ method public boolean getEa();
+ method public boolean getRds();
+ method public boolean getStereo();
+ method public boolean getTa();
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.FmBandConfig> CREATOR;
+ }
+
+ public static class RadioManager.FmBandConfig.Builder {
+ ctor public RadioManager.FmBandConfig.Builder(android.hardware.radio.RadioManager.FmBandDescriptor);
+ ctor public RadioManager.FmBandConfig.Builder(android.hardware.radio.RadioManager.FmBandConfig);
+ method public android.hardware.radio.RadioManager.FmBandConfig build();
+ method public android.hardware.radio.RadioManager.FmBandConfig.Builder setAf(boolean);
+ method public android.hardware.radio.RadioManager.FmBandConfig.Builder setEa(boolean);
+ method public android.hardware.radio.RadioManager.FmBandConfig.Builder setRds(boolean);
+ method public android.hardware.radio.RadioManager.FmBandConfig.Builder setStereo(boolean);
+ method public android.hardware.radio.RadioManager.FmBandConfig.Builder setTa(boolean);
+ }
+
+ public static class RadioManager.FmBandDescriptor extends android.hardware.radio.RadioManager.BandDescriptor {
+ method public boolean isAfSupported();
+ method public boolean isEaSupported();
+ method public boolean isRdsSupported();
+ method public boolean isStereoSupported();
+ method public boolean isTaSupported();
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.FmBandDescriptor> CREATOR;
+ }
+
+ public static class RadioManager.ModuleProperties implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.hardware.radio.RadioManager.BandDescriptor[] getBands();
+ method public int getClassId();
+ method @Nullable public java.util.Map<java.lang.String,java.lang.Integer> getDabFrequencyTable();
+ method public int getId();
+ method public String getImplementor();
+ method public int getNumAudioSources();
+ method public int getNumTuners();
+ method public String getProduct();
+ method public String getSerial();
+ method @NonNull public String getServiceName();
+ method @NonNull public java.util.Map<java.lang.String,java.lang.String> getVendorInfo();
+ method public String getVersion();
+ method public boolean isBackgroundScanningSupported();
+ method public boolean isCaptureSupported();
+ method public boolean isInitializationRequired();
+ method public boolean isProgramIdentifierSupported(@android.hardware.radio.ProgramSelector.IdentifierType int);
+ method public boolean isProgramTypeSupported(@android.hardware.radio.ProgramSelector.ProgramType int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.ModuleProperties> CREATOR;
+ }
+
+ public static class RadioManager.ProgramInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @Deprecated public int getChannel();
+ method @Nullable public android.hardware.radio.ProgramSelector.Identifier getLogicallyTunedTo();
+ method public android.hardware.radio.RadioMetadata getMetadata();
+ method @Nullable public android.hardware.radio.ProgramSelector.Identifier getPhysicallyTunedTo();
+ method @Nullable public java.util.Collection<android.hardware.radio.ProgramSelector.Identifier> getRelatedContent();
+ method @NonNull public android.hardware.radio.ProgramSelector getSelector();
+ method public int getSignalStrength();
+ method @Deprecated public int getSubChannel();
+ method @NonNull public java.util.Map<java.lang.String,java.lang.String> getVendorInfo();
+ method @Deprecated public boolean isDigital();
+ method public boolean isLive();
+ method public boolean isMuted();
+ method public boolean isStereo();
+ method public boolean isTrafficAnnouncementActive();
+ method public boolean isTrafficProgram();
+ method public boolean isTuned();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.ProgramInfo> CREATOR;
+ }
+
+ public final class RadioMetadata implements android.os.Parcelable {
+ method public boolean containsKey(String);
+ method public int describeContents();
+ method @Deprecated public android.graphics.Bitmap getBitmap(String);
+ method public android.hardware.radio.RadioMetadata.Clock getClock(String);
+ method public int getInt(String);
+ method public String getString(String);
+ method public java.util.Set<java.lang.String> keySet();
+ method public int size();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioMetadata> CREATOR;
+ field public static final String METADATA_KEY_ALBUM = "android.hardware.radio.metadata.ALBUM";
+ field public static final String METADATA_KEY_ART = "android.hardware.radio.metadata.ART";
+ field public static final String METADATA_KEY_ARTIST = "android.hardware.radio.metadata.ARTIST";
+ field public static final String METADATA_KEY_CLOCK = "android.hardware.radio.metadata.CLOCK";
+ field public static final String METADATA_KEY_DAB_COMPONENT_NAME = "android.hardware.radio.metadata.DAB_COMPONENT_NAME";
+ field public static final String METADATA_KEY_DAB_COMPONENT_NAME_SHORT = "android.hardware.radio.metadata.DAB_COMPONENT_NAME_SHORT";
+ field public static final String METADATA_KEY_DAB_ENSEMBLE_NAME = "android.hardware.radio.metadata.DAB_ENSEMBLE_NAME";
+ field public static final String METADATA_KEY_DAB_ENSEMBLE_NAME_SHORT = "android.hardware.radio.metadata.DAB_ENSEMBLE_NAME_SHORT";
+ field public static final String METADATA_KEY_DAB_SERVICE_NAME = "android.hardware.radio.metadata.DAB_SERVICE_NAME";
+ field public static final String METADATA_KEY_DAB_SERVICE_NAME_SHORT = "android.hardware.radio.metadata.DAB_SERVICE_NAME_SHORT";
+ field public static final String METADATA_KEY_GENRE = "android.hardware.radio.metadata.GENRE";
+ field public static final String METADATA_KEY_ICON = "android.hardware.radio.metadata.ICON";
+ field public static final String METADATA_KEY_PROGRAM_NAME = "android.hardware.radio.metadata.PROGRAM_NAME";
+ field public static final String METADATA_KEY_RBDS_PTY = "android.hardware.radio.metadata.RBDS_PTY";
+ field public static final String METADATA_KEY_RDS_PI = "android.hardware.radio.metadata.RDS_PI";
+ field public static final String METADATA_KEY_RDS_PS = "android.hardware.radio.metadata.RDS_PS";
+ field public static final String METADATA_KEY_RDS_PTY = "android.hardware.radio.metadata.RDS_PTY";
+ field public static final String METADATA_KEY_RDS_RT = "android.hardware.radio.metadata.RDS_RT";
+ field public static final String METADATA_KEY_TITLE = "android.hardware.radio.metadata.TITLE";
+ }
+
+ public static final class RadioMetadata.Builder {
+ ctor public RadioMetadata.Builder();
+ ctor public RadioMetadata.Builder(android.hardware.radio.RadioMetadata);
+ method public android.hardware.radio.RadioMetadata build();
+ method public android.hardware.radio.RadioMetadata.Builder putBitmap(String, android.graphics.Bitmap);
+ method public android.hardware.radio.RadioMetadata.Builder putClock(String, long, int);
+ method public android.hardware.radio.RadioMetadata.Builder putInt(String, int);
+ method public android.hardware.radio.RadioMetadata.Builder putString(String, String);
+ }
+
+ public static final class RadioMetadata.Clock implements android.os.Parcelable {
+ ctor public RadioMetadata.Clock(long, int);
+ method public int describeContents();
+ method public int getTimezoneOffsetMinutes();
+ method public long getUtcEpochSeconds();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.radio.RadioMetadata.Clock> CREATOR;
+ }
+
+ public abstract class RadioTuner {
+ ctor public RadioTuner();
+ method public abstract int cancel();
+ method public abstract void cancelAnnouncement();
+ method public abstract void close();
+ method @Deprecated public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]);
+ method @Nullable public android.hardware.radio.ProgramList getDynamicProgramList(@Nullable android.hardware.radio.ProgramList.Filter);
+ method public abstract boolean getMute();
+ method @NonNull public java.util.Map<java.lang.String,java.lang.String> getParameters(@NonNull java.util.List<java.lang.String>);
+ method @Deprecated public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]);
+ method @Deprecated @NonNull public abstract java.util.List<android.hardware.radio.RadioManager.ProgramInfo> getProgramList(@Nullable java.util.Map<java.lang.String,java.lang.String>);
+ method public abstract boolean hasControl();
+ method @Deprecated public abstract boolean isAnalogForced();
+ method @Deprecated public abstract boolean isAntennaConnected();
+ method public boolean isConfigFlagSet(int);
+ method public boolean isConfigFlagSupported(int);
+ method public abstract int scan(int, boolean);
+ method @Deprecated public abstract void setAnalogForced(boolean);
+ method public void setConfigFlag(int, boolean);
+ method @Deprecated public abstract int setConfiguration(android.hardware.radio.RadioManager.BandConfig);
+ method public abstract int setMute(boolean);
+ method @NonNull public java.util.Map<java.lang.String,java.lang.String> setParameters(@NonNull java.util.Map<java.lang.String,java.lang.String>);
+ method public abstract boolean startBackgroundScan();
+ method public abstract int step(int, boolean);
+ method @Deprecated public abstract int tune(int, int);
+ method public abstract void tune(@NonNull android.hardware.radio.ProgramSelector);
+ field public static final int DIRECTION_DOWN = 1; // 0x1
+ field public static final int DIRECTION_UP = 0; // 0x0
+ field @Deprecated public static final int ERROR_BACKGROUND_SCAN_FAILED = 6; // 0x6
+ field @Deprecated public static final int ERROR_BACKGROUND_SCAN_UNAVAILABLE = 5; // 0x5
+ field @Deprecated public static final int ERROR_CANCELLED = 2; // 0x2
+ field @Deprecated public static final int ERROR_CONFIG = 4; // 0x4
+ field @Deprecated public static final int ERROR_HARDWARE_FAILURE = 0; // 0x0
+ field @Deprecated public static final int ERROR_SCAN_TIMEOUT = 3; // 0x3
+ field @Deprecated public static final int ERROR_SERVER_DIED = 1; // 0x1
+ }
+
+ public abstract static class RadioTuner.Callback {
+ ctor public RadioTuner.Callback();
+ method public void onAntennaState(boolean);
+ method public void onBackgroundScanAvailabilityChange(boolean);
+ method public void onBackgroundScanComplete();
+ method @Deprecated public void onConfigurationChanged(android.hardware.radio.RadioManager.BandConfig);
+ method public void onControlChanged(boolean);
+ method public void onEmergencyAnnouncement(boolean);
+ method @Deprecated public void onError(int);
+ method @Deprecated public void onMetadataChanged(android.hardware.radio.RadioMetadata);
+ method public void onParametersUpdated(@NonNull java.util.Map<java.lang.String,java.lang.String>);
+ method public void onProgramInfoChanged(android.hardware.radio.RadioManager.ProgramInfo);
+ method public void onProgramListChanged();
+ method public void onTrafficAnnouncement(boolean);
+ method public void onTuneFailed(int, @Nullable android.hardware.radio.ProgramSelector);
+ }
+
+}
+
+package android.hardware.soundtrigger {
+
+ public class SoundTrigger {
+ field public static final int RECOGNITION_MODE_GENERIC = 8; // 0x8
+ field public static final int RECOGNITION_MODE_USER_AUTHENTICATION = 4; // 0x4
+ field public static final int RECOGNITION_MODE_USER_IDENTIFICATION = 2; // 0x2
+ field public static final int RECOGNITION_MODE_VOICE_TRIGGER = 1; // 0x1
+ field public static final int STATUS_OK = 0; // 0x0
+ }
+
+ public static final class SoundTrigger.Keyphrase implements android.os.Parcelable {
+ ctor public SoundTrigger.Keyphrase(int, int, @NonNull java.util.Locale, @NonNull String, @Nullable int[]);
+ method public int getId();
+ method @NonNull public java.util.Locale getLocale();
+ method public int getRecognitionModes();
+ method @NonNull public String getText();
+ method @NonNull public int[] getUsers();
+ method @NonNull public static android.hardware.soundtrigger.SoundTrigger.Keyphrase readFromParcel(@NonNull android.os.Parcel);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.Keyphrase> CREATOR;
+ }
+
+ public static final class SoundTrigger.KeyphraseSoundModel extends android.hardware.soundtrigger.SoundTrigger.SoundModel implements android.os.Parcelable {
+ ctor public SoundTrigger.KeyphraseSoundModel(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], @Nullable android.hardware.soundtrigger.SoundTrigger.Keyphrase[], int);
+ ctor public SoundTrigger.KeyphraseSoundModel(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], @Nullable android.hardware.soundtrigger.SoundTrigger.Keyphrase[]);
+ method @NonNull public android.hardware.soundtrigger.SoundTrigger.Keyphrase[] getKeyphrases();
+ method @NonNull public static android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel readFromParcel(@NonNull android.os.Parcel);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel> CREATOR;
+ }
+
+ public static final class SoundTrigger.ModelParamRange implements android.os.Parcelable {
+ method public int getEnd();
+ method public int getStart();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.ModelParamRange> CREATOR;
+ }
+
+ public static final class SoundTrigger.ModuleProperties implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAudioCapabilities();
+ method @NonNull public String getDescription();
+ method public int getId();
+ method @NonNull public String getImplementor();
+ method public int getMaxBufferMillis();
+ method public int getMaxKeyphrases();
+ method public int getMaxSoundModels();
+ method public int getMaxUsers();
+ method public int getPowerConsumptionMw();
+ method public int getRecognitionModes();
+ method @NonNull public String getSupportedModelArch();
+ method @NonNull public java.util.UUID getUuid();
+ method public int getVersion();
+ method public boolean isCaptureTransitionSupported();
+ method public boolean isConcurrentCaptureSupported();
+ method public boolean isTriggerReturnedInEvent();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int AUDIO_CAPABILITY_ECHO_CANCELLATION = 1; // 0x1
+ field public static final int AUDIO_CAPABILITY_NOISE_SUPPRESSION = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.ModuleProperties> CREATOR;
+ }
+
+ public static class SoundTrigger.RecognitionEvent {
+ method @Nullable public android.media.AudioFormat getCaptureFormat();
+ method public int getCaptureSession();
+ method public byte[] getData();
+ method public boolean isCaptureAvailable();
+ }
+
+ public static class SoundTrigger.SoundModel {
+ method @NonNull public byte[] getData();
+ method public int getType();
+ method @NonNull public java.util.UUID getUuid();
+ method @NonNull public java.util.UUID getVendorUuid();
+ method public int getVersion();
+ field public static final int TYPE_GENERIC_SOUND = 1; // 0x1
+ field public static final int TYPE_KEYPHRASE = 0; // 0x0
+ }
+
+}
+
+package android.hardware.usb {
+
+ public class UsbDeviceConnection {
+ method public boolean resetDevice();
+ }
+
+ public class UsbManager {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public long getCurrentFunctions();
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_USB) public java.util.List<android.hardware.usb.UsbPort> getPorts();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void grantPermission(android.hardware.usb.UsbDevice, String);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void resetUsbGadget();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void setCurrentFunctions(long);
+ field @RequiresPermission(android.Manifest.permission.MANAGE_USB) public static final String ACTION_USB_ACCESSORY_HANDSHAKE = "android.hardware.usb.action.USB_ACCESSORY_HANDSHAKE";
+ field @RequiresPermission(android.Manifest.permission.MANAGE_USB) public static final String ACTION_USB_PORT_CHANGED = "android.hardware.usb.action.USB_PORT_CHANGED";
+ field public static final String ACTION_USB_STATE = "android.hardware.usb.action.USB_STATE";
+ field public static final String EXTRA_ACCESSORY_HANDSHAKE_END = "android.hardware.usb.extra.ACCESSORY_HANDSHAKE_END";
+ field public static final String EXTRA_ACCESSORY_START = "android.hardware.usb.extra.ACCESSORY_START";
+ field public static final String EXTRA_ACCESSORY_STRING_COUNT = "android.hardware.usb.extra.ACCESSORY_STRING_COUNT";
+ field public static final String EXTRA_ACCESSORY_UEVENT_TIME = "android.hardware.usb.extra.ACCESSORY_UEVENT_TIME";
+ field public static final long FUNCTION_ACCESSORY = 2L; // 0x2L
+ field public static final long FUNCTION_ADB = 1L; // 0x1L
+ field public static final long FUNCTION_AUDIO_SOURCE = 64L; // 0x40L
+ field public static final long FUNCTION_MIDI = 8L; // 0x8L
+ field public static final long FUNCTION_MTP = 4L; // 0x4L
+ field public static final long FUNCTION_NCM = 1024L; // 0x400L
+ field public static final long FUNCTION_NONE = 0L; // 0x0L
+ field public static final long FUNCTION_PTP = 16L; // 0x10L
+ field public static final long FUNCTION_RNDIS = 32L; // 0x20L
+ field public static final String USB_CONFIGURED = "configured";
+ field public static final String USB_CONNECTED = "connected";
+ field public static final String USB_FUNCTION_NCM = "ncm";
+ field public static final String USB_FUNCTION_RNDIS = "rndis";
+ }
+
+ public final class UsbPort {
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USB) public android.hardware.usb.UsbPortStatus getStatus();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void setRoles(int, int);
+ }
+
+ public final class UsbPortStatus implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getCurrentDataRole();
+ method public int getCurrentMode();
+ method public int getCurrentPowerRole();
+ method public int getSupportedRoleCombinations();
+ method public boolean isConnected();
+ method public boolean isRoleCombinationSupported(int, int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.hardware.usb.UsbPortStatus> CREATOR;
+ field public static final int DATA_ROLE_DEVICE = 2; // 0x2
+ field public static final int DATA_ROLE_HOST = 1; // 0x1
+ field public static final int DATA_ROLE_NONE = 0; // 0x0
+ field public static final int MODE_AUDIO_ACCESSORY = 4; // 0x4
+ field public static final int MODE_DEBUG_ACCESSORY = 8; // 0x8
+ field public static final int MODE_DFP = 2; // 0x2
+ field public static final int MODE_NONE = 0; // 0x0
+ field public static final int MODE_UFP = 1; // 0x1
+ field public static final int POWER_ROLE_NONE = 0; // 0x0
+ field public static final int POWER_ROLE_SINK = 2; // 0x2
+ field public static final int POWER_ROLE_SOURCE = 1; // 0x1
+ }
+
+}
+
+package android.location {
+
+ public abstract class BatchedLocationCallback {
+ ctor public BatchedLocationCallback();
+ method public void onLocationBatch(java.util.List<android.location.Location>);
+ }
+
+ public final class GnssCapabilities {
+ method public boolean hasGeofencing();
+ method public boolean hasLowPowerMode();
+ method public boolean hasMeasurementCorrections();
+ method public boolean hasMeasurementCorrectionsExcessPathLength();
+ method public boolean hasMeasurementCorrectionsLosSats();
+ method public boolean hasMeasurementCorrectionsReflectingPane();
+ method public boolean hasMeasurements();
+ method public boolean hasNavMessages();
+ method public boolean hasSatelliteBlacklist();
+ }
+
+ public final class GnssMeasurementCorrections implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+ method @FloatRange(from=0.0f, to=360.0f) public float getEnvironmentBearingDegrees();
+ method @FloatRange(from=0.0f, to=180.0f) public float getEnvironmentBearingUncertaintyDegrees();
+ method @FloatRange(from=0.0f) public double getHorizontalPositionUncertaintyMeters();
+ method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
+ method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
+ method @NonNull public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
+ method @IntRange(from=0) public long getToaGpsNanosecondsOfWeek();
+ method @FloatRange(from=0.0f) public double getVerticalPositionUncertaintyMeters();
+ method public boolean hasEnvironmentBearing();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
+ }
+
+ public static final class GnssMeasurementCorrections.Builder {
+ ctor public GnssMeasurementCorrections.Builder();
+ method @NonNull public android.location.GnssMeasurementCorrections build();
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingDegrees(@FloatRange(from=0.0f, to=360.0f) float);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingUncertaintyDegrees(@FloatRange(from=0.0f, to=180.0f) float);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@NonNull java.util.List<android.location.GnssSingleSatCorrection>);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(@IntRange(from=0) long);
+ method @NonNull public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
+ }
+
+ public final class GnssReflectingPlane implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+ method @FloatRange(from=0.0f, to=360.0f) public double getAzimuthDegrees();
+ method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
+ method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
+ }
+
+ public static final class GnssReflectingPlane.Builder {
+ ctor public GnssReflectingPlane.Builder();
+ method @NonNull public android.location.GnssReflectingPlane build();
+ method @NonNull public android.location.GnssReflectingPlane.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(@FloatRange(from=0.0f, to=360.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
+ method @NonNull public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
+ }
+
+ public final class GnssRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean isFullTracking();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssRequest> CREATOR;
+ }
+
+ public static final class GnssRequest.Builder {
+ ctor public GnssRequest.Builder();
+ ctor public GnssRequest.Builder(@NonNull android.location.GnssRequest);
+ method @NonNull public android.location.GnssRequest build();
+ method @NonNull public android.location.GnssRequest.Builder setFullTracking(boolean);
+ }
+
+ public final class GnssSingleSatCorrection implements android.os.Parcelable {
+ method public int describeContents();
+ method @FloatRange(from=0.0f, fromInclusive=false) public float getCarrierFrequencyHz();
+ method public int getConstellationType();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
+ method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
+ method @FloatRange(from=0.0f, to=1.0f) public float getProbabilityLineOfSight();
+ method @Nullable public android.location.GnssReflectingPlane getReflectingPlane();
+ method @IntRange(from=0) public int getSatelliteId();
+ method public boolean hasExcessPathLength();
+ method public boolean hasExcessPathLengthUncertainty();
+ method public boolean hasReflectingPlane();
+ method public boolean hasValidSatelliteLineOfSight();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
+ }
+
+ public static final class GnssSingleSatCorrection.Builder {
+ ctor public GnssSingleSatCorrection.Builder();
+ method @NonNull public android.location.GnssSingleSatCorrection build();
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(@FloatRange(from=0.0f, fromInclusive=false) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
+ method @NonNull public android.location.GnssSingleSatCorrection.Builder setSatelliteId(@IntRange(from=0) int);
+ }
+
+ @Deprecated public class GpsClock implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated public double getBiasInNs();
+ method @Deprecated public double getBiasUncertaintyInNs();
+ method @Deprecated public double getDriftInNsPerSec();
+ method @Deprecated public double getDriftUncertaintyInNsPerSec();
+ method @Deprecated public long getFullBiasInNs();
+ method @Deprecated public short getLeapSecond();
+ method @Deprecated public long getTimeInNs();
+ method @Deprecated public double getTimeUncertaintyInNs();
+ method @Deprecated public byte getType();
+ method @Deprecated public boolean hasBiasInNs();
+ method @Deprecated public boolean hasBiasUncertaintyInNs();
+ method @Deprecated public boolean hasDriftInNsPerSec();
+ method @Deprecated public boolean hasDriftUncertaintyInNsPerSec();
+ method @Deprecated public boolean hasFullBiasInNs();
+ method @Deprecated public boolean hasLeapSecond();
+ method @Deprecated public boolean hasTimeUncertaintyInNs();
+ method @Deprecated public void reset();
+ method @Deprecated public void resetBiasInNs();
+ method @Deprecated public void resetBiasUncertaintyInNs();
+ method @Deprecated public void resetDriftInNsPerSec();
+ method @Deprecated public void resetDriftUncertaintyInNsPerSec();
+ method @Deprecated public void resetFullBiasInNs();
+ method @Deprecated public void resetLeapSecond();
+ method @Deprecated public void resetTimeUncertaintyInNs();
+ method @Deprecated public void set(android.location.GpsClock);
+ method @Deprecated public void setBiasInNs(double);
+ method @Deprecated public void setBiasUncertaintyInNs(double);
+ method @Deprecated public void setDriftInNsPerSec(double);
+ method @Deprecated public void setDriftUncertaintyInNsPerSec(double);
+ method @Deprecated public void setFullBiasInNs(long);
+ method @Deprecated public void setLeapSecond(short);
+ method @Deprecated public void setTimeInNs(long);
+ method @Deprecated public void setTimeUncertaintyInNs(double);
+ method @Deprecated public void setType(byte);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsClock> CREATOR;
+ field @Deprecated public static final byte TYPE_GPS_TIME = 2; // 0x2
+ field @Deprecated public static final byte TYPE_LOCAL_HW_TIME = 1; // 0x1
+ field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsMeasurement implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated public double getAccumulatedDeltaRangeInMeters();
+ method @Deprecated public short getAccumulatedDeltaRangeState();
+ method @Deprecated public double getAccumulatedDeltaRangeUncertaintyInMeters();
+ method @Deprecated public double getAzimuthInDeg();
+ method @Deprecated public double getAzimuthUncertaintyInDeg();
+ method @Deprecated public int getBitNumber();
+ method @Deprecated public long getCarrierCycles();
+ method @Deprecated public float getCarrierFrequencyInHz();
+ method @Deprecated public double getCarrierPhase();
+ method @Deprecated public double getCarrierPhaseUncertainty();
+ method @Deprecated public double getCn0InDbHz();
+ method @Deprecated public double getCodePhaseInChips();
+ method @Deprecated public double getCodePhaseUncertaintyInChips();
+ method @Deprecated public double getDopplerShiftInHz();
+ method @Deprecated public double getDopplerShiftUncertaintyInHz();
+ method @Deprecated public double getElevationInDeg();
+ method @Deprecated public double getElevationUncertaintyInDeg();
+ method @Deprecated public byte getLossOfLock();
+ method @Deprecated public byte getMultipathIndicator();
+ method @Deprecated public byte getPrn();
+ method @Deprecated public double getPseudorangeInMeters();
+ method @Deprecated public double getPseudorangeRateInMetersPerSec();
+ method @Deprecated public double getPseudorangeRateUncertaintyInMetersPerSec();
+ method @Deprecated public double getPseudorangeUncertaintyInMeters();
+ method @Deprecated public long getReceivedGpsTowInNs();
+ method @Deprecated public long getReceivedGpsTowUncertaintyInNs();
+ method @Deprecated public double getSnrInDb();
+ method @Deprecated public short getState();
+ method @Deprecated public short getTimeFromLastBitInMs();
+ method @Deprecated public double getTimeOffsetInNs();
+ method @Deprecated public boolean hasAzimuthInDeg();
+ method @Deprecated public boolean hasAzimuthUncertaintyInDeg();
+ method @Deprecated public boolean hasBitNumber();
+ method @Deprecated public boolean hasCarrierCycles();
+ method @Deprecated public boolean hasCarrierFrequencyInHz();
+ method @Deprecated public boolean hasCarrierPhase();
+ method @Deprecated public boolean hasCarrierPhaseUncertainty();
+ method @Deprecated public boolean hasCodePhaseInChips();
+ method @Deprecated public boolean hasCodePhaseUncertaintyInChips();
+ method @Deprecated public boolean hasDopplerShiftInHz();
+ method @Deprecated public boolean hasDopplerShiftUncertaintyInHz();
+ method @Deprecated public boolean hasElevationInDeg();
+ method @Deprecated public boolean hasElevationUncertaintyInDeg();
+ method @Deprecated public boolean hasPseudorangeInMeters();
+ method @Deprecated public boolean hasPseudorangeUncertaintyInMeters();
+ method @Deprecated public boolean hasSnrInDb();
+ method @Deprecated public boolean hasTimeFromLastBitInMs();
+ method @Deprecated public boolean isPseudorangeRateCorrected();
+ method @Deprecated public boolean isUsedInFix();
+ method @Deprecated public void reset();
+ method @Deprecated public void resetAzimuthInDeg();
+ method @Deprecated public void resetAzimuthUncertaintyInDeg();
+ method @Deprecated public void resetBitNumber();
+ method @Deprecated public void resetCarrierCycles();
+ method @Deprecated public void resetCarrierFrequencyInHz();
+ method @Deprecated public void resetCarrierPhase();
+ method @Deprecated public void resetCarrierPhaseUncertainty();
+ method @Deprecated public void resetCodePhaseInChips();
+ method @Deprecated public void resetCodePhaseUncertaintyInChips();
+ method @Deprecated public void resetDopplerShiftInHz();
+ method @Deprecated public void resetDopplerShiftUncertaintyInHz();
+ method @Deprecated public void resetElevationInDeg();
+ method @Deprecated public void resetElevationUncertaintyInDeg();
+ method @Deprecated public void resetPseudorangeInMeters();
+ method @Deprecated public void resetPseudorangeUncertaintyInMeters();
+ method @Deprecated public void resetSnrInDb();
+ method @Deprecated public void resetTimeFromLastBitInMs();
+ method @Deprecated public void set(android.location.GpsMeasurement);
+ method @Deprecated public void setAccumulatedDeltaRangeInMeters(double);
+ method @Deprecated public void setAccumulatedDeltaRangeState(short);
+ method @Deprecated public void setAccumulatedDeltaRangeUncertaintyInMeters(double);
+ method @Deprecated public void setAzimuthInDeg(double);
+ method @Deprecated public void setAzimuthUncertaintyInDeg(double);
+ method @Deprecated public void setBitNumber(int);
+ method @Deprecated public void setCarrierCycles(long);
+ method @Deprecated public void setCarrierFrequencyInHz(float);
+ method @Deprecated public void setCarrierPhase(double);
+ method @Deprecated public void setCarrierPhaseUncertainty(double);
+ method @Deprecated public void setCn0InDbHz(double);
+ method @Deprecated public void setCodePhaseInChips(double);
+ method @Deprecated public void setCodePhaseUncertaintyInChips(double);
+ method @Deprecated public void setDopplerShiftInHz(double);
+ method @Deprecated public void setDopplerShiftUncertaintyInHz(double);
+ method @Deprecated public void setElevationInDeg(double);
+ method @Deprecated public void setElevationUncertaintyInDeg(double);
+ method @Deprecated public void setLossOfLock(byte);
+ method @Deprecated public void setMultipathIndicator(byte);
+ method @Deprecated public void setPrn(byte);
+ method @Deprecated public void setPseudorangeInMeters(double);
+ method @Deprecated public void setPseudorangeRateInMetersPerSec(double);
+ method @Deprecated public void setPseudorangeRateUncertaintyInMetersPerSec(double);
+ method @Deprecated public void setPseudorangeUncertaintyInMeters(double);
+ method @Deprecated public void setReceivedGpsTowInNs(long);
+ method @Deprecated public void setReceivedGpsTowUncertaintyInNs(long);
+ method @Deprecated public void setSnrInDb(double);
+ method @Deprecated public void setState(short);
+ method @Deprecated public void setTimeFromLastBitInMs(short);
+ method @Deprecated public void setTimeOffsetInNs(double);
+ method @Deprecated public void setUsedInFix(boolean);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated public static final short ADR_STATE_CYCLE_SLIP = 4; // 0x4
+ field @Deprecated public static final short ADR_STATE_RESET = 2; // 0x2
+ field @Deprecated public static final short ADR_STATE_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final short ADR_STATE_VALID = 1; // 0x1
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurement> CREATOR;
+ field @Deprecated public static final byte LOSS_OF_LOCK_CYCLE_SLIP = 2; // 0x2
+ field @Deprecated public static final byte LOSS_OF_LOCK_OK = 1; // 0x1
+ field @Deprecated public static final byte LOSS_OF_LOCK_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_NOT_USED = 2; // 0x2
+ field @Deprecated public static final byte MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final short STATE_BIT_SYNC = 2; // 0x2
+ field @Deprecated public static final short STATE_CODE_LOCK = 1; // 0x1
+ field @Deprecated public static final short STATE_MSEC_AMBIGUOUS = 16; // 0x10
+ field @Deprecated public static final short STATE_SUBFRAME_SYNC = 4; // 0x4
+ field @Deprecated public static final short STATE_TOW_DECODED = 8; // 0x8
+ field @Deprecated public static final short STATE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsMeasurementsEvent implements android.os.Parcelable {
+ ctor @Deprecated public GpsMeasurementsEvent(android.location.GpsClock, android.location.GpsMeasurement[]);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public android.location.GpsClock getClock();
+ method @Deprecated @NonNull public java.util.Collection<android.location.GpsMeasurement> getMeasurements();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsMeasurementsEvent> CREATOR;
+ field @Deprecated public static final int STATUS_GPS_LOCATION_DISABLED = 2; // 0x2
+ field @Deprecated public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
+ field @Deprecated public static final int STATUS_READY = 1; // 0x1
+ }
+
+ @Deprecated public static interface GpsMeasurementsEvent.Listener {
+ method @Deprecated public void onGpsMeasurementsReceived(android.location.GpsMeasurementsEvent);
+ method @Deprecated public void onStatusChanged(int);
+ }
+
+ @Deprecated public class GpsNavigationMessage implements android.os.Parcelable {
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public byte[] getData();
+ method @Deprecated public short getMessageId();
+ method @Deprecated public byte getPrn();
+ method @Deprecated public short getStatus();
+ method @Deprecated public short getSubmessageId();
+ method @Deprecated public byte getType();
+ method @Deprecated public void reset();
+ method @Deprecated public void set(android.location.GpsNavigationMessage);
+ method @Deprecated public void setData(byte[]);
+ method @Deprecated public void setMessageId(short);
+ method @Deprecated public void setPrn(byte);
+ method @Deprecated public void setStatus(short);
+ method @Deprecated public void setSubmessageId(short);
+ method @Deprecated public void setType(byte);
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessage> CREATOR;
+ field @Deprecated public static final short STATUS_PARITY_PASSED = 1; // 0x1
+ field @Deprecated public static final short STATUS_PARITY_REBUILT = 2; // 0x2
+ field @Deprecated public static final short STATUS_UNKNOWN = 0; // 0x0
+ field @Deprecated public static final byte TYPE_CNAV2 = 4; // 0x4
+ field @Deprecated public static final byte TYPE_L1CA = 1; // 0x1
+ field @Deprecated public static final byte TYPE_L2CNAV = 2; // 0x2
+ field @Deprecated public static final byte TYPE_L5CNAV = 3; // 0x3
+ field @Deprecated public static final byte TYPE_UNKNOWN = 0; // 0x0
+ }
+
+ @Deprecated public class GpsNavigationMessageEvent implements android.os.Parcelable {
+ ctor @Deprecated public GpsNavigationMessageEvent(android.location.GpsNavigationMessage);
+ method @Deprecated public int describeContents();
+ method @Deprecated @NonNull public android.location.GpsNavigationMessage getNavigationMessage();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessageEvent> CREATOR;
+ field @Deprecated public static int STATUS_GPS_LOCATION_DISABLED;
+ field @Deprecated public static int STATUS_NOT_SUPPORTED;
+ field @Deprecated public static int STATUS_READY;
+ }
+
+ @Deprecated public static interface GpsNavigationMessageEvent.Listener {
+ method @Deprecated public void onGpsNavigationMessageReceived(android.location.GpsNavigationMessageEvent);
+ method @Deprecated public void onStatusChanged(int);
+ }
+
+ public class Location implements android.os.Parcelable {
+ method public boolean isComplete();
+ method public void makeComplete();
+ method public void setIsFromMockProvider(boolean);
+ field @Deprecated public static final String EXTRA_NO_GPS_LOCATION = "noGPSLocation";
+ }
+
+ public class LocationManager {
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
+ method @Nullable public String getExtraLocationControllerPackage();
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int getGnssBatchSize();
+ method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void injectGnssMeasurementCorrections(@NonNull android.location.GnssMeasurementCorrections);
+ method public boolean isExtraLocationControllerPackageEnabled();
+ method public boolean isLocationEnabledForUser(@NonNull android.os.UserHandle);
+ method public boolean isProviderEnabledForUser(@NonNull String, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler);
+ method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.LOCATION_HARDWARE}) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackage(@Nullable String);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackageEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
+ }
+
+ public final class LocationRequest implements android.os.Parcelable {
+ method @Deprecated @NonNull public static android.location.LocationRequest create();
+ method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedCriteria(@NonNull android.location.Criteria, long, float, boolean);
+ method @Deprecated @NonNull public static android.location.LocationRequest createFromDeprecatedProvider(@NonNull String, long, float, boolean);
+ method @Deprecated public long getExpireAt();
+ method @Deprecated public long getExpireIn();
+ method @Deprecated public long getFastestInterval();
+ method @Deprecated public boolean getHideFromAppOps();
+ method @Deprecated public long getInterval();
+ method @Deprecated public int getNumUpdates();
+ method @Deprecated @NonNull public String getProvider();
+ method @Deprecated public float getSmallestDisplacement();
+ method @NonNull public android.os.WorkSource getWorkSource();
+ method public boolean isHiddenFromAppOps();
+ method public boolean isLocationSettingsIgnored();
+ method public boolean isLowPower();
+ method @Deprecated public boolean isLowPowerMode();
+ method @Deprecated @NonNull public android.location.LocationRequest setExpireAt(long);
+ method @Deprecated @NonNull public android.location.LocationRequest setExpireIn(long);
+ method @Deprecated @NonNull public android.location.LocationRequest setFastestInterval(long);
+ method @Deprecated public void setHideFromAppOps(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setInterval(long);
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public android.location.LocationRequest setLocationSettingsIgnored(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setLowPowerMode(boolean);
+ method @Deprecated @NonNull public android.location.LocationRequest setNumUpdates(int);
+ method @Deprecated @NonNull public android.location.LocationRequest setProvider(@NonNull String);
+ method @Deprecated @NonNull public android.location.LocationRequest setQuality(int);
+ method @Deprecated @NonNull public android.location.LocationRequest setSmallestDisplacement(float);
+ method @Deprecated public void setWorkSource(@Nullable android.os.WorkSource);
+ field @Deprecated public static final int ACCURACY_BLOCK = 102; // 0x66
+ field @Deprecated public static final int ACCURACY_CITY = 104; // 0x68
+ field @Deprecated public static final int ACCURACY_FINE = 100; // 0x64
+ field @Deprecated public static final int POWER_HIGH = 203; // 0xcb
+ field @Deprecated public static final int POWER_LOW = 201; // 0xc9
+ field @Deprecated public static final int POWER_NONE = 200; // 0xc8
+ }
+
+ public static final class LocationRequest.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_APP_OPS_STATS) public android.location.LocationRequest.Builder setHiddenFromAppOps(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public android.location.LocationRequest.Builder setLocationSettingsIgnored(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.location.LocationRequest.Builder setLowPower(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.location.LocationRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
+ }
+
+}
+
+package android.media {
+
+ public final class AudioAttributes implements android.os.Parcelable {
+ method public int getAllFlags();
+ method public android.os.Bundle getBundle();
+ method public int getCapturePreset();
+ method public int getSystemUsage();
+ method public static boolean isSystemUsage(int);
+ field public static final int FLAG_BEACON = 8; // 0x8
+ field public static final int FLAG_BYPASS_INTERRUPTION_POLICY = 64; // 0x40
+ field public static final int FLAG_BYPASS_MUTE = 128; // 0x80
+ field public static final int FLAG_HW_HOTWORD = 32; // 0x20
+ field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_ANNOUNCEMENT = 1003; // 0x3eb
+ field @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.MODIFY_AUDIO_ROUTING}) public static final int USAGE_CALL_ASSISTANT = 17; // 0x11
+ field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_EMERGENCY = 1000; // 0x3e8
+ field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_SAFETY = 1001; // 0x3e9
+ field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_VEHICLE_STATUS = 1002; // 0x3ea
+ }
+
+ public static class AudioAttributes.Builder {
+ method public android.media.AudioAttributes.Builder addBundle(@NonNull android.os.Bundle);
+ method public android.media.AudioAttributes.Builder setCapturePreset(int);
+ method public android.media.AudioAttributes.Builder setInternalCapturePreset(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public android.media.AudioAttributes.Builder setSystemUsage(int);
+ }
+
+ public final class AudioDeviceAttributes implements android.os.Parcelable {
+ ctor public AudioDeviceAttributes(@NonNull android.media.AudioDeviceInfo);
+ ctor public AudioDeviceAttributes(int, int, @NonNull String);
+ method public int describeContents();
+ method @NonNull public String getAddress();
+ method public int getRole();
+ method public int getType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.AudioDeviceAttributes> CREATOR;
+ field public static final int ROLE_INPUT = 1; // 0x1
+ field public static final int ROLE_OUTPUT = 2; // 0x2
+ }
+
+ public final class AudioFocusInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.media.AudioAttributes getAttributes();
+ method @NonNull public String getClientId();
+ method public int getClientUid();
+ method public int getFlags();
+ method public int getGainRequest();
+ method public int getLossReceived();
+ method @NonNull public String getPackageName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.AudioFocusInfo> CREATOR;
+ }
+
+ public final class AudioFocusRequest {
+ method public boolean locksFocus();
+ }
+
+ public static final class AudioFocusRequest.Builder {
+ method @NonNull public android.media.AudioFocusRequest.Builder setLocksFocus(boolean);
+ }
+
+ public class AudioManager {
+ method @Deprecated public int abandonAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, android.media.AudioAttributes);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void addOnPreferredDeviceForStrategyChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.OnPreferredDeviceForStrategyChangedListener) throws java.lang.SecurityException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void addOnPreferredDevicesForCapturePresetChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.OnPreferredDevicesForCapturePresetChangedListener) throws java.lang.SecurityException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void addOnPreferredDevicesForStrategyChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.OnPreferredDevicesForStrategyChangedListener) throws java.lang.SecurityException;
+ method public void clearAudioServerStateCallback();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean clearPreferredDevicesForCapturePreset(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int dispatchAudioFocusChange(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy);
+ method @IntRange(from=0) public long getAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static java.util.List<android.media.audiopolicy.AudioProductStrategy> getAudioProductStrategies();
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static java.util.List<android.media.audiopolicy.AudioVolumeGroup> getAudioVolumeGroups();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getDeviceVolumeBehavior(@NonNull android.media.AudioDeviceAttributes);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public java.util.List<android.media.AudioDeviceAttributes> getDevicesForAttributes(@NonNull android.media.AudioAttributes);
+ method @IntRange(from=0) public long getMaxAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo);
+ method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getMaxVolumeIndexForAttributes(@NonNull android.media.AudioAttributes);
+ method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getMinVolumeIndexForAttributes(@NonNull android.media.AudioAttributes);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public android.media.AudioDeviceAttributes getPreferredDeviceForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public java.util.List<android.media.AudioDeviceAttributes> getPreferredDevicesForCapturePreset(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public java.util.List<android.media.AudioDeviceAttributes> getPreferredDevicesForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int[] getSupportedSystemUsages();
+ method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getVolumeIndexForAttributes(@NonNull android.media.AudioAttributes);
+ method public boolean isAudioServerRunning();
+ method public boolean isHdmiSystemAudioSupported();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int registerAudioPolicy(@NonNull android.media.audiopolicy.AudioPolicy);
+ method public void registerVolumeGroupCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.VolumeGroupCallback);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void removeOnPreferredDeviceForStrategyChangedListener(@NonNull android.media.AudioManager.OnPreferredDeviceForStrategyChangedListener);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void removeOnPreferredDevicesForCapturePresetChangedListener(@NonNull android.media.AudioManager.OnPreferredDevicesForCapturePresetChangedListener);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void removeOnPreferredDevicesForStrategyChangedListener(@NonNull android.media.AudioManager.OnPreferredDevicesForStrategyChangedListener);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean removePreferredDeviceForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.media.AudioAttributes, int, int) throws java.lang.IllegalArgumentException;
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.MODIFY_AUDIO_ROUTING}) public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.media.AudioAttributes, int, int, android.media.audiopolicy.AudioPolicy) throws java.lang.IllegalArgumentException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int requestAudioFocus(@NonNull android.media.AudioFocusRequest, @Nullable android.media.audiopolicy.AudioPolicy);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean setAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo, @IntRange(from=0) long);
+ method public void setAudioServerStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.AudioServerStateCallback);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setDeviceVolumeBehavior(@NonNull android.media.AudioDeviceAttributes, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setFocusRequestResult(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean setPreferredDeviceForCapturePreset(int, @NonNull android.media.AudioDeviceAttributes);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean setPreferredDeviceForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy, @NonNull android.media.AudioDeviceAttributes);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean setPreferredDevicesForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy, @NonNull java.util.List<android.media.AudioDeviceAttributes>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setSupportedSystemUsages(@NonNull int[]);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setVolumeIndexForAttributes(@NonNull android.media.AudioAttributes, int, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void unregisterAudioPolicy(@NonNull android.media.audiopolicy.AudioPolicy);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void unregisterAudioPolicyAsync(@NonNull android.media.audiopolicy.AudioPolicy);
+ method public void unregisterVolumeGroupCallback(@NonNull android.media.AudioManager.VolumeGroupCallback);
+ field public static final int AUDIOFOCUS_FLAG_DELAY_OK = 1; // 0x1
+ field public static final int AUDIOFOCUS_FLAG_LOCK = 4; // 0x4
+ field public static final int AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS = 2; // 0x2
+ field public static final int DEVICE_VOLUME_BEHAVIOR_ABSOLUTE = 3; // 0x3
+ field public static final int DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_MULTI_MODE = 4; // 0x4
+ field public static final int DEVICE_VOLUME_BEHAVIOR_FIXED = 2; // 0x2
+ field public static final int DEVICE_VOLUME_BEHAVIOR_FULL = 1; // 0x1
+ field public static final int DEVICE_VOLUME_BEHAVIOR_VARIABLE = 0; // 0x0
+ field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int STREAM_ASSISTANT = 11; // 0xb
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
+ public abstract static class AudioManager.AudioServerStateCallback {
+ ctor public AudioManager.AudioServerStateCallback();
+ method public void onAudioServerDown();
+ method public void onAudioServerUp();
+ }
+
+ @Deprecated public static interface AudioManager.OnPreferredDeviceForStrategyChangedListener {
+ method @Deprecated public void onPreferredDeviceForStrategyChanged(@NonNull android.media.audiopolicy.AudioProductStrategy, @Nullable android.media.AudioDeviceAttributes);
+ }
+
+ public static interface AudioManager.OnPreferredDevicesForCapturePresetChangedListener {
+ method public void onPreferredDevicesForCapturePresetChanged(int, @NonNull java.util.List<android.media.AudioDeviceAttributes>);
+ }
+
+ public static interface AudioManager.OnPreferredDevicesForStrategyChangedListener {
+ method public void onPreferredDevicesForStrategyChanged(@NonNull android.media.audiopolicy.AudioProductStrategy, @NonNull java.util.List<android.media.AudioDeviceAttributes>);
+ }
+
+ public abstract static class AudioManager.VolumeGroupCallback {
+ ctor public AudioManager.VolumeGroupCallback();
+ method public void onAudioVolumeGroupChanged(int, int);
+ }
+
+ public final class AudioPlaybackConfiguration implements android.os.Parcelable {
+ method public int getClientPid();
+ method public int getClientUid();
+ method public int getPlayerInterfaceId();
+ method public android.media.PlayerProxy getPlayerProxy();
+ method public int getPlayerState();
+ method public int getPlayerType();
+ method public boolean isActive();
+ field public static final int PLAYER_STATE_IDLE = 1; // 0x1
+ field public static final int PLAYER_STATE_PAUSED = 3; // 0x3
+ field public static final int PLAYER_STATE_RELEASED = 0; // 0x0
+ field public static final int PLAYER_STATE_STARTED = 2; // 0x2
+ field public static final int PLAYER_STATE_STOPPED = 4; // 0x4
+ field public static final int PLAYER_STATE_UNKNOWN = -1; // 0xffffffff
+ field public static final int PLAYER_TYPE_JAM_AUDIOTRACK = 1; // 0x1
+ field public static final int PLAYER_TYPE_JAM_MEDIAPLAYER = 2; // 0x2
+ field public static final int PLAYER_TYPE_JAM_SOUNDPOOL = 3; // 0x3
+ field public static final int PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE = 11; // 0xb
+ field public static final int PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD = 12; // 0xc
+ field public static final int PLAYER_TYPE_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public class AudioRecord implements android.media.AudioRecordingMonitor android.media.AudioRouting android.media.MicrophoneDirection {
+ ctor public AudioRecord(android.media.AudioAttributes, android.media.AudioFormat, int, int) throws java.lang.IllegalArgumentException;
+ }
+
+ public static class AudioRecord.Builder {
+ method public android.media.AudioRecord.Builder setAudioAttributes(@NonNull android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
+ method public android.media.AudioRecord.Builder setSessionId(int) throws java.lang.IllegalArgumentException;
+ }
+
+ public final class AudioRecordingConfiguration implements android.os.Parcelable {
+ method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getClientUid();
+ }
+
+ public class AudioTrack implements android.media.AudioRouting android.media.VolumeAutomation {
+ field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int ENCAPSULATION_MODE_HANDLE = 2; // 0x2
+ }
+
+ public static class AudioTrack.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public android.media.AudioTrack.Builder setTunerConfiguration(@NonNull android.media.AudioTrack.TunerConfiguration);
+ }
+
+ public static class AudioTrack.TunerConfiguration {
+ ctor @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public AudioTrack.TunerConfiguration(@IntRange(from=1) int, @IntRange(from=1) int);
+ method @IntRange(from=1) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getContentId();
+ method @IntRange(from=1) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getSyncId();
+ }
+
+ public class HwAudioSource {
+ method public boolean isPlaying();
+ method public void start();
+ method public void stop();
+ }
+
+ public static final class HwAudioSource.Builder {
+ ctor public HwAudioSource.Builder();
+ method @NonNull public android.media.HwAudioSource build();
+ method @NonNull public android.media.HwAudioSource.Builder setAudioAttributes(@NonNull android.media.AudioAttributes);
+ method @NonNull public android.media.HwAudioSource.Builder setAudioDeviceInfo(@NonNull android.media.AudioDeviceInfo);
+ }
+
+ public class MediaPlayer implements android.media.AudioRouting android.media.VolumeAutomation {
+ method @RequiresPermission("android.permission.BIND_IMS_SERVICE") public void setOnImsRxNoticeListener(@Nullable android.media.MediaPlayer.OnImsRxNoticeListener, @Nullable android.os.Handler);
+ }
+
+ public static interface MediaPlayer.OnImsRxNoticeListener {
+ method public void onImsRxNotice(@NonNull android.media.MediaPlayer, @NonNull byte[]);
+ }
+
+ public final class MediaRecorder.AudioSource {
+ field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public static final int ECHO_REFERENCE = 1997; // 0x7cd
+ field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_HOTWORD) public static final int HOTWORD = 1999; // 0x7cf
+ field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public static final int RADIO_TUNER = 1998; // 0x7ce
+ }
+
+ public final class MediaTranscodeManager {
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingSession enqueueRequest(@NonNull android.media.MediaTranscodeManager.TranscodingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.media.MediaTranscodeManager.OnTranscodingFinishedListener) throws java.io.FileNotFoundException, android.media.MediaTranscodingException.ServiceNotAvailableException;
+ field public static final int PRIORITY_REALTIME = 1; // 0x1
+ field public static final int TRANSCODING_TYPE_VIDEO = 1; // 0x1
+ }
+
+ @java.lang.FunctionalInterface public static interface MediaTranscodeManager.OnTranscodingFinishedListener {
+ method public void onTranscodingFinished(@NonNull android.media.MediaTranscodeManager.TranscodingSession);
+ }
+
+ public static final class MediaTranscodeManager.TranscodingRequest {
+ method public int getClientPid();
+ method public int getClientUid();
+ method @NonNull public android.net.Uri getDestinationUri();
+ method public int getPriority();
+ method @NonNull public android.net.Uri getSourceUri();
+ method public int getType();
+ method @Nullable public android.media.MediaFormat getVideoTrackFormat();
+ }
+
+ public static final class MediaTranscodeManager.TranscodingRequest.Builder {
+ ctor public MediaTranscodeManager.TranscodingRequest.Builder();
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest build();
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setClientPid(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setClientUid(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setDestinationUri(@NonNull android.net.Uri);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setPriority(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setSourceUri(@NonNull android.net.Uri);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setType(int);
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.Builder setVideoTrackFormat(@NonNull android.media.MediaFormat);
+ }
+
+ public static class MediaTranscodeManager.TranscodingRequest.MediaFormatResolver {
+ ctor public MediaTranscodeManager.TranscodingRequest.MediaFormatResolver();
+ method @Nullable public android.media.MediaFormat resolveVideoFormat();
+ method @NonNull public android.media.MediaTranscodeManager.TranscodingRequest.MediaFormatResolver setSourceVideoFormatHint(@NonNull android.media.MediaFormat);
+ method public boolean shouldTranscode();
+ field public static final String CAPS_SUPPORTS_HEVC = "support-hevc";
+ }
+
+ public static final class MediaTranscodeManager.TranscodingSession {
+ method public void cancel();
+ method @IntRange(from=0, to=100) public int getProgress();
+ method public int getResult();
+ method public int getSessionId();
+ method public int getStatus();
+ method public void setOnProgressUpdateListener(@NonNull java.util.concurrent.Executor, @Nullable android.media.MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener);
+ method public void setOnProgressUpdateListener(int, @NonNull java.util.concurrent.Executor, @Nullable android.media.MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener);
+ field public static final int RESULT_CANCELED = 4; // 0x4
+ field public static final int RESULT_ERROR = 3; // 0x3
+ field public static final int RESULT_NONE = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 2; // 0x2
+ field public static final int STATUS_FINISHED = 3; // 0x3
+ field public static final int STATUS_PAUSED = 4; // 0x4
+ field public static final int STATUS_PENDING = 1; // 0x1
+ field public static final int STATUS_RUNNING = 2; // 0x2
+ }
+
+ @java.lang.FunctionalInterface public static interface MediaTranscodeManager.TranscodingSession.OnProgressUpdateListener {
+ method public void onProgressUpdate(@NonNull android.media.MediaTranscodeManager.TranscodingSession, @IntRange(from=0, to=100) int);
+ }
+
+ public class PlayerProxy {
+ method public void pause();
+ method public void setPan(float);
+ method public void setStartDelayMs(int);
+ method public void setVolume(float);
+ method public void start();
+ method public void stop();
+ }
+
+ public class RingtoneManager {
+ method @RequiresPermission(android.Manifest.permission.WRITE_SETTINGS) public static void ensureDefaultRingtones(@NonNull android.content.Context);
+ }
+
+}
+
+package android.media.audiofx {
+
+ public class AudioEffect {
+ ctor @RequiresPermission("android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS") public AudioEffect(@NonNull java.util.UUID, @NonNull android.media.AudioDeviceAttributes);
+ method @RequiresPermission("android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS") public static boolean isEffectSupportedForDevice(@NonNull java.util.UUID, @NonNull android.media.AudioDeviceAttributes);
+ }
+
+}
+
+package android.media.audiopolicy {
+
+ public class AudioMix {
+ method public int getMixState();
+ field public static final int MIX_STATE_DISABLED = -1; // 0xffffffff
+ field public static final int MIX_STATE_IDLE = 0; // 0x0
+ field public static final int MIX_STATE_MIXING = 1; // 0x1
+ field public static final int ROUTE_FLAG_LOOP_BACK = 2; // 0x2
+ field public static final int ROUTE_FLAG_RENDER = 1; // 0x1
+ }
+
+ public static class AudioMix.Builder {
+ ctor public AudioMix.Builder(android.media.audiopolicy.AudioMixingRule) throws java.lang.IllegalArgumentException;
+ method public android.media.audiopolicy.AudioMix build() throws java.lang.IllegalArgumentException;
+ method public android.media.audiopolicy.AudioMix.Builder setDevice(@NonNull android.media.AudioDeviceInfo) throws java.lang.IllegalArgumentException;
+ method public android.media.audiopolicy.AudioMix.Builder setFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException;
+ method public android.media.audiopolicy.AudioMix.Builder setRouteFlags(int) throws java.lang.IllegalArgumentException;
+ }
+
+ public class AudioMixingRule {
+ field public static final int RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET = 2; // 0x2
+ field public static final int RULE_MATCH_ATTRIBUTE_USAGE = 1; // 0x1
+ field public static final int RULE_MATCH_UID = 4; // 0x4
+ field public static final int RULE_MATCH_USERID = 8; // 0x8
+ }
+
+ public static class AudioMixingRule.Builder {
+ ctor public AudioMixingRule.Builder();
+ method public android.media.audiopolicy.AudioMixingRule.Builder addMixRule(int, Object) throws java.lang.IllegalArgumentException;
+ method public android.media.audiopolicy.AudioMixingRule.Builder addRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
+ method @NonNull public android.media.audiopolicy.AudioMixingRule.Builder allowPrivilegedPlaybackCapture(boolean);
+ method public android.media.audiopolicy.AudioMixingRule build();
+ method public android.media.audiopolicy.AudioMixingRule.Builder excludeMixRule(int, Object) throws java.lang.IllegalArgumentException;
+ method public android.media.audiopolicy.AudioMixingRule.Builder excludeRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
+ }
+
+ public class AudioPolicy {
+ method public int attachMixes(@NonNull java.util.List<android.media.audiopolicy.AudioMix>);
+ method public android.media.AudioRecord createAudioRecordSink(android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
+ method public android.media.AudioTrack createAudioTrackSource(android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
+ method public int detachMixes(@NonNull java.util.List<android.media.audiopolicy.AudioMix>);
+ method public int getFocusDuckingBehavior();
+ method public int getStatus();
+ method public boolean removeUidDeviceAffinity(int);
+ method public boolean removeUserIdDeviceAffinity(int);
+ method public int setFocusDuckingBehavior(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
+ method public void setRegistration(String);
+ method public boolean setUidDeviceAffinity(int, @NonNull java.util.List<android.media.AudioDeviceInfo>);
+ method public boolean setUserIdDeviceAffinity(int, @NonNull java.util.List<android.media.AudioDeviceInfo>);
+ method public String toLogFriendlyString();
+ field public static final int FOCUS_POLICY_DUCKING_DEFAULT = 0; // 0x0
+ field public static final int FOCUS_POLICY_DUCKING_IN_APP = 0; // 0x0
+ field public static final int FOCUS_POLICY_DUCKING_IN_POLICY = 1; // 0x1
+ field public static final int POLICY_STATUS_REGISTERED = 2; // 0x2
+ field public static final int POLICY_STATUS_UNREGISTERED = 1; // 0x1
+ }
+
+ public abstract static class AudioPolicy.AudioPolicyFocusListener {
+ ctor public AudioPolicy.AudioPolicyFocusListener();
+ method public void onAudioFocusAbandon(android.media.AudioFocusInfo);
+ method public void onAudioFocusGrant(android.media.AudioFocusInfo, int);
+ method public void onAudioFocusLoss(android.media.AudioFocusInfo, boolean);
+ method public void onAudioFocusRequest(android.media.AudioFocusInfo, int);
+ }
+
+ public abstract static class AudioPolicy.AudioPolicyStatusListener {
+ ctor public AudioPolicy.AudioPolicyStatusListener();
+ method public void onMixStateUpdate(android.media.audiopolicy.AudioMix);
+ method public void onStatusChange();
+ }
+
+ public abstract static class AudioPolicy.AudioPolicyVolumeCallback {
+ ctor public AudioPolicy.AudioPolicyVolumeCallback();
+ method public void onVolumeAdjustment(int);
+ }
+
+ public static class AudioPolicy.Builder {
+ ctor public AudioPolicy.Builder(android.content.Context);
+ method @NonNull public android.media.audiopolicy.AudioPolicy.Builder addMix(@NonNull android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
+ method @NonNull public android.media.audiopolicy.AudioPolicy build();
+ method public void setAudioPolicyFocusListener(android.media.audiopolicy.AudioPolicy.AudioPolicyFocusListener);
+ method public void setAudioPolicyStatusListener(android.media.audiopolicy.AudioPolicy.AudioPolicyStatusListener);
+ method @NonNull public android.media.audiopolicy.AudioPolicy.Builder setAudioPolicyVolumeCallback(@NonNull android.media.audiopolicy.AudioPolicy.AudioPolicyVolumeCallback);
+ method @NonNull public android.media.audiopolicy.AudioPolicy.Builder setIsAudioFocusPolicy(boolean);
+ method @NonNull public android.media.audiopolicy.AudioPolicy.Builder setLooper(@NonNull android.os.Looper) throws java.lang.IllegalArgumentException;
+ }
+
+ public final class AudioProductStrategy implements android.os.Parcelable {
+ method @NonNull public static android.media.audiopolicy.AudioProductStrategy createInvalidAudioProductStrategy(int);
+ method public int describeContents();
+ method @NonNull public android.media.AudioAttributes getAudioAttributes();
+ method public int getId();
+ method public boolean supportsAudioAttributes(@NonNull android.media.AudioAttributes);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.audiopolicy.AudioProductStrategy> CREATOR;
+ }
+
+ public final class AudioVolumeGroup implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.media.AudioAttributes> getAudioAttributes();
+ method public int getId();
+ method @NonNull public int[] getLegacyStreamTypes();
+ method @NonNull public String name();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.media.audiopolicy.AudioVolumeGroup> CREATOR;
+ field public static final int DEFAULT_VOLUME_GROUP = -1; // 0xffffffff
+ }
+
+}
+
+package android.media.musicrecognition {
+
+ public class MusicRecognitionManager {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_MUSIC_RECOGNITION) public void beginStreamingSearch(@NonNull android.media.musicrecognition.RecognitionRequest, @NonNull java.util.concurrent.Executor, @NonNull android.media.musicrecognition.MusicRecognitionManager.RecognitionCallback);
+ field public static final int RECOGNITION_FAILED_AUDIO_UNAVAILABLE = 7; // 0x7
+ field public static final int RECOGNITION_FAILED_NOT_FOUND = 1; // 0x1
+ field public static final int RECOGNITION_FAILED_NO_CONNECTIVITY = 2; // 0x2
+ field public static final int RECOGNITION_FAILED_SERVICE_KILLED = 5; // 0x5
+ field public static final int RECOGNITION_FAILED_SERVICE_UNAVAILABLE = 3; // 0x3
+ field public static final int RECOGNITION_FAILED_TIMEOUT = 6; // 0x6
+ field public static final int RECOGNITION_FAILED_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public static interface MusicRecognitionManager.RecognitionCallback {
+ method public void onAudioStreamClosed();
+ method public void onRecognitionFailed(@NonNull android.media.musicrecognition.RecognitionRequest, int);
+ method public void onRecognitionSucceeded(@NonNull android.media.musicrecognition.RecognitionRequest, @NonNull android.media.MediaMetadata, @Nullable android.os.Bundle);
+ }
+
+ public abstract class MusicRecognitionService extends android.app.Service {
+ ctor public MusicRecognitionService();
+ method public abstract void onRecognize(@NonNull android.os.ParcelFileDescriptor, @NonNull android.media.AudioFormat, @NonNull android.media.musicrecognition.MusicRecognitionService.Callback);
+ }
+
+ public static interface MusicRecognitionService.Callback {
+ method public void onRecognitionFailed(int);
+ method public void onRecognitionSucceeded(@NonNull android.media.MediaMetadata, @Nullable android.os.Bundle);
+ }
+
+ public final class RecognitionRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.media.AudioAttributes getAudioAttributes();
+ method @NonNull public android.media.AudioFormat getAudioFormat();
+ method public int getCaptureSession();
+ method public int getIgnoreBeginningFrames();
+ method public int getMaxAudioLengthSeconds();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.musicrecognition.RecognitionRequest> CREATOR;
+ }
+
+ public static final class RecognitionRequest.Builder {
+ ctor public RecognitionRequest.Builder();
+ method @NonNull public android.media.musicrecognition.RecognitionRequest build();
+ method @NonNull public android.media.musicrecognition.RecognitionRequest.Builder setAudioAttributes(@NonNull android.media.AudioAttributes);
+ method @NonNull public android.media.musicrecognition.RecognitionRequest.Builder setAudioFormat(@NonNull android.media.AudioFormat);
+ method @NonNull public android.media.musicrecognition.RecognitionRequest.Builder setCaptureSession(int);
+ method @NonNull public android.media.musicrecognition.RecognitionRequest.Builder setIgnoreBeginningFrames(int);
+ method @NonNull public android.media.musicrecognition.RecognitionRequest.Builder setMaxAudioLengthSeconds(int);
+ }
+
+}
+
+package android.media.session {
+
+ public final class MediaSessionManager {
+ method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void addOnMediaKeyEventDispatchedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.OnMediaKeyEventDispatchedListener);
+ method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void addOnMediaKeyEventSessionChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.OnMediaKeyEventSessionChangedListener);
+ method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void removeOnMediaKeyEventDispatchedListener(@NonNull android.media.session.MediaSessionManager.OnMediaKeyEventDispatchedListener);
+ method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void removeOnMediaKeyEventSessionChangedListener(@NonNull android.media.session.MediaSessionManager.OnMediaKeyEventSessionChangedListener);
+ method @RequiresPermission(android.Manifest.permission.SET_MEDIA_KEY_LISTENER) public void setOnMediaKeyListener(android.media.session.MediaSessionManager.OnMediaKeyListener, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER) public void setOnVolumeKeyLongPressListener(android.media.session.MediaSessionManager.OnVolumeKeyLongPressListener, @Nullable android.os.Handler);
+ }
+
+ public static interface MediaSessionManager.OnMediaKeyEventDispatchedListener {
+ method public void onMediaKeyEventDispatched(@NonNull android.view.KeyEvent, @NonNull String, @Nullable android.media.session.MediaSession.Token);
+ }
+
+ public static interface MediaSessionManager.OnMediaKeyEventSessionChangedListener {
+ method public void onMediaKeyEventSessionChanged(@NonNull String, @Nullable android.media.session.MediaSession.Token);
+ }
+
+ public static interface MediaSessionManager.OnMediaKeyListener {
+ method public boolean onMediaKey(android.view.KeyEvent);
+ }
+
+ public static interface MediaSessionManager.OnVolumeKeyLongPressListener {
+ method public void onVolumeKeyLongPress(android.view.KeyEvent);
+ }
+
+}
+
+package android.media.soundtrigger {
+
+ public abstract class SoundTriggerDetectionService extends android.app.Service {
+ ctor public SoundTriggerDetectionService();
+ method @MainThread public void onConnected(@NonNull java.util.UUID, @Nullable android.os.Bundle);
+ method @MainThread public void onDisconnected(@NonNull java.util.UUID, @Nullable android.os.Bundle);
+ method @MainThread public void onError(@NonNull java.util.UUID, @Nullable android.os.Bundle, int, int);
+ method @MainThread public void onGenericRecognitionEvent(@NonNull java.util.UUID, @Nullable android.os.Bundle, int, @NonNull android.hardware.soundtrigger.SoundTrigger.RecognitionEvent);
+ method @MainThread public abstract void onStopOperation(@NonNull java.util.UUID, @Nullable android.os.Bundle, int);
+ method public final void operationFinished(@Nullable java.util.UUID, int);
+ }
+
+ public final class SoundTriggerDetector {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public boolean startRecognition(int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public boolean stopRecognition();
+ field public static final int RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS = 2; // 0x2
+ field public static final int RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO = 1; // 0x1
+ field public static final int RECOGNITION_FLAG_ENABLE_AUDIO_ECHO_CANCELLATION = 4; // 0x4
+ field public static final int RECOGNITION_FLAG_ENABLE_AUDIO_NOISE_SUPPRESSION = 8; // 0x8
+ }
+
+ public abstract static class SoundTriggerDetector.Callback {
+ ctor public SoundTriggerDetector.Callback();
+ method public abstract void onAvailabilityChanged(int);
+ method public abstract void onDetected(@NonNull android.media.soundtrigger.SoundTriggerDetector.EventPayload);
+ method public abstract void onError();
+ method public abstract void onRecognitionPaused();
+ method public abstract void onRecognitionResumed();
+ }
+
+ public static class SoundTriggerDetector.EventPayload {
+ method @Nullable public android.media.AudioFormat getCaptureAudioFormat();
+ method @Nullable public byte[] getTriggerAudio();
+ }
+
+ public final class SoundTriggerManager {
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.media.soundtrigger.SoundTriggerDetector createSoundTriggerDetector(java.util.UUID, @NonNull android.media.soundtrigger.SoundTriggerDetector.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public void deleteModel(java.util.UUID);
+ method public int getDetectionServiceOperationsTimeout();
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.media.soundtrigger.SoundTriggerManager.Model getModel(java.util.UUID);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.hardware.soundtrigger.SoundTrigger.ModuleProperties getModuleProperties();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public int getParameter(@NonNull java.util.UUID, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.hardware.soundtrigger.SoundTrigger.ModelParamRange queryParameter(@Nullable java.util.UUID, int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public int setParameter(@Nullable java.util.UUID, int, int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public void updateModel(android.media.soundtrigger.SoundTriggerManager.Model);
+ }
+
+ public static class SoundTriggerManager.Model {
+ method @NonNull public static android.media.soundtrigger.SoundTriggerManager.Model create(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], int);
+ method @NonNull public static android.media.soundtrigger.SoundTriggerManager.Model create(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[]);
+ method @Nullable public byte[] getModelData();
+ method @NonNull public java.util.UUID getModelUuid();
+ method @NonNull public java.util.UUID getVendorUuid();
+ method public int getVersion();
+ }
+
+}
+
+package android.media.tv {
+
+ public final class DvbDeviceInfo implements android.os.Parcelable {
+ ctor public DvbDeviceInfo(int, int);
+ method public int describeContents();
+ method @IntRange(from=0) public int getAdapterId();
+ method @IntRange(from=0) public int getDeviceId();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.DvbDeviceInfo> CREATOR;
+ }
+
+ public final class TunedInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getAppTag();
+ method public int getAppType();
+ method @Nullable public android.net.Uri getChannelUri();
+ method @NonNull public String getInputId();
+ method public boolean isForeground();
+ method public boolean isRecordingSession();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int APP_TAG_SELF = 0; // 0x0
+ field public static final int APP_TYPE_NON_SYSTEM = 3; // 0x3
+ field public static final int APP_TYPE_SELF = 1; // 0x1
+ field public static final int APP_TYPE_SYSTEM = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TunedInfo> CREATOR;
+ }
+
+ public final class TvContentRatingSystemInfo implements android.os.Parcelable {
+ method public static android.media.tv.TvContentRatingSystemInfo createTvContentRatingSystemInfo(int, android.content.pm.ApplicationInfo);
+ method public int describeContents();
+ method public android.net.Uri getXmlUri();
+ method public boolean isSystemDefined();
+ method public void writeToParcel(android.os.Parcel, int);
+ }
+
+ public final class TvContract {
+ method public static android.net.Uri buildChannelsUriForInput(@Nullable String, boolean);
+ method public static android.net.Uri buildChannelsUriForInput(@Nullable String, @Nullable String, boolean);
+ field public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED = "android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
+ field public static final String EXTRA_BLOCKED_PACKAGES = "android.media.tv.extra.BLOCKED_PACKAGES";
+ field public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
+ field public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
+ field public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
+ field public static final String EXTRA_EXISTING_COLUMN_NAMES = "android.media.tv.extra.EXISTING_COLUMN_NAMES";
+ field public static final String EXTRA_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
+ field public static final String EXTRA_RESULT_CODE = "android.media.tv.extra.RESULT_CODE";
+ field public static final String METHOD_ADD_COLUMN = "add_column";
+ field public static final String METHOD_BLOCK_PACKAGE = "block_package";
+ field public static final String METHOD_GET_BLOCKED_PACKAGES = "get_blocked_packages";
+ field public static final String METHOD_GET_COLUMNS = "get_columns";
+ field public static final String METHOD_UNBLOCK_PACKAGE = "unblock_package";
+ field public static final int RESULT_ERROR_INVALID_ARGUMENT = 2; // 0x2
+ field public static final int RESULT_ERROR_IO = 1; // 0x1
+ field public static final int RESULT_OK = 0; // 0x0
+ }
+
+ public static final class TvContract.WatchedPrograms implements android.media.tv.TvContract.BaseTvColumns {
+ field public static final String COLUMN_CHANNEL_ID = "channel_id";
+ field public static final String COLUMN_DESCRIPTION = "description";
+ field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
+ field public static final String COLUMN_INTERNAL_SESSION_TOKEN = "session_token";
+ field public static final String COLUMN_INTERNAL_TUNE_PARAMS = "tune_params";
+ field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
+ field public static final String COLUMN_TITLE = "title";
+ field public static final String COLUMN_WATCH_END_TIME_UTC_MILLIS = "watch_end_time_utc_millis";
+ field public static final String COLUMN_WATCH_START_TIME_UTC_MILLIS = "watch_start_time_utc_millis";
+ field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/watched_program";
+ field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/watched_program";
+ field public static final android.net.Uri CONTENT_URI;
+ }
+
+ public final class TvInputHardwareInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public String getAudioAddress();
+ method public int getAudioType();
+ method public int getCableConnectionStatus();
+ method public int getDeviceId();
+ method public int getHdmiPortId();
+ method public int getType();
+ method public void readFromParcel(android.os.Parcel);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CABLE_CONNECTION_STATUS_CONNECTED = 1; // 0x1
+ field public static final int CABLE_CONNECTION_STATUS_DISCONNECTED = 2; // 0x2
+ field public static final int CABLE_CONNECTION_STATUS_UNKNOWN = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TvInputHardwareInfo> CREATOR;
+ field public static final int TV_INPUT_TYPE_COMPONENT = 6; // 0x6
+ field public static final int TV_INPUT_TYPE_COMPOSITE = 3; // 0x3
+ field public static final int TV_INPUT_TYPE_DISPLAY_PORT = 10; // 0xa
+ field public static final int TV_INPUT_TYPE_DVI = 8; // 0x8
+ field public static final int TV_INPUT_TYPE_HDMI = 9; // 0x9
+ field public static final int TV_INPUT_TYPE_OTHER_HARDWARE = 1; // 0x1
+ field public static final int TV_INPUT_TYPE_SCART = 5; // 0x5
+ field public static final int TV_INPUT_TYPE_SVIDEO = 4; // 0x4
+ field public static final int TV_INPUT_TYPE_TUNER = 2; // 0x2
+ field public static final int TV_INPUT_TYPE_VGA = 7; // 0x7
+ }
+
+ public static final class TvInputHardwareInfo.Builder {
+ ctor public TvInputHardwareInfo.Builder();
+ method public android.media.tv.TvInputHardwareInfo.Builder audioAddress(String);
+ method public android.media.tv.TvInputHardwareInfo.Builder audioType(int);
+ method public android.media.tv.TvInputHardwareInfo build();
+ method public android.media.tv.TvInputHardwareInfo.Builder cableConnectionStatus(int);
+ method public android.media.tv.TvInputHardwareInfo.Builder deviceId(int);
+ method public android.media.tv.TvInputHardwareInfo.Builder hdmiPortId(int);
+ method public android.media.tv.TvInputHardwareInfo.Builder type(int);
+ }
+
+ public final class TvInputInfo implements android.os.Parcelable {
+ method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.hardware.hdmi.HdmiDeviceInfo, String, String, android.net.Uri) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.hardware.hdmi.HdmiDeviceInfo, String, int, android.graphics.drawable.Icon) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.media.tv.TvInputHardwareInfo, String, android.net.Uri) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.media.tv.TvInputHardwareInfo, int, android.graphics.drawable.Icon) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public android.hardware.hdmi.HdmiDeviceInfo getHdmiDeviceInfo();
+ method public boolean isConnectedToHdmiSwitch();
+ method public boolean isHardwareInput();
+ method public android.graphics.drawable.Drawable loadIcon(@NonNull android.content.Context, int);
+ }
+
+ public static final class TvInputInfo.Builder {
+ method public android.media.tv.TvInputInfo.Builder setHdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo);
+ method public android.media.tv.TvInputInfo.Builder setIcon(android.graphics.drawable.Icon);
+ method public android.media.tv.TvInputInfo.Builder setIcon(android.graphics.drawable.Icon, int);
+ method public android.media.tv.TvInputInfo.Builder setLabel(CharSequence);
+ method public android.media.tv.TvInputInfo.Builder setLabel(@StringRes int);
+ method public android.media.tv.TvInputInfo.Builder setParentId(String);
+ method public android.media.tv.TvInputInfo.Builder setTvInputHardwareInfo(android.media.tv.TvInputHardwareInfo);
+ }
+
+ public static final class TvInputInfo.TvInputSettings {
+ method public static java.util.Map<java.lang.String,java.lang.String> getCustomLabels(android.content.Context, int);
+ method public static java.util.Set<java.lang.String> getHiddenTvInputIds(android.content.Context, int);
+ method public static void putCustomLabels(android.content.Context, java.util.Map<java.lang.String,java.lang.String>, int);
+ method public static void putHiddenTvInputs(android.content.Context, java.util.Set<java.lang.String>, int);
+ }
+
+ public final class TvInputManager {
+ method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, @NonNull android.media.tv.TvInputInfo, @NonNull android.media.tv.TvInputManager.HardwareCallback);
+ method @Nullable @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, @NonNull android.media.tv.TvInputInfo, @Nullable String, int, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.TvInputManager.HardwareCallback);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void addBlockedRating(@NonNull android.media.tv.TvContentRating);
+ method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public boolean captureFrame(String, android.view.Surface, android.media.tv.TvStreamConfig);
+ method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(String);
+ method @NonNull @RequiresPermission("com.android.providers.tv.permission.ACCESS_WATCHED_PROGRAMS") public java.util.List<android.media.tv.TunedInfo> getCurrentTunedInfos();
+ method @NonNull @RequiresPermission("android.permission.DVB_DEVICE") public java.util.List<android.media.tv.DvbDeviceInfo> getDvbDeviceList();
+ method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public java.util.List<android.media.tv.TvInputHardwareInfo> getHardwareList();
+ method @RequiresPermission(android.Manifest.permission.READ_CONTENT_RATING_SYSTEMS) public java.util.List<android.media.tv.TvContentRatingSystemInfo> getTvContentRatingSystemList();
+ method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public boolean isSingleSessionActive();
+ method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyPreviewProgramAddedToWatchNext(String, long, long);
+ method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyPreviewProgramBrowsableDisabled(String, long);
+ method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyWatchNextProgramBrowsableDisabled(String, long);
+ method @Nullable @RequiresPermission("android.permission.DVB_DEVICE") public android.os.ParcelFileDescriptor openDvbDevice(@NonNull android.media.tv.DvbDeviceInfo, int);
+ method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public void releaseTvInputHardware(int, android.media.tv.TvInputManager.Hardware);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void removeBlockedRating(@NonNull android.media.tv.TvContentRating);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void setParentalControlsEnabled(boolean);
+ }
+
+ public static final class TvInputManager.Hardware {
+ method public void overrideAudioSink(int, String, int, int, int);
+ method public void setStreamVolume(float);
+ method public boolean setSurface(android.view.Surface, android.media.tv.TvStreamConfig);
+ }
+
+ public abstract static class TvInputManager.HardwareCallback {
+ ctor public TvInputManager.HardwareCallback();
+ method public abstract void onReleased();
+ method public abstract void onStreamConfigChanged(android.media.tv.TvStreamConfig[]);
+ }
+
+ public abstract static class TvInputManager.TvInputCallback {
+ method public void onCurrentTunedInfosUpdated(@NonNull java.util.List<android.media.tv.TunedInfo>);
+ }
+
+ public abstract class TvInputService extends android.app.Service {
+ method @Nullable public android.os.IBinder createExtension();
+ method @Nullable public android.media.tv.TvInputInfo onHardwareAdded(android.media.tv.TvInputHardwareInfo);
+ method @Nullable public String onHardwareRemoved(android.media.tv.TvInputHardwareInfo);
+ method @Nullable public android.media.tv.TvInputInfo onHdmiDeviceAdded(android.hardware.hdmi.HdmiDeviceInfo);
+ method @Nullable public String onHdmiDeviceRemoved(android.hardware.hdmi.HdmiDeviceInfo);
+ method public void onHdmiDeviceUpdated(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
+ }
+
+ public abstract static class TvInputService.RecordingSession {
+ method public void notifySessionEvent(@NonNull String, android.os.Bundle);
+ }
+
+ public abstract static class TvInputService.Session implements android.view.KeyEvent.Callback {
+ method public void notifySessionEvent(@NonNull String, android.os.Bundle);
+ method public void onSetMain(boolean);
+ }
+
+ public abstract static class TvRecordingClient.RecordingCallback {
+ method public void onEvent(String, String, android.os.Bundle);
+ }
+
+ public class TvStreamConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getGeneration();
+ method public int getMaxHeight();
+ method public int getMaxWidth();
+ method public int getStreamId();
+ method public int getType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TvStreamConfig> CREATOR;
+ field public static final int STREAM_TYPE_BUFFER_PRODUCER = 2; // 0x2
+ field public static final int STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE = 1; // 0x1
+ }
+
+ public static final class TvStreamConfig.Builder {
+ ctor public TvStreamConfig.Builder();
+ method public android.media.tv.TvStreamConfig build();
+ method public android.media.tv.TvStreamConfig.Builder generation(int);
+ method public android.media.tv.TvStreamConfig.Builder maxHeight(int);
+ method public android.media.tv.TvStreamConfig.Builder maxWidth(int);
+ method public android.media.tv.TvStreamConfig.Builder streamId(int);
+ method public android.media.tv.TvStreamConfig.Builder type(int);
+ }
+
+ public class TvView extends android.view.ViewGroup {
+ method @RequiresPermission("android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE") public void setMain();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void unblockContent(android.media.tv.TvContentRating);
+ }
+
+ public abstract static class TvView.TvInputCallback {
+ method public void onEvent(String, String, android.os.Bundle);
+ }
+
+}
+
+package android.media.tv.tuner {
+
+ public class DemuxCapabilities {
+ method public int getAudioFilterCount();
+ method public int getDemuxCount();
+ method public int getFilterCapabilities();
+ method @NonNull @Size(5) public int[] getLinkCapabilities();
+ method public int getPcrFilterCount();
+ method public int getPesFilterCount();
+ method public int getPlaybackCount();
+ method public int getRecordCount();
+ method public int getSectionFilterCount();
+ method public long getSectionFilterLength();
+ method public int getTsFilterCount();
+ method public int getVideoFilterCount();
+ method public boolean isTimeFilterSupported();
+ }
+
+ public class Descrambler implements java.lang.AutoCloseable {
+ method public int addPid(int, int, @Nullable android.media.tv.tuner.filter.Filter);
+ method public void close();
+ method public int removePid(int, int, @Nullable android.media.tv.tuner.filter.Filter);
+ method public int setKeyToken(@NonNull byte[]);
+ field public static final int PID_TYPE_MMTP = 2; // 0x2
+ field public static final int PID_TYPE_T = 1; // 0x1
+ }
+
+ public class Lnb implements java.lang.AutoCloseable {
+ method public void close();
+ method public int sendDiseqcMessage(@NonNull byte[]);
+ method public int setSatellitePosition(int);
+ method public int setTone(int);
+ method public int setVoltage(int);
+ field public static final int EVENT_TYPE_DISEQC_RX_OVERFLOW = 0; // 0x0
+ field public static final int EVENT_TYPE_DISEQC_RX_PARITY_ERROR = 2; // 0x2
+ field public static final int EVENT_TYPE_DISEQC_RX_TIMEOUT = 1; // 0x1
+ field public static final int EVENT_TYPE_LNB_OVERLOAD = 3; // 0x3
+ field public static final int POSITION_A = 1; // 0x1
+ field public static final int POSITION_B = 2; // 0x2
+ field public static final int POSITION_UNDEFINED = 0; // 0x0
+ field public static final int TONE_CONTINUOUS = 1; // 0x1
+ field public static final int TONE_NONE = 0; // 0x0
+ field public static final int VOLTAGE_11V = 2; // 0x2
+ field public static final int VOLTAGE_12V = 3; // 0x3
+ field public static final int VOLTAGE_13V = 4; // 0x4
+ field public static final int VOLTAGE_14V = 5; // 0x5
+ field public static final int VOLTAGE_15V = 6; // 0x6
+ field public static final int VOLTAGE_18V = 7; // 0x7
+ field public static final int VOLTAGE_19V = 8; // 0x8
+ field public static final int VOLTAGE_5V = 1; // 0x1
+ field public static final int VOLTAGE_NONE = 0; // 0x0
+ }
+
+ public interface LnbCallback {
+ method public void onDiseqcMessage(@NonNull byte[]);
+ method public void onEvent(int);
+ }
+
+ public class Tuner implements java.lang.AutoCloseable {
+ ctor @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public Tuner(@NonNull android.content.Context, @Nullable String, int);
+ method public int cancelScanning();
+ method public int cancelTuning();
+ method public void clearOnTuneEventListener();
+ method public void clearResourceLostListener();
+ method public void close();
+ method public int connectCiCam(int);
+ method public int disconnectCiCam();
+ method public int getAvSyncHwId(@NonNull android.media.tv.tuner.filter.Filter);
+ method public long getAvSyncTime(int);
+ method @Nullable public android.media.tv.tuner.DemuxCapabilities getDemuxCapabilities();
+ method @Nullable public android.media.tv.tuner.frontend.FrontendInfo getFrontendInfo();
+ method @Nullable public android.media.tv.tuner.frontend.FrontendStatus getFrontendStatus(@NonNull int[]);
+ method public int linkFrontendToCiCam(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_DESCRAMBLER) public android.media.tv.tuner.Descrambler openDescrambler();
+ method @Nullable public android.media.tv.tuner.dvr.DvrPlayback openDvrPlayback(long, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.dvr.OnPlaybackStatusChangedListener);
+ method @Nullable public android.media.tv.tuner.dvr.DvrRecorder openDvrRecorder(long, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.dvr.OnRecordStatusChangedListener);
+ method @Nullable public android.media.tv.tuner.filter.Filter openFilter(int, int, long, @Nullable java.util.concurrent.Executor, @Nullable android.media.tv.tuner.filter.FilterCallback);
+ method @Nullable public android.media.tv.tuner.Lnb openLnb(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.LnbCallback);
+ method @Nullable public android.media.tv.tuner.Lnb openLnbByName(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.LnbCallback);
+ method @Nullable public android.media.tv.tuner.filter.TimeFilter openTimeFilter();
+ method public int scan(@NonNull android.media.tv.tuner.frontend.FrontendSettings, int, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.frontend.ScanCallback);
+ method public int setLnaEnabled(boolean);
+ method public void setOnTuneEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.frontend.OnTuneEventListener);
+ method public void setResourceLostListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.Tuner.OnResourceLostListener);
+ method public void shareFrontendFromTuner(@NonNull android.media.tv.tuner.Tuner);
+ method public int tune(@NonNull android.media.tv.tuner.frontend.FrontendSettings);
+ method public int unlinkFrontendToCiCam(int);
+ method public void updateResourcePriority(int, int);
+ field public static final int INVALID_AV_SYNC_ID = -1; // 0xffffffff
+ field public static final int INVALID_FILTER_ID = -1; // 0xffffffff
+ field public static final long INVALID_FILTER_ID_64BIT = -1L; // 0xffffffffffffffffL
+ field public static final int INVALID_FIRST_MACROBLOCK_IN_SLICE = -1; // 0xffffffff
+ field public static final int INVALID_FRONTEND_SETTING_FREQUENCY = -1; // 0xffffffff
+ field public static final int INVALID_LTS_ID = -1; // 0xffffffff
+ field public static final int INVALID_MMTP_RECORD_EVENT_MPT_SEQUENCE_NUM = -1; // 0xffffffff
+ field public static final int INVALID_STREAM_ID = 65535; // 0xffff
+ field public static final long INVALID_TIMESTAMP = -1L; // 0xffffffffffffffffL
+ field public static final int INVALID_TS_PID = 65535; // 0xffff
+ field public static final int RESULT_INVALID_ARGUMENT = 4; // 0x4
+ field public static final int RESULT_INVALID_STATE = 3; // 0x3
+ field public static final int RESULT_NOT_INITIALIZED = 2; // 0x2
+ field public static final int RESULT_OUT_OF_MEMORY = 5; // 0x5
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final int RESULT_UNAVAILABLE = 1; // 0x1
+ field public static final int RESULT_UNKNOWN_ERROR = 6; // 0x6
+ field public static final int SCAN_TYPE_AUTO = 1; // 0x1
+ field public static final int SCAN_TYPE_BLIND = 2; // 0x2
+ field public static final int SCAN_TYPE_UNDEFINED = 0; // 0x0
+ }
+
+ public static interface Tuner.OnResourceLostListener {
+ method public void onResourceLost(@NonNull android.media.tv.tuner.Tuner);
+ }
+
+ public final class TunerVersionChecker {
+ method public static int getTunerVersion();
+ field public static final int TUNER_VERSION_1_0 = 65536; // 0x10000
+ field public static final int TUNER_VERSION_1_1 = 65537; // 0x10001
+ field public static final int TUNER_VERSION_UNKNOWN = 0; // 0x0
+ }
+
+}
+
+package android.media.tv.tuner.dvr {
+
+ public class DvrPlayback implements java.lang.AutoCloseable {
+ method @Deprecated public int attachFilter(@NonNull android.media.tv.tuner.filter.Filter);
+ method public void close();
+ method public int configure(@NonNull android.media.tv.tuner.dvr.DvrSettings);
+ method @Deprecated public int detachFilter(@NonNull android.media.tv.tuner.filter.Filter);
+ method public int flush();
+ method public long read(long);
+ method public long read(@NonNull byte[], long, long);
+ method public void setFileDescriptor(@NonNull android.os.ParcelFileDescriptor);
+ method public int start();
+ method public int stop();
+ field public static final int PLAYBACK_STATUS_ALMOST_EMPTY = 2; // 0x2
+ field public static final int PLAYBACK_STATUS_ALMOST_FULL = 4; // 0x4
+ field public static final int PLAYBACK_STATUS_EMPTY = 1; // 0x1
+ field public static final int PLAYBACK_STATUS_FULL = 8; // 0x8
+ }
+
+ public class DvrRecorder implements java.lang.AutoCloseable {
+ method public int attachFilter(@NonNull android.media.tv.tuner.filter.Filter);
+ method public void close();
+ method public int configure(@NonNull android.media.tv.tuner.dvr.DvrSettings);
+ method public int detachFilter(@NonNull android.media.tv.tuner.filter.Filter);
+ method public int flush();
+ method public void setFileDescriptor(@NonNull android.os.ParcelFileDescriptor);
+ method public int start();
+ method public int stop();
+ method public long write(long);
+ method public long write(@NonNull byte[], long, long);
+ }
+
+ public class DvrSettings {
+ method @NonNull public static android.media.tv.tuner.dvr.DvrSettings.Builder builder();
+ method public int getDataFormat();
+ method public long getHighThreshold();
+ method public long getLowThreshold();
+ method public long getPacketSize();
+ method public int getStatusMask();
+ field public static final int DATA_FORMAT_ES = 2; // 0x2
+ field public static final int DATA_FORMAT_PES = 1; // 0x1
+ field public static final int DATA_FORMAT_SHV_TLV = 3; // 0x3
+ field public static final int DATA_FORMAT_TS = 0; // 0x0
+ }
+
+ public static final class DvrSettings.Builder {
+ ctor public DvrSettings.Builder();
+ method @NonNull public android.media.tv.tuner.dvr.DvrSettings build();
+ method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setDataFormat(int);
+ method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setHighThreshold(long);
+ method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setLowThreshold(long);
+ method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setPacketSize(long);
+ method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setStatusMask(int);
+ }
+
+ public interface OnPlaybackStatusChangedListener {
+ method public void onPlaybackStatusChanged(int);
+ }
+
+ public interface OnRecordStatusChangedListener {
+ method public void onRecordStatusChanged(int);
+ }
+
+}
+
+package android.media.tv.tuner.filter {
+
+ public final class AlpFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
+ method @NonNull public static android.media.tv.tuner.filter.AlpFilterConfiguration.Builder builder();
+ method public int getLengthType();
+ method public int getPacketType();
+ method public int getType();
+ field public static final int LENGTH_TYPE_UNDEFINED = 0; // 0x0
+ field public static final int LENGTH_TYPE_WITHOUT_ADDITIONAL_HEADER = 1; // 0x1
+ field public static final int LENGTH_TYPE_WITH_ADDITIONAL_HEADER = 2; // 0x2
+ field public static final int PACKET_TYPE_COMPRESSED = 2; // 0x2
+ field public static final int PACKET_TYPE_EXTENSION = 6; // 0x6
+ field public static final int PACKET_TYPE_IPV4 = 0; // 0x0
+ field public static final int PACKET_TYPE_MPEG2_TS = 7; // 0x7
+ field public static final int PACKET_TYPE_SIGNALING = 4; // 0x4
+ }
+
+ public static final class AlpFilterConfiguration.Builder {
+ method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration build();
+ method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration.Builder setLengthType(int);
+ method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration.Builder setPacketType(int);
+ method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration.Builder setSettings(@Nullable android.media.tv.tuner.filter.Settings);
+ }
+
+ public class AudioDescriptor {
+ method public byte getAdFade();
+ method public byte getAdGainCenter();
+ method public byte getAdGainFront();
+ method public byte getAdGainSurround();
+ method public byte getAdPan();
+ method public char getAdVersionTextTag();
+ }
+
+ public class AvSettings extends android.media.tv.tuner.filter.Settings {
+ method @NonNull public static android.media.tv.tuner.filter.AvSettings.Builder builder(int, boolean);
+ method public int getAudioStreamType();
+ method public int getVideoStreamType();
+ method public boolean isPassthrough();
+ field public static final int AUDIO_STREAM_TYPE_AAC = 6; // 0x6
+ field public static final int AUDIO_STREAM_TYPE_AC3 = 7; // 0x7
+ field public static final int AUDIO_STREAM_TYPE_AC4 = 9; // 0x9
+ field public static final int AUDIO_STREAM_TYPE_DRA = 15; // 0xf
+ field public static final int AUDIO_STREAM_TYPE_DTS = 10; // 0xa
+ field public static final int AUDIO_STREAM_TYPE_DTS_HD = 11; // 0xb
+ field public static final int AUDIO_STREAM_TYPE_EAC3 = 8; // 0x8
+ field public static final int AUDIO_STREAM_TYPE_MP3 = 2; // 0x2
+ field public static final int AUDIO_STREAM_TYPE_MPEG1 = 3; // 0x3
+ field public static final int AUDIO_STREAM_TYPE_MPEG2 = 4; // 0x4
+ field public static final int AUDIO_STREAM_TYPE_MPEGH = 5; // 0x5
+ field public static final int AUDIO_STREAM_TYPE_OPUS = 13; // 0xd
+ field public static final int AUDIO_STREAM_TYPE_PCM = 1; // 0x1
+ field public static final int AUDIO_STREAM_TYPE_UNDEFINED = 0; // 0x0
+ field public static final int AUDIO_STREAM_TYPE_VORBIS = 14; // 0xe
+ field public static final int AUDIO_STREAM_TYPE_WMA = 12; // 0xc
+ field public static final int VIDEO_STREAM_TYPE_AV1 = 10; // 0xa
+ field public static final int VIDEO_STREAM_TYPE_AVC = 5; // 0x5
+ field public static final int VIDEO_STREAM_TYPE_AVS = 11; // 0xb
+ field public static final int VIDEO_STREAM_TYPE_AVS2 = 12; // 0xc
+ field public static final int VIDEO_STREAM_TYPE_HEVC = 6; // 0x6
+ field public static final int VIDEO_STREAM_TYPE_MPEG1 = 2; // 0x2
+ field public static final int VIDEO_STREAM_TYPE_MPEG2 = 3; // 0x3
+ field public static final int VIDEO_STREAM_TYPE_MPEG4P2 = 4; // 0x4
+ field public static final int VIDEO_STREAM_TYPE_RESERVED = 1; // 0x1
+ field public static final int VIDEO_STREAM_TYPE_UNDEFINED = 0; // 0x0
+ field public static final int VIDEO_STREAM_TYPE_VC1 = 7; // 0x7
+ field public static final int VIDEO_STREAM_TYPE_VP8 = 8; // 0x8
+ field public static final int VIDEO_STREAM_TYPE_VP9 = 9; // 0x9
+ }
+
+ public static class AvSettings.Builder {
+ method @NonNull public android.media.tv.tuner.filter.AvSettings build();
+ method @NonNull public android.media.tv.tuner.filter.AvSettings.Builder setAudioStreamType(int);
+ method @NonNull public android.media.tv.tuner.filter.AvSettings.Builder setPassthrough(boolean);
+ method @NonNull public android.media.tv.tuner.filter.AvSettings.Builder setVideoStreamType(int);
+ }
+
+ public class DownloadEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public int getDataLength();
+ method public int getItemFragmentIndex();
+ method public int getItemId();
+ method public int getLastItemFragmentIndex();
+ method public int getMpuSequenceNumber();
+ }
+
+ public class DownloadSettings extends android.media.tv.tuner.filter.Settings {
+ method @NonNull public static android.media.tv.tuner.filter.DownloadSettings.Builder builder(int);
+ method public int getDownloadId();
+ }
+
+ public static class DownloadSettings.Builder {
+ method @NonNull public android.media.tv.tuner.filter.DownloadSettings build();
+ method @NonNull public android.media.tv.tuner.filter.DownloadSettings.Builder setDownloadId(int);
+ }
+
+ public class Filter implements java.lang.AutoCloseable {
+ method public void close();
+ method public int configure(@NonNull android.media.tv.tuner.filter.FilterConfiguration);
+ method public int flush();
+ method public int getId();
+ method public long getId64Bit();
+ method public int read(@NonNull byte[], long, long);
+ method public int setDataSource(@Nullable android.media.tv.tuner.filter.Filter);
+ method public int start();
+ method public int stop();
+ field public static final int STATUS_DATA_READY = 1; // 0x1
+ field public static final int STATUS_HIGH_WATER = 4; // 0x4
+ field public static final int STATUS_LOW_WATER = 2; // 0x2
+ field public static final int STATUS_OVERFLOW = 8; // 0x8
+ field public static final int SUBTYPE_AUDIO = 3; // 0x3
+ field public static final int SUBTYPE_DOWNLOAD = 5; // 0x5
+ field public static final int SUBTYPE_IP = 13; // 0xd
+ field public static final int SUBTYPE_IP_PAYLOAD = 12; // 0xc
+ field public static final int SUBTYPE_MMTP = 10; // 0xa
+ field public static final int SUBTYPE_NTP = 11; // 0xb
+ field public static final int SUBTYPE_PAYLOAD_THROUGH = 14; // 0xe
+ field public static final int SUBTYPE_PCR = 8; // 0x8
+ field public static final int SUBTYPE_PES = 2; // 0x2
+ field public static final int SUBTYPE_PTP = 16; // 0x10
+ field public static final int SUBTYPE_RECORD = 6; // 0x6
+ field public static final int SUBTYPE_SECTION = 1; // 0x1
+ field public static final int SUBTYPE_TEMI = 9; // 0x9
+ field public static final int SUBTYPE_TLV = 15; // 0xf
+ field public static final int SUBTYPE_TS = 7; // 0x7
+ field public static final int SUBTYPE_UNDEFINED = 0; // 0x0
+ field public static final int SUBTYPE_VIDEO = 4; // 0x4
+ field public static final int TYPE_ALP = 16; // 0x10
+ field public static final int TYPE_IP = 4; // 0x4
+ field public static final int TYPE_MMTP = 2; // 0x2
+ field public static final int TYPE_TLV = 8; // 0x8
+ field public static final int TYPE_TS = 1; // 0x1
+ field public static final int TYPE_UNDEFINED = 0; // 0x0
+ }
+
+ public interface FilterCallback {
+ method public void onFilterEvent(@NonNull android.media.tv.tuner.filter.Filter, @NonNull android.media.tv.tuner.filter.FilterEvent[]);
+ method public void onFilterStatusChanged(@NonNull android.media.tv.tuner.filter.Filter, int);
+ }
+
+ public abstract class FilterConfiguration {
+ method @Nullable public android.media.tv.tuner.filter.Settings getSettings();
+ method public abstract int getType();
+ }
+
+ public abstract class FilterEvent {
+ ctor public FilterEvent();
+ }
+
+ public final class IpFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
+ method @NonNull public static android.media.tv.tuner.filter.IpFilterConfiguration.Builder builder();
+ method @NonNull @Size(min=4, max=16) public byte[] getDstIpAddress();
+ method public int getDstPort();
+ method @IntRange(from=0, to=61439) public int getIpFilterContextId();
+ method @NonNull @Size(min=4, max=16) public byte[] getSrcIpAddress();
+ method public int getSrcPort();
+ method public int getType();
+ method public boolean isPassthrough();
+ field public static final int INVALID_IP_FILTER_CONTEXT_ID = -1; // 0xffffffff
+ }
+
+ public static final class IpFilterConfiguration.Builder {
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration build();
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setDstIpAddress(@NonNull byte[]);
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setDstPort(int);
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setIpFilterContextId(int);
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setPassthrough(boolean);
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setSettings(@Nullable android.media.tv.tuner.filter.Settings);
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setSrcIpAddress(@NonNull byte[]);
+ method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setSrcPort(int);
+ }
+
+ public class IpPayloadEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public int getDataLength();
+ }
+
+ public class MediaEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public long getAudioHandle();
+ method public long getAvDataId();
+ method public long getDataLength();
+ method @Nullable public android.media.tv.tuner.filter.AudioDescriptor getExtraMetaData();
+ method @Nullable public android.media.MediaCodec.LinearBlock getLinearBlock();
+ method public int getMpuSequenceNumber();
+ method public long getOffset();
+ method public long getPts();
+ method public int getStreamId();
+ method public boolean isPrivateData();
+ method public boolean isPtsPresent();
+ method public boolean isSecureMemory();
+ method public void release();
+ }
+
+ public final class MmtpFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
+ method @NonNull public static android.media.tv.tuner.filter.MmtpFilterConfiguration.Builder builder();
+ method public int getMmtpPacketId();
+ method public int getType();
+ }
+
+ public static final class MmtpFilterConfiguration.Builder {
+ method @NonNull public android.media.tv.tuner.filter.MmtpFilterConfiguration build();
+ method @NonNull public android.media.tv.tuner.filter.MmtpFilterConfiguration.Builder setMmtpPacketId(int);
+ method @NonNull public android.media.tv.tuner.filter.MmtpFilterConfiguration.Builder setSettings(@Nullable android.media.tv.tuner.filter.Settings);
+ }
+
+ public class MmtpRecordEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public long getDataLength();
+ method public int getFirstMbInSlice();
+ method public int getMpuSequenceNumber();
+ method public long getPts();
+ method public int getScHevcIndexMask();
+ }
+
+ public class PesEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public int getDataLength();
+ method public int getMpuSequenceNumber();
+ method public int getStreamId();
+ }
+
+ public class PesSettings extends android.media.tv.tuner.filter.Settings {
+ method @NonNull public static android.media.tv.tuner.filter.PesSettings.Builder builder(int);
+ method public int getStreamId();
+ method public boolean isRaw();
+ }
+
+ public static class PesSettings.Builder {
+ method @NonNull public android.media.tv.tuner.filter.PesSettings build();
+ method @NonNull public android.media.tv.tuner.filter.PesSettings.Builder setRaw(boolean);
+ method @NonNull public android.media.tv.tuner.filter.PesSettings.Builder setStreamId(int);
+ }
+
+ public class RecordSettings extends android.media.tv.tuner.filter.Settings {
+ method @NonNull public static android.media.tv.tuner.filter.RecordSettings.Builder builder(int);
+ method public int getScIndexMask();
+ method public int getScIndexType();
+ method public int getTsIndexMask();
+ field public static final int INDEX_TYPE_NONE = 0; // 0x0
+ field public static final int INDEX_TYPE_SC = 1; // 0x1
+ field public static final int INDEX_TYPE_SC_HEVC = 2; // 0x2
+ field public static final int SC_HEVC_INDEX_AUD = 2; // 0x2
+ field public static final int SC_HEVC_INDEX_SLICE_BLA_N_LP = 16; // 0x10
+ field public static final int SC_HEVC_INDEX_SLICE_BLA_W_RADL = 8; // 0x8
+ field public static final int SC_HEVC_INDEX_SLICE_CE_BLA_W_LP = 4; // 0x4
+ field public static final int SC_HEVC_INDEX_SLICE_IDR_N_LP = 64; // 0x40
+ field public static final int SC_HEVC_INDEX_SLICE_IDR_W_RADL = 32; // 0x20
+ field public static final int SC_HEVC_INDEX_SLICE_TRAIL_CRA = 128; // 0x80
+ field public static final int SC_HEVC_INDEX_SPS = 1; // 0x1
+ field public static final int SC_INDEX_B_FRAME = 4; // 0x4
+ field public static final int SC_INDEX_B_SLICE = 64; // 0x40
+ field public static final int SC_INDEX_I_FRAME = 1; // 0x1
+ field public static final int SC_INDEX_I_SLICE = 16; // 0x10
+ field public static final int SC_INDEX_P_FRAME = 2; // 0x2
+ field public static final int SC_INDEX_P_SLICE = 32; // 0x20
+ field public static final int SC_INDEX_SEQUENCE = 8; // 0x8
+ field public static final int SC_INDEX_SI_SLICE = 128; // 0x80
+ field public static final int SC_INDEX_SP_SLICE = 256; // 0x100
+ field public static final int TS_INDEX_ADAPTATION_EXTENSION_FLAG = 4096; // 0x1000
+ field public static final int TS_INDEX_CHANGE_TO_EVEN_SCRAMBLED = 8; // 0x8
+ field public static final int TS_INDEX_CHANGE_TO_NOT_SCRAMBLED = 4; // 0x4
+ field public static final int TS_INDEX_CHANGE_TO_ODD_SCRAMBLED = 16; // 0x10
+ field public static final int TS_INDEX_DISCONTINUITY_INDICATOR = 32; // 0x20
+ field public static final int TS_INDEX_FIRST_PACKET = 1; // 0x1
+ field public static final int TS_INDEX_OPCR_FLAG = 512; // 0x200
+ field public static final int TS_INDEX_PAYLOAD_UNIT_START_INDICATOR = 2; // 0x2
+ field public static final int TS_INDEX_PCR_FLAG = 256; // 0x100
+ field public static final int TS_INDEX_PRIORITY_INDICATOR = 128; // 0x80
+ field public static final int TS_INDEX_PRIVATE_DATA = 2048; // 0x800
+ field public static final int TS_INDEX_RANDOM_ACCESS_INDICATOR = 64; // 0x40
+ field public static final int TS_INDEX_SPLICING_POINT_FLAG = 1024; // 0x400
+ }
+
+ public static class RecordSettings.Builder {
+ method @NonNull public android.media.tv.tuner.filter.RecordSettings build();
+ method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setScIndexMask(int);
+ method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setScIndexType(int);
+ method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setTsIndexMask(int);
+ }
+
+ public class SectionEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public int getDataLength();
+ method public int getSectionNumber();
+ method public int getTableId();
+ method public int getVersion();
+ }
+
+ public abstract class SectionSettings extends android.media.tv.tuner.filter.Settings {
+ method public boolean isCrcEnabled();
+ method public boolean isRaw();
+ method public boolean isRepeat();
+ }
+
+ public abstract static class SectionSettings.Builder<T extends android.media.tv.tuner.filter.SectionSettings.Builder<T>> {
+ method @NonNull public T setCrcEnabled(boolean);
+ method @NonNull public T setRaw(boolean);
+ method @NonNull public T setRepeat(boolean);
+ }
+
+ public class SectionSettingsWithSectionBits extends android.media.tv.tuner.filter.SectionSettings {
+ method @NonNull public static android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder builder(int);
+ method @NonNull public byte[] getFilterBytes();
+ method @NonNull public byte[] getMask();
+ method @NonNull public byte[] getMode();
+ }
+
+ public static class SectionSettingsWithSectionBits.Builder extends android.media.tv.tuner.filter.SectionSettings.Builder<android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder> {
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits build();
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder setFilter(@NonNull byte[]);
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder setMask(@NonNull byte[]);
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder setMode(@NonNull byte[]);
+ }
+
+ public class SectionSettingsWithTableInfo extends android.media.tv.tuner.filter.SectionSettings {
+ method @NonNull public static android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder builder(int);
+ method public int getTableId();
+ method public int getVersion();
+ }
+
+ public static class SectionSettingsWithTableInfo.Builder extends android.media.tv.tuner.filter.SectionSettings.Builder<android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder> {
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithTableInfo build();
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder setTableId(int);
+ method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder setVersion(int);
+ }
+
+ public abstract class Settings {
+ method public int getType();
+ }
+
+ public class TemiEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method @NonNull public byte[] getDescriptorData();
+ method public byte getDescriptorTag();
+ method public long getPts();
+ }
+
+ public class TimeFilter implements java.lang.AutoCloseable {
+ method public int clearTimestamp();
+ method public void close();
+ method public long getSourceTime();
+ method public long getTimeStamp();
+ method public int setCurrentTimestamp(long);
+ }
+
+ public final class TlvFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
+ method @NonNull public static android.media.tv.tuner.filter.TlvFilterConfiguration.Builder builder();
+ method public int getPacketType();
+ method public int getType();
+ method public boolean isCompressedIpPacket();
+ method public boolean isPassthrough();
+ field public static final int PACKET_TYPE_COMPRESSED = 3; // 0x3
+ field public static final int PACKET_TYPE_IPV4 = 1; // 0x1
+ field public static final int PACKET_TYPE_IPV6 = 2; // 0x2
+ field public static final int PACKET_TYPE_NULL = 255; // 0xff
+ field public static final int PACKET_TYPE_SIGNALING = 254; // 0xfe
+ }
+
+ public static final class TlvFilterConfiguration.Builder {
+ method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration build();
+ method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setCompressedIpPacket(boolean);
+ method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setPacketType(int);
+ method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setPassthrough(boolean);
+ method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setSettings(@Nullable android.media.tv.tuner.filter.Settings);
+ }
+
+ public final class TsFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
+ method @NonNull public static android.media.tv.tuner.filter.TsFilterConfiguration.Builder builder();
+ method public int getTpid();
+ method public int getType();
+ }
+
+ public static final class TsFilterConfiguration.Builder {
+ method @NonNull public android.media.tv.tuner.filter.TsFilterConfiguration build();
+ method @NonNull public android.media.tv.tuner.filter.TsFilterConfiguration.Builder setSettings(@Nullable android.media.tv.tuner.filter.Settings);
+ method @NonNull public android.media.tv.tuner.filter.TsFilterConfiguration.Builder setTpid(int);
+ }
+
+ public class TsRecordEvent extends android.media.tv.tuner.filter.FilterEvent {
+ method public long getDataLength();
+ method public int getFirstMbInSlice();
+ method public int getPacketId();
+ method public long getPts();
+ method public int getScIndexMask();
+ method public int getTsIndexMask();
+ }
+
+}
+
+package android.media.tv.tuner.frontend {
+
+ public class AnalogFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getSifStandardCapability();
+ method public int getSignalTypeCapability();
+ }
+
+ public class AnalogFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder builder();
+ method public int getAftFlag();
+ method public int getSifStandard();
+ method public int getSignalType();
+ method public int getType();
+ field public static final int AFT_FLAG_FALSE = 2; // 0x2
+ field public static final int AFT_FLAG_TRUE = 1; // 0x1
+ field public static final int AFT_FLAG_UNDEFINED = 0; // 0x0
+ field public static final int SIF_AUTO = 1; // 0x1
+ field public static final int SIF_BG = 2; // 0x2
+ field public static final int SIF_BG_A2 = 4; // 0x4
+ field public static final int SIF_BG_NICAM = 8; // 0x8
+ field public static final int SIF_DK = 32; // 0x20
+ field public static final int SIF_DK1_A2 = 64; // 0x40
+ field public static final int SIF_DK2_A2 = 128; // 0x80
+ field public static final int SIF_DK3_A2 = 256; // 0x100
+ field public static final int SIF_DK_NICAM = 512; // 0x200
+ field public static final int SIF_I = 16; // 0x10
+ field public static final int SIF_I_NICAM = 32768; // 0x8000
+ field public static final int SIF_L = 1024; // 0x400
+ field public static final int SIF_L_NICAM = 65536; // 0x10000
+ field public static final int SIF_L_PRIME = 131072; // 0x20000
+ field public static final int SIF_M = 2048; // 0x800
+ field public static final int SIF_M_A2 = 8192; // 0x2000
+ field public static final int SIF_M_BTSC = 4096; // 0x1000
+ field public static final int SIF_M_EIAJ = 16384; // 0x4000
+ field public static final int SIF_UNDEFINED = 0; // 0x0
+ field public static final int SIGNAL_TYPE_AUTO = 1; // 0x1
+ field public static final int SIGNAL_TYPE_NTSC = 32; // 0x20
+ field public static final int SIGNAL_TYPE_NTSC_443 = 64; // 0x40
+ field public static final int SIGNAL_TYPE_PAL = 2; // 0x2
+ field public static final int SIGNAL_TYPE_PAL_60 = 16; // 0x10
+ field public static final int SIGNAL_TYPE_PAL_M = 4; // 0x4
+ field public static final int SIGNAL_TYPE_PAL_N = 8; // 0x8
+ field public static final int SIGNAL_TYPE_SECAM = 128; // 0x80
+ field public static final int SIGNAL_TYPE_UNDEFINED = 0; // 0x0
+ }
+
+ public static class AnalogFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder setAftFlag(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder setSifStandard(int);
+ method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder setSignalType(int);
+ }
+
+ public class Atsc3FrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getBandwidthCapability();
+ method public int getDemodOutputFormatCapability();
+ method public int getFecCapability();
+ method public int getModulationCapability();
+ method public int getPlpCodeRateCapability();
+ method public int getTimeInterleaveModeCapability();
+ }
+
+ public class Atsc3FrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder builder();
+ method public int getBandwidth();
+ method public int getDemodOutputFormat();
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings[] getPlpSettings();
+ method public int getType();
+ field public static final int BANDWIDTH_AUTO = 1; // 0x1
+ field public static final int BANDWIDTH_BANDWIDTH_6MHZ = 2; // 0x2
+ field public static final int BANDWIDTH_BANDWIDTH_7MHZ = 4; // 0x4
+ field public static final int BANDWIDTH_BANDWIDTH_8MHZ = 8; // 0x8
+ field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
+ field public static final int CODERATE_10_15 = 512; // 0x200
+ field public static final int CODERATE_11_15 = 1024; // 0x400
+ field public static final int CODERATE_12_15 = 2048; // 0x800
+ field public static final int CODERATE_13_15 = 4096; // 0x1000
+ field public static final int CODERATE_2_15 = 2; // 0x2
+ field public static final int CODERATE_3_15 = 4; // 0x4
+ field public static final int CODERATE_4_15 = 8; // 0x8
+ field public static final int CODERATE_5_15 = 16; // 0x10
+ field public static final int CODERATE_6_15 = 32; // 0x20
+ field public static final int CODERATE_7_15 = 64; // 0x40
+ field public static final int CODERATE_8_15 = 128; // 0x80
+ field public static final int CODERATE_9_15 = 256; // 0x100
+ field public static final int CODERATE_AUTO = 1; // 0x1
+ field public static final int CODERATE_UNDEFINED = 0; // 0x0
+ field public static final int DEMOD_OUTPUT_FORMAT_ATSC3_LINKLAYER_PACKET = 1; // 0x1
+ field public static final int DEMOD_OUTPUT_FORMAT_BASEBAND_PACKET = 2; // 0x2
+ field public static final int DEMOD_OUTPUT_FORMAT_UNDEFINED = 0; // 0x0
+ field public static final int FEC_AUTO = 1; // 0x1
+ field public static final int FEC_BCH_LDPC_16K = 2; // 0x2
+ field public static final int FEC_BCH_LDPC_64K = 4; // 0x4
+ field public static final int FEC_CRC_LDPC_16K = 8; // 0x8
+ field public static final int FEC_CRC_LDPC_64K = 16; // 0x10
+ field public static final int FEC_LDPC_16K = 32; // 0x20
+ field public static final int FEC_LDPC_64K = 64; // 0x40
+ field public static final int FEC_UNDEFINED = 0; // 0x0
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_1024QAM = 32; // 0x20
+ field public static final int MODULATION_MOD_16QAM = 4; // 0x4
+ field public static final int MODULATION_MOD_256QAM = 16; // 0x10
+ field public static final int MODULATION_MOD_4096QAM = 64; // 0x40
+ field public static final int MODULATION_MOD_64QAM = 8; // 0x8
+ field public static final int MODULATION_MOD_QPSK = 2; // 0x2
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ field public static final int TIME_INTERLEAVE_MODE_AUTO = 1; // 0x1
+ field public static final int TIME_INTERLEAVE_MODE_CTI = 2; // 0x2
+ field public static final int TIME_INTERLEAVE_MODE_HTI = 4; // 0x4
+ field public static final int TIME_INTERLEAVE_MODE_UNDEFINED = 0; // 0x0
+ }
+
+ public static class Atsc3FrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setBandwidth(int);
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setDemodOutputFormat(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setPlpSettings(@NonNull android.media.tv.tuner.frontend.Atsc3PlpSettings[]);
+ }
+
+ public class Atsc3PlpInfo {
+ method public boolean getLlsFlag();
+ method public int getPlpId();
+ }
+
+ public class Atsc3PlpSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder builder();
+ method public int getCodeRate();
+ method public int getFec();
+ method public int getInterleaveMode();
+ method public int getModulation();
+ method public int getPlpId();
+ }
+
+ public static class Atsc3PlpSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setCodeRate(int);
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setFec(int);
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setInterleaveMode(int);
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setPlpId(int);
+ }
+
+ public class AtscFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getModulationCapability();
+ }
+
+ public class AtscFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.AtscFrontendSettings.Builder builder();
+ method public int getModulation();
+ method public int getType();
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_16VSB = 8; // 0x8
+ field public static final int MODULATION_MOD_8VSB = 4; // 0x4
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ }
+
+ public static class AtscFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.AtscFrontendSettings build();
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.AtscFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.AtscFrontendSettings.Builder setModulation(int);
+ }
+
+ public final class DtmbFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getBandwidthCapability();
+ method public int getCodeRateCapability();
+ method public int getGuardIntervalCapability();
+ method public int getModulationCapability();
+ method public int getTimeInterleaveModeCapability();
+ method public int getTransmissionModeCapability();
+ }
+
+ public final class DtmbFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder builder();
+ method public int getBandwidth();
+ method public int getCodeRate();
+ method public int getGuardInterval();
+ method public int getModulation();
+ method public int getTimeInterleaveMode();
+ method public int getTransmissionMode();
+ method public int getType();
+ field public static final int BANDWIDTH_6MHZ = 4; // 0x4
+ field public static final int BANDWIDTH_8MHZ = 2; // 0x2
+ field public static final int BANDWIDTH_AUTO = 1; // 0x1
+ field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
+ field public static final int CODERATE_2_5 = 2; // 0x2
+ field public static final int CODERATE_3_5 = 4; // 0x4
+ field public static final int CODERATE_4_5 = 8; // 0x8
+ field public static final int CODERATE_AUTO = 1; // 0x1
+ field public static final int CODERATE_UNDEFINED = 0; // 0x0
+ field public static final int GUARD_INTERVAL_AUTO = 1; // 0x1
+ field public static final int GUARD_INTERVAL_PN_420_CONST = 16; // 0x10
+ field public static final int GUARD_INTERVAL_PN_420_VARIOUS = 2; // 0x2
+ field public static final int GUARD_INTERVAL_PN_595_CONST = 4; // 0x4
+ field public static final int GUARD_INTERVAL_PN_945_CONST = 32; // 0x20
+ field public static final int GUARD_INTERVAL_PN_945_VARIOUS = 8; // 0x8
+ field public static final int GUARD_INTERVAL_PN_RESERVED = 64; // 0x40
+ field public static final int GUARD_INTERVAL_UNDEFINED = 0; // 0x0
+ field public static final int MODULATION_CONSTELLATION_16QAM = 8; // 0x8
+ field public static final int MODULATION_CONSTELLATION_32QAM = 16; // 0x10
+ field public static final int MODULATION_CONSTELLATION_4QAM = 2; // 0x2
+ field public static final int MODULATION_CONSTELLATION_4QAM_NR = 4; // 0x4
+ field public static final int MODULATION_CONSTELLATION_64QAM = 32; // 0x20
+ field public static final int MODULATION_CONSTELLATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_CONSTELLATION_UNDEFINED = 0; // 0x0
+ field public static final int TIME_INTERLEAVE_MODE_AUTO = 1; // 0x1
+ field public static final int TIME_INTERLEAVE_MODE_TIMER_INT_240 = 2; // 0x2
+ field public static final int TIME_INTERLEAVE_MODE_TIMER_INT_720 = 4; // 0x4
+ field public static final int TIME_INTERLEAVE_MODE_UNDEFINED = 0; // 0x0
+ field public static final int TRANSMISSION_MODE_AUTO = 1; // 0x1
+ field public static final int TRANSMISSION_MODE_C1 = 2; // 0x2
+ field public static final int TRANSMISSION_MODE_C3780 = 4; // 0x4
+ field public static final int TRANSMISSION_MODE_UNDEFINED = 0; // 0x0
+ }
+
+ public static final class DtmbFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setBandwidth(int);
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setCodeRate(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setGuardInterval(int);
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setTimeInterleaveMode(int);
+ method @NonNull public android.media.tv.tuner.frontend.DtmbFrontendSettings.Builder setTransmissionMode(int);
+ }
+
+ public class DvbcFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getAnnexCapability();
+ method public int getFecCapability();
+ method public int getModulationCapability();
+ }
+
+ public class DvbcFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder builder();
+ method public int getAnnex();
+ method public int getBandwidth();
+ method public long getInnerFec();
+ method public int getModulation();
+ method public int getOuterFec();
+ method public int getSpectralInversion();
+ method public int getSymbolRate();
+ method public int getTimeInterleaveMode();
+ method public int getType();
+ field public static final int ANNEX_A = 1; // 0x1
+ field public static final int ANNEX_B = 2; // 0x2
+ field public static final int ANNEX_C = 4; // 0x4
+ field public static final int ANNEX_UNDEFINED = 0; // 0x0
+ field public static final int BANDWIDTH_5MHZ = 1; // 0x1
+ field public static final int BANDWIDTH_6MHZ = 2; // 0x2
+ field public static final int BANDWIDTH_7MHZ = 4; // 0x4
+ field public static final int BANDWIDTH_8MHZ = 8; // 0x8
+ field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_128QAM = 16; // 0x10
+ field public static final int MODULATION_MOD_16QAM = 2; // 0x2
+ field public static final int MODULATION_MOD_256QAM = 32; // 0x20
+ field public static final int MODULATION_MOD_32QAM = 4; // 0x4
+ field public static final int MODULATION_MOD_64QAM = 8; // 0x8
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ field public static final int OUTER_FEC_OUTER_FEC_NONE = 1; // 0x1
+ field public static final int OUTER_FEC_OUTER_FEC_RS = 2; // 0x2
+ field public static final int OUTER_FEC_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int SPECTRAL_INVERSION_INVERTED = 2; // 0x2
+ field @Deprecated public static final int SPECTRAL_INVERSION_NORMAL = 1; // 0x1
+ field @Deprecated public static final int SPECTRAL_INVERSION_UNDEFINED = 0; // 0x0
+ field public static final int TIME_INTERLEAVE_MODE_128_1_0 = 2; // 0x2
+ field public static final int TIME_INTERLEAVE_MODE_128_1_1 = 4; // 0x4
+ field public static final int TIME_INTERLEAVE_MODE_128_2 = 128; // 0x80
+ field public static final int TIME_INTERLEAVE_MODE_128_3 = 256; // 0x100
+ field public static final int TIME_INTERLEAVE_MODE_128_4 = 512; // 0x200
+ field public static final int TIME_INTERLEAVE_MODE_16_8 = 32; // 0x20
+ field public static final int TIME_INTERLEAVE_MODE_32_4 = 16; // 0x10
+ field public static final int TIME_INTERLEAVE_MODE_64_2 = 8; // 0x8
+ field public static final int TIME_INTERLEAVE_MODE_8_16 = 64; // 0x40
+ field public static final int TIME_INTERLEAVE_MODE_AUTO = 1; // 0x1
+ field public static final int TIME_INTERLEAVE_MODE_UNDEFINED = 0; // 0x0
+ }
+
+ public static class DvbcFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setAnnex(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setBandwidth(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setInnerFec(long);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setOuterFec(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setSpectralInversion(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setSymbolRate(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setTimeInterleaveMode(int);
+ }
+
+ public class DvbsCodeRate {
+ method @NonNull public static android.media.tv.tuner.frontend.DvbsCodeRate.Builder builder();
+ method public int getBitsPer1000Symbol();
+ method public long getInnerFec();
+ method public boolean isLinear();
+ method public boolean isShortFrameEnabled();
+ }
+
+ public static class DvbsCodeRate.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate build();
+ method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setBitsPer1000Symbol(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setInnerFec(long);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setLinear(boolean);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setShortFrameEnabled(boolean);
+ }
+
+ public class DvbsFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public long getInnerFecCapability();
+ method public int getModulationCapability();
+ method public int getStandardCapability();
+ }
+
+ public class DvbsFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder builder();
+ method @Nullable public android.media.tv.tuner.frontend.DvbsCodeRate getCodeRate();
+ method public boolean getCouldHandleDiseqcRxMessage();
+ method public int getInputStreamId();
+ method public int getModulation();
+ method public int getPilot();
+ method public int getRolloff();
+ method public int getScanType();
+ method public int getStandard();
+ method public int getSymbolRate();
+ method public int getType();
+ method public int getVcmMode();
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_128APSK = 2048; // 0x800
+ field public static final int MODULATION_MOD_16APSK = 256; // 0x100
+ field public static final int MODULATION_MOD_16PSK = 16; // 0x10
+ field public static final int MODULATION_MOD_16QAM = 8; // 0x8
+ field public static final int MODULATION_MOD_256APSK = 4096; // 0x1000
+ field public static final int MODULATION_MOD_32APSK = 512; // 0x200
+ field public static final int MODULATION_MOD_32PSK = 32; // 0x20
+ field public static final int MODULATION_MOD_64APSK = 1024; // 0x400
+ field public static final int MODULATION_MOD_8APSK = 128; // 0x80
+ field public static final int MODULATION_MOD_8PSK = 4; // 0x4
+ field public static final int MODULATION_MOD_ACM = 64; // 0x40
+ field public static final int MODULATION_MOD_QPSK = 2; // 0x2
+ field public static final int MODULATION_MOD_RESERVED = 8192; // 0x2000
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ field public static final int PILOT_AUTO = 3; // 0x3
+ field public static final int PILOT_OFF = 2; // 0x2
+ field public static final int PILOT_ON = 1; // 0x1
+ field public static final int PILOT_UNDEFINED = 0; // 0x0
+ field public static final int ROLLOFF_0_10 = 5; // 0x5
+ field public static final int ROLLOFF_0_15 = 4; // 0x4
+ field public static final int ROLLOFF_0_20 = 3; // 0x3
+ field public static final int ROLLOFF_0_25 = 2; // 0x2
+ field public static final int ROLLOFF_0_35 = 1; // 0x1
+ field public static final int ROLLOFF_0_5 = 6; // 0x6
+ field public static final int ROLLOFF_UNDEFINED = 0; // 0x0
+ field public static final int SCAN_TYPE_DIRECT = 1; // 0x1
+ field public static final int SCAN_TYPE_DISEQC = 2; // 0x2
+ field public static final int SCAN_TYPE_JESS = 4; // 0x4
+ field public static final int SCAN_TYPE_UNDEFINED = 0; // 0x0
+ field public static final int SCAN_TYPE_UNICABLE = 3; // 0x3
+ field public static final int STANDARD_AUTO = 1; // 0x1
+ field public static final int STANDARD_S = 2; // 0x2
+ field public static final int STANDARD_S2 = 4; // 0x4
+ field public static final int STANDARD_S2X = 8; // 0x8
+ field public static final int VCM_MODE_AUTO = 1; // 0x1
+ field public static final int VCM_MODE_MANUAL = 2; // 0x2
+ field public static final int VCM_MODE_UNDEFINED = 0; // 0x0
+ }
+
+ public static class DvbsFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setCodeRate(@Nullable android.media.tv.tuner.frontend.DvbsCodeRate);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setCouldHandleDiseqcRxMessage(boolean);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setInputStreamId(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setPilot(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setRolloff(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setScanType(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setStandard(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setSymbolRate(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setVcmMode(int);
+ }
+
+ public class DvbtFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getBandwidthCapability();
+ method public int getCodeRateCapability();
+ method public int getConstellationCapability();
+ method public int getGuardIntervalCapability();
+ method public int getHierarchyCapability();
+ method public int getTransmissionModeCapability();
+ method public boolean isMisoSupported();
+ method public boolean isT2Supported();
+ }
+
+ public class DvbtFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder builder();
+ method public int getBandwidth();
+ method public int getConstellation();
+ method public int getGuardInterval();
+ method public int getHierarchy();
+ method public int getHighPriorityCodeRate();
+ method public int getLowPriorityCodeRate();
+ method public int getPlpGroupId();
+ method public int getPlpId();
+ method public int getPlpMode();
+ method public int getStandard();
+ method public int getTransmissionMode();
+ method public int getType();
+ method public boolean isHighPriority();
+ method public boolean isMiso();
+ field public static final int BANDWIDTH_10MHZ = 64; // 0x40
+ field public static final int BANDWIDTH_1_7MHZ = 32; // 0x20
+ field public static final int BANDWIDTH_5MHZ = 16; // 0x10
+ field public static final int BANDWIDTH_6MHZ = 8; // 0x8
+ field public static final int BANDWIDTH_7MHZ = 4; // 0x4
+ field public static final int BANDWIDTH_8MHZ = 2; // 0x2
+ field public static final int BANDWIDTH_AUTO = 1; // 0x1
+ field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
+ field public static final int CODERATE_1_2 = 2; // 0x2
+ field public static final int CODERATE_2_3 = 4; // 0x4
+ field public static final int CODERATE_3_4 = 8; // 0x8
+ field public static final int CODERATE_3_5 = 64; // 0x40
+ field public static final int CODERATE_4_5 = 128; // 0x80
+ field public static final int CODERATE_5_6 = 16; // 0x10
+ field public static final int CODERATE_6_7 = 256; // 0x100
+ field public static final int CODERATE_7_8 = 32; // 0x20
+ field public static final int CODERATE_8_9 = 512; // 0x200
+ field public static final int CODERATE_AUTO = 1; // 0x1
+ field public static final int CODERATE_UNDEFINED = 0; // 0x0
+ field public static final int CONSTELLATION_16QAM = 4; // 0x4
+ field public static final int CONSTELLATION_16QAM_R = 64; // 0x40
+ field public static final int CONSTELLATION_256QAM = 16; // 0x10
+ field public static final int CONSTELLATION_256QAM_R = 256; // 0x100
+ field public static final int CONSTELLATION_64QAM = 8; // 0x8
+ field public static final int CONSTELLATION_64QAM_R = 128; // 0x80
+ field public static final int CONSTELLATION_AUTO = 1; // 0x1
+ field public static final int CONSTELLATION_QPSK = 2; // 0x2
+ field public static final int CONSTELLATION_QPSK_R = 32; // 0x20
+ field public static final int CONSTELLATION_UNDEFINED = 0; // 0x0
+ field public static final int GUARD_INTERVAL_19_128 = 64; // 0x40
+ field public static final int GUARD_INTERVAL_19_256 = 128; // 0x80
+ field public static final int GUARD_INTERVAL_1_128 = 32; // 0x20
+ field public static final int GUARD_INTERVAL_1_16 = 4; // 0x4
+ field public static final int GUARD_INTERVAL_1_32 = 2; // 0x2
+ field public static final int GUARD_INTERVAL_1_4 = 16; // 0x10
+ field public static final int GUARD_INTERVAL_1_8 = 8; // 0x8
+ field public static final int GUARD_INTERVAL_AUTO = 1; // 0x1
+ field public static final int GUARD_INTERVAL_UNDEFINED = 0; // 0x0
+ field public static final int HIERARCHY_1_INDEPTH = 64; // 0x40
+ field public static final int HIERARCHY_1_NATIVE = 4; // 0x4
+ field public static final int HIERARCHY_2_INDEPTH = 128; // 0x80
+ field public static final int HIERARCHY_2_NATIVE = 8; // 0x8
+ field public static final int HIERARCHY_4_INDEPTH = 256; // 0x100
+ field public static final int HIERARCHY_4_NATIVE = 16; // 0x10
+ field public static final int HIERARCHY_AUTO = 1; // 0x1
+ field public static final int HIERARCHY_NON_INDEPTH = 32; // 0x20
+ field public static final int HIERARCHY_NON_NATIVE = 2; // 0x2
+ field public static final int HIERARCHY_UNDEFINED = 0; // 0x0
+ field public static final int PLP_MODE_AUTO = 1; // 0x1
+ field public static final int PLP_MODE_MANUAL = 2; // 0x2
+ field public static final int PLP_MODE_UNDEFINED = 0; // 0x0
+ field public static final int STANDARD_AUTO = 1; // 0x1
+ field public static final int STANDARD_T = 2; // 0x2
+ field public static final int STANDARD_T2 = 4; // 0x4
+ field public static final int TRANSMISSION_MODE_16K = 32; // 0x20
+ field public static final int TRANSMISSION_MODE_1K = 16; // 0x10
+ field public static final int TRANSMISSION_MODE_2K = 2; // 0x2
+ field public static final int TRANSMISSION_MODE_32K = 64; // 0x40
+ field public static final int TRANSMISSION_MODE_4K = 8; // 0x8
+ field public static final int TRANSMISSION_MODE_8K = 4; // 0x4
+ field public static final int TRANSMISSION_MODE_AUTO = 1; // 0x1
+ field public static final int TRANSMISSION_MODE_EXTENDED_16K = 256; // 0x100
+ field public static final int TRANSMISSION_MODE_EXTENDED_32K = 512; // 0x200
+ field public static final int TRANSMISSION_MODE_EXTENDED_8K = 128; // 0x80
+ field public static final int TRANSMISSION_MODE_UNDEFINED = 0; // 0x0
+ }
+
+ public static class DvbtFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setBandwidth(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setConstellation(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setGuardInterval(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setHierarchy(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setHighPriority(boolean);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setHighPriorityCodeRate(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setLowPriorityCodeRate(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setMiso(boolean);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setPlpGroupId(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setPlpId(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setPlpMode(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setStandard(int);
+ method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setTransmissionMode(int);
+ }
+
+ public abstract class FrontendCapabilities {
+ ctor public FrontendCapabilities();
+ }
+
+ public class FrontendInfo {
+ method public int getAcquireRange();
+ method public int getExclusiveGroupId();
+ method @NonNull public android.util.Range<java.lang.Integer> getFrequencyRange();
+ method @NonNull public android.media.tv.tuner.frontend.FrontendCapabilities getFrontendCapabilities();
+ method public int getId();
+ method @NonNull public int[] getStatusCapabilities();
+ method @NonNull public android.util.Range<java.lang.Integer> getSymbolRateRange();
+ method public int getType();
+ }
+
+ public abstract class FrontendSettings {
+ method @IntRange(from=1) public int getEndFrequency();
+ method public int getFrequency();
+ method public int getFrontendSpectralInversion();
+ method public abstract int getType();
+ method @IntRange(from=1) public void setEndFrequency(int);
+ method public void setSpectralInversion(int);
+ field public static final long FEC_11_15 = 4194304L; // 0x400000L
+ field public static final long FEC_11_20 = 8388608L; // 0x800000L
+ field public static final long FEC_11_45 = 16777216L; // 0x1000000L
+ field public static final long FEC_13_18 = 33554432L; // 0x2000000L
+ field public static final long FEC_13_45 = 67108864L; // 0x4000000L
+ field public static final long FEC_14_45 = 134217728L; // 0x8000000L
+ field public static final long FEC_1_2 = 2L; // 0x2L
+ field public static final long FEC_1_3 = 4L; // 0x4L
+ field public static final long FEC_1_4 = 8L; // 0x8L
+ field public static final long FEC_1_5 = 16L; // 0x10L
+ field public static final long FEC_23_36 = 268435456L; // 0x10000000L
+ field public static final long FEC_25_36 = 536870912L; // 0x20000000L
+ field public static final long FEC_26_45 = 1073741824L; // 0x40000000L
+ field public static final long FEC_28_45 = -2147483648L; // 0xffffffff80000000L
+ field public static final long FEC_29_45 = 1L; // 0x1L
+ field public static final long FEC_2_3 = 32L; // 0x20L
+ field public static final long FEC_2_5 = 64L; // 0x40L
+ field public static final long FEC_2_9 = 128L; // 0x80L
+ field public static final long FEC_31_45 = 2L; // 0x2L
+ field public static final long FEC_32_45 = 4L; // 0x4L
+ field public static final long FEC_3_4 = 256L; // 0x100L
+ field public static final long FEC_3_5 = 512L; // 0x200L
+ field public static final long FEC_4_15 = 2048L; // 0x800L
+ field public static final long FEC_4_5 = 1024L; // 0x400L
+ field public static final long FEC_5_6 = 4096L; // 0x1000L
+ field public static final long FEC_5_9 = 8192L; // 0x2000L
+ field public static final long FEC_6_7 = 16384L; // 0x4000L
+ field public static final long FEC_77_90 = 8L; // 0x8L
+ field public static final long FEC_7_15 = 131072L; // 0x20000L
+ field public static final long FEC_7_8 = 32768L; // 0x8000L
+ field public static final long FEC_7_9 = 65536L; // 0x10000L
+ field public static final long FEC_8_15 = 524288L; // 0x80000L
+ field public static final long FEC_8_9 = 262144L; // 0x40000L
+ field public static final long FEC_9_10 = 1048576L; // 0x100000L
+ field public static final long FEC_9_20 = 2097152L; // 0x200000L
+ field public static final long FEC_AUTO = 1L; // 0x1L
+ field public static final long FEC_UNDEFINED = 0L; // 0x0L
+ field public static final int FRONTEND_SPECTRAL_INVERSION_INVERTED = 2; // 0x2
+ field public static final int FRONTEND_SPECTRAL_INVERSION_NORMAL = 1; // 0x1
+ field public static final int FRONTEND_SPECTRAL_INVERSION_UNDEFINED = 0; // 0x0
+ field public static final int TYPE_ANALOG = 1; // 0x1
+ field public static final int TYPE_ATSC = 2; // 0x2
+ field public static final int TYPE_ATSC3 = 3; // 0x3
+ field public static final int TYPE_DTMB = 10; // 0xa
+ field public static final int TYPE_DVBC = 4; // 0x4
+ field public static final int TYPE_DVBS = 5; // 0x5
+ field public static final int TYPE_DVBT = 6; // 0x6
+ field public static final int TYPE_ISDBS = 7; // 0x7
+ field public static final int TYPE_ISDBS3 = 8; // 0x8
+ field public static final int TYPE_ISDBT = 9; // 0x9
+ field public static final int TYPE_UNDEFINED = 0; // 0x0
+ }
+
+ public class FrontendStatus {
+ method public int getAgc();
+ method @NonNull public android.media.tv.tuner.frontend.FrontendStatus.Atsc3PlpTuningInfo[] getAtsc3PlpTuningInfo();
+ method public int getBandwidth();
+ method public int getBer();
+ method @NonNull public int[] getBers();
+ method @NonNull public int[] getCodeRates();
+ method @NonNull public int[] getExtendedModulations();
+ method public int getFreqOffset();
+ method public int getGuardInterval();
+ method public int getHierarchy();
+ method public long getInnerFec();
+ method @NonNull public int[] getInterleaving();
+ method @IntRange(from=0, to=255) @NonNull public int[] getIsdbtSegment();
+ method @NonNull public boolean[] getLayerErrors();
+ method public int getLnbVoltage();
+ method public int getMer();
+ method public int getModulation();
+ method public int getPer();
+ method public int getPerBer();
+ method public int getPlpId();
+ method public int getSignalQuality();
+ method public int getSignalStrength();
+ method public int getSnr();
+ method public int getSpectralInversion();
+ method public int getSymbolRate();
+ method @IntRange(from=0, to=65535) public int getSystemId();
+ method public int getTransmissionMode();
+ method @NonNull public int[] getTsDataRate();
+ method public int getUec();
+ method public boolean isDemodLocked();
+ method public boolean isEwbs();
+ method public boolean isLnaOn();
+ method public boolean isRfLocked();
+ field public static final int FRONTEND_STATUS_TYPE_AGC = 14; // 0xe
+ field public static final int FRONTEND_STATUS_TYPE_ATSC3_PLP_INFO = 21; // 0x15
+ field public static final int FRONTEND_STATUS_TYPE_BANDWIDTH = 25; // 0x19
+ field public static final int FRONTEND_STATUS_TYPE_BER = 2; // 0x2
+ field public static final int FRONTEND_STATUS_TYPE_BERS = 23; // 0x17
+ field public static final int FRONTEND_STATUS_TYPE_CODERATES = 24; // 0x18
+ field public static final int FRONTEND_STATUS_TYPE_DEMOD_LOCK = 0; // 0x0
+ field public static final int FRONTEND_STATUS_TYPE_EWBS = 13; // 0xd
+ field public static final int FRONTEND_STATUS_TYPE_FEC = 8; // 0x8
+ field public static final int FRONTEND_STATUS_TYPE_FREQ_OFFSET = 18; // 0x12
+ field public static final int FRONTEND_STATUS_TYPE_GUARD_INTERVAL = 26; // 0x1a
+ field public static final int FRONTEND_STATUS_TYPE_HIERARCHY = 19; // 0x13
+ field public static final int FRONTEND_STATUS_TYPE_INTERLEAVINGS = 30; // 0x1e
+ field public static final int FRONTEND_STATUS_TYPE_ISDBT_SEGMENTS = 31; // 0x1f
+ field public static final int FRONTEND_STATUS_TYPE_LAYER_ERROR = 16; // 0x10
+ field public static final int FRONTEND_STATUS_TYPE_LNA = 15; // 0xf
+ field public static final int FRONTEND_STATUS_TYPE_LNB_VOLTAGE = 11; // 0xb
+ field public static final int FRONTEND_STATUS_TYPE_MER = 17; // 0x11
+ field public static final int FRONTEND_STATUS_TYPE_MODULATION = 9; // 0x9
+ field public static final int FRONTEND_STATUS_TYPE_MODULATIONS_EXT = 22; // 0x16
+ field public static final int FRONTEND_STATUS_TYPE_PER = 3; // 0x3
+ field public static final int FRONTEND_STATUS_TYPE_PLP_ID = 12; // 0xc
+ field public static final int FRONTEND_STATUS_TYPE_PRE_BER = 4; // 0x4
+ field public static final int FRONTEND_STATUS_TYPE_RF_LOCK = 20; // 0x14
+ field public static final int FRONTEND_STATUS_TYPE_SIGNAL_QUALITY = 5; // 0x5
+ field public static final int FRONTEND_STATUS_TYPE_SIGNAL_STRENGTH = 6; // 0x6
+ field public static final int FRONTEND_STATUS_TYPE_SNR = 1; // 0x1
+ field public static final int FRONTEND_STATUS_TYPE_SPECTRAL = 10; // 0xa
+ field public static final int FRONTEND_STATUS_TYPE_SYMBOL_RATE = 7; // 0x7
+ field public static final int FRONTEND_STATUS_TYPE_T2_SYSTEM_ID = 29; // 0x1d
+ field public static final int FRONTEND_STATUS_TYPE_TRANSMISSION_MODE = 27; // 0x1b
+ field public static final int FRONTEND_STATUS_TYPE_TS_DATA_RATES = 32; // 0x20
+ field public static final int FRONTEND_STATUS_TYPE_UEC = 28; // 0x1c
+ }
+
+ public static class FrontendStatus.Atsc3PlpTuningInfo {
+ method public int getPlpId();
+ method public int getUec();
+ method public boolean isLocked();
+ }
+
+ public class Isdbs3FrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getCodeRateCapability();
+ method public int getModulationCapability();
+ }
+
+ public class Isdbs3FrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder builder();
+ method public int getCodeRate();
+ method public int getModulation();
+ method public int getRolloff();
+ method public int getStreamId();
+ method public int getStreamIdType();
+ method public int getSymbolRate();
+ method public int getType();
+ field public static final int CODERATE_1_2 = 8; // 0x8
+ field public static final int CODERATE_1_3 = 2; // 0x2
+ field public static final int CODERATE_2_3 = 32; // 0x20
+ field public static final int CODERATE_2_5 = 4; // 0x4
+ field public static final int CODERATE_3_4 = 64; // 0x40
+ field public static final int CODERATE_3_5 = 16; // 0x10
+ field public static final int CODERATE_4_5 = 256; // 0x100
+ field public static final int CODERATE_5_6 = 512; // 0x200
+ field public static final int CODERATE_7_8 = 1024; // 0x400
+ field public static final int CODERATE_7_9 = 128; // 0x80
+ field public static final int CODERATE_9_10 = 2048; // 0x800
+ field public static final int CODERATE_AUTO = 1; // 0x1
+ field public static final int CODERATE_UNDEFINED = 0; // 0x0
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_16APSK = 16; // 0x10
+ field public static final int MODULATION_MOD_32APSK = 32; // 0x20
+ field public static final int MODULATION_MOD_8PSK = 8; // 0x8
+ field public static final int MODULATION_MOD_BPSK = 2; // 0x2
+ field public static final int MODULATION_MOD_QPSK = 4; // 0x4
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ field public static final int ROLLOFF_0_03 = 1; // 0x1
+ field public static final int ROLLOFF_UNDEFINED = 0; // 0x0
+ }
+
+ public static class Isdbs3FrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setCodeRate(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setRolloff(int);
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setStreamId(int);
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setStreamIdType(int);
+ method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setSymbolRate(int);
+ }
+
+ public class IsdbsFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getCodeRateCapability();
+ method public int getModulationCapability();
+ }
+
+ public class IsdbsFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder builder();
+ method public int getCodeRate();
+ method public int getModulation();
+ method public int getRolloff();
+ method public int getStreamId();
+ method public int getStreamIdType();
+ method public int getSymbolRate();
+ method public int getType();
+ field public static final int CODERATE_1_2 = 2; // 0x2
+ field public static final int CODERATE_2_3 = 4; // 0x4
+ field public static final int CODERATE_3_4 = 8; // 0x8
+ field public static final int CODERATE_5_6 = 16; // 0x10
+ field public static final int CODERATE_7_8 = 32; // 0x20
+ field public static final int CODERATE_AUTO = 1; // 0x1
+ field public static final int CODERATE_UNDEFINED = 0; // 0x0
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_BPSK = 2; // 0x2
+ field public static final int MODULATION_MOD_QPSK = 4; // 0x4
+ field public static final int MODULATION_MOD_TC8PSK = 8; // 0x8
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ field public static final int ROLLOFF_0_35 = 1; // 0x1
+ field public static final int ROLLOFF_UNDEFINED = 0; // 0x0
+ field public static final int STREAM_ID_TYPE_ID = 0; // 0x0
+ field public static final int STREAM_ID_TYPE_RELATIVE_NUMBER = 1; // 0x1
+ }
+
+ public static class IsdbsFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setCodeRate(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setRolloff(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setStreamId(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setStreamIdType(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setSymbolRate(int);
+ }
+
+ public class IsdbtFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
+ method public int getBandwidthCapability();
+ method public int getCodeRateCapability();
+ method public int getGuardIntervalCapability();
+ method public int getModeCapability();
+ method public int getModulationCapability();
+ }
+
+ public class IsdbtFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
+ method @NonNull public static android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder builder();
+ method public int getBandwidth();
+ method public int getCodeRate();
+ method public int getGuardInterval();
+ method public int getMode();
+ method public int getModulation();
+ method public int getServiceAreaId();
+ method public int getType();
+ field public static final int BANDWIDTH_6MHZ = 8; // 0x8
+ field public static final int BANDWIDTH_7MHZ = 4; // 0x4
+ field public static final int BANDWIDTH_8MHZ = 2; // 0x2
+ field public static final int BANDWIDTH_AUTO = 1; // 0x1
+ field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
+ field public static final int MODE_1 = 2; // 0x2
+ field public static final int MODE_2 = 4; // 0x4
+ field public static final int MODE_3 = 8; // 0x8
+ field public static final int MODE_AUTO = 1; // 0x1
+ field public static final int MODE_UNDEFINED = 0; // 0x0
+ field public static final int MODULATION_AUTO = 1; // 0x1
+ field public static final int MODULATION_MOD_16QAM = 8; // 0x8
+ field public static final int MODULATION_MOD_64QAM = 16; // 0x10
+ field public static final int MODULATION_MOD_DQPSK = 2; // 0x2
+ field public static final int MODULATION_MOD_QPSK = 4; // 0x4
+ field public static final int MODULATION_UNDEFINED = 0; // 0x0
+ }
+
+ public static class IsdbtFrontendSettings.Builder {
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setBandwidth(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setCodeRate(int);
+ method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setFrequency(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setGuardInterval(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setMode(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setModulation(int);
+ method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setServiceAreaId(int);
+ }
+
+ public interface OnTuneEventListener {
+ method public void onTuneEvent(int);
+ field public static final int SIGNAL_LOCKED = 0; // 0x0
+ field public static final int SIGNAL_LOST_LOCK = 2; // 0x2
+ field public static final int SIGNAL_NO_SIGNAL = 1; // 0x1
+ }
+
+ public interface ScanCallback {
+ method public void onAnalogSifStandardReported(int);
+ method public void onAtsc3PlpInfosReported(@NonNull android.media.tv.tuner.frontend.Atsc3PlpInfo[]);
+ method public default void onDvbcAnnexReported(int);
+ method public void onDvbsStandardReported(int);
+ method public void onDvbtStandardReported(int);
+ method public void onFrequenciesReported(@NonNull int[]);
+ method public void onGroupIdsReported(@NonNull int[]);
+ method public void onHierarchyReported(int);
+ method public void onInputStreamIdsReported(@NonNull int[]);
+ method public void onLocked();
+ method public default void onModulationReported(int);
+ method public void onPlpIdsReported(@NonNull int[]);
+ method public default void onPriorityReported(boolean);
+ method public void onProgress(@IntRange(from=0, to=100) int);
+ method public void onScanStopped();
+ method public void onSignalTypeReported(int);
+ method public void onSymbolRatesReported(@NonNull int[]);
+ }
+
+}
+
+package android.media.voice {
+
+ public final class KeyphraseModelManager {
+ method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void deleteKeyphraseSoundModel(int, @NonNull java.util.Locale);
+ method @Nullable @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int, @NonNull java.util.Locale);
+ method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void updateKeyphraseSoundModel(@NonNull android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel);
+ }
+
+}
+
+package android.metrics {
+
+ public class LogMaker {
+ ctor public LogMaker(int);
+ ctor public LogMaker(Object[]);
+ method public android.metrics.LogMaker addTaggedData(int, Object);
+ method public android.metrics.LogMaker clearCategory();
+ method public android.metrics.LogMaker clearPackageName();
+ method public android.metrics.LogMaker clearSubtype();
+ method public android.metrics.LogMaker clearTaggedData(int);
+ method public android.metrics.LogMaker clearType();
+ method public void deserialize(Object[]);
+ method public int getCategory();
+ method public long getCounterBucket();
+ method public String getCounterName();
+ method public int getCounterValue();
+ method public String getPackageName();
+ method public int getProcessId();
+ method public int getSubtype();
+ method public Object getTaggedData(int);
+ method public long getTimestamp();
+ method public int getType();
+ method public int getUid();
+ method public boolean isLongCounterBucket();
+ method public boolean isSubsetOf(android.metrics.LogMaker);
+ method public boolean isValidValue(Object);
+ method public Object[] serialize();
+ method public android.metrics.LogMaker setCategory(int);
+ method public android.metrics.LogMaker setPackageName(String);
+ method public android.metrics.LogMaker setSubtype(int);
+ method public android.metrics.LogMaker setType(int);
+ }
+
+ public class MetricsReader {
+ ctor public MetricsReader();
+ method public void checkpoint();
+ method public boolean hasNext();
+ method public android.metrics.LogMaker next();
+ method public void read(long);
+ method public void reset();
+ }
+
+}
+
+package android.net {
+
+ public class CaptivePortal implements android.os.Parcelable {
+ method public void logEvent(int, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork();
+ method public void useNetwork();
+ field public static final int APP_REQUEST_REEVALUATION_REQUIRED = 100; // 0x64
+ field public static final int APP_RETURN_DISMISSED = 0; // 0x0
+ field public static final int APP_RETURN_UNWANTED = 1; // 0x1
+ field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
+ }
+
+ public final class CaptivePortalData implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getByteLimit();
+ method public long getExpiryTimeMillis();
+ method public long getRefreshTimeMillis();
+ method @Nullable public android.net.Uri getUserPortalUrl();
+ method @Nullable public android.net.Uri getVenueInfoUrl();
+ method public boolean isCaptive();
+ method public boolean isSessionExtendable();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.CaptivePortalData> CREATOR;
+ }
+
+ public static class CaptivePortalData.Builder {
+ ctor public CaptivePortalData.Builder();
+ ctor public CaptivePortalData.Builder(@Nullable android.net.CaptivePortalData);
+ method @NonNull public android.net.CaptivePortalData build();
+ method @NonNull public android.net.CaptivePortalData.Builder setBytesRemaining(long);
+ method @NonNull public android.net.CaptivePortalData.Builder setCaptive(boolean);
+ method @NonNull public android.net.CaptivePortalData.Builder setExpiryTime(long);
+ method @NonNull public android.net.CaptivePortalData.Builder setRefreshTime(long);
+ method @NonNull public android.net.CaptivePortalData.Builder setSessionExtendable(boolean);
+ method @NonNull public android.net.CaptivePortalData.Builder setUserPortalUrl(@Nullable android.net.Uri);
+ method @NonNull public android.net.CaptivePortalData.Builder setVenueInfoUrl(@Nullable android.net.Uri);
+ }
+
+ public class ConnectivityManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createNattKeepalive(@NonNull android.net.Network, @NonNull android.os.ParcelFileDescriptor, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
+ method @NonNull @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull java.net.Socket, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String getCaptivePortalServerUrl();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEntitlementResultListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported();
+ method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_FACTORY}) public int registerNetworkProvider(@NonNull android.net.NetworkProvider);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEventCallback);
+ method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void requestNetwork(@NonNull android.net.NetworkRequest, int, int, @NonNull android.os.Handler, @NonNull android.net.ConnectivityManager.NetworkCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_AIRPLANE_MODE, android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void setAirplaneMode(boolean);
+ method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public boolean shouldAvoidBadWifi();
+ method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(@NonNull android.net.Network, @NonNull android.os.Bundle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback, android.os.Handler);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void stopTethering(int);
+ method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_FACTORY}) public void unregisterNetworkProvider(@NonNull android.net.NetworkProvider);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void unregisterTetheringEventCallback(@NonNull android.net.ConnectivityManager.OnTetheringEventCallback);
+ field public static final String EXTRA_CAPTIVE_PORTAL_PROBE_SPEC = "android.net.extra.CAPTIVE_PORTAL_PROBE_SPEC";
+ field public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT = "android.net.extra.CAPTIVE_PORTAL_USER_AGENT";
+ field public static final int TETHERING_BLUETOOTH = 2; // 0x2
+ field public static final int TETHERING_USB = 1; // 0x1
+ field public static final int TETHERING_WIFI = 0; // 0x0
+ field @Deprecated public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN = 13; // 0xd
+ field @Deprecated public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0
+ field @Deprecated public static final int TETHER_ERROR_PROVISION_FAILED = 11; // 0xb
+ field public static final int TYPE_NONE = -1; // 0xffffffff
+ field @Deprecated public static final int TYPE_WIFI_P2P = 13; // 0xd
+ }
+
+ @Deprecated public abstract static class ConnectivityManager.OnStartTetheringCallback {
+ ctor @Deprecated public ConnectivityManager.OnStartTetheringCallback();
+ method @Deprecated public void onTetheringFailed();
+ method @Deprecated public void onTetheringStarted();
+ }
+
+ @Deprecated public static interface ConnectivityManager.OnTetheringEntitlementResultListener {
+ method @Deprecated public void onTetheringEntitlementResult(int);
+ }
+
+ @Deprecated public abstract static class ConnectivityManager.OnTetheringEventCallback {
+ ctor @Deprecated public ConnectivityManager.OnTetheringEventCallback();
+ method @Deprecated public void onUpstreamChanged(@Nullable android.net.Network);
+ }
+
+ public class EthernetManager {
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
+ }
+
+ public static interface EthernetManager.TetheredInterfaceCallback {
+ method public void onAvailable(@NonNull String);
+ method public void onUnavailable();
+ }
+
+ public static class EthernetManager.TetheredInterfaceRequest {
+ method public void release();
+ }
+
+ public final class InvalidPacketException extends java.lang.Exception {
+ ctor public InvalidPacketException(int);
+ method public int getError();
+ field public static final int ERROR_INVALID_IP_ADDRESS = -21; // 0xffffffeb
+ field public static final int ERROR_INVALID_LENGTH = -23; // 0xffffffe9
+ field public static final int ERROR_INVALID_PORT = -22; // 0xffffffea
+ }
+
+ public final class IpConfiguration implements android.os.Parcelable {
+ ctor public IpConfiguration();
+ ctor public IpConfiguration(@NonNull android.net.IpConfiguration);
+ method public int describeContents();
+ method @Nullable public android.net.ProxyInfo getHttpProxy();
+ method @NonNull public android.net.IpConfiguration.IpAssignment getIpAssignment();
+ method @NonNull public android.net.IpConfiguration.ProxySettings getProxySettings();
+ method @Nullable public android.net.StaticIpConfiguration getStaticIpConfiguration();
+ method public void setHttpProxy(@Nullable android.net.ProxyInfo);
+ method public void setIpAssignment(@NonNull android.net.IpConfiguration.IpAssignment);
+ method public void setProxySettings(@NonNull android.net.IpConfiguration.ProxySettings);
+ method public void setStaticIpConfiguration(@Nullable android.net.StaticIpConfiguration);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.IpConfiguration> CREATOR;
+ }
+
+ public enum IpConfiguration.IpAssignment {
+ enum_constant public static final android.net.IpConfiguration.IpAssignment DHCP;
+ enum_constant public static final android.net.IpConfiguration.IpAssignment STATIC;
+ enum_constant public static final android.net.IpConfiguration.IpAssignment UNASSIGNED;
+ }
+
+ public enum IpConfiguration.ProxySettings {
+ enum_constant public static final android.net.IpConfiguration.ProxySettings NONE;
+ enum_constant public static final android.net.IpConfiguration.ProxySettings PAC;
+ enum_constant public static final android.net.IpConfiguration.ProxySettings STATIC;
+ enum_constant public static final android.net.IpConfiguration.ProxySettings UNASSIGNED;
+ }
+
+ public final class IpPrefix implements android.os.Parcelable {
+ ctor public IpPrefix(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
+ ctor public IpPrefix(@NonNull String);
+ }
+
+ public final class IpSecManager {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void applyTunnelModeTransform(@NonNull android.net.IpSecManager.IpSecTunnelInterface, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecManager.IpSecTunnelInterface createIpSecTunnelInterface(@NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull android.net.Network) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
+ }
+
+ public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
+ method public void close();
+ method @NonNull public String getInterfaceName();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
+ }
+
+ public static class IpSecTransform.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecTransform buildTunnelModeTransform(@NonNull java.net.InetAddress, @NonNull android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
+ }
+
+ public class KeepalivePacketData {
+ ctor protected KeepalivePacketData(@NonNull java.net.InetAddress, @IntRange(from=0, to=65535) int, @NonNull java.net.InetAddress, @IntRange(from=0, to=65535) int, @NonNull byte[]) throws android.net.InvalidPacketException;
+ method @NonNull public java.net.InetAddress getDstAddress();
+ method public int getDstPort();
+ method @NonNull public byte[] getPacket();
+ method @NonNull public java.net.InetAddress getSrcAddress();
+ method public int getSrcPort();
+ }
+
+ public class LinkAddress implements android.os.Parcelable {
+ ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int, int, int);
+ ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int, int, int, long, long);
+ ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
+ ctor public LinkAddress(@NonNull String);
+ ctor public LinkAddress(@NonNull String, int, int);
+ method public long getDeprecationTime();
+ method public long getExpirationTime();
+ method public boolean isGlobalPreferred();
+ method public boolean isIpv4();
+ method public boolean isIpv6();
+ method public boolean isSameAddressAs(@Nullable android.net.LinkAddress);
+ field public static final long LIFETIME_PERMANENT = 9223372036854775807L; // 0x7fffffffffffffffL
+ field public static final long LIFETIME_UNKNOWN = -1L; // 0xffffffffffffffffL
+ }
+
+ public final class LinkProperties implements android.os.Parcelable {
+ ctor public LinkProperties(@Nullable android.net.LinkProperties);
+ ctor public LinkProperties(@Nullable android.net.LinkProperties, boolean);
+ method public boolean addDnsServer(@NonNull java.net.InetAddress);
+ method public boolean addLinkAddress(@NonNull android.net.LinkAddress);
+ method public boolean addPcscfServer(@NonNull java.net.InetAddress);
+ method @NonNull public java.util.List<java.net.InetAddress> getAddresses();
+ method @NonNull public java.util.List<java.lang.String> getAllInterfaceNames();
+ method @NonNull public java.util.List<android.net.LinkAddress> getAllLinkAddresses();
+ method @NonNull public java.util.List<android.net.RouteInfo> getAllRoutes();
+ method @Nullable public android.net.Uri getCaptivePortalApiUrl();
+ method @Nullable public android.net.CaptivePortalData getCaptivePortalData();
+ method @NonNull public java.util.List<java.net.InetAddress> getPcscfServers();
+ method @Nullable public String getTcpBufferSizes();
+ method @NonNull public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
+ method public boolean hasGlobalIpv6Address();
+ method public boolean hasIpv4Address();
+ method public boolean hasIpv4DefaultRoute();
+ method public boolean hasIpv4DnsServer();
+ method public boolean hasIpv6DefaultRoute();
+ method public boolean hasIpv6DnsServer();
+ method public boolean isIpv4Provisioned();
+ method public boolean isIpv6Provisioned();
+ method public boolean isProvisioned();
+ method public boolean isReachable(@NonNull java.net.InetAddress);
+ method public boolean removeDnsServer(@NonNull java.net.InetAddress);
+ method public boolean removeLinkAddress(@NonNull android.net.LinkAddress);
+ method public boolean removeRoute(@NonNull android.net.RouteInfo);
+ method public void setCaptivePortalApiUrl(@Nullable android.net.Uri);
+ method public void setCaptivePortalData(@Nullable android.net.CaptivePortalData);
+ method public void setPcscfServers(@NonNull java.util.Collection<java.net.InetAddress>);
+ method public void setPrivateDnsServerName(@Nullable String);
+ method public void setTcpBufferSizes(@Nullable String);
+ method public void setUsePrivateDns(boolean);
+ method public void setValidatedPrivateDnsServers(@NonNull java.util.Collection<java.net.InetAddress>);
+ }
+
+ public final class MatchAllNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
+ ctor public MatchAllNetworkSpecifier();
+ method public int describeContents();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.MatchAllNetworkSpecifier> CREATOR;
+ }
+
+ public final class NattKeepalivePacketData extends android.net.KeepalivePacketData implements android.os.Parcelable {
+ ctor public NattKeepalivePacketData(@NonNull java.net.InetAddress, int, @NonNull java.net.InetAddress, int, @NonNull byte[]) throws android.net.InvalidPacketException;
+ method public int describeContents();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.NattKeepalivePacketData> CREATOR;
+ }
+
+ public class Network implements android.os.Parcelable {
+ ctor public Network(@NonNull android.net.Network);
+ method public int getNetId();
+ method @NonNull public android.net.Network getPrivateDnsBypassingCopy();
+ }
+
+ public abstract class NetworkAgent {
+ ctor public NetworkAgent(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String, @NonNull android.net.NetworkCapabilities, @NonNull android.net.LinkProperties, int, @NonNull android.net.NetworkAgentConfig, @Nullable android.net.NetworkProvider);
+ method @Nullable public android.net.Network getNetwork();
+ method public void markConnected();
+ method public void onAddKeepalivePacketFilter(int, @NonNull android.net.KeepalivePacketData);
+ method public void onAutomaticReconnectDisabled();
+ method public void onNetworkUnwanted();
+ method public void onRemoveKeepalivePacketFilter(int);
+ method public void onSaveAcceptUnvalidated(boolean);
+ method public void onSignalStrengthThresholdsUpdated(@NonNull int[]);
+ method public void onStartSocketKeepalive(int, @NonNull java.time.Duration, @NonNull android.net.KeepalivePacketData);
+ method public void onStopSocketKeepalive(int);
+ method public void onValidationStatus(int, @Nullable android.net.Uri);
+ method @NonNull public android.net.Network register();
+ method public final void sendLinkProperties(@NonNull android.net.LinkProperties);
+ method public final void sendNetworkCapabilities(@NonNull android.net.NetworkCapabilities);
+ method public final void sendNetworkScore(@IntRange(from=0, to=99) int);
+ method public final void sendSocketKeepaliveEvent(int, int);
+ method public void unregister();
+ field public static final int VALIDATION_STATUS_NOT_VALID = 2; // 0x2
+ field public static final int VALIDATION_STATUS_VALID = 1; // 0x1
+ }
+
+ public final class NetworkAgentConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getLegacyType();
+ method @NonNull public String getLegacyTypeName();
+ method public boolean isExplicitlySelected();
+ method public boolean isPartialConnectivityAcceptable();
+ method public boolean isUnvalidatedConnectivityAcceptable();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkAgentConfig> CREATOR;
+ }
+
+ public static final class NetworkAgentConfig.Builder {
+ ctor public NetworkAgentConfig.Builder();
+ method @NonNull public android.net.NetworkAgentConfig build();
+ method @NonNull public android.net.NetworkAgentConfig.Builder setExplicitlySelected(boolean);
+ method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyType(int);
+ method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyTypeName(@NonNull String);
+ method @NonNull public android.net.NetworkAgentConfig.Builder setPartialConnectivityAcceptable(boolean);
+ method @NonNull public android.net.NetworkAgentConfig.Builder setUnvalidatedConnectivityAcceptable(boolean);
+ }
+
+ public final class NetworkCapabilities implements android.os.Parcelable {
+ method @NonNull public int[] getAdministratorUids();
+ method @Nullable public String getSsid();
+ method @NonNull public int[] getTransportTypes();
+ method public boolean satisfiedByNetworkCapabilities(@Nullable android.net.NetworkCapabilities);
+ field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16
+ field public static final int NET_CAPABILITY_OEM_PRIVATE = 26; // 0x1a
+ field public static final int NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24; // 0x18
+ }
+
+ public static final class NetworkCapabilities.Builder {
+ ctor public NetworkCapabilities.Builder();
+ ctor public NetworkCapabilities.Builder(@NonNull android.net.NetworkCapabilities);
+ method @NonNull public android.net.NetworkCapabilities.Builder addCapability(int);
+ method @NonNull public android.net.NetworkCapabilities.Builder addTransportType(int);
+ method @NonNull public android.net.NetworkCapabilities build();
+ method @NonNull public android.net.NetworkCapabilities.Builder removeCapability(int);
+ method @NonNull public android.net.NetworkCapabilities.Builder removeTransportType(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setAdministratorUids(@NonNull int[]);
+ method @NonNull public android.net.NetworkCapabilities.Builder setLinkDownstreamBandwidthKbps(int);
+ method @NonNull public android.net.NetworkCapabilities.Builder setLinkUpstreamBandwidthKbps(int);
+ method @NonNull public android.net.NetworkCapabilities.Builder setNetworkSpecifier(@Nullable android.net.NetworkSpecifier);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setOwnerUid(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setRequestorPackageName(@Nullable String);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setRequestorUid(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP) public android.net.NetworkCapabilities.Builder setSignalStrength(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setSsid(@Nullable String);
+ method @NonNull public android.net.NetworkCapabilities.Builder setTransportInfo(@Nullable android.net.TransportInfo);
+ }
+
+ public class NetworkKey implements android.os.Parcelable {
+ ctor public NetworkKey(android.net.WifiKey);
+ method @Nullable public static android.net.NetworkKey createFromScanResult(@NonNull android.net.wifi.ScanResult);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkKey> CREATOR;
+ field public static final int TYPE_WIFI = 1; // 0x1
+ field public final int type;
+ field public final android.net.WifiKey wifiKey;
+ }
+
+ public class NetworkProvider {
+ ctor public NetworkProvider(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void declareNetworkRequestUnfulfillable(@NonNull android.net.NetworkRequest);
+ method public int getProviderId();
+ method public void onNetworkRequestWithdrawn(@NonNull android.net.NetworkRequest);
+ method public void onNetworkRequested(@NonNull android.net.NetworkRequest, @IntRange(from=0, to=99) int, int);
+ field public static final int ID_NONE = -1; // 0xffffffff
+ }
+
+ public abstract class NetworkRecommendationProvider {
+ ctor public NetworkRecommendationProvider(android.content.Context, java.util.concurrent.Executor);
+ method public final android.os.IBinder getBinder();
+ method public abstract void onRequestScores(android.net.NetworkKey[]);
+ }
+
+ public class NetworkRequest implements android.os.Parcelable {
+ method @Nullable public String getRequestorPackageName();
+ method public int getRequestorUid();
+ }
+
+ public static class NetworkRequest.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP) public android.net.NetworkRequest.Builder setSignalStrength(int);
+ }
+
+ public class NetworkScoreManager {
+ method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public boolean clearScores() throws java.lang.SecurityException;
+ method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public void disableScoring() throws java.lang.SecurityException;
+ method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public String getActiveScorerPackage();
+ method @RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES) public void registerNetworkScoreCallback(int, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.NetworkScoreManager.NetworkScoreCallback) throws java.lang.SecurityException;
+ method @RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES) public boolean requestScores(@NonNull java.util.Collection<android.net.NetworkKey>) throws java.lang.SecurityException;
+ method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public boolean setActiveScorer(String) throws java.lang.SecurityException;
+ method @RequiresPermission(android.Manifest.permission.SCORE_NETWORKS) public boolean updateScores(@NonNull android.net.ScoredNetwork[]) throws java.lang.SecurityException;
+ field @Deprecated public static final String ACTION_CHANGE_ACTIVE = "android.net.scoring.CHANGE_ACTIVE";
+ field public static final String ACTION_CUSTOM_ENABLE = "android.net.scoring.CUSTOM_ENABLE";
+ field public static final String ACTION_RECOMMEND_NETWORKS = "android.net.action.RECOMMEND_NETWORKS";
+ field public static final String ACTION_SCORER_CHANGED = "android.net.scoring.SCORER_CHANGED";
+ field @Deprecated public static final String ACTION_SCORE_NETWORKS = "android.net.scoring.SCORE_NETWORKS";
+ field @Deprecated public static final String EXTRA_NETWORKS_TO_SCORE = "networksToScore";
+ field public static final String EXTRA_NEW_SCORER = "newScorer";
+ field @Deprecated public static final String EXTRA_PACKAGE_NAME = "packageName";
+ field public static final int SCORE_FILTER_CURRENT_NETWORK = 1; // 0x1
+ field public static final int SCORE_FILTER_NONE = 0; // 0x0
+ field public static final int SCORE_FILTER_SCAN_RESULTS = 2; // 0x2
+ }
+
+ public abstract static class NetworkScoreManager.NetworkScoreCallback {
+ ctor public NetworkScoreManager.NetworkScoreCallback();
+ method public abstract void onScoresInvalidated();
+ method public abstract void onScoresUpdated(@NonNull java.util.Collection<android.net.ScoredNetwork>);
+ }
+
+ public abstract class NetworkSpecifier {
+ method public boolean canBeSatisfiedBy(@Nullable android.net.NetworkSpecifier);
+ method @Nullable public android.net.NetworkSpecifier redact();
+ }
+
+ public class NetworkStack {
+ method @Nullable public static android.os.IBinder getService();
+ field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK";
+ }
+
+ public final class NetworkStats implements android.os.Parcelable {
+ ctor public NetworkStats(long, int);
+ method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats);
+ method @NonNull public android.net.NetworkStats addEntry(@NonNull android.net.NetworkStats.Entry);
+ method public int describeContents();
+ method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR;
+ field public static final int DEFAULT_NETWORK_NO = 0; // 0x0
+ field public static final int DEFAULT_NETWORK_YES = 1; // 0x1
+ field public static final String IFACE_VT = "vt_data0";
+ field public static final int METERED_NO = 0; // 0x0
+ field public static final int METERED_YES = 1; // 0x1
+ field public static final int ROAMING_NO = 0; // 0x0
+ field public static final int ROAMING_YES = 1; // 0x1
+ field public static final int SET_DEFAULT = 0; // 0x0
+ field public static final int SET_FOREGROUND = 1; // 0x1
+ field public static final int TAG_NONE = 0; // 0x0
+ field public static final int UID_ALL = -1; // 0xffffffff
+ field public static final int UID_TETHERING = -5; // 0xfffffffb
+ }
+
+ public static class NetworkStats.Entry {
+ ctor public NetworkStats.Entry(@Nullable String, int, int, int, int, int, int, long, long, long, long, long);
+ }
+
+ public final class RouteInfo implements android.os.Parcelable {
+ ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int);
+ ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int, int);
+ method public int getMtu();
+ method public int getType();
+ field public static final int RTN_THROW = 9; // 0x9
+ field public static final int RTN_UNICAST = 1; // 0x1
+ field public static final int RTN_UNREACHABLE = 7; // 0x7
+ }
+
+ public class RssiCurve implements android.os.Parcelable {
+ ctor public RssiCurve(int, int, byte[]);
+ ctor public RssiCurve(int, int, byte[], int);
+ method public int describeContents();
+ method public byte lookupScore(int);
+ method public byte lookupScore(int, boolean);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.RssiCurve> CREATOR;
+ field public final int activeNetworkRssiBoost;
+ field public final int bucketWidth;
+ field public final byte[] rssiBuckets;
+ field public final int start;
+ }
+
+ public class ScoredNetwork implements android.os.Parcelable {
+ ctor public ScoredNetwork(android.net.NetworkKey, android.net.RssiCurve);
+ ctor public ScoredNetwork(android.net.NetworkKey, android.net.RssiCurve, boolean);
+ ctor public ScoredNetwork(android.net.NetworkKey, android.net.RssiCurve, boolean, @Nullable android.os.Bundle);
+ method public int calculateBadge(int);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final String ATTRIBUTES_KEY_BADGING_CURVE = "android.net.attributes.key.BADGING_CURVE";
+ field public static final String ATTRIBUTES_KEY_HAS_CAPTIVE_PORTAL = "android.net.attributes.key.HAS_CAPTIVE_PORTAL";
+ field public static final String ATTRIBUTES_KEY_RANKING_SCORE_OFFSET = "android.net.attributes.key.RANKING_SCORE_OFFSET";
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.ScoredNetwork> CREATOR;
+ field @Nullable public final android.os.Bundle attributes;
+ field public final boolean meteredHint;
+ field public final android.net.NetworkKey networkKey;
+ field public final android.net.RssiCurve rssiCurve;
+ }
+
+ public abstract class SocketKeepalive implements java.lang.AutoCloseable {
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
+ public final class StaticIpConfiguration implements android.os.Parcelable {
+ ctor public StaticIpConfiguration();
+ ctor public StaticIpConfiguration(@Nullable android.net.StaticIpConfiguration);
+ method public void addDnsServer(@NonNull java.net.InetAddress);
+ method public void clear();
+ method public int describeContents();
+ method @NonNull public java.util.List<java.net.InetAddress> getDnsServers();
+ method @Nullable public String getDomains();
+ method @Nullable public java.net.InetAddress getGateway();
+ method @Nullable public android.net.LinkAddress getIpAddress();
+ method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR;
+ }
+
+ public static final class StaticIpConfiguration.Builder {
+ ctor public StaticIpConfiguration.Builder();
+ method @NonNull public android.net.StaticIpConfiguration build();
+ method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>);
+ method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String);
+ method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress);
+ method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@Nullable android.net.LinkAddress);
+ }
+
+ public final class TetheredClient implements android.os.Parcelable {
+ ctor public TetheredClient(@NonNull android.net.MacAddress, @NonNull java.util.Collection<android.net.TetheredClient.AddressInfo>, int);
+ method public int describeContents();
+ method @NonNull public java.util.List<android.net.TetheredClient.AddressInfo> getAddresses();
+ method @NonNull public android.net.MacAddress getMacAddress();
+ method public int getTetheringType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient> CREATOR;
+ }
+
+ public static final class TetheredClient.AddressInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.net.LinkAddress getAddress();
+ method @Nullable public String getHostname();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient.AddressInfo> CREATOR;
+ }
+
+ public class TetheringManager {
+ method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.TetheringEventCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void requestLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.OnTetheringEntitlementResultListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void startTethering(@NonNull android.net.TetheringManager.TetheringRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.StartTetheringCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void stopAllTethering();
+ method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void stopTethering(int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.ACCESS_NETWORK_STATE}) public void unregisterTetheringEventCallback(@NonNull android.net.TetheringManager.TetheringEventCallback);
+ field public static final String ACTION_TETHER_STATE_CHANGED = "android.net.conn.TETHER_STATE_CHANGED";
+ field public static final String EXTRA_ACTIVE_LOCAL_ONLY = "android.net.extra.ACTIVE_LOCAL_ONLY";
+ field public static final String EXTRA_ACTIVE_TETHER = "tetherArray";
+ field public static final String EXTRA_AVAILABLE_TETHER = "availableArray";
+ field public static final String EXTRA_ERRORED_TETHER = "erroredArray";
+ field public static final int TETHERING_BLUETOOTH = 2; // 0x2
+ field public static final int TETHERING_ETHERNET = 5; // 0x5
+ field public static final int TETHERING_INVALID = -1; // 0xffffffff
+ field public static final int TETHERING_NCM = 4; // 0x4
+ field public static final int TETHERING_USB = 1; // 0x1
+ field public static final int TETHERING_WIFI = 0; // 0x0
+ field public static final int TETHERING_WIFI_P2P = 3; // 0x3
+ field public static final int TETHER_ERROR_DHCPSERVER_ERROR = 12; // 0xc
+ field public static final int TETHER_ERROR_DISABLE_FORWARDING_ERROR = 9; // 0x9
+ field public static final int TETHER_ERROR_ENABLE_FORWARDING_ERROR = 8; // 0x8
+ field public static final int TETHER_ERROR_ENTITLEMENT_UNKNOWN = 13; // 0xd
+ field public static final int TETHER_ERROR_IFACE_CFG_ERROR = 10; // 0xa
+ field public static final int TETHER_ERROR_INTERNAL_ERROR = 5; // 0x5
+ field public static final int TETHER_ERROR_NO_ACCESS_TETHERING_PERMISSION = 15; // 0xf
+ field public static final int TETHER_ERROR_NO_CHANGE_TETHERING_PERMISSION = 14; // 0xe
+ field public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0
+ field public static final int TETHER_ERROR_PROVISIONING_FAILED = 11; // 0xb
+ field public static final int TETHER_ERROR_SERVICE_UNAVAIL = 2; // 0x2
+ field public static final int TETHER_ERROR_TETHER_IFACE_ERROR = 6; // 0x6
+ field public static final int TETHER_ERROR_UNAVAIL_IFACE = 4; // 0x4
+ field public static final int TETHER_ERROR_UNKNOWN_IFACE = 1; // 0x1
+ field public static final int TETHER_ERROR_UNKNOWN_TYPE = 16; // 0x10
+ field public static final int TETHER_ERROR_UNSUPPORTED = 3; // 0x3
+ field public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR = 7; // 0x7
+ field public static final int TETHER_HARDWARE_OFFLOAD_FAILED = 2; // 0x2
+ field public static final int TETHER_HARDWARE_OFFLOAD_STARTED = 1; // 0x1
+ field public static final int TETHER_HARDWARE_OFFLOAD_STOPPED = 0; // 0x0
+ }
+
+ public static interface TetheringManager.OnTetheringEntitlementResultListener {
+ method public void onTetheringEntitlementResult(int);
+ }
+
+ public static interface TetheringManager.StartTetheringCallback {
+ method public default void onTetheringFailed(int);
+ method public default void onTetheringStarted();
+ }
+
+ public static interface TetheringManager.TetheringEventCallback {
+ method public default void onClientsChanged(@NonNull java.util.Collection<android.net.TetheredClient>);
+ method public default void onError(@NonNull String, int);
+ method public default void onOffloadStatusChanged(int);
+ method public default void onTetherableInterfacesChanged(@NonNull java.util.List<java.lang.String>);
+ method public default void onTetheredInterfacesChanged(@NonNull java.util.List<java.lang.String>);
+ method public default void onTetheringSupported(boolean);
+ method public default void onUpstreamChanged(@Nullable android.net.Network);
+ }
+
+ public static class TetheringManager.TetheringRequest {
+ method @Nullable public android.net.LinkAddress getClientStaticIpv4Address();
+ method @Nullable public android.net.LinkAddress getLocalIpv4Address();
+ method public boolean getShouldShowEntitlementUi();
+ method public int getTetheringType();
+ method public boolean isExemptFromEntitlementCheck();
+ }
+
+ public static class TetheringManager.TetheringRequest.Builder {
+ ctor public TetheringManager.TetheringRequest.Builder(int);
+ method @NonNull public android.net.TetheringManager.TetheringRequest build();
+ method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setExemptFromEntitlementCheck(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setShouldShowEntitlementUi(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setStaticIpv4Addresses(@NonNull android.net.LinkAddress, @NonNull android.net.LinkAddress);
+ }
+
+ public class TrafficStats {
+ method public static void setThreadStatsTagApp();
+ method public static void setThreadStatsTagBackup();
+ method public static void setThreadStatsTagRestore();
+ field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f
+ field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80
+ field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff
+ field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00
+ field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f
+ field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00
+ }
+
+ public abstract class Uri implements java.lang.Comparable<android.net.Uri> android.os.Parcelable {
+ method @NonNull public String toSafeString();
+ }
+
+ public class VpnService extends android.app.Service {
+ method @RequiresPermission(android.Manifest.permission.CONTROL_VPN) public static void prepareAndAuthorize(android.content.Context);
+ }
+
+ public class WebAddress {
+ ctor public WebAddress(String) throws android.net.ParseException;
+ }
+
+ public class WifiKey implements android.os.Parcelable {
+ ctor public WifiKey(String, String);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.WifiKey> CREATOR;
+ field public final String bssid;
+ field public final String ssid;
+ }
+
+}
+
+package android.net.apf {
+
+ public final class ApfCapabilities implements android.os.Parcelable {
+ ctor public ApfCapabilities(int, int, int);
+ method public int describeContents();
+ method public static boolean getApfDrop8023Frames();
+ method @NonNull public static int[] getApfEtherTypeBlackList();
+ method public boolean hasDataAccess();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.net.apf.ApfCapabilities> CREATOR;
+ field public final int apfPacketFormat;
+ field public final int apfVersionSupported;
+ field public final int maximumApfProgramSize;
+ }
+
+}
+
+package android.net.metrics {
+
+ public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static final class ApfProgramEvent.Builder {
+ ctor public ApfProgramEvent.Builder();
+ method @NonNull public android.net.metrics.ApfProgramEvent build();
+ method @NonNull public android.net.metrics.ApfProgramEvent.Builder setActualLifetime(long);
+ method @NonNull public android.net.metrics.ApfProgramEvent.Builder setCurrentRas(int);
+ method @NonNull public android.net.metrics.ApfProgramEvent.Builder setFilteredRas(int);
+ method @NonNull public android.net.metrics.ApfProgramEvent.Builder setFlags(boolean, boolean);
+ method @NonNull public android.net.metrics.ApfProgramEvent.Builder setLifetime(long);
+ method @NonNull public android.net.metrics.ApfProgramEvent.Builder setProgramLength(int);
+ }
+
+ public final class ApfStats implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static final class ApfStats.Builder {
+ ctor public ApfStats.Builder();
+ method @NonNull public android.net.metrics.ApfStats build();
+ method @NonNull public android.net.metrics.ApfStats.Builder setDroppedRas(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setDurationMs(long);
+ method @NonNull public android.net.metrics.ApfStats.Builder setMatchingRas(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setMaxProgramSize(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setParseErrors(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setProgramUpdates(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setProgramUpdatesAll(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setProgramUpdatesAllowingMulticast(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setReceivedRas(int);
+ method @NonNull public android.net.metrics.ApfStats.Builder setZeroLifetimeRas(int);
+ }
+
+ public final class DhcpClientEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static final class DhcpClientEvent.Builder {
+ ctor public DhcpClientEvent.Builder();
+ method @NonNull public android.net.metrics.DhcpClientEvent build();
+ method @NonNull public android.net.metrics.DhcpClientEvent.Builder setDurationMs(int);
+ method @NonNull public android.net.metrics.DhcpClientEvent.Builder setMsg(String);
+ }
+
+ public final class DhcpErrorEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public DhcpErrorEvent(int);
+ method public static int errorCodeWithOption(int, int);
+ field public static final int BOOTP_TOO_SHORT = 67174400; // 0x4010000
+ field public static final int BUFFER_UNDERFLOW = 83951616; // 0x5010000
+ field public static final int DHCP_BAD_MAGIC_COOKIE = 67239936; // 0x4020000
+ field public static final int DHCP_ERROR = 4; // 0x4
+ field public static final int DHCP_INVALID_OPTION_LENGTH = 67305472; // 0x4030000
+ field public static final int DHCP_NO_COOKIE = 67502080; // 0x4060000
+ field public static final int DHCP_NO_MSG_TYPE = 67371008; // 0x4040000
+ field public static final int DHCP_UNKNOWN_MSG_TYPE = 67436544; // 0x4050000
+ field public static final int L2_ERROR = 1; // 0x1
+ field public static final int L2_TOO_SHORT = 16842752; // 0x1010000
+ field public static final int L2_WRONG_ETH_TYPE = 16908288; // 0x1020000
+ field public static final int L3_ERROR = 2; // 0x2
+ field public static final int L3_INVALID_IP = 33751040; // 0x2030000
+ field public static final int L3_NOT_IPV4 = 33685504; // 0x2020000
+ field public static final int L3_TOO_SHORT = 33619968; // 0x2010000
+ field public static final int L4_ERROR = 3; // 0x3
+ field public static final int L4_NOT_UDP = 50397184; // 0x3010000
+ field public static final int L4_WRONG_PORT = 50462720; // 0x3020000
+ field public static final int MISC_ERROR = 5; // 0x5
+ field public static final int PARSING_ERROR = 84082688; // 0x5030000
+ field public static final int RECEIVE_ERROR = 84017152; // 0x5020000
+ }
+
+ public class IpConnectivityLog {
+ ctor public IpConnectivityLog();
+ method public boolean log(long, @NonNull android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(@NonNull String, @NonNull android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(@NonNull android.net.Network, @NonNull int[], @NonNull android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(int, @NonNull int[], @NonNull android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(@NonNull android.net.metrics.IpConnectivityLog.Event);
+ }
+
+ public static interface IpConnectivityLog.Event extends android.os.Parcelable {
+ }
+
+ public final class IpManagerEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public IpManagerEvent(int, long);
+ field public static final int COMPLETE_LIFECYCLE = 3; // 0x3
+ field public static final int ERROR_INTERFACE_NOT_FOUND = 8; // 0x8
+ field public static final int ERROR_INVALID_PROVISIONING = 7; // 0x7
+ field public static final int ERROR_STARTING_IPREACHABILITYMONITOR = 6; // 0x6
+ field public static final int ERROR_STARTING_IPV4 = 4; // 0x4
+ field public static final int ERROR_STARTING_IPV6 = 5; // 0x5
+ field public static final int PROVISIONING_FAIL = 2; // 0x2
+ field public static final int PROVISIONING_OK = 1; // 0x1
+ }
+
+ public final class IpReachabilityEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public IpReachabilityEvent(int);
+ field public static final int NUD_FAILED = 512; // 0x200
+ field public static final int NUD_FAILED_ORGANIC = 1024; // 0x400
+ field public static final int PROBE = 256; // 0x100
+ field public static final int PROVISIONING_LOST = 768; // 0x300
+ field public static final int PROVISIONING_LOST_ORGANIC = 1280; // 0x500
+ }
+
+ public final class NetworkEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public NetworkEvent(int, long);
+ ctor public NetworkEvent(int);
+ field public static final int NETWORK_CAPTIVE_PORTAL_FOUND = 4; // 0x4
+ field public static final int NETWORK_CONNECTED = 1; // 0x1
+ field public static final int NETWORK_CONSECUTIVE_DNS_TIMEOUT_FOUND = 12; // 0xc
+ field public static final int NETWORK_DISCONNECTED = 7; // 0x7
+ field public static final int NETWORK_FIRST_VALIDATION_PORTAL_FOUND = 10; // 0xa
+ field public static final int NETWORK_FIRST_VALIDATION_SUCCESS = 8; // 0x8
+ field public static final int NETWORK_LINGER = 5; // 0x5
+ field public static final int NETWORK_PARTIAL_CONNECTIVITY = 13; // 0xd
+ field public static final int NETWORK_REVALIDATION_PORTAL_FOUND = 11; // 0xb
+ field public static final int NETWORK_REVALIDATION_SUCCESS = 9; // 0x9
+ field public static final int NETWORK_UNLINGER = 6; // 0x6
+ field public static final int NETWORK_VALIDATED = 2; // 0x2
+ field public static final int NETWORK_VALIDATION_FAILED = 3; // 0x3
+ }
+
+ public final class RaEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static final class RaEvent.Builder {
+ ctor public RaEvent.Builder();
+ method @NonNull public android.net.metrics.RaEvent build();
+ method @NonNull public android.net.metrics.RaEvent.Builder updateDnsslLifetime(long);
+ method @NonNull public android.net.metrics.RaEvent.Builder updatePrefixPreferredLifetime(long);
+ method @NonNull public android.net.metrics.RaEvent.Builder updatePrefixValidLifetime(long);
+ method @NonNull public android.net.metrics.RaEvent.Builder updateRdnssLifetime(long);
+ method @NonNull public android.net.metrics.RaEvent.Builder updateRouteInfoLifetime(long);
+ method @NonNull public android.net.metrics.RaEvent.Builder updateRouterLifetime(long);
+ }
+
+ public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
+ method @NonNull public static String getProbeName(int);
+ field public static final int DNS_FAILURE = 0; // 0x0
+ field public static final int DNS_SUCCESS = 1; // 0x1
+ field public static final int PROBE_DNS = 0; // 0x0
+ field public static final int PROBE_FALLBACK = 4; // 0x4
+ field public static final int PROBE_HTTP = 1; // 0x1
+ field public static final int PROBE_HTTPS = 2; // 0x2
+ field public static final int PROBE_PAC = 3; // 0x3
+ field public static final int PROBE_PRIVDNS = 5; // 0x5
+ }
+
+ public static final class ValidationProbeEvent.Builder {
+ ctor public ValidationProbeEvent.Builder();
+ method @NonNull public android.net.metrics.ValidationProbeEvent build();
+ method @NonNull public android.net.metrics.ValidationProbeEvent.Builder setDurationMs(long);
+ method @NonNull public android.net.metrics.ValidationProbeEvent.Builder setProbeType(int, boolean);
+ method @NonNull public android.net.metrics.ValidationProbeEvent.Builder setReturnCode(int);
+ }
+
+}
+
+package android.net.netstats.provider {
+
+ public abstract class NetworkStatsProvider {
+ ctor public NetworkStatsProvider();
+ method public void notifyAlertReached();
+ method public void notifyLimitReached();
+ method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats);
+ method public abstract void onRequestStatsUpdate(int);
+ method public abstract void onSetAlert(long);
+ method public abstract void onSetLimit(@NonNull String, long);
+ field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff
+ }
+
+}
+
+package android.net.sip {
+
+ public class SipAudioCall {
+ method @Nullable public android.net.rtp.AudioGroup getAudioGroup();
+ method public void setAudioGroup(@NonNull android.net.rtp.AudioGroup);
+ }
+
+ public class SipManager {
+ method @NonNull public java.util.List<android.net.sip.SipProfile> getProfiles() throws android.net.sip.SipException;
+ field public static final String ACTION_SIP_CALL_OPTION_CHANGED = "android.net.sip.action.SIP_CALL_OPTION_CHANGED";
+ field public static final String ACTION_SIP_INCOMING_CALL = "android.net.sip.action.SIP_INCOMING_CALL";
+ field public static final String ACTION_SIP_REMOVE_PROFILE = "android.net.sip.action.SIP_REMOVE_PROFILE";
+ field public static final String ACTION_SIP_SERVICE_UP = "android.net.sip.action.SIP_SERVICE_UP";
+ field public static final String ACTION_START_SIP = "android.net.sip.action.START_SIP";
+ }
+
+ public class SipProfile implements java.lang.Cloneable android.os.Parcelable java.io.Serializable {
+ method public int getCallingUid();
+ }
+
+}
+
+package android.net.util {
+
+ public final class SocketUtils {
+ method public static void bindSocketToInterface(@NonNull java.io.FileDescriptor, @NonNull String) throws android.system.ErrnoException;
+ method public static void closeSocket(@Nullable java.io.FileDescriptor) throws java.io.IOException;
+ method @NonNull public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
+ method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int);
+ method @Deprecated @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
+ method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int, @NonNull byte[]);
+ }
+
+}
+
+package android.net.wifi {
+
+ public abstract class EasyConnectStatusCallback {
+ ctor public EasyConnectStatusCallback();
+ method public abstract void onConfiguratorSuccess(int);
+ method public abstract void onEnrolleeSuccess(int);
+ method public void onFailure(int);
+ method public void onFailure(int, @Nullable String, @NonNull android.util.SparseArray<int[]>, @NonNull int[]);
+ method public abstract void onProgress(int);
+ field public static final int EASY_CONNECT_EVENT_PROGRESS_AUTHENTICATION_SUCCESS = 0; // 0x0
+ field public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_ACCEPTED = 3; // 0x3
+ field public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_SENT_WAITING_RESPONSE = 2; // 0x2
+ field public static final int EASY_CONNECT_EVENT_PROGRESS_RESPONSE_PENDING = 1; // 0x1
+ field public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 1; // 0x1
+ field public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 0; // 0x0
+ }
+
+ @Deprecated public class RttManager {
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void disableResponder(android.net.wifi.RttManager.ResponderCallback);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void enableResponder(android.net.wifi.RttManager.ResponderCallback);
+ method @Deprecated public android.net.wifi.RttManager.Capabilities getCapabilities();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.net.wifi.RttManager.RttCapabilities getRttCapabilities();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startRanging(android.net.wifi.RttManager.RttParams[], android.net.wifi.RttManager.RttListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopRanging(android.net.wifi.RttManager.RttListener);
+ field @Deprecated public static final int BASE = 160256; // 0x27200
+ field @Deprecated public static final int CMD_OP_ABORTED = 160260; // 0x27204
+ field @Deprecated public static final int CMD_OP_DISABLE_RESPONDER = 160262; // 0x27206
+ field @Deprecated public static final int CMD_OP_ENABLE_RESPONDER = 160261; // 0x27205
+ field @Deprecated public static final int CMD_OP_ENALBE_RESPONDER_FAILED = 160264; // 0x27208
+ field @Deprecated public static final int CMD_OP_ENALBE_RESPONDER_SUCCEEDED = 160263; // 0x27207
+ field @Deprecated public static final int CMD_OP_FAILED = 160258; // 0x27202
+ field @Deprecated public static final int CMD_OP_START_RANGING = 160256; // 0x27200
+ field @Deprecated public static final int CMD_OP_STOP_RANGING = 160257; // 0x27201
+ field @Deprecated public static final int CMD_OP_SUCCEEDED = 160259; // 0x27203
+ field @Deprecated public static final String DESCRIPTION_KEY = "android.net.wifi.RttManager.Description";
+ field @Deprecated public static final int PREAMBLE_HT = 2; // 0x2
+ field @Deprecated public static final int PREAMBLE_LEGACY = 1; // 0x1
+ field @Deprecated public static final int PREAMBLE_VHT = 4; // 0x4
+ field @Deprecated public static final int REASON_INITIATOR_NOT_ALLOWED_WHEN_RESPONDER_ON = -6; // 0xfffffffa
+ field @Deprecated public static final int REASON_INVALID_LISTENER = -3; // 0xfffffffd
+ field @Deprecated public static final int REASON_INVALID_REQUEST = -4; // 0xfffffffc
+ field @Deprecated public static final int REASON_NOT_AVAILABLE = -2; // 0xfffffffe
+ field @Deprecated public static final int REASON_PERMISSION_DENIED = -5; // 0xfffffffb
+ field @Deprecated public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
+ field @Deprecated public static final int RTT_BW_10_SUPPORT = 2; // 0x2
+ field @Deprecated public static final int RTT_BW_160_SUPPORT = 32; // 0x20
+ field @Deprecated public static final int RTT_BW_20_SUPPORT = 4; // 0x4
+ field @Deprecated public static final int RTT_BW_40_SUPPORT = 8; // 0x8
+ field @Deprecated public static final int RTT_BW_5_SUPPORT = 1; // 0x1
+ field @Deprecated public static final int RTT_BW_80_SUPPORT = 16; // 0x10
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_10 = 6; // 0x6
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_160 = 3; // 0x3
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_20 = 0; // 0x0
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_40 = 1; // 0x1
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_5 = 5; // 0x5
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_80 = 2; // 0x2
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_80P80 = 4; // 0x4
+ field @Deprecated public static final int RTT_CHANNEL_WIDTH_UNSPECIFIED = -1; // 0xffffffff
+ field @Deprecated public static final int RTT_PEER_NAN = 5; // 0x5
+ field @Deprecated public static final int RTT_PEER_P2P_CLIENT = 4; // 0x4
+ field @Deprecated public static final int RTT_PEER_P2P_GO = 3; // 0x3
+ field @Deprecated public static final int RTT_PEER_TYPE_AP = 1; // 0x1
+ field @Deprecated public static final int RTT_PEER_TYPE_STA = 2; // 0x2
+ field @Deprecated public static final int RTT_PEER_TYPE_UNSPECIFIED = 0; // 0x0
+ field @Deprecated public static final int RTT_STATUS_ABORTED = 8; // 0x8
+ field @Deprecated public static final int RTT_STATUS_FAILURE = 1; // 0x1
+ field @Deprecated public static final int RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6; // 0x6
+ field @Deprecated public static final int RTT_STATUS_FAIL_BUSY_TRY_LATER = 12; // 0xc
+ field @Deprecated public static final int RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15; // 0xf
+ field @Deprecated public static final int RTT_STATUS_FAIL_INVALID_TS = 9; // 0x9
+ field @Deprecated public static final int RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4; // 0x4
+ field @Deprecated public static final int RTT_STATUS_FAIL_NO_CAPABILITY = 7; // 0x7
+ field @Deprecated public static final int RTT_STATUS_FAIL_NO_RSP = 2; // 0x2
+ field @Deprecated public static final int RTT_STATUS_FAIL_PROTOCOL = 10; // 0xa
+ field @Deprecated public static final int RTT_STATUS_FAIL_REJECTED = 3; // 0x3
+ field @Deprecated public static final int RTT_STATUS_FAIL_SCHEDULE = 11; // 0xb
+ field @Deprecated public static final int RTT_STATUS_FAIL_TM_TIMEOUT = 5; // 0x5
+ field @Deprecated public static final int RTT_STATUS_INVALID_REQ = 13; // 0xd
+ field @Deprecated public static final int RTT_STATUS_NO_WIFI = 14; // 0xe
+ field @Deprecated public static final int RTT_STATUS_SUCCESS = 0; // 0x0
+ field @Deprecated public static final int RTT_TYPE_11_MC = 4; // 0x4
+ field @Deprecated public static final int RTT_TYPE_11_V = 2; // 0x2
+ field @Deprecated public static final int RTT_TYPE_ONE_SIDED = 1; // 0x1
+ field @Deprecated public static final int RTT_TYPE_TWO_SIDED = 2; // 0x2
+ field @Deprecated public static final int RTT_TYPE_UNSPECIFIED = 0; // 0x0
+ }
+
+ @Deprecated public class RttManager.Capabilities {
+ ctor @Deprecated public RttManager.Capabilities();
+ field @Deprecated public int supportedPeerType;
+ field @Deprecated public int supportedType;
+ }
+
+ @Deprecated public static class RttManager.ParcelableRttParams implements android.os.Parcelable {
+ field @Deprecated @NonNull public android.net.wifi.RttManager.RttParams[] mParams;
+ }
+
+ @Deprecated public static class RttManager.ParcelableRttResults implements android.os.Parcelable {
+ ctor @Deprecated public RttManager.ParcelableRttResults(android.net.wifi.RttManager.RttResult[]);
+ field @Deprecated public android.net.wifi.RttManager.RttResult[] mResults;
+ }
+
+ @Deprecated public abstract static class RttManager.ResponderCallback {
+ ctor @Deprecated public RttManager.ResponderCallback();
+ method @Deprecated public abstract void onResponderEnableFailure(int);
+ method @Deprecated public abstract void onResponderEnabled(android.net.wifi.RttManager.ResponderConfig);
+ }
+
+ @Deprecated public static class RttManager.ResponderConfig implements android.os.Parcelable {
+ ctor @Deprecated public RttManager.ResponderConfig();
+ method @Deprecated public int describeContents();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.RttManager.ResponderConfig> CREATOR;
+ field @Deprecated public int centerFreq0;
+ field @Deprecated public int centerFreq1;
+ field @Deprecated public int channelWidth;
+ field @Deprecated public int frequency;
+ field @Deprecated public String macAddress;
+ field @Deprecated public int preamble;
+ }
+
+ @Deprecated public static class RttManager.RttCapabilities implements android.os.Parcelable {
+ ctor @Deprecated public RttManager.RttCapabilities();
+ field @Deprecated public int bwSupported;
+ field @Deprecated public boolean lciSupported;
+ field @Deprecated public boolean lcrSupported;
+ field @Deprecated public int mcVersion;
+ field @Deprecated public boolean oneSidedRttSupported;
+ field @Deprecated public int preambleSupported;
+ field @Deprecated public boolean responderSupported;
+ field @Deprecated public boolean secureRttSupported;
+ field @Deprecated public boolean supportedPeerType;
+ field @Deprecated public boolean supportedType;
+ field @Deprecated public boolean twoSided11McRttSupported;
+ }
+
+ @Deprecated public static interface RttManager.RttListener {
+ method @Deprecated public void onAborted();
+ method @Deprecated public void onFailure(int, String);
+ method @Deprecated public void onSuccess(android.net.wifi.RttManager.RttResult[]);
+ }
+
+ @Deprecated public static class RttManager.RttParams {
+ ctor @Deprecated public RttManager.RttParams();
+ field @Deprecated public boolean LCIRequest;
+ field @Deprecated public boolean LCRRequest;
+ field @Deprecated public int bandwidth;
+ field @Deprecated public String bssid;
+ field @Deprecated public int burstTimeout;
+ field @Deprecated public int centerFreq0;
+ field @Deprecated public int centerFreq1;
+ field @Deprecated public int channelWidth;
+ field @Deprecated public int deviceType;
+ field @Deprecated public int frequency;
+ field @Deprecated public int interval;
+ field @Deprecated public int numRetriesPerFTMR;
+ field @Deprecated public int numRetriesPerMeasurementFrame;
+ field @Deprecated public int numSamplesPerBurst;
+ field @Deprecated public int num_retries;
+ field @Deprecated public int num_samples;
+ field @Deprecated public int numberBurst;
+ field @Deprecated public int preamble;
+ field @Deprecated public int requestType;
+ field @Deprecated public boolean secure;
+ }
+
+ @Deprecated public static class RttManager.RttResult {
+ ctor @Deprecated public RttManager.RttResult();
+ field @Deprecated public android.net.wifi.RttManager.WifiInformationElement LCI;
+ field @Deprecated public android.net.wifi.RttManager.WifiInformationElement LCR;
+ field @Deprecated public String bssid;
+ field @Deprecated public int burstDuration;
+ field @Deprecated public int burstNumber;
+ field @Deprecated public int distance;
+ field @Deprecated public int distanceSpread;
+ field @Deprecated public int distanceStandardDeviation;
+ field @Deprecated public int distance_cm;
+ field @Deprecated public int distance_sd_cm;
+ field @Deprecated public int distance_spread_cm;
+ field @Deprecated public int frameNumberPerBurstPeer;
+ field @Deprecated public int measurementFrameNumber;
+ field @Deprecated public int measurementType;
+ field @Deprecated public int negotiatedBurstNum;
+ field @Deprecated public int requestType;
+ field @Deprecated public int retryAfterDuration;
+ field @Deprecated public int rssi;
+ field @Deprecated public int rssiSpread;
+ field @Deprecated public int rssi_spread;
+ field @Deprecated public long rtt;
+ field @Deprecated public long rttSpread;
+ field @Deprecated public long rttStandardDeviation;
+ field @Deprecated public long rtt_ns;
+ field @Deprecated public long rtt_sd_ns;
+ field @Deprecated public long rtt_spread_ns;
+ field @Deprecated public int rxRate;
+ field @Deprecated public boolean secure;
+ field @Deprecated public int status;
+ field @Deprecated public int successMeasurementFrameNumber;
+ field @Deprecated public long ts;
+ field @Deprecated public int txRate;
+ field @Deprecated public int tx_rate;
+ }
+
+ @Deprecated public static class RttManager.WifiInformationElement {
+ ctor @Deprecated public RttManager.WifiInformationElement();
+ field @Deprecated public byte[] data;
+ field @Deprecated public byte id;
+ }
+
+ public final class ScanResult implements android.os.Parcelable {
+ field public static final int CIPHER_CCMP = 3; // 0x3
+ field public static final int CIPHER_GCMP_256 = 4; // 0x4
+ field public static final int CIPHER_NONE = 0; // 0x0
+ field public static final int CIPHER_NO_GROUP_ADDRESSED = 1; // 0x1
+ field public static final int CIPHER_SMS4 = 5; // 0x5
+ field public static final int CIPHER_TKIP = 2; // 0x2
+ field public static final int KEY_MGMT_EAP = 2; // 0x2
+ field public static final int KEY_MGMT_EAP_SHA256 = 6; // 0x6
+ field public static final int KEY_MGMT_EAP_SUITE_B_192 = 10; // 0xa
+ field public static final int KEY_MGMT_FT_EAP = 4; // 0x4
+ field public static final int KEY_MGMT_FT_PSK = 3; // 0x3
+ field public static final int KEY_MGMT_FT_SAE = 11; // 0xb
+ field public static final int KEY_MGMT_NONE = 0; // 0x0
+ field public static final int KEY_MGMT_OSEN = 7; // 0x7
+ field public static final int KEY_MGMT_OWE = 9; // 0x9
+ field public static final int KEY_MGMT_OWE_TRANSITION = 12; // 0xc
+ field public static final int KEY_MGMT_PSK = 1; // 0x1
+ field public static final int KEY_MGMT_PSK_SHA256 = 5; // 0x5
+ field public static final int KEY_MGMT_SAE = 8; // 0x8
+ field public static final int KEY_MGMT_WAPI_CERT = 14; // 0xe
+ field public static final int KEY_MGMT_WAPI_PSK = 13; // 0xd
+ field public static final int PROTOCOL_NONE = 0; // 0x0
+ field public static final int PROTOCOL_OSEN = 3; // 0x3
+ field public static final int PROTOCOL_RSN = 2; // 0x2
+ field public static final int PROTOCOL_WAPI = 4; // 0x4
+ field public static final int PROTOCOL_WPA = 1; // 0x1
+ }
+
+ public final class SoftApCapability implements android.os.Parcelable {
+ method public boolean areFeaturesSupported(long);
+ method public int describeContents();
+ method public int getMaxSupportedClients();
+ method @NonNull public int[] getSupportedChannelList(int);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApCapability> CREATOR;
+ field public static final long SOFTAP_FEATURE_ACS_OFFLOAD = 1L; // 0x1L
+ field public static final long SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT = 2L; // 0x2L
+ field public static final long SOFTAP_FEATURE_MAC_ADDRESS_CUSTOMIZATION = 8L; // 0x8L
+ field public static final long SOFTAP_FEATURE_WPA3_SAE = 4L; // 0x4L
+ }
+
+ public final class SoftApConfiguration implements android.os.Parcelable {
+ method @NonNull public java.util.List<android.net.MacAddress> getAllowedClientList();
+ method public int getBand();
+ method @NonNull public int[] getBands();
+ method @NonNull public java.util.List<android.net.MacAddress> getBlockedClientList();
+ method public int getChannel();
+ method @NonNull public android.util.SparseIntArray getChannels();
+ method public int getMacRandomizationSetting();
+ method public int getMaxNumberOfClients();
+ method public long getShutdownTimeoutMillis();
+ method public boolean isAutoShutdownEnabled();
+ method public boolean isClientControlByUserEnabled();
+ method @Nullable public android.net.wifi.WifiConfiguration toWifiConfiguration();
+ field public static final int BAND_2GHZ = 1; // 0x1
+ field public static final int BAND_5GHZ = 2; // 0x2
+ field public static final int BAND_6GHZ = 4; // 0x4
+ field @Deprecated public static final int BAND_ANY = 7; // 0x7
+ field public static final int RANDOMIZATION_NONE = 0; // 0x0
+ field public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1
+ }
+
+ public static final class SoftApConfiguration.Builder {
+ ctor public SoftApConfiguration.Builder();
+ ctor public SoftApConfiguration.Builder(@NonNull android.net.wifi.SoftApConfiguration);
+ method @NonNull public android.net.wifi.SoftApConfiguration build();
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setAllowedClientList(@NonNull java.util.List<android.net.MacAddress>);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setAutoShutdownEnabled(boolean);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBand(int);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBands(@NonNull int[]);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBlockedClientList(@NonNull java.util.List<android.net.MacAddress>);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBssid(@Nullable android.net.MacAddress);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setChannel(int, int);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setChannels(@NonNull android.util.SparseIntArray);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setClientControlByUserEnabled(boolean);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setHiddenSsid(boolean);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setMacRandomizationSetting(int);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setMaxNumberOfClients(@IntRange(from=0) int);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setPassphrase(@Nullable String, int);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setShutdownTimeoutMillis(@IntRange(from=0) long);
+ method @NonNull public android.net.wifi.SoftApConfiguration.Builder setSsid(@Nullable String);
+ }
+
+ public final class SoftApInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getBandwidth();
+ method @Nullable public android.net.MacAddress getBssid();
+ method public int getFrequency();
+ method public int getWifiStandard();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CHANNEL_WIDTH_160MHZ = 6; // 0x6
+ field public static final int CHANNEL_WIDTH_20MHZ = 2; // 0x2
+ field public static final int CHANNEL_WIDTH_20MHZ_NOHT = 1; // 0x1
+ field public static final int CHANNEL_WIDTH_40MHZ = 3; // 0x3
+ field public static final int CHANNEL_WIDTH_80MHZ = 4; // 0x4
+ field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 5; // 0x5
+ field public static final int CHANNEL_WIDTH_INVALID = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApInfo> CREATOR;
+ }
+
+ public final class WifiClient implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.net.MacAddress getMacAddress();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiClient> CREATOR;
+ }
+
+ @Deprecated public class WifiConfiguration implements android.os.Parcelable {
+ method @Deprecated public int getAuthType();
+ method @Deprecated @NonNull public android.net.IpConfiguration getIpConfiguration();
+ method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus getNetworkSelectionStatus();
+ method @Deprecated @NonNull public String getPrintableSsid();
+ method @Deprecated public int getRecentFailureReason();
+ method @Deprecated public boolean hasNoInternetAccess();
+ method @Deprecated public boolean isEphemeral();
+ method @Deprecated public static boolean isMetered(@Nullable android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiInfo);
+ method @Deprecated public boolean isNoInternetAccessExpected();
+ method @Deprecated public void setIpConfiguration(@Nullable android.net.IpConfiguration);
+ method @Deprecated public void setNetworkSelectionStatus(@NonNull android.net.wifi.WifiConfiguration.NetworkSelectionStatus);
+ field @Deprecated public static final int INVALID_NETWORK_ID = -1; // 0xffffffff
+ field @Deprecated public static final int METERED_OVERRIDE_METERED = 1; // 0x1
+ field @Deprecated public static final int METERED_OVERRIDE_NONE = 0; // 0x0
+ field @Deprecated public static final int METERED_OVERRIDE_NOT_METERED = 2; // 0x2
+ field @Deprecated public static final int RANDOMIZATION_AUTO = 3; // 0x3
+ field @Deprecated public static final int RANDOMIZATION_ENHANCED = 2; // 0x2
+ field @Deprecated public static final int RANDOMIZATION_NONE = 0; // 0x0
+ field @Deprecated public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1
+ field @Deprecated public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17; // 0x11
+ field @Deprecated public static final int RECENT_FAILURE_DISCONNECTION_AP_BUSY = 1004; // 0x3ec
+ field @Deprecated public static final int RECENT_FAILURE_MBO_OCE_DISCONNECT = 1001; // 0x3e9
+ field @Deprecated public static final int RECENT_FAILURE_NONE = 0; // 0x0
+ field @Deprecated public static final int RECENT_FAILURE_POOR_CHANNEL_CONDITIONS = 1003; // 0x3eb
+ field @Deprecated public static final int RECENT_FAILURE_REFUSED_TEMPORARILY = 1002; // 0x3ea
+ field @Deprecated public boolean allowAutojoin;
+ field @Deprecated public int carrierId;
+ field @Deprecated public String creatorName;
+ field @Deprecated public int creatorUid;
+ field @Deprecated public boolean fromWifiNetworkSpecifier;
+ field @Deprecated public boolean fromWifiNetworkSuggestion;
+ field @Deprecated public String lastUpdateName;
+ field @Deprecated public int lastUpdateUid;
+ field @Deprecated public int macRandomizationSetting;
+ field @Deprecated public boolean meteredHint;
+ field @Deprecated public int meteredOverride;
+ field @Deprecated public int numAssociation;
+ field @Deprecated public int numScorerOverride;
+ field @Deprecated public int numScorerOverrideAndSwitchedNetwork;
+ field @Deprecated public boolean requirePmf;
+ field @Deprecated public boolean shared;
+ field @Deprecated public int subscriptionId;
+ field @Deprecated public boolean useExternalScores;
+ }
+
+ @Deprecated public static class WifiConfiguration.KeyMgmt {
+ field @Deprecated public static final int WAPI_CERT = 14; // 0xe
+ field @Deprecated public static final int WAPI_PSK = 13; // 0xd
+ field @Deprecated public static final int WPA2_PSK = 4; // 0x4
+ }
+
+ @Deprecated public static class WifiConfiguration.NetworkSelectionStatus {
+ method @Deprecated public int getDisableReasonCounter(int);
+ method @Deprecated public long getDisableTime();
+ method @Deprecated public static int getMaxNetworkSelectionDisableReason();
+ method @Deprecated public int getNetworkSelectionDisableReason();
+ method @Deprecated @Nullable public static String getNetworkSelectionDisableReasonString(int);
+ method @Deprecated public int getNetworkSelectionStatus();
+ method @Deprecated @NonNull public String getNetworkStatusString();
+ method @Deprecated public boolean hasEverConnected();
+ field @Deprecated public static final int DISABLED_ASSOCIATION_REJECTION = 1; // 0x1
+ field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE = 2; // 0x2
+ field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_CREDENTIALS = 5; // 0x5
+ field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_SUBSCRIPTION = 9; // 0x9
+ field @Deprecated public static final int DISABLED_BY_WIFI_MANAGER = 7; // 0x7
+ field @Deprecated public static final int DISABLED_BY_WRONG_PASSWORD = 8; // 0x8
+ field @Deprecated public static final int DISABLED_DHCP_FAILURE = 3; // 0x3
+ field @Deprecated public static final int DISABLED_NONE = 0; // 0x0
+ field @Deprecated public static final int DISABLED_NO_INTERNET_PERMANENT = 6; // 0x6
+ field @Deprecated public static final int DISABLED_NO_INTERNET_TEMPORARY = 4; // 0x4
+ field @Deprecated public static final int NETWORK_SELECTION_ENABLED = 0; // 0x0
+ field @Deprecated public static final int NETWORK_SELECTION_PERMANENTLY_DISABLED = 2; // 0x2
+ field @Deprecated public static final int NETWORK_SELECTION_TEMPORARY_DISABLED = 1; // 0x1
+ }
+
+ @Deprecated public static final class WifiConfiguration.NetworkSelectionStatus.Builder {
+ ctor @Deprecated public WifiConfiguration.NetworkSelectionStatus.Builder();
+ method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus build();
+ method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus.Builder setNetworkSelectionDisableReason(int);
+ method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus.Builder setNetworkSelectionStatus(int);
+ }
+
+ public class WifiEnterpriseConfig implements android.os.Parcelable {
+ method @Nullable public String[] getCaCertificateAliases();
+ method @NonNull public String getCaPath();
+ method @NonNull public String getClientCertificateAlias();
+ method public int getOcsp();
+ method @NonNull public String getWapiCertSuite();
+ method public void setCaCertificateAliases(@Nullable String[]);
+ method public void setCaPath(@NonNull String);
+ method public void setClientCertificateAlias(@NonNull String);
+ method public void setOcsp(int);
+ method public void setWapiCertSuite(@NonNull String);
+ field public static final int OCSP_NONE = 0; // 0x0
+ field public static final int OCSP_REQUEST_CERT_STATUS = 1; // 0x1
+ field public static final int OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3; // 0x3
+ field public static final int OCSP_REQUIRE_CERT_STATUS = 2; // 0x2
+ }
+
+ public class WifiFrameworkInitializer {
+ method public static void registerServiceWrappers();
+ }
+
+ public class WifiInfo implements android.os.Parcelable {
+ method public double getLostTxPacketsPerSecond();
+ method @Nullable public String getRequestingPackageName();
+ method public double getRetriedTxPacketsPerSecond();
+ method public int getScore();
+ method public double getSuccessfulRxPacketsPerSecond();
+ method public double getSuccessfulTxPacketsPerSecond();
+ method public boolean isEphemeral();
+ method public boolean isOemPaid();
+ method public boolean isOemPrivate();
+ method public boolean isOsuAp();
+ method public boolean isPasspointAp();
+ method public boolean isTrusted();
+ method @Nullable public static String sanitizeSsid(@Nullable String);
+ field public static final String DEFAULT_MAC_ADDRESS = "02:00:00:00:00:00";
+ field public static final int INVALID_RSSI = -127; // 0xffffff81
+ }
+
+ public class WifiManager {
+ method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void addOnWifiUsabilityStatsListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoin(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoinGlobal(boolean);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoinPasspoint(@NonNull String, boolean);
+ method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void clearWifiConnectedNetworkScorer();
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void connect(@NonNull android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiManager.ActionListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void connect(int, @Nullable android.net.wifi.WifiManager.ActionListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void disable(int, @Nullable android.net.wifi.WifiManager.ActionListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK}) public void disableEphemeralNetwork(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void factoryReset();
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void forget(int, @Nullable android.net.wifi.WifiManager.ActionListener);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.util.Pair<android.net.wifi.WifiConfiguration,java.util.Map<java.lang.Integer,java.util.List<android.net.wifi.ScanResult>>>> getAllMatchingWifiConfigs(@NonNull java.util.List<android.net.wifi.ScanResult>);
+ method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String getCountryCode();
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public android.net.Network getCurrentNetwork();
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String[] getFactoryMacAddresses();
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.Map<android.net.wifi.hotspot2.OsuProvider,java.util.List<android.net.wifi.ScanResult>> getMatchingOsuProviders(@Nullable java.util.List<android.net.wifi.ScanResult>);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.Map<android.net.wifi.hotspot2.OsuProvider,android.net.wifi.hotspot2.PasspointConfiguration> getMatchingPasspointConfigsForOsuProviders(@NonNull java.util.Set<android.net.wifi.hotspot2.OsuProvider>);
+ method @NonNull @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE}) public java.util.Map<android.net.wifi.WifiNetworkSuggestion,java.util.List<android.net.wifi.ScanResult>> getMatchingScanResults(@NonNull java.util.List<android.net.wifi.WifiNetworkSuggestion>, @Nullable java.util.List<android.net.wifi.ScanResult>);
+ method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE, android.Manifest.permission.READ_WIFI_CREDENTIAL}) public java.util.List<android.net.wifi.WifiConfiguration> getPrivilegedConfiguredNetworks();
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public android.net.wifi.SoftApConfiguration getSoftApConfiguration();
+ method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void getWifiActivityEnergyInfoAsync(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.OnWifiActivityEnergyInfoListener);
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public android.net.wifi.WifiConfiguration getWifiApConfiguration();
+ method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public int getWifiApState();
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.net.wifi.WifiConfiguration> getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(@NonNull java.util.List<android.net.wifi.ScanResult>);
+ method public boolean is60GHzBandSupported();
+ method public boolean isApMacRandomizationSupported();
+ method public boolean isConnectedMacRandomizationSupported();
+ method @Deprecated public boolean isDeviceToDeviceRttSupported();
+ method public boolean isPortableHotspotSupported();
+ method public boolean isVerboseLoggingEnabled();
+ method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isWifiApEnabled();
+ method public boolean isWifiScannerSupported();
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerNetworkRequestMatchCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerSoftApCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SoftApCallback);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerTrafficStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.TrafficStateCallback);
+ method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void removeOnWifiUsabilityStatsListener(@NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreBackupData(@NonNull byte[]);
+ method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public android.net.wifi.SoftApConfiguration restoreSoftApBackupData(@NonNull byte[]);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreSupplicantBackupData(@NonNull byte[], @NonNull byte[]);
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public byte[] retrieveBackupData();
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public byte[] retrieveSoftApBackupData();
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void save(@NonNull android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiManager.ActionListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setAutoWakeupEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE) public void setDeviceMobilityState(int);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setMacRandomizationSettingPasspointEnabled(@NonNull String, boolean);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setPasspointMeteredOverride(@NonNull String, int);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanAlwaysAvailable(boolean);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanThrottleEnabled(boolean);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public boolean setSoftApConfiguration(@NonNull android.net.wifi.SoftApConfiguration);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setVerboseLoggingEnabled(boolean);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
+ method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public boolean setWifiConnectedNetworkScorer(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.WifiConnectedNetworkScorer);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsConfiguratorInitiator(@NonNull String, int, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsEnrolleeInitiator(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startLocalOnlyHotspot(@NonNull android.net.wifi.SoftApConfiguration, @Nullable java.util.concurrent.Executor, @Nullable android.net.wifi.WifiManager.LocalOnlyHotspotCallback);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public boolean startScan(android.os.WorkSource);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startSubscriptionProvisioning(@NonNull android.net.wifi.hotspot2.OsuProvider, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.hotspot2.ProvisioningCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean startTetheredHotspot(@Nullable android.net.wifi.SoftApConfiguration);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopEasyConnectSession();
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean stopSoftAp();
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterNetworkRequestMatchCallback(@NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterSoftApCallback(@NonNull android.net.wifi.WifiManager.SoftApCallback);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterTrafficStateCallback(@NonNull android.net.wifi.WifiManager.TrafficStateCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void updateInterfaceIpState(@Nullable String, int);
+ method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void updateWifiUsabilityScore(int, int, int);
+ field public static final String ACTION_LINK_CONFIGURATION_CHANGED = "android.net.wifi.LINK_CONFIGURATION_CHANGED";
+ field @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public static final String ACTION_NETWORK_SETTINGS_RESET = "android.net.wifi.action.NETWORK_SETTINGS_RESET";
+ field public static final String ACTION_PASSPOINT_LAUNCH_OSU_VIEW = "android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW";
+ field public static final String ACTION_REQUEST_DISABLE = "android.net.wifi.action.REQUEST_DISABLE";
+ field public static final String ACTION_REQUEST_ENABLE = "android.net.wifi.action.REQUEST_ENABLE";
+ field public static final int CHANGE_REASON_ADDED = 0; // 0x0
+ field public static final int CHANGE_REASON_CONFIG_CHANGE = 2; // 0x2
+ field public static final int CHANGE_REASON_REMOVED = 1; // 0x1
+ field public static final String CONFIGURED_NETWORKS_CHANGED_ACTION = "android.net.wifi.CONFIGURED_NETWORKS_CHANGE";
+ field public static final int DEVICE_MOBILITY_STATE_HIGH_MVMT = 1; // 0x1
+ field public static final int DEVICE_MOBILITY_STATE_LOW_MVMT = 2; // 0x2
+ field public static final int DEVICE_MOBILITY_STATE_STATIONARY = 3; // 0x3
+ field public static final int DEVICE_MOBILITY_STATE_UNKNOWN = 0; // 0x0
+ field public static final int EASY_CONNECT_NETWORK_ROLE_AP = 1; // 0x1
+ field public static final int EASY_CONNECT_NETWORK_ROLE_STA = 0; // 0x0
+ field public static final String EXTRA_CHANGE_REASON = "changeReason";
+ field @Deprecated public static final String EXTRA_LINK_PROPERTIES = "android.net.wifi.extra.LINK_PROPERTIES";
+ field @Deprecated public static final String EXTRA_MULTIPLE_NETWORKS_CHANGED = "multipleChanges";
+ field public static final String EXTRA_OSU_NETWORK = "android.net.wifi.extra.OSU_NETWORK";
+ field public static final String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
+ field public static final String EXTRA_URL = "android.net.wifi.extra.URL";
+ field public static final String EXTRA_WIFI_AP_FAILURE_REASON = "android.net.wifi.extra.WIFI_AP_FAILURE_REASON";
+ field public static final String EXTRA_WIFI_AP_INTERFACE_NAME = "android.net.wifi.extra.WIFI_AP_INTERFACE_NAME";
+ field public static final String EXTRA_WIFI_AP_MODE = "android.net.wifi.extra.WIFI_AP_MODE";
+ field public static final String EXTRA_WIFI_AP_STATE = "wifi_state";
+ field @Deprecated public static final String EXTRA_WIFI_CONFIGURATION = "wifiConfiguration";
+ field public static final String EXTRA_WIFI_CREDENTIAL_EVENT_TYPE = "et";
+ field public static final String EXTRA_WIFI_CREDENTIAL_SSID = "ssid";
+ field public static final int IFACE_IP_MODE_CONFIGURATION_ERROR = 0; // 0x0
+ field public static final int IFACE_IP_MODE_LOCAL_ONLY = 2; // 0x2
+ field public static final int IFACE_IP_MODE_TETHERED = 1; // 0x1
+ field public static final int IFACE_IP_MODE_UNSPECIFIED = -1; // 0xffffffff
+ field public static final int PASSPOINT_HOME_NETWORK = 0; // 0x0
+ field public static final int PASSPOINT_ROAMING_NETWORK = 1; // 0x1
+ field public static final int SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER = 0; // 0x0
+ field public static final int SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS = 1; // 0x1
+ field public static final int SAP_START_FAILURE_GENERAL = 0; // 0x0
+ field public static final int SAP_START_FAILURE_NO_CHANNEL = 1; // 0x1
+ field public static final int SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION = 2; // 0x2
+ field public static final String WIFI_AP_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_AP_STATE_CHANGED";
+ field public static final int WIFI_AP_STATE_DISABLED = 11; // 0xb
+ field public static final int WIFI_AP_STATE_DISABLING = 10; // 0xa
+ field public static final int WIFI_AP_STATE_ENABLED = 13; // 0xd
+ field public static final int WIFI_AP_STATE_ENABLING = 12; // 0xc
+ field public static final int WIFI_AP_STATE_FAILED = 14; // 0xe
+ field public static final String WIFI_CREDENTIAL_CHANGED_ACTION = "android.net.wifi.WIFI_CREDENTIAL_CHANGED";
+ field public static final int WIFI_CREDENTIAL_FORGOT = 1; // 0x1
+ field public static final int WIFI_CREDENTIAL_SAVED = 0; // 0x0
+ }
+
+ public static interface WifiManager.ActionListener {
+ method public void onFailure(int);
+ method public void onSuccess();
+ }
+
+ public static interface WifiManager.NetworkRequestMatchCallback {
+ method public default void onAbort();
+ method public default void onMatch(@NonNull java.util.List<android.net.wifi.ScanResult>);
+ method public default void onUserSelectionCallbackRegistration(@NonNull android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback);
+ method public default void onUserSelectionConnectFailure(@NonNull android.net.wifi.WifiConfiguration);
+ method public default void onUserSelectionConnectSuccess(@NonNull android.net.wifi.WifiConfiguration);
+ }
+
+ public static interface WifiManager.NetworkRequestUserSelectionCallback {
+ method public default void reject();
+ method public default void select(@NonNull android.net.wifi.WifiConfiguration);
+ }
+
+ public static interface WifiManager.OnWifiActivityEnergyInfoListener {
+ method public void onWifiActivityEnergyInfo(@Nullable android.os.connectivity.WifiActivityEnergyInfo);
+ }
+
+ public static interface WifiManager.OnWifiUsabilityStatsListener {
+ method public void onWifiUsabilityStats(int, boolean, @NonNull android.net.wifi.WifiUsabilityStatsEntry);
+ }
+
+ public static interface WifiManager.ScoreUpdateObserver {
+ method public void notifyScoreUpdate(int, int);
+ method public void triggerUpdateOfWifiUsabilityStats(int);
+ }
+
+ public static interface WifiManager.SoftApCallback {
+ method public default void onBlockedClientConnecting(@NonNull android.net.wifi.WifiClient, int);
+ method public default void onCapabilityChanged(@NonNull android.net.wifi.SoftApCapability);
+ method public default void onConnectedClientsChanged(@NonNull java.util.List<android.net.wifi.WifiClient>);
+ method public default void onInfoChanged(@NonNull android.net.wifi.SoftApInfo);
+ method public default void onStateChanged(int, int);
+ }
+
+ public static interface WifiManager.TrafficStateCallback {
+ method public void onStateChanged(int);
+ field public static final int DATA_ACTIVITY_IN = 1; // 0x1
+ field public static final int DATA_ACTIVITY_INOUT = 3; // 0x3
+ field public static final int DATA_ACTIVITY_NONE = 0; // 0x0
+ field public static final int DATA_ACTIVITY_OUT = 2; // 0x2
+ }
+
+ public static interface WifiManager.WifiConnectedNetworkScorer {
+ method public void onSetScoreUpdateObserver(@NonNull android.net.wifi.WifiManager.ScoreUpdateObserver);
+ method public void onStart(int);
+ method public void onStop(int);
+ }
+
+ public final class WifiMigration {
+ method @Nullable public static java.io.InputStream convertAndRetrieveSharedConfigStoreFile(int);
+ method @Nullable public static java.io.InputStream convertAndRetrieveUserConfigStoreFile(int, @NonNull android.os.UserHandle);
+ method @NonNull public static android.net.wifi.WifiMigration.SettingsMigrationData loadFromSettings(@NonNull android.content.Context);
+ method public static void removeSharedConfigStoreFile(int);
+ method public static void removeUserConfigStoreFile(int, @NonNull android.os.UserHandle);
+ field public static final int STORE_FILE_SHARED_GENERAL = 0; // 0x0
+ field public static final int STORE_FILE_SHARED_SOFTAP = 1; // 0x1
+ field public static final int STORE_FILE_USER_GENERAL = 2; // 0x2
+ field public static final int STORE_FILE_USER_NETWORK_SUGGESTIONS = 3; // 0x3
+ }
+
+ public static final class WifiMigration.SettingsMigrationData implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getP2pDeviceName();
+ method public boolean isP2pFactoryResetPending();
+ method public boolean isScanAlwaysAvailable();
+ method public boolean isScanThrottleEnabled();
+ method public boolean isSoftApTimeoutEnabled();
+ method public boolean isVerboseLoggingEnabled();
+ method public boolean isWakeUpEnabled();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiMigration.SettingsMigrationData> CREATOR;
+ }
+
+ public static final class WifiMigration.SettingsMigrationData.Builder {
+ ctor public WifiMigration.SettingsMigrationData.Builder();
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData build();
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setP2pDeviceName(@Nullable String);
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setP2pFactoryResetPending(boolean);
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setScanAlwaysAvailable(boolean);
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setScanThrottleEnabled(boolean);
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setSoftApTimeoutEnabled(boolean);
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setVerboseLoggingEnabled(boolean);
+ method @NonNull public android.net.wifi.WifiMigration.SettingsMigrationData.Builder setWakeUpEnabled(boolean);
+ }
+
+ public class WifiNetworkConnectionStatistics implements android.os.Parcelable {
+ ctor public WifiNetworkConnectionStatistics(int, int);
+ ctor public WifiNetworkConnectionStatistics();
+ ctor public WifiNetworkConnectionStatistics(android.net.wifi.WifiNetworkConnectionStatistics);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkConnectionStatistics> CREATOR;
+ field public int numConnection;
+ field public int numUsage;
+ }
+
+ public final class WifiNetworkSuggestion implements android.os.Parcelable {
+ method @NonNull public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ method public boolean isOemPaid();
+ method public boolean isOemPrivate();
+ }
+
+ public static final class WifiNetworkSuggestion.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierId(int);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setOemPaid(boolean);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setOemPrivate(boolean);
+ }
+
+ public class WifiScanner {
+ method @Deprecated public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
+ method @Deprecated public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<java.lang.Integer> getAvailableChannels(int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean getScanResults();
+ method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<android.net.wifi.ScanResult> getSingleScanResults();
+ method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void registerScanListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiScanner.ScanListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setScanningEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
+ method @Deprecated public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
+ method @Deprecated public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
+ method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopScan(android.net.wifi.WifiScanner.ScanListener);
+ method @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
+ method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
+ method public void unregisterScanListener(@NonNull android.net.wifi.WifiScanner.ScanListener);
+ field public static final int MAX_SCAN_PERIOD_MS = 1024000; // 0xfa000
+ field public static final int MIN_SCAN_PERIOD_MS = 1000; // 0x3e8
+ field public static final int REASON_DUPLICATE_REQEUST = -5; // 0xfffffffb
+ field public static final int REASON_INVALID_LISTENER = -2; // 0xfffffffe
+ field public static final int REASON_INVALID_REQUEST = -3; // 0xfffffffd
+ field public static final int REASON_NOT_AUTHORIZED = -4; // 0xfffffffc
+ field public static final int REASON_SUCCEEDED = 0; // 0x0
+ field public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
+ field @Deprecated public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0; // 0x0
+ field public static final int REPORT_EVENT_AFTER_EACH_SCAN = 1; // 0x1
+ field public static final int REPORT_EVENT_FULL_SCAN_RESULT = 2; // 0x2
+ field public static final int REPORT_EVENT_NO_BATCH = 4; // 0x4
+ field public static final int SCAN_TYPE_HIGH_ACCURACY = 2; // 0x2
+ field public static final int SCAN_TYPE_LOW_LATENCY = 0; // 0x0
+ field public static final int SCAN_TYPE_LOW_POWER = 1; // 0x1
+ field public static final int WIFI_BAND_24_5_6_GHZ = 11; // 0xb
+ field public static final int WIFI_BAND_24_5_WITH_DFS_6_GHZ = 15; // 0xf
+ field public static final int WIFI_BAND_24_GHZ = 1; // 0x1
+ field public static final int WIFI_BAND_5_GHZ = 2; // 0x2
+ field public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 4; // 0x4
+ field public static final int WIFI_BAND_5_GHZ_WITH_DFS = 6; // 0x6
+ field public static final int WIFI_BAND_60_GHZ = 16; // 0x10
+ field public static final int WIFI_BAND_6_GHZ = 8; // 0x8
+ field public static final int WIFI_BAND_BOTH = 3; // 0x3
+ field public static final int WIFI_BAND_BOTH_WITH_DFS = 7; // 0x7
+ field public static final int WIFI_BAND_UNSPECIFIED = 0; // 0x0
+ }
+
+ public static interface WifiScanner.ActionListener {
+ method public void onFailure(int, String);
+ method public void onSuccess();
+ }
+
+ @Deprecated public static class WifiScanner.BssidInfo {
+ ctor @Deprecated public WifiScanner.BssidInfo();
+ field @Deprecated public String bssid;
+ field @Deprecated public int frequencyHint;
+ field @Deprecated public int high;
+ field @Deprecated public int low;
+ }
+
+ @Deprecated public static interface WifiScanner.BssidListener extends android.net.wifi.WifiScanner.ActionListener {
+ method @Deprecated public void onFound(android.net.wifi.ScanResult[]);
+ method @Deprecated public void onLost(android.net.wifi.ScanResult[]);
+ }
+
+ public static class WifiScanner.ChannelSpec {
+ ctor public WifiScanner.ChannelSpec(int);
+ field public int frequency;
+ }
+
+ @Deprecated public static class WifiScanner.HotlistSettings implements android.os.Parcelable {
+ ctor @Deprecated public WifiScanner.HotlistSettings();
+ field @Deprecated public int apLostThreshold;
+ field @Deprecated public android.net.wifi.WifiScanner.BssidInfo[] bssidInfos;
+ }
+
+ public static class WifiScanner.ParcelableScanData implements android.os.Parcelable {
+ ctor public WifiScanner.ParcelableScanData(android.net.wifi.WifiScanner.ScanData[]);
+ method public android.net.wifi.WifiScanner.ScanData[] getResults();
+ field public android.net.wifi.WifiScanner.ScanData[] mResults;
+ }
+
+ public static class WifiScanner.ParcelableScanResults implements android.os.Parcelable {
+ ctor public WifiScanner.ParcelableScanResults(android.net.wifi.ScanResult[]);
+ method public android.net.wifi.ScanResult[] getResults();
+ field public android.net.wifi.ScanResult[] mResults;
+ }
+
+ public static class WifiScanner.ScanData implements android.os.Parcelable {
+ ctor public WifiScanner.ScanData(int, int, android.net.wifi.ScanResult[]);
+ ctor public WifiScanner.ScanData(android.net.wifi.WifiScanner.ScanData);
+ method public int getFlags();
+ method public int getId();
+ method public android.net.wifi.ScanResult[] getResults();
+ }
+
+ public static interface WifiScanner.ScanListener extends android.net.wifi.WifiScanner.ActionListener {
+ method public void onFullResult(android.net.wifi.ScanResult);
+ method @Deprecated public void onPeriodChanged(int);
+ method public void onResults(android.net.wifi.WifiScanner.ScanData[]);
+ }
+
+ public static class WifiScanner.ScanSettings implements android.os.Parcelable {
+ ctor public WifiScanner.ScanSettings();
+ field public int band;
+ field public android.net.wifi.WifiScanner.ChannelSpec[] channels;
+ field @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public final java.util.List<android.net.wifi.WifiScanner.ScanSettings.HiddenNetwork> hiddenNetworks;
+ field public boolean hideFromAppOps;
+ field public boolean ignoreLocationSettings;
+ field @Deprecated public int maxPeriodInMs;
+ field @Deprecated public int maxScansToCache;
+ field @Deprecated public int numBssidsPerScan;
+ field @Deprecated public int periodInMs;
+ field @Deprecated public int reportEvents;
+ field @Deprecated public int stepCount;
+ field @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public int type;
+ }
+
+ public static class WifiScanner.ScanSettings.HiddenNetwork {
+ ctor public WifiScanner.ScanSettings.HiddenNetwork(@NonNull String);
+ field @NonNull public final String ssid;
+ }
+
+ @Deprecated public static interface WifiScanner.WifiChangeListener extends android.net.wifi.WifiScanner.ActionListener {
+ method @Deprecated public void onChanging(android.net.wifi.ScanResult[]);
+ method @Deprecated public void onQuiescence(android.net.wifi.ScanResult[]);
+ }
+
+ @Deprecated public static class WifiScanner.WifiChangeSettings implements android.os.Parcelable {
+ ctor @Deprecated public WifiScanner.WifiChangeSettings();
+ field @Deprecated public android.net.wifi.WifiScanner.BssidInfo[] bssidInfos;
+ field @Deprecated public int lostApSampleSize;
+ field @Deprecated public int minApsBreachingThreshold;
+ field @Deprecated public int periodInMs;
+ field @Deprecated public int rssiSampleSize;
+ field @Deprecated public int unchangedSampleSize;
+ }
+
+ public final class WifiUsabilityStatsEntry implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getCellularDataNetworkType();
+ method public int getCellularSignalStrengthDb();
+ method public int getCellularSignalStrengthDbm();
+ method public int getLinkSpeedMbps();
+ method public int getProbeElapsedTimeSinceLastUpdateMillis();
+ method public int getProbeMcsRateSinceLastUpdate();
+ method public int getProbeStatusSinceLastUpdate();
+ method public int getRssi();
+ method public int getRxLinkSpeedMbps();
+ method public long getTimeStampMillis();
+ method public long getTotalBackgroundScanTimeMillis();
+ method public long getTotalBeaconRx();
+ method public long getTotalCcaBusyFreqTimeMillis();
+ method public long getTotalHotspot2ScanTimeMillis();
+ method public long getTotalNanScanTimeMillis();
+ method public long getTotalPnoScanTimeMillis();
+ method public long getTotalRadioOnFreqTimeMillis();
+ method public long getTotalRadioOnTimeMillis();
+ method public long getTotalRadioRxTimeMillis();
+ method public long getTotalRadioTxTimeMillis();
+ method public long getTotalRoamScanTimeMillis();
+ method public long getTotalRxSuccess();
+ method public long getTotalScanTimeMillis();
+ method public long getTotalTxBad();
+ method public long getTotalTxRetries();
+ method public long getTotalTxSuccess();
+ method public boolean isSameRegisteredCell();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiUsabilityStatsEntry> CREATOR;
+ field public static final int PROBE_STATUS_FAILURE = 3; // 0x3
+ field public static final int PROBE_STATUS_NO_PROBE = 1; // 0x1
+ field public static final int PROBE_STATUS_SUCCESS = 2; // 0x2
+ field public static final int PROBE_STATUS_UNKNOWN = 0; // 0x0
+ }
+
+}
+
+package android.net.wifi.aware {
+
+ public class DiscoverySession implements java.lang.AutoCloseable {
+ method @Deprecated public android.net.NetworkSpecifier createNetworkSpecifierPmk(@NonNull android.net.wifi.aware.PeerHandle, @NonNull byte[]);
+ }
+
+ public class WifiAwareManager {
+ method public void enableInstantCommunicationMode(boolean);
+ }
+
+ public class WifiAwareSession implements java.lang.AutoCloseable {
+ method public android.net.NetworkSpecifier createNetworkSpecifierPmk(int, @NonNull byte[], @NonNull byte[]);
+ }
+
+}
+
+package android.net.wifi.hotspot2 {
+
+ public final class OsuProvider implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getFriendlyName();
+ method @Nullable public android.net.Uri getServerUri();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.OsuProvider> CREATOR;
+ }
+
+ public final class PasspointConfiguration implements android.os.Parcelable {
+ method public int getMeteredOverride();
+ method public boolean isAutojoinEnabled();
+ method public boolean isMacRandomizationEnabled();
+ }
+
+ public abstract class ProvisioningCallback {
+ ctor public ProvisioningCallback();
+ method public abstract void onProvisioningComplete();
+ method public abstract void onProvisioningFailure(int);
+ method public abstract void onProvisioningStatus(int);
+ field public static final int OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22; // 0x16
+ field public static final int OSU_FAILURE_AP_CONNECTION = 1; // 0x1
+ field public static final int OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8; // 0x8
+ field public static final int OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17; // 0x11
+ field public static final int OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21; // 0x15
+ field public static final int OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14; // 0xe
+ field public static final int OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19; // 0x13
+ field public static final int OSU_FAILURE_NO_PPS_MO = 16; // 0x10
+ field public static final int OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18; // 0x12
+ field public static final int OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23; // 0x17
+ field public static final int OSU_FAILURE_PROVISIONING_ABORTED = 6; // 0x6
+ field public static final int OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7; // 0x7
+ field public static final int OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20; // 0x14
+ field public static final int OSU_FAILURE_SERVER_CONNECTION = 3; // 0x3
+ field public static final int OSU_FAILURE_SERVER_URL_INVALID = 2; // 0x2
+ field public static final int OSU_FAILURE_SERVER_VALIDATION = 4; // 0x4
+ field public static final int OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5; // 0x5
+ field public static final int OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11; // 0xb
+ field public static final int OSU_FAILURE_START_REDIRECT_LISTENER = 12; // 0xc
+ field public static final int OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13; // 0xd
+ field public static final int OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9; // 0x9
+ field public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15; // 0xf
+ field public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10; // 0xa
+ field public static final int OSU_STATUS_AP_CONNECTED = 2; // 0x2
+ field public static final int OSU_STATUS_AP_CONNECTING = 1; // 0x1
+ field public static final int OSU_STATUS_INIT_SOAP_EXCHANGE = 6; // 0x6
+ field public static final int OSU_STATUS_REDIRECT_RESPONSE_RECEIVED = 8; // 0x8
+ field public static final int OSU_STATUS_RETRIEVING_TRUST_ROOT_CERTS = 11; // 0xb
+ field public static final int OSU_STATUS_SECOND_SOAP_EXCHANGE = 9; // 0x9
+ field public static final int OSU_STATUS_SERVER_CONNECTED = 5; // 0x5
+ field public static final int OSU_STATUS_SERVER_CONNECTING = 3; // 0x3
+ field public static final int OSU_STATUS_SERVER_VALIDATED = 4; // 0x4
+ field public static final int OSU_STATUS_THIRD_SOAP_EXCHANGE = 10; // 0xa
+ field public static final int OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE = 7; // 0x7
+ }
+
+}
+
+package android.net.wifi.nl80211 {
+
+ public final class DeviceWiphyCapabilities implements android.os.Parcelable {
+ ctor public DeviceWiphyCapabilities();
+ method public int describeContents();
+ method public int getMaxNumberRxSpatialStreams();
+ method public int getMaxNumberTxSpatialStreams();
+ method public boolean isChannelWidthSupported(int);
+ method public boolean isWifiStandardSupported(int);
+ method public void setWifiStandardSupport(int, boolean);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.DeviceWiphyCapabilities> CREATOR;
+ }
+
+ public final class NativeScanResult implements android.os.Parcelable {
+ ctor public NativeScanResult();
+ method public int describeContents();
+ method @Nullable public android.net.MacAddress getBssid();
+ method public int getCapabilities();
+ method public int getFrequencyMhz();
+ method @NonNull public byte[] getInformationElements();
+ method @NonNull public java.util.List<android.net.wifi.nl80211.RadioChainInfo> getRadioChainInfos();
+ method public int getSignalMbm();
+ method @NonNull public byte[] getSsid();
+ method public long getTsf();
+ method public boolean isAssociated();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int BSS_CAPABILITY_APSD = 2048; // 0x800
+ field public static final int BSS_CAPABILITY_CF_POLLABLE = 4; // 0x4
+ field public static final int BSS_CAPABILITY_CF_POLL_REQUEST = 8; // 0x8
+ field public static final int BSS_CAPABILITY_CHANNEL_AGILITY = 128; // 0x80
+ field public static final int BSS_CAPABILITY_DELAYED_BLOCK_ACK = 16384; // 0x4000
+ field public static final int BSS_CAPABILITY_DMG_ESS = 3; // 0x3
+ field public static final int BSS_CAPABILITY_DMG_IBSS = 1; // 0x1
+ field public static final int BSS_CAPABILITY_DSSS_OFDM = 8192; // 0x2000
+ field public static final int BSS_CAPABILITY_ESS = 1; // 0x1
+ field public static final int BSS_CAPABILITY_IBSS = 2; // 0x2
+ field public static final int BSS_CAPABILITY_IMMEDIATE_BLOCK_ACK = 32768; // 0x8000
+ field public static final int BSS_CAPABILITY_PBCC = 64; // 0x40
+ field public static final int BSS_CAPABILITY_PRIVACY = 16; // 0x10
+ field public static final int BSS_CAPABILITY_QOS = 512; // 0x200
+ field public static final int BSS_CAPABILITY_RADIO_MANAGEMENT = 4096; // 0x1000
+ field public static final int BSS_CAPABILITY_SHORT_PREAMBLE = 32; // 0x20
+ field public static final int BSS_CAPABILITY_SHORT_SLOT_TIME = 1024; // 0x400
+ field public static final int BSS_CAPABILITY_SPECTRUM_MANAGEMENT = 256; // 0x100
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.NativeScanResult> CREATOR;
+ }
+
+ public final class NativeWifiClient implements android.os.Parcelable {
+ ctor public NativeWifiClient(@Nullable android.net.MacAddress);
+ method public int describeContents();
+ method @Nullable public android.net.MacAddress getMacAddress();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.NativeWifiClient> CREATOR;
+ }
+
+ public final class PnoNetwork implements android.os.Parcelable {
+ ctor public PnoNetwork();
+ method public int describeContents();
+ method @NonNull public int[] getFrequenciesMhz();
+ method @NonNull public byte[] getSsid();
+ method public boolean isHidden();
+ method public void setFrequenciesMhz(@NonNull int[]);
+ method public void setHidden(boolean);
+ method public void setSsid(@NonNull byte[]);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.PnoNetwork> CREATOR;
+ }
+
+ public final class PnoSettings implements android.os.Parcelable {
+ ctor public PnoSettings();
+ method public int describeContents();
+ method public long getIntervalMillis();
+ method public int getMin2gRssiDbm();
+ method public int getMin5gRssiDbm();
+ method public int getMin6gRssiDbm();
+ method @NonNull public java.util.List<android.net.wifi.nl80211.PnoNetwork> getPnoNetworks();
+ method public void setIntervalMillis(long);
+ method public void setMin2gRssiDbm(int);
+ method public void setMin5gRssiDbm(int);
+ method public void setMin6gRssiDbm(int);
+ method public void setPnoNetworks(@NonNull java.util.List<android.net.wifi.nl80211.PnoNetwork>);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.PnoSettings> CREATOR;
+ }
+
+ public final class RadioChainInfo implements android.os.Parcelable {
+ ctor public RadioChainInfo(int, int);
+ method public int describeContents();
+ method public int getChainId();
+ method public int getLevelDbm();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.RadioChainInfo> CREATOR;
+ }
+
+ public class WifiNl80211Manager {
+ method public void abortScan(@NonNull String);
+ method public void enableVerboseLogging(boolean);
+ method @NonNull public int[] getChannelsMhzForBand(int);
+ method @Nullable public android.net.wifi.nl80211.DeviceWiphyCapabilities getDeviceWiphyCapabilities(@NonNull String);
+ method @NonNull public java.util.List<android.net.wifi.nl80211.NativeScanResult> getScanResults(@NonNull String, int);
+ method @Nullable public android.net.wifi.nl80211.WifiNl80211Manager.TxPacketCounters getTxPacketCounters(@NonNull String);
+ method @Nullable public static android.net.wifi.nl80211.WifiNl80211Manager.OemSecurityType parseOemSecurityTypeElement(int, int, @NonNull byte[]);
+ method @Deprecated public boolean registerApCallback(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.SoftApCallback);
+ method public void sendMgmtFrame(@NonNull String, @NonNull byte[], int, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.SendMgmtFrameCallback);
+ method public void setOnServiceDeadCallback(@NonNull Runnable);
+ method public boolean setupInterfaceForClientMode(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.ScanEventCallback, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.ScanEventCallback);
+ method public boolean setupInterfaceForSoftApMode(@NonNull String);
+ method @Nullable public android.net.wifi.nl80211.WifiNl80211Manager.SignalPollResult signalPoll(@NonNull String);
+ method public boolean startPnoScan(@NonNull String, @NonNull android.net.wifi.nl80211.PnoSettings, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.PnoScanRequestCallback);
+ method public boolean startScan(@NonNull String, int, @Nullable java.util.Set<java.lang.Integer>, @Nullable java.util.List<byte[]>);
+ method public boolean stopPnoScan(@NonNull String);
+ method public boolean tearDownClientInterface(@NonNull String);
+ method public boolean tearDownInterfaces();
+ method public boolean tearDownSoftApInterface(@NonNull String);
+ field public static final int SCAN_TYPE_PNO_SCAN = 1; // 0x1
+ field public static final int SCAN_TYPE_SINGLE_SCAN = 0; // 0x0
+ field public static final int SEND_MGMT_FRAME_ERROR_ALREADY_STARTED = 5; // 0x5
+ field public static final int SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED = 2; // 0x2
+ field public static final int SEND_MGMT_FRAME_ERROR_NO_ACK = 3; // 0x3
+ field public static final int SEND_MGMT_FRAME_ERROR_TIMEOUT = 4; // 0x4
+ field public static final int SEND_MGMT_FRAME_ERROR_UNKNOWN = 1; // 0x1
+ }
+
+ public static class WifiNl80211Manager.OemSecurityType {
+ ctor public WifiNl80211Manager.OemSecurityType(int, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, int);
+ field public final int groupCipher;
+ field @NonNull public final java.util.List<java.lang.Integer> keyManagement;
+ field @NonNull public final java.util.List<java.lang.Integer> pairwiseCipher;
+ field public final int protocol;
+ }
+
+ public static interface WifiNl80211Manager.PnoScanRequestCallback {
+ method public void onPnoRequestFailed();
+ method public void onPnoRequestSucceeded();
+ }
+
+ public static interface WifiNl80211Manager.ScanEventCallback {
+ method public void onScanFailed();
+ method public void onScanResultReady();
+ }
+
+ public static interface WifiNl80211Manager.SendMgmtFrameCallback {
+ method public void onAck(int);
+ method public void onFailure(int);
+ }
+
+ public static class WifiNl80211Manager.SignalPollResult {
+ field public final int associationFrequencyMHz;
+ field public final int currentRssiDbm;
+ field public final int rxBitrateMbps;
+ field public final int txBitrateMbps;
+ }
+
+ @Deprecated public static interface WifiNl80211Manager.SoftApCallback {
+ method @Deprecated public void onConnectedClientsChanged(@NonNull android.net.wifi.nl80211.NativeWifiClient, boolean);
+ method @Deprecated public void onFailure();
+ method @Deprecated public void onSoftApChannelSwitched(int, int);
+ }
+
+ public static class WifiNl80211Manager.TxPacketCounters {
+ field public final int txPacketFailed;
+ field public final int txPacketSucceeded;
+ }
+
+}
+
+package android.net.wifi.p2p {
+
+ public final class WifiP2pGroupList implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.net.wifi.p2p.WifiP2pGroup> getGroupList();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pGroupList> CREATOR;
+ }
+
+ public class WifiP2pManager {
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void deletePersistentGroup(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, int, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void factoryReset(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.READ_WIFI_CREDENTIAL}) public void requestPersistentGroupInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.PersistentGroupInfoListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void setDeviceName(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull String, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ method @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) public void setMiracastMode(int);
+ method @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) public void setWfdInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pWfdInfo, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void setWifiP2pChannels(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, int, int, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void startListening(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void stopListening(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
+ field public static final String ACTION_WIFI_P2P_PERSISTENT_GROUPS_CHANGED = "android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED";
+ field public static final int MIRACAST_DISABLED = 0; // 0x0
+ field public static final int MIRACAST_SINK = 2; // 0x2
+ field public static final int MIRACAST_SOURCE = 1; // 0x1
+ }
+
+ public static interface WifiP2pManager.PersistentGroupInfoListener {
+ method public void onPersistentGroupInfoAvailable(@NonNull android.net.wifi.p2p.WifiP2pGroupList);
+ }
+
+}
+
+package android.net.wifi.rtt {
+
+ public static final class RangingRequest.Builder {
+ method public android.net.wifi.rtt.RangingRequest.Builder addResponder(@NonNull android.net.wifi.rtt.ResponderConfig);
+ }
+
+ public final class RangingResult implements android.os.Parcelable {
+ method @NonNull public byte[] getLci();
+ method @NonNull public byte[] getLcr();
+ }
+
+ public final class ResponderConfig implements android.os.Parcelable {
+ ctor public ResponderConfig(@NonNull android.net.MacAddress, int, boolean, int, int, int, int, int);
+ ctor public ResponderConfig(@NonNull android.net.wifi.aware.PeerHandle, int, boolean, int, int, int, int, int);
+ method public int describeContents();
+ method public static android.net.wifi.rtt.ResponderConfig fromScanResult(android.net.wifi.ScanResult);
+ method public static android.net.wifi.rtt.ResponderConfig fromWifiAwarePeerHandleWithDefaults(android.net.wifi.aware.PeerHandle);
+ method public static android.net.wifi.rtt.ResponderConfig fromWifiAwarePeerMacAddressWithDefaults(android.net.MacAddress);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
+ field public static final int CHANNEL_WIDTH_20MHZ = 0; // 0x0
+ field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
+ field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
+ field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
+ field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderConfig> CREATOR;
+ field public static final int PREAMBLE_HE = 3; // 0x3
+ field public static final int PREAMBLE_HT = 1; // 0x1
+ field public static final int PREAMBLE_LEGACY = 0; // 0x0
+ field public static final int PREAMBLE_VHT = 2; // 0x2
+ field public static final int RESPONDER_AP = 0; // 0x0
+ field public static final int RESPONDER_AWARE = 4; // 0x4
+ field public static final int RESPONDER_P2P_CLIENT = 3; // 0x3
+ field public static final int RESPONDER_P2P_GO = 2; // 0x2
+ field public static final int RESPONDER_STA = 1; // 0x1
+ field public final int centerFreq0;
+ field public final int centerFreq1;
+ field public final int channelWidth;
+ field public final int frequency;
+ field public final android.net.MacAddress macAddress;
+ field public final android.net.wifi.aware.PeerHandle peerHandle;
+ field public final int preamble;
+ field public final int responderType;
+ field public final boolean supports80211mc;
+ }
+
+ public final class ResponderLocation implements android.os.Parcelable {
+ method public boolean getExtraInfoOnAssociationIndication();
+ }
+
+ public class WifiRttManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE}) public void cancelRanging(@Nullable android.os.WorkSource);
+ method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.ACCESS_WIFI_STATE}) public void startRanging(@Nullable android.os.WorkSource, @NonNull android.net.wifi.rtt.RangingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.rtt.RangingResultCallback);
+ }
+
+}
+
+package android.nfc {
+
+ public final class NfcAdapter {
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean addNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler, String[]);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disable();
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disable(boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disableNdefPush();
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enable();
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableNdefPush();
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableSecureNfc(boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean removeNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler);
+ method public void setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, int);
+ field public static final int FLAG_NDEF_PUSH_NO_CONFIRM = 1; // 0x1
+ }
+
+ public static interface NfcAdapter.NfcUnlockHandler {
+ method public boolean onUnlockAttempted(android.nfc.Tag);
+ }
+
+}
+
+package android.os {
+
+ public class BatteryManager {
+ method @RequiresPermission(android.Manifest.permission.POWER_SAVER) public boolean setChargingStateUpdateDelayMillis(int);
+ field public static final String EXTRA_EVENTS = "android.os.extra.EVENTS";
+ field public static final String EXTRA_EVENT_TIMESTAMP = "android.os.extra.EVENT_TIMESTAMP";
+ }
+
+ public final class BatterySaverPolicyConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method public float getAdjustBrightnessFactor();
+ method public boolean getAdvertiseIsEnabled();
+ method public boolean getDeferFullBackup();
+ method public boolean getDeferKeyValueBackup();
+ method @NonNull public java.util.Map<java.lang.String,java.lang.String> getDeviceSpecificSettings();
+ method public boolean getDisableAnimation();
+ method public boolean getDisableAod();
+ method public boolean getDisableLaunchBoost();
+ method public boolean getDisableOptionalSensors();
+ method public boolean getDisableSoundTrigger();
+ method public boolean getDisableVibration();
+ method public boolean getEnableAdjustBrightness();
+ method public boolean getEnableDataSaver();
+ method public boolean getEnableFirewall();
+ method public boolean getEnableNightMode();
+ method public boolean getEnableQuickDoze();
+ method public boolean getForceAllAppsStandby();
+ method public boolean getForceBackgroundCheck();
+ method public int getLocationMode();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.BatterySaverPolicyConfig> CREATOR;
+ }
+
+ public static final class BatterySaverPolicyConfig.Builder {
+ ctor public BatterySaverPolicyConfig.Builder();
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder addDeviceSpecificSetting(@NonNull String, @NonNull String);
+ method @NonNull public android.os.BatterySaverPolicyConfig build();
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setAdjustBrightnessFactor(float);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setAdvertiseIsEnabled(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDeferFullBackup(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDeferKeyValueBackup(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableAnimation(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableAod(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableLaunchBoost(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableOptionalSensors(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableSoundTrigger(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableVibration(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableAdjustBrightness(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableDataSaver(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableFirewall(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableNightMode(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableQuickDoze(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setForceAllAppsStandby(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setForceBackgroundCheck(boolean);
+ method @NonNull public android.os.BatterySaverPolicyConfig.Builder setLocationMode(int);
+ }
+
+ public final class BatteryStatsManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.os.connectivity.CellularBatteryStats getCellularBatteryStats();
+ method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.os.connectivity.WifiBatteryStats getWifiBatteryStats();
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportFullWifiLockAcquiredFromSource(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportFullWifiLockReleasedFromSource(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiBatchedScanStartedFromSource(@NonNull android.os.WorkSource, @IntRange(from=0) int);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiBatchedScanStoppedFromSource(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiMulticastDisabled(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiMulticastEnabled(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiOff();
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiOn();
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiRssiChanged(@IntRange(from=0xffffff81, to=0) int);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiScanStartedFromSource(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiScanStoppedFromSource(@NonNull android.os.WorkSource);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiState(int, @Nullable String);
+ method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiSupplicantStateChanged(int, boolean);
+ field public static final int WIFI_STATE_OFF = 0; // 0x0
+ field public static final int WIFI_STATE_OFF_SCANNING = 1; // 0x1
+ field public static final int WIFI_STATE_ON_CONNECTED_P2P = 5; // 0x5
+ field public static final int WIFI_STATE_ON_CONNECTED_STA = 4; // 0x4
+ field public static final int WIFI_STATE_ON_CONNECTED_STA_P2P = 6; // 0x6
+ field public static final int WIFI_STATE_ON_DISCONNECTED = 3; // 0x3
+ field public static final int WIFI_STATE_ON_NO_NETWORKS = 2; // 0x2
+ field public static final int WIFI_STATE_SOFT_AP = 7; // 0x7
+ field public static final int WIFI_SUPPL_STATE_ASSOCIATED = 7; // 0x7
+ field public static final int WIFI_SUPPL_STATE_ASSOCIATING = 6; // 0x6
+ field public static final int WIFI_SUPPL_STATE_AUTHENTICATING = 5; // 0x5
+ field public static final int WIFI_SUPPL_STATE_COMPLETED = 10; // 0xa
+ field public static final int WIFI_SUPPL_STATE_DISCONNECTED = 1; // 0x1
+ field public static final int WIFI_SUPPL_STATE_DORMANT = 11; // 0xb
+ field public static final int WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE = 8; // 0x8
+ field public static final int WIFI_SUPPL_STATE_GROUP_HANDSHAKE = 9; // 0x9
+ field public static final int WIFI_SUPPL_STATE_INACTIVE = 3; // 0x3
+ field public static final int WIFI_SUPPL_STATE_INTERFACE_DISABLED = 2; // 0x2
+ field public static final int WIFI_SUPPL_STATE_INVALID = 0; // 0x0
+ field public static final int WIFI_SUPPL_STATE_SCANNING = 4; // 0x4
+ field public static final int WIFI_SUPPL_STATE_UNINITIALIZED = 12; // 0xc
+ }
+
+ public class Binder implements android.os.IBinder {
+ method public int handleShellCommand(@NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull String[]);
+ method public static void setProxyTransactListener(@Nullable android.os.Binder.ProxyTransactListener);
+ }
+
+ public static interface Binder.ProxyTransactListener {
+ method public void onTransactEnded(@Nullable Object);
+ method @Nullable public Object onTransactStarted(@NonNull android.os.IBinder, int);
+ }
+
+ public final class BugreportManager {
+ method @RequiresPermission(android.Manifest.permission.DUMP) public void cancelBugreport();
+ method @RequiresPermission(android.Manifest.permission.DUMP) public void requestBugreport(@NonNull android.os.BugreportParams, @Nullable CharSequence, @Nullable CharSequence);
+ method @RequiresPermission(android.Manifest.permission.DUMP) public void startBugreport(@NonNull android.os.ParcelFileDescriptor, @Nullable android.os.ParcelFileDescriptor, @NonNull android.os.BugreportParams, @NonNull java.util.concurrent.Executor, @NonNull android.os.BugreportManager.BugreportCallback);
+ }
+
+ public abstract static class BugreportManager.BugreportCallback {
+ ctor public BugreportManager.BugreportCallback();
+ method public void onError(int);
+ method public void onFinished();
+ method public void onProgress(@FloatRange(from=0.0f, to=100.0f) float);
+ field public static final int BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS = 5; // 0x5
+ field public static final int BUGREPORT_ERROR_INVALID_INPUT = 1; // 0x1
+ field public static final int BUGREPORT_ERROR_RUNTIME = 2; // 0x2
+ field public static final int BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT = 4; // 0x4
+ field public static final int BUGREPORT_ERROR_USER_DENIED_CONSENT = 3; // 0x3
+ }
+
+ public final class BugreportParams {
+ ctor public BugreportParams(int);
+ method public int getMode();
+ field public static final int BUGREPORT_MODE_FULL = 0; // 0x0
+ field public static final int BUGREPORT_MODE_INTERACTIVE = 1; // 0x1
+ field public static final int BUGREPORT_MODE_REMOTE = 2; // 0x2
+ field public static final int BUGREPORT_MODE_TELEPHONY = 4; // 0x4
+ field public static final int BUGREPORT_MODE_WEAR = 3; // 0x3
+ field public static final int BUGREPORT_MODE_WIFI = 5; // 0x5
+ }
+
+ public static class Build.VERSION {
+ field @NonNull public static final String PREVIEW_SDK_FINGERPRINT;
+ }
+
+ public final class ConfigUpdate {
+ field public static final String ACTION_UPDATE_CARRIER_ID_DB = "android.os.action.UPDATE_CARRIER_ID_DB";
+ field public static final String ACTION_UPDATE_CARRIER_PROVISIONING_URLS = "android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS";
+ field public static final String ACTION_UPDATE_CONVERSATION_ACTIONS = "android.intent.action.UPDATE_CONVERSATION_ACTIONS";
+ field public static final String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS";
+ field public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = "android.os.action.UPDATE_EMERGENCY_NUMBER_DB";
+ field public static final String ACTION_UPDATE_INTENT_FIREWALL = "android.intent.action.UPDATE_INTENT_FIREWALL";
+ field public static final String ACTION_UPDATE_LANG_ID = "android.intent.action.UPDATE_LANG_ID";
+ field public static final String ACTION_UPDATE_NETWORK_WATCHLIST = "android.intent.action.UPDATE_NETWORK_WATCHLIST";
+ field public static final String ACTION_UPDATE_PINS = "android.intent.action.UPDATE_PINS";
+ field public static final String ACTION_UPDATE_SMART_SELECTION = "android.intent.action.UPDATE_SMART_SELECTION";
+ field public static final String ACTION_UPDATE_SMS_SHORT_CODES = "android.intent.action.UPDATE_SMS_SHORT_CODES";
+ field public static final String EXTRA_REQUIRED_HASH = "android.os.extra.REQUIRED_HASH";
+ field public static final String EXTRA_VERSION = "android.os.extra.VERSION";
+ }
+
+ public class DeviceIdleManager {
+ method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void endIdle(@NonNull String);
+ }
+
+ public class Environment {
+ method @NonNull public static java.util.Collection<java.io.File> getInternalMediaDirectories();
+ method @NonNull public static java.io.File getOdmDirectory();
+ method @NonNull public static java.io.File getOemDirectory();
+ method @NonNull public static java.io.File getProductDirectory();
+ method @Deprecated @NonNull public static java.io.File getProductServicesDirectory();
+ method @NonNull public static java.io.File getSystemExtDirectory();
+ method @NonNull public static java.io.File getVendorDirectory();
+ }
+
+ public class HidlMemory implements java.io.Closeable {
+ ctor public HidlMemory(@NonNull String, @IntRange(from=0) long, @Nullable android.os.NativeHandle);
+ method public void close() throws java.io.IOException;
+ method @NonNull public android.os.HidlMemory dup() throws java.io.IOException;
+ method protected void finalize();
+ method @Nullable public android.os.NativeHandle getHandle();
+ method @NonNull public String getName();
+ method public long getSize();
+ method @Nullable public android.os.NativeHandle releaseHandle();
+ }
+
+ public class HidlSupport {
+ method public static boolean deepEquals(Object, Object);
+ method public static int deepHashCode(Object);
+ method public static int getPidIfSharable();
+ method public static boolean interfacesEqual(android.os.IHwInterface, Object);
+ }
+
+ public abstract class HwBinder implements android.os.IHwBinder {
+ ctor public HwBinder();
+ method public static final void configureRpcThreadpool(long, boolean);
+ method public static void enableInstrumentation();
+ method public static final android.os.IHwBinder getService(String, String) throws java.util.NoSuchElementException, android.os.RemoteException;
+ method public static final android.os.IHwBinder getService(String, String, boolean) throws java.util.NoSuchElementException, android.os.RemoteException;
+ method public static final void joinRpcThreadpool();
+ method public abstract void onTransact(int, android.os.HwParcel, android.os.HwParcel, int) throws android.os.RemoteException;
+ method public final void registerService(String) throws android.os.RemoteException;
+ method public final void transact(int, android.os.HwParcel, android.os.HwParcel, int) throws android.os.RemoteException;
+ }
+
+ public class HwBlob {
+ ctor public HwBlob(int);
+ method public final void copyToBoolArray(long, boolean[], int);
+ method public final void copyToDoubleArray(long, double[], int);
+ method public final void copyToFloatArray(long, float[], int);
+ method public final void copyToInt16Array(long, short[], int);
+ method public final void copyToInt32Array(long, int[], int);
+ method public final void copyToInt64Array(long, long[], int);
+ method public final void copyToInt8Array(long, byte[], int);
+ method public final boolean getBool(long);
+ method public final double getDouble(long);
+ method public final long getFieldHandle(long);
+ method public final float getFloat(long);
+ method public final short getInt16(long);
+ method public final int getInt32(long);
+ method public final long getInt64(long);
+ method public final byte getInt8(long);
+ method public final String getString(long);
+ method public final long handle();
+ method public final void putBlob(long, android.os.HwBlob);
+ method public final void putBool(long, boolean);
+ method public final void putBoolArray(long, boolean[]);
+ method public final void putDouble(long, double);
+ method public final void putDoubleArray(long, double[]);
+ method public final void putFloat(long, float);
+ method public final void putFloatArray(long, float[]);
+ method public final void putHidlMemory(long, @NonNull android.os.HidlMemory);
+ method public final void putInt16(long, short);
+ method public final void putInt16Array(long, short[]);
+ method public final void putInt32(long, int);
+ method public final void putInt32Array(long, int[]);
+ method public final void putInt64(long, long);
+ method public final void putInt64Array(long, long[]);
+ method public final void putInt8(long, byte);
+ method public final void putInt8Array(long, byte[]);
+ method public final void putNativeHandle(long, @Nullable android.os.NativeHandle);
+ method public final void putString(long, String);
+ method public static Boolean[] wrapArray(@NonNull boolean[]);
+ method public static Long[] wrapArray(@NonNull long[]);
+ method public static Byte[] wrapArray(@NonNull byte[]);
+ method public static Short[] wrapArray(@NonNull short[]);
+ method public static Integer[] wrapArray(@NonNull int[]);
+ method public static Float[] wrapArray(@NonNull float[]);
+ method public static Double[] wrapArray(@NonNull double[]);
+ }
+
+ public class HwParcel {
+ ctor public HwParcel();
+ method public final void enforceInterface(String);
+ method public final boolean readBool();
+ method public final java.util.ArrayList<java.lang.Boolean> readBoolVector();
+ method public final android.os.HwBlob readBuffer(long);
+ method public final double readDouble();
+ method public final java.util.ArrayList<java.lang.Double> readDoubleVector();
+ method public final android.os.HwBlob readEmbeddedBuffer(long, long, long, boolean);
+ method @NonNull @Nullable public final android.os.HidlMemory readEmbeddedHidlMemory(long, long, long);
+ method @Nullable public final android.os.NativeHandle readEmbeddedNativeHandle(long, long);
+ method public final float readFloat();
+ method public final java.util.ArrayList<java.lang.Float> readFloatVector();
+ method @NonNull public final android.os.HidlMemory readHidlMemory();
+ method public final short readInt16();
+ method public final java.util.ArrayList<java.lang.Short> readInt16Vector();
+ method public final int readInt32();
+ method public final java.util.ArrayList<java.lang.Integer> readInt32Vector();
+ method public final long readInt64();
+ method public final java.util.ArrayList<java.lang.Long> readInt64Vector();
+ method public final byte readInt8();
+ method public final java.util.ArrayList<java.lang.Byte> readInt8Vector();
+ method @Nullable public final android.os.NativeHandle readNativeHandle();
+ method @NonNull public final java.util.ArrayList<android.os.NativeHandle> readNativeHandleVector();
+ method public final String readString();
+ method public final java.util.ArrayList<java.lang.String> readStringVector();
+ method public final android.os.IHwBinder readStrongBinder();
+ method public final void release();
+ method public final void releaseTemporaryStorage();
+ method public final void send();
+ method public final void verifySuccess();
+ method public final void writeBool(boolean);
+ method public final void writeBoolVector(java.util.ArrayList<java.lang.Boolean>);
+ method public final void writeBuffer(android.os.HwBlob);
+ method public final void writeDouble(double);
+ method public final void writeDoubleVector(java.util.ArrayList<java.lang.Double>);
+ method public final void writeFloat(float);
+ method public final void writeFloatVector(java.util.ArrayList<java.lang.Float>);
+ method public final void writeHidlMemory(@NonNull android.os.HidlMemory);
+ method public final void writeInt16(short);
+ method public final void writeInt16Vector(java.util.ArrayList<java.lang.Short>);
+ method public final void writeInt32(int);
+ method public final void writeInt32Vector(java.util.ArrayList<java.lang.Integer>);
+ method public final void writeInt64(long);
+ method public final void writeInt64Vector(java.util.ArrayList<java.lang.Long>);
+ method public final void writeInt8(byte);
+ method public final void writeInt8Vector(java.util.ArrayList<java.lang.Byte>);
+ method public final void writeInterfaceToken(String);
+ method public final void writeNativeHandle(@Nullable android.os.NativeHandle);
+ method public final void writeNativeHandleVector(@NonNull java.util.ArrayList<android.os.NativeHandle>);
+ method public final void writeStatus(int);
+ method public final void writeString(String);
+ method public final void writeStringVector(java.util.ArrayList<java.lang.String>);
+ method public final void writeStrongBinder(android.os.IHwBinder);
+ field public static final int STATUS_SUCCESS = 0; // 0x0
+ }
+
+ public interface IHwBinder {
+ method public boolean linkToDeath(android.os.IHwBinder.DeathRecipient, long);
+ method public android.os.IHwInterface queryLocalInterface(String);
+ method public void transact(int, android.os.HwParcel, android.os.HwParcel, int) throws android.os.RemoteException;
+ method public boolean unlinkToDeath(android.os.IHwBinder.DeathRecipient);
+ }
+
+ public static interface IHwBinder.DeathRecipient {
+ method public void serviceDied(long);
+ }
+
+ public interface IHwInterface {
+ method public android.os.IHwBinder asBinder();
+ }
+
+ public class IncidentManager {
+ method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void approveReport(android.net.Uri);
+ method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void cancelAuthorization(android.os.IncidentManager.AuthListener);
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void deleteIncidentReports(android.net.Uri);
+ method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void denyReport(android.net.Uri);
+ method @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public android.os.IncidentManager.IncidentReport getIncidentReport(android.net.Uri);
+ method @NonNull @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public java.util.List<android.net.Uri> getIncidentReportList(String);
+ method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public java.util.List<android.os.IncidentManager.PendingReport> getPendingReports();
+ method public void registerSection(int, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.IncidentManager.DumpCallback);
+ method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void reportIncident(android.os.IncidentReportArgs);
+ method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void requestAuthorization(int, String, int, android.os.IncidentManager.AuthListener);
+ method public void unregisterSection(int);
+ field public static final int FLAG_CONFIRMATION_DIALOG = 1; // 0x1
+ field public static final int PRIVACY_POLICY_AUTO = 200; // 0xc8
+ field public static final int PRIVACY_POLICY_EXPLICIT = 100; // 0x64
+ field public static final int PRIVACY_POLICY_LOCAL = 0; // 0x0
+ }
+
+ public static class IncidentManager.AuthListener {
+ ctor public IncidentManager.AuthListener();
+ method public void onReportApproved();
+ method public void onReportDenied();
+ }
+
+ public static class IncidentManager.DumpCallback {
+ ctor public IncidentManager.DumpCallback();
+ method public void onDumpSection(int, @NonNull java.io.OutputStream);
+ }
+
+ public static class IncidentManager.IncidentReport implements java.io.Closeable android.os.Parcelable {
+ ctor public IncidentManager.IncidentReport(android.os.Parcel);
+ method public void close();
+ method public int describeContents();
+ method public java.io.InputStream getInputStream() throws java.io.IOException;
+ method public long getPrivacyPolicy();
+ method public long getTimestamp();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.IncidentManager.IncidentReport> CREATOR;
+ }
+
+ public static class IncidentManager.PendingReport {
+ ctor public IncidentManager.PendingReport(@NonNull android.net.Uri);
+ method public int getFlags();
+ method @NonNull public String getRequestingPackage();
+ method public long getTimestamp();
+ method @NonNull public android.net.Uri getUri();
+ }
+
+ public final class IncidentReportArgs implements android.os.Parcelable {
+ ctor public IncidentReportArgs();
+ ctor public IncidentReportArgs(android.os.Parcel);
+ method public void addHeader(byte[]);
+ method public void addSection(int);
+ method public boolean containsSection(int);
+ method public int describeContents();
+ method public boolean isAll();
+ method public void readFromParcel(android.os.Parcel);
+ method public int sectionCount();
+ method public void setAll(boolean);
+ method public void setPrivacyPolicy(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.IncidentReportArgs> CREATOR;
+ }
+
+ public final class NativeHandle implements java.io.Closeable {
+ ctor public NativeHandle();
+ ctor public NativeHandle(@NonNull java.io.FileDescriptor, boolean);
+ ctor public NativeHandle(@NonNull java.io.FileDescriptor[], @NonNull int[], boolean);
+ method public void close() throws java.io.IOException;
+ method @NonNull public android.os.NativeHandle dup() throws java.io.IOException;
+ method @NonNull public java.io.FileDescriptor getFileDescriptor();
+ method @NonNull public java.io.FileDescriptor[] getFileDescriptors();
+ method @NonNull public int[] getInts();
+ method public boolean hasSingleFileDescriptor();
+ }
+
+ public interface Parcelable {
+ field public static final int PARCELABLE_STABILITY_LOCAL = 0; // 0x0
+ field public static final int PARCELABLE_STABILITY_VINTF = 1; // 0x1
+ }
+
+ public final class ParcelableHolder implements android.os.Parcelable {
+ ctor public ParcelableHolder(int);
+ method public int describeContents();
+ method @Nullable public <T extends android.os.Parcelable> T getParcelable(@NonNull Class<T>);
+ method public int getStability();
+ method public void readFromParcel(@NonNull android.os.Parcel);
+ method public boolean setParcelable(@Nullable android.os.Parcelable);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.ParcelableHolder> CREATOR;
+ }
+
+ public final class PowerManager {
+ method @RequiresPermission(allOf={android.Manifest.permission.READ_DREAM_STATE, android.Manifest.permission.WRITE_DREAM_STATE}) public void dream(long);
+ method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public boolean forceSuspend();
+ method @RequiresPermission(android.Manifest.permission.POWER_SAVER) public int getPowerSaveModeTrigger();
+ method @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE) public boolean isAmbientDisplayAvailable();
+ method @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE) public boolean isAmbientDisplaySuppressed();
+ method @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE) public boolean isAmbientDisplaySuppressedForToken(@NonNull String);
+ method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setAdaptivePowerSaveEnabled(boolean);
+ method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setAdaptivePowerSavePolicy(@NonNull android.os.BatterySaverPolicyConfig);
+ method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void setBatteryDischargePrediction(@NonNull java.time.Duration, boolean);
+ method @RequiresPermission(android.Manifest.permission.POWER_SAVER) public boolean setDynamicPowerSaveHint(boolean, int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setPowerSaveModeEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void suppressAmbientDisplay(@NonNull String, boolean);
+ method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.USER_ACTIVITY}) public void userActivity(long, int, int);
+ field public static final int POWER_SAVE_MODE_TRIGGER_DYNAMIC = 1; // 0x1
+ field public static final int POWER_SAVE_MODE_TRIGGER_PERCENTAGE = 0; // 0x0
+ field public static final String REBOOT_USERSPACE = "userspace";
+ field public static final int USER_ACTIVITY_EVENT_ACCESSIBILITY = 3; // 0x3
+ field public static final int USER_ACTIVITY_EVENT_BUTTON = 1; // 0x1
+ field public static final int USER_ACTIVITY_EVENT_OTHER = 0; // 0x0
+ field public static final int USER_ACTIVITY_EVENT_TOUCH = 2; // 0x2
+ field public static final int USER_ACTIVITY_FLAG_INDIRECT = 2; // 0x2
+ field public static final int USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS = 1; // 0x1
+ }
+
+ public class PowerWhitelistManager {
+ method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void addToWhitelist(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void addToWhitelist(@NonNull java.util.List<java.lang.String>);
+ method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void removeFromWhitelist(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public void whitelistAppTemporarily(@NonNull String, long);
+ method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public long whitelistAppTemporarilyForEvent(@NonNull String, int, @NonNull String);
+ field public static final int EVENT_MMS = 2; // 0x2
+ field public static final int EVENT_SMS = 1; // 0x1
+ field public static final int EVENT_UNSPECIFIED = 0; // 0x0
+ }
+
+ public class RecoverySystem {
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void cancelScheduledUpdate(android.content.Context) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void clearPrepareForUnattendedUpdate(@NonNull android.content.Context) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void installPackage(android.content.Context, java.io.File, boolean) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void prepareForUnattendedUpdate(@NonNull android.content.Context, @NonNull String, @Nullable android.content.IntentSender) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener, android.os.Handler) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void rebootAndApply(@NonNull android.content.Context, @NonNull String, @NonNull String) throws java.io.IOException;
+ method @RequiresPermission(allOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void rebootWipeAb(android.content.Context, java.io.File, String) throws java.io.IOException;
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void scheduleUpdateOnBoot(android.content.Context, java.io.File) throws java.io.IOException;
+ method public static boolean verifyPackageCompatibility(java.io.File) throws java.io.IOException;
+ }
+
+ public final class RemoteCallback implements android.os.Parcelable {
+ ctor public RemoteCallback(android.os.RemoteCallback.OnResultListener);
+ ctor public RemoteCallback(@NonNull android.os.RemoteCallback.OnResultListener, @Nullable android.os.Handler);
+ method public int describeContents();
+ method public void sendResult(@Nullable android.os.Bundle);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.RemoteCallback> CREATOR;
+ }
+
+ public static interface RemoteCallback.OnResultListener {
+ method public void onResult(@Nullable android.os.Bundle);
+ }
+
+ public class ServiceSpecificException extends java.lang.RuntimeException {
+ ctor public ServiceSpecificException(int, @Nullable String);
+ ctor public ServiceSpecificException(int);
+ field public final int errorCode;
+ }
+
+ public final class StatsDimensionsValue implements android.os.Parcelable {
+ method public int describeContents();
+ method public boolean getBooleanValue();
+ method public int getField();
+ method public float getFloatValue();
+ method public int getIntValue();
+ method public long getLongValue();
+ method public String getStringValue();
+ method public java.util.List<android.os.StatsDimensionsValue> getTupleValueList();
+ method public int getValueType();
+ method public boolean isValueType(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int BOOLEAN_VALUE_TYPE = 5; // 0x5
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.StatsDimensionsValue> CREATOR;
+ field public static final int FLOAT_VALUE_TYPE = 6; // 0x6
+ field public static final int INT_VALUE_TYPE = 3; // 0x3
+ field public static final int LONG_VALUE_TYPE = 4; // 0x4
+ field public static final int STRING_VALUE_TYPE = 2; // 0x2
+ field public static final int TUPLE_VALUE_TYPE = 7; // 0x7
+ }
+
+ public class SystemConfigManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Set<java.lang.String> getDisabledUntilUsedPreinstalledCarrierApps();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
+ }
+
+ public class SystemProperties {
+ method @NonNull public static String get(@NonNull String);
+ method @NonNull public static String get(@NonNull String, @Nullable String);
+ method public static boolean getBoolean(@NonNull String, boolean);
+ method public static int getInt(@NonNull String, int);
+ method public static long getLong(@NonNull String, long);
+ }
+
+ public class SystemUpdateManager {
+ method @RequiresPermission(anyOf={android.Manifest.permission.READ_SYSTEM_UPDATE_INFO, android.Manifest.permission.RECOVERY}) public android.os.Bundle retrieveSystemUpdateInfo();
+ method @RequiresPermission(android.Manifest.permission.RECOVERY) public void updateSystemUpdateInfo(android.os.PersistableBundle);
+ field public static final String KEY_IS_SECURITY_UPDATE = "is_security_update";
+ field public static final String KEY_STATUS = "status";
+ field public static final String KEY_TARGET_BUILD_FINGERPRINT = "target_build_fingerprint";
+ field public static final String KEY_TARGET_SECURITY_PATCH_LEVEL = "target_security_patch_level";
+ field public static final String KEY_TITLE = "title";
+ field public static final int STATUS_IDLE = 1; // 0x1
+ field public static final int STATUS_IN_PROGRESS = 3; // 0x3
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ field public static final int STATUS_WAITING_DOWNLOAD = 2; // 0x2
+ field public static final int STATUS_WAITING_INSTALL = 4; // 0x4
+ field public static final int STATUS_WAITING_REBOOT = 5; // 0x5
+ }
+
+ public class UpdateEngine {
+ ctor public UpdateEngine();
+ method @NonNull @WorkerThread public android.os.UpdateEngine.AllocateSpaceResult allocateSpace(@NonNull String, @NonNull String[]);
+ method public void applyPayload(String, long, long, String[]);
+ method public void applyPayload(@NonNull android.content.res.AssetFileDescriptor, @NonNull String[]);
+ method public boolean bind(android.os.UpdateEngineCallback, android.os.Handler);
+ method public boolean bind(android.os.UpdateEngineCallback);
+ method public void cancel();
+ method @WorkerThread public int cleanupAppliedPayload();
+ method public void resetStatus();
+ method public void resume();
+ method public void suspend();
+ method public boolean unbind();
+ method public boolean verifyPayloadMetadata(String);
+ }
+
+ public static final class UpdateEngine.AllocateSpaceResult {
+ method public int getErrorCode();
+ method public long getFreeSpaceRequired();
+ }
+
+ public static final class UpdateEngine.ErrorCodeConstants {
+ ctor public UpdateEngine.ErrorCodeConstants();
+ field public static final int DEVICE_CORRUPTED = 61; // 0x3d
+ field public static final int DOWNLOAD_PAYLOAD_VERIFICATION_ERROR = 12; // 0xc
+ field public static final int DOWNLOAD_TRANSFER_ERROR = 9; // 0x9
+ field public static final int ERROR = 1; // 0x1
+ field public static final int FILESYSTEM_COPIER_ERROR = 4; // 0x4
+ field public static final int INSTALL_DEVICE_OPEN_ERROR = 7; // 0x7
+ field public static final int KERNEL_DEVICE_OPEN_ERROR = 8; // 0x8
+ field public static final int NOT_ENOUGH_SPACE = 60; // 0x3c
+ field public static final int PAYLOAD_HASH_MISMATCH_ERROR = 10; // 0xa
+ field public static final int PAYLOAD_MISMATCHED_TYPE_ERROR = 6; // 0x6
+ field public static final int PAYLOAD_SIZE_MISMATCH_ERROR = 11; // 0xb
+ field public static final int PAYLOAD_TIMESTAMP_ERROR = 51; // 0x33
+ field public static final int POST_INSTALL_RUNNER_ERROR = 5; // 0x5
+ field public static final int SUCCESS = 0; // 0x0
+ field public static final int UPDATED_BUT_NOT_ACTIVE = 52; // 0x34
+ }
+
+ public static final class UpdateEngine.UpdateStatusConstants {
+ ctor public UpdateEngine.UpdateStatusConstants();
+ field public static final int ATTEMPTING_ROLLBACK = 8; // 0x8
+ field public static final int CHECKING_FOR_UPDATE = 1; // 0x1
+ field public static final int DISABLED = 9; // 0x9
+ field public static final int DOWNLOADING = 3; // 0x3
+ field public static final int FINALIZING = 5; // 0x5
+ field public static final int IDLE = 0; // 0x0
+ field public static final int REPORTING_ERROR_EVENT = 7; // 0x7
+ field public static final int UPDATED_NEED_REBOOT = 6; // 0x6
+ field public static final int UPDATE_AVAILABLE = 2; // 0x2
+ field public static final int VERIFYING = 4; // 0x4
+ }
+
+ public abstract class UpdateEngineCallback {
+ ctor public UpdateEngineCallback();
+ method public abstract void onPayloadApplicationComplete(int);
+ method public abstract void onStatusUpdate(int, float);
+ }
+
+ public final class UserHandle implements android.os.Parcelable {
+ method @NonNull public static String formatUid(int);
+ method public static int getAppId(int);
+ method public int getIdentifier();
+ method @Deprecated public boolean isOwner();
+ method public boolean isSystem();
+ method public static int myUserId();
+ method public static android.os.UserHandle of(int);
+ field @NonNull public static final android.os.UserHandle ALL;
+ field @NonNull public static final android.os.UserHandle CURRENT;
+ field @NonNull public static final android.os.UserHandle SYSTEM;
+ }
+
+ public class UserManager {
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void clearSeedAccountData();
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.os.UserHandle createProfile(@NonNull String, @NonNull String, @NonNull java.util.Set<java.lang.String>) throws android.os.UserManager.UserOperationException;
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}, conditional=true) public java.util.List<android.os.UserHandle> getAllProfiles();
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}, conditional=true) public java.util.List<android.os.UserHandle> getEnabledProfiles();
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getProfileParent(@NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getSeedAccountName();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.PersistableBundle getSeedAccountOptions();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getSeedAccountType();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public long[] getSerialNumbersOfUsers(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<android.os.UserHandle> getUserHandles(boolean);
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED}) public android.graphics.Bitmap getUserIcon();
+ method @Deprecated @android.os.UserManager.UserRestrictionSource @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public int getUserRestrictionSource(String, android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<android.os.UserManager.EnforcingUser> getUserRestrictionSources(String, android.os.UserHandle);
+ method @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public int getUserSwitchability();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean hasRestrictedProfiles();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean hasUserRestrictionForUser(@NonNull String, @NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isAdminUser();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isGuestUser();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isManagedProfile(int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isPrimaryUser();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isProfile();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isRestrictedProfile();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isRestrictedProfile(@NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isSameProfileGroup(@NonNull android.os.UserHandle, @NonNull android.os.UserHandle);
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED}) public boolean isUserNameSet();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isUserOfType(@NonNull String);
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isUserUnlockingOrUnlocked(@NonNull android.os.UserHandle);
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean removeUser(@NonNull android.os.UserHandle);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setUserIcon(@NonNull android.graphics.Bitmap) throws android.os.UserManager.UserOperationException;
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setUserName(@Nullable String);
+ field public static final String ACTION_USER_RESTRICTIONS_CHANGED = "android.os.action.USER_RESTRICTIONS_CHANGED";
+ field @Deprecated public static final String DISALLOW_OEM_UNLOCK = "no_oem_unlock";
+ field public static final String DISALLOW_RUN_IN_BACKGROUND = "no_run_in_background";
+ field public static final int RESTRICTION_NOT_SET = 0; // 0x0
+ field public static final int RESTRICTION_SOURCE_DEVICE_OWNER = 2; // 0x2
+ field public static final int RESTRICTION_SOURCE_PROFILE_OWNER = 4; // 0x4
+ field public static final int RESTRICTION_SOURCE_SYSTEM = 1; // 0x1
+ field public static final int SWITCHABILITY_STATUS_OK = 0; // 0x0
+ field public static final int SWITCHABILITY_STATUS_SYSTEM_USER_LOCKED = 4; // 0x4
+ field public static final int SWITCHABILITY_STATUS_USER_IN_CALL = 1; // 0x1
+ field public static final int SWITCHABILITY_STATUS_USER_SWITCH_DISALLOWED = 2; // 0x2
+ field public static final String USER_TYPE_FULL_SECONDARY = "android.os.usertype.full.SECONDARY";
+ field public static final String USER_TYPE_FULL_SYSTEM = "android.os.usertype.full.SYSTEM";
+ field public static final String USER_TYPE_PROFILE_MANAGED = "android.os.usertype.profile.MANAGED";
+ field public static final String USER_TYPE_SYSTEM_HEADLESS = "android.os.usertype.system.HEADLESS";
+ }
+
+ public static final class UserManager.EnforcingUser implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.os.UserHandle getUserHandle();
+ method @android.os.UserManager.UserRestrictionSource public int getUserRestrictionSource();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.UserManager.EnforcingUser> CREATOR;
+ }
+
+ @IntDef(flag=true, prefix={"RESTRICTION_"}, value={android.os.UserManager.RESTRICTION_NOT_SET, android.os.UserManager.RESTRICTION_SOURCE_SYSTEM, android.os.UserManager.RESTRICTION_SOURCE_DEVICE_OWNER, android.os.UserManager.RESTRICTION_SOURCE_PROFILE_OWNER}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface UserManager.UserRestrictionSource {
+ }
+
+ public abstract class Vibrator {
+ method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public void addVibratorStateListener(@NonNull android.os.Vibrator.OnVibratorStateChangedListener);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public void addVibratorStateListener(@NonNull java.util.concurrent.Executor, @NonNull android.os.Vibrator.OnVibratorStateChangedListener);
+ method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public boolean isVibrating();
+ method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public void removeVibratorStateListener(@NonNull android.os.Vibrator.OnVibratorStateChangedListener);
+ }
+
+ public static interface Vibrator.OnVibratorStateChangedListener {
+ method public void onVibratorStateChanged(boolean);
+ }
+
+ public class WorkSource implements android.os.Parcelable {
+ ctor public WorkSource(int);
+ ctor public WorkSource(int, @NonNull String);
+ method public android.os.WorkSource.WorkChain createWorkChain();
+ method @Nullable public String getPackageName(int);
+ method public int getUid(int);
+ method @Nullable public java.util.List<android.os.WorkSource.WorkChain> getWorkChains();
+ method public boolean isEmpty();
+ method public int size();
+ method @NonNull public android.os.WorkSource withoutNames();
+ }
+
+ public static final class WorkSource.WorkChain implements android.os.Parcelable {
+ ctor public WorkSource.WorkChain();
+ method public android.os.WorkSource.WorkChain addNode(int, @Nullable String);
+ method public int describeContents();
+ method public String getAttributionTag();
+ method public int getAttributionUid();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.WorkSource.WorkChain> CREATOR;
+ }
+
+}
+
+package android.os.connectivity {
+
+ public final class CellularBatteryStats implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getEnergyConsumedMaMillis();
+ method public long getIdleTimeMillis();
+ method public long getKernelActiveTimeMillis();
+ method public long getLoggingDurationMillis();
+ method public long getMonitoredRailChargeConsumedMaMillis();
+ method public long getNumBytesRx();
+ method public long getNumBytesTx();
+ method public long getNumPacketsRx();
+ method public long getNumPacketsTx();
+ method public long getRxTimeMillis();
+ method public long getSleepTimeMillis();
+ method @NonNull public long getTimeInRatMicros(int);
+ method @NonNull public long getTimeInRxSignalStrengthLevelMicros(@IntRange(from=android.telephony.CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN, to=android.telephony.CellSignalStrength.SIGNAL_STRENGTH_GREAT) int);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.connectivity.CellularBatteryStats> CREATOR;
+ }
+
+ public final class WifiActivityEnergyInfo implements android.os.Parcelable {
+ ctor public WifiActivityEnergyInfo(long, int, @IntRange(from=0) long, @IntRange(from=0) long, @IntRange(from=0) long, @IntRange(from=0) long);
+ method public int describeContents();
+ method @IntRange(from=0) public long getControllerEnergyUsedMicroJoules();
+ method @IntRange(from=0) public long getControllerIdleDurationMillis();
+ method @IntRange(from=0) public long getControllerRxDurationMillis();
+ method @IntRange(from=0) public long getControllerScanDurationMillis();
+ method @IntRange(from=0) public long getControllerTxDurationMillis();
+ method public int getStackState();
+ method public long getTimeSinceBootMillis();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.connectivity.WifiActivityEnergyInfo> CREATOR;
+ field public static final int STACK_STATE_INVALID = 0; // 0x0
+ field public static final int STACK_STATE_STATE_ACTIVE = 1; // 0x1
+ field public static final int STACK_STATE_STATE_IDLE = 3; // 0x3
+ field public static final int STACK_STATE_STATE_SCANNING = 2; // 0x2
+ }
+
+ public final class WifiBatteryStats implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getAppScanRequestCount();
+ method public long getEnergyConsumedMaMillis();
+ method public long getIdleTimeMillis();
+ method public long getKernelActiveTimeMillis();
+ method public long getLoggingDurationMillis();
+ method public long getMonitoredRailChargeConsumedMaMillis();
+ method public long getNumBytesRx();
+ method public long getNumBytesTx();
+ method public long getNumPacketsRx();
+ method public long getNumPacketsTx();
+ method public long getRxTimeMillis();
+ method public long getScanTimeMillis();
+ method public long getSleepTimeMillis();
+ method public long getTxTimeMillis();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.connectivity.WifiBatteryStats> CREATOR;
+ }
+
+}
+
+package android.os.ext {
+
+ public class SdkExtensions {
+ method public static int getExtensionVersion(int);
+ }
+
+}
+
+package android.os.image {
+
+ public class DynamicSystemClient {
+ ctor public DynamicSystemClient(@NonNull android.content.Context);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void bind();
+ method public void setOnStatusChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.os.image.DynamicSystemClient.OnStatusChangedListener);
+ method public void setOnStatusChangedListener(@NonNull android.os.image.DynamicSystemClient.OnStatusChangedListener);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void start(@NonNull android.net.Uri, long);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void start(@NonNull android.net.Uri, long, long);
+ method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void unbind();
+ field public static final int CAUSE_ERROR_EXCEPTION = 6; // 0x6
+ field public static final int CAUSE_ERROR_INVALID_URL = 4; // 0x4
+ field public static final int CAUSE_ERROR_IO = 3; // 0x3
+ field public static final int CAUSE_ERROR_IPC = 5; // 0x5
+ field public static final int CAUSE_INSTALL_CANCELLED = 2; // 0x2
+ field public static final int CAUSE_INSTALL_COMPLETED = 1; // 0x1
+ field public static final int CAUSE_NOT_SPECIFIED = 0; // 0x0
+ field public static final int STATUS_IN_PROGRESS = 2; // 0x2
+ field public static final int STATUS_IN_USE = 4; // 0x4
+ field public static final int STATUS_NOT_STARTED = 1; // 0x1
+ field public static final int STATUS_READY = 3; // 0x3
+ field public static final int STATUS_UNKNOWN = 0; // 0x0
+ }
+
+ public static interface DynamicSystemClient.OnStatusChangedListener {
+ method public void onStatusChanged(int, int, long, @Nullable Throwable);
+ }
+
+}
+
+package android.os.storage {
+
+ public class StorageManager {
+ method @WorkerThread public void allocateBytes(@NonNull java.util.UUID, long, @RequiresPermission int) throws java.io.IOException;
+ method @WorkerThread public void allocateBytes(java.io.FileDescriptor, long, @RequiresPermission int) throws java.io.IOException;
+ method @WorkerThread public long getAllocatableBytes(@NonNull java.util.UUID, @RequiresPermission int) throws java.io.IOException;
+ method public static boolean hasIsolatedStorage();
+ method public void updateExternalStorageFileQuotaType(@NonNull java.io.File, int) throws java.io.IOException;
+ field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
+ field public static final int QUOTA_TYPE_MEDIA_AUDIO = 2; // 0x2
+ field public static final int QUOTA_TYPE_MEDIA_IMAGE = 1; // 0x1
+ field public static final int QUOTA_TYPE_MEDIA_NONE = 0; // 0x0
+ field public static final int QUOTA_TYPE_MEDIA_VIDEO = 3; // 0x3
+ }
+
+ public final class StorageVolume implements android.os.Parcelable {
+ method @NonNull public String getId();
+ }
+
+}
+
+package android.permission {
+
+ public final class PermissionControllerManager {
+ method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.RESTORE_RUNTIME_PERMISSIONS}) public void applyStagedRuntimePermissionBackup(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @RequiresPermission(android.Manifest.permission.GET_RUNTIME_PERMISSIONS) public void getRuntimePermissionBackup(@NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<byte[]>);
+ method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public void revokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>, boolean, int, @NonNull java.util.concurrent.Executor, @NonNull android.permission.PermissionControllerManager.OnRevokeRuntimePermissionsCallback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.RESTORE_RUNTIME_PERMISSIONS}) public void stageAndApplyRuntimePermissionsBackup(@NonNull byte[], @NonNull android.os.UserHandle);
+ field public static final int COUNT_ONLY_WHEN_GRANTED = 1; // 0x1
+ field public static final int COUNT_WHEN_SYSTEM = 2; // 0x2
+ field public static final int REASON_INSTALLER_POLICY_VIOLATION = 2; // 0x2
+ field public static final int REASON_MALWARE = 1; // 0x1
+ }
+
+ public abstract static class PermissionControllerManager.OnRevokeRuntimePermissionsCallback {
+ ctor public PermissionControllerManager.OnRevokeRuntimePermissionsCallback();
+ method public abstract void onRevokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
+ }
+
+ public abstract class PermissionControllerService extends android.app.Service {
+ ctor public PermissionControllerService();
+ method @BinderThread public void onApplyStagedRuntimePermissionBackup(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @NonNull public final android.os.IBinder onBind(android.content.Intent);
+ method @BinderThread public abstract void onCountPermissionApps(@NonNull java.util.List<java.lang.String>, int, @NonNull java.util.function.IntConsumer);
+ method @BinderThread public abstract void onGetAppPermissions(@NonNull String, @NonNull java.util.function.Consumer<java.util.List<android.permission.RuntimePermissionPresentationInfo>>);
+ method @BinderThread public abstract void onGetPermissionUsages(boolean, long, @NonNull java.util.function.Consumer<java.util.List<android.permission.RuntimePermissionUsageInfo>>);
+ method @BinderThread public abstract void onGetRuntimePermissionsBackup(@NonNull android.os.UserHandle, @NonNull java.io.OutputStream, @NonNull Runnable);
+ method @BinderThread public abstract void onGrantOrUpgradeDefaultRuntimePermissions(@NonNull Runnable);
+ method @BinderThread public void onOneTimePermissionSessionTimeout(@NonNull String);
+ method @Deprecated @BinderThread public void onRestoreDelayedRuntimePermissionsBackup(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @Deprecated @BinderThread public void onRestoreRuntimePermissionsBackup(@NonNull android.os.UserHandle, @NonNull java.io.InputStream, @NonNull Runnable);
+ method @BinderThread public abstract void onRevokeRuntimePermission(@NonNull String, @NonNull String, @NonNull Runnable);
+ method @BinderThread public abstract void onRevokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>, boolean, int, @NonNull String, @NonNull java.util.function.Consumer<java.util.Map<java.lang.String,java.util.List<java.lang.String>>>);
+ method @BinderThread public abstract void onSetRuntimePermissionGrantStateByDeviceAdmin(@NonNull String, @NonNull String, @NonNull String, int, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @BinderThread public void onStageAndApplyRuntimePermissionsBackup(@NonNull android.os.UserHandle, @NonNull java.io.InputStream, @NonNull Runnable);
+ method @BinderThread public void onUpdateUserSensitivePermissionFlags(int, @NonNull java.util.concurrent.Executor, @NonNull Runnable);
+ method @BinderThread public void onUpdateUserSensitivePermissionFlags(int, @NonNull Runnable);
+ field public static final String SERVICE_INTERFACE = "android.permission.PermissionControllerService";
+ }
+
+ public final class PermissionManager {
+ method public int checkDeviceIdentifierAccess(@Nullable String, @Nullable String, @Nullable String, int, int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY) public java.util.Set<java.lang.String> getAutoRevokeExemptionGrantedPackages();
+ method @NonNull @RequiresPermission(android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY) public java.util.Set<java.lang.String> getAutoRevokeExemptionRequestedPackages();
+ method @IntRange(from=0) @RequiresPermission(anyOf={android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, android.Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS}) public int getRuntimePermissionsVersion();
+ method @NonNull public java.util.List<android.permission.PermissionManager.SplitPermissionInfo> getSplitPermissions();
+ method @RequiresPermission(anyOf={android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, android.Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS}) public void setRuntimePermissionsVersion(@IntRange(from=0) int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void startOneTimePermissionSession(@NonNull String, long, int, int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void stopOneTimePermissionSession(@NonNull String);
+ }
+
+ public static final class PermissionManager.SplitPermissionInfo {
+ method @NonNull public java.util.List<java.lang.String> getNewPermissions();
+ method @NonNull public String getSplitPermission();
+ method public int getTargetSdk();
+ }
+
+ public final class RuntimePermissionPresentationInfo implements android.os.Parcelable {
+ ctor public RuntimePermissionPresentationInfo(@NonNull CharSequence, boolean, boolean);
+ method public int describeContents();
+ method @NonNull public CharSequence getLabel();
+ method public boolean isGranted();
+ method public boolean isStandard();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.permission.RuntimePermissionPresentationInfo> CREATOR;
+ }
+
+ public final class RuntimePermissionUsageInfo implements android.os.Parcelable {
+ ctor public RuntimePermissionUsageInfo(@NonNull String, int);
+ method public int describeContents();
+ method public int getAppAccessCount();
+ method @NonNull public String getName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.permission.RuntimePermissionUsageInfo> CREATOR;
+ }
+
+}
+
+package android.permissionpresenterservice {
+
+ @Deprecated public abstract class RuntimePermissionPresenterService extends android.app.Service {
+ ctor @Deprecated public RuntimePermissionPresenterService();
+ method @Deprecated public final void attachBaseContext(android.content.Context);
+ method @Deprecated public final android.os.IBinder onBind(android.content.Intent);
+ method @Deprecated public abstract java.util.List<android.content.pm.permission.RuntimePermissionPresentationInfo> onGetAppPermissions(@NonNull String);
+ field @Deprecated public static final String SERVICE_INTERFACE = "android.permissionpresenterservice.RuntimePermissionPresenterService";
+ }
+
+}
+
+package android.preference {
+
+ @Deprecated public class PreferenceManager {
+ method @Deprecated public boolean isStorageCredentialProtected();
+ method @Deprecated public void setStorageCredentialProtected();
+ }
+
+}
+
+package android.print {
+
+ public final class PrintManager {
+ method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICE_RECOMMENDATIONS) public void addPrintServiceRecommendationsChangeListener(@NonNull android.print.PrintManager.PrintServiceRecommendationsChangeListener, @Nullable android.os.Handler);
+ method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICES) public void addPrintServicesChangeListener(@NonNull android.print.PrintManager.PrintServicesChangeListener, @Nullable android.os.Handler);
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICE_RECOMMENDATIONS) public java.util.List<android.printservice.recommendation.RecommendationInfo> getPrintServiceRecommendations();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICES) public java.util.List<android.printservice.PrintServiceInfo> getPrintServices(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICE_RECOMMENDATIONS) public void removePrintServiceRecommendationsChangeListener(@NonNull android.print.PrintManager.PrintServiceRecommendationsChangeListener);
+ method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICES) public void removePrintServicesChangeListener(@NonNull android.print.PrintManager.PrintServicesChangeListener);
+ field public static final int ENABLED_SERVICES = 1; // 0x1
+ }
+
+ public static interface PrintManager.PrintServiceRecommendationsChangeListener {
+ method public void onPrintServiceRecommendationsChanged();
+ }
+
+ public static interface PrintManager.PrintServicesChangeListener {
+ method public void onPrintServicesChanged();
+ }
+
+}
+
+package android.printservice {
+
+ public final class PrintServiceInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.content.ComponentName getComponentName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.printservice.PrintServiceInfo> CREATOR;
+ }
+
+}
+
+package android.printservice.recommendation {
+
+ public final class RecommendationInfo implements android.os.Parcelable {
+ ctor public RecommendationInfo(@NonNull CharSequence, @NonNull CharSequence, @NonNull java.util.List<java.net.InetAddress>, boolean);
+ ctor @Deprecated public RecommendationInfo(@NonNull CharSequence, @NonNull CharSequence, @IntRange(from=0) int, boolean);
+ method public int describeContents();
+ method @NonNull public java.util.List<java.net.InetAddress> getDiscoveredPrinters();
+ method public CharSequence getName();
+ method public int getNumDiscoveredPrinters();
+ method public CharSequence getPackageName();
+ method public boolean recommendsMultiVendorService();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.printservice.recommendation.RecommendationInfo> CREATOR;
+ }
+
+ public abstract class RecommendationService extends android.app.Service {
+ ctor public RecommendationService();
+ method public final android.os.IBinder onBind(android.content.Intent);
+ method public abstract void onConnected();
+ method public abstract void onDisconnected();
+ method public final void updateRecommendations(@Nullable java.util.List<android.printservice.recommendation.RecommendationInfo>);
+ field public static final String SERVICE_INTERFACE = "android.printservice.recommendation.RecommendationService";
+ }
+
+}
+
+package android.provider {
+
+ @Deprecated public static final class ContactsContract.MetadataSync implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncColumns {
+ field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata";
+ field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata";
+ field @Deprecated public static final android.net.Uri CONTENT_URI;
+ field @Deprecated public static final String METADATA_AUTHORITY = "com.android.contacts.metadata";
+ field @Deprecated public static final android.net.Uri METADATA_AUTHORITY_URI;
+ }
+
+ @Deprecated protected static interface ContactsContract.MetadataSyncColumns {
+ field @Deprecated public static final String ACCOUNT_NAME = "account_name";
+ field @Deprecated public static final String ACCOUNT_TYPE = "account_type";
+ field @Deprecated public static final String DATA = "data";
+ field @Deprecated public static final String DATA_SET = "data_set";
+ field @Deprecated public static final String DELETED = "deleted";
+ field @Deprecated public static final String RAW_CONTACT_BACKUP_ID = "raw_contact_backup_id";
+ }
+
+ @Deprecated public static final class ContactsContract.MetadataSyncState implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncStateColumns {
+ field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata_sync_state";
+ field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata_sync_state";
+ field @Deprecated public static final android.net.Uri CONTENT_URI;
+ }
+
+ @Deprecated protected static interface ContactsContract.MetadataSyncStateColumns {
+ field @Deprecated public static final String ACCOUNT_NAME = "account_name";
+ field @Deprecated public static final String ACCOUNT_TYPE = "account_type";
+ field @Deprecated public static final String DATA_SET = "data_set";
+ field @Deprecated public static final String STATE = "state";
+ }
+
+ public final class DeviceConfig {
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static void addOnPropertiesChangedListener(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.provider.DeviceConfig.OnPropertiesChangedListener);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static boolean getBoolean(@NonNull String, @NonNull String, boolean);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static float getFloat(@NonNull String, @NonNull String, float);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static int getInt(@NonNull String, @NonNull String, int);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static long getLong(@NonNull String, @NonNull String, long);
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static android.provider.DeviceConfig.Properties getProperties(@NonNull String, @NonNull java.lang.String...);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static String getProperty(@NonNull String, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static String getString(@NonNull String, @NonNull String, @Nullable String);
+ method public static void removeOnPropertiesChangedListener(@NonNull android.provider.DeviceConfig.OnPropertiesChangedListener);
+ method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static void resetToDefaults(int, @Nullable String);
+ method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperties(@NonNull android.provider.DeviceConfig.Properties) throws android.provider.DeviceConfig.BadConfigException;
+ method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperty(@NonNull String, @NonNull String, @Nullable String, boolean);
+ field public static final String NAMESPACE_ACTIVITY_MANAGER = "activity_manager";
+ field public static final String NAMESPACE_ACTIVITY_MANAGER_NATIVE_BOOT = "activity_manager_native_boot";
+ field public static final String NAMESPACE_APP_COMPAT = "app_compat";
+ field public static final String NAMESPACE_ATTENTION_MANAGER_SERVICE = "attention_manager_service";
+ field public static final String NAMESPACE_AUTOFILL = "autofill";
+ field public static final String NAMESPACE_BIOMETRICS = "biometrics";
+ field public static final String NAMESPACE_BLOBSTORE = "blobstore";
+ field public static final String NAMESPACE_BLUETOOTH = "bluetooth";
+ field public static final String NAMESPACE_CONNECTIVITY = "connectivity";
+ field public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture";
+ field @Deprecated public static final String NAMESPACE_DEX_BOOT = "dex_boot";
+ field public static final String NAMESPACE_DISPLAY_MANAGER = "display_manager";
+ field public static final String NAMESPACE_GAME_DRIVER = "game_driver";
+ field public static final String NAMESPACE_INPUT_NATIVE_BOOT = "input_native_boot";
+ field public static final String NAMESPACE_INTELLIGENCE_ATTENTION = "intelligence_attention";
+ field public static final String NAMESPACE_MEDIA_NATIVE = "media_native";
+ field public static final String NAMESPACE_NETD_NATIVE = "netd_native";
+ field public static final String NAMESPACE_PACKAGE_MANAGER_SERVICE = "package_manager_service";
+ field public static final String NAMESPACE_PERMISSIONS = "permissions";
+ field public static final String NAMESPACE_PRIVACY = "privacy";
+ field public static final String NAMESPACE_PROFCOLLECT_NATIVE_BOOT = "profcollect_native_boot";
+ field public static final String NAMESPACE_ROLLBACK = "rollback";
+ field public static final String NAMESPACE_ROLLBACK_BOOT = "rollback_boot";
+ field public static final String NAMESPACE_RUNTIME = "runtime";
+ field public static final String NAMESPACE_RUNTIME_NATIVE = "runtime_native";
+ field public static final String NAMESPACE_RUNTIME_NATIVE_BOOT = "runtime_native_boot";
+ field public static final String NAMESPACE_SCHEDULER = "scheduler";
+ field @Deprecated public static final String NAMESPACE_STORAGE = "storage";
+ field public static final String NAMESPACE_STORAGE_NATIVE_BOOT = "storage_native_boot";
+ field public static final String NAMESPACE_SYSTEMUI = "systemui";
+ field public static final String NAMESPACE_TELEPHONY = "telephony";
+ field public static final String NAMESPACE_TEXTCLASSIFIER = "textclassifier";
+ field public static final String NAMESPACE_WINDOW_MANAGER_NATIVE_BOOT = "window_manager_native_boot";
+ }
+
+ public static class DeviceConfig.BadConfigException extends java.lang.Exception {
+ ctor public DeviceConfig.BadConfigException();
+ }
+
+ public static interface DeviceConfig.OnPropertiesChangedListener {
+ method public void onPropertiesChanged(@NonNull android.provider.DeviceConfig.Properties);
+ }
+
+ public static class DeviceConfig.Properties {
+ method public boolean getBoolean(@NonNull String, boolean);
+ method public float getFloat(@NonNull String, float);
+ method public int getInt(@NonNull String, int);
+ method @NonNull public java.util.Set<java.lang.String> getKeyset();
+ method public long getLong(@NonNull String, long);
+ method @NonNull public String getNamespace();
+ method @Nullable public String getString(@NonNull String, @Nullable String);
+ }
+
+ public static final class DeviceConfig.Properties.Builder {
+ ctor public DeviceConfig.Properties.Builder(@NonNull String);
+ method @NonNull public android.provider.DeviceConfig.Properties build();
+ method @NonNull public android.provider.DeviceConfig.Properties.Builder setBoolean(@NonNull String, boolean);
+ method @NonNull public android.provider.DeviceConfig.Properties.Builder setFloat(@NonNull String, float);
+ method @NonNull public android.provider.DeviceConfig.Properties.Builder setInt(@NonNull String, int);
+ method @NonNull public android.provider.DeviceConfig.Properties.Builder setLong(@NonNull String, long);
+ method @NonNull public android.provider.DeviceConfig.Properties.Builder setString(@NonNull String, @Nullable String);
+ }
+
+ public final class DocumentsContract {
+ method @NonNull public static android.net.Uri buildDocumentUriAsUser(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
+ method public static boolean isManageMode(@NonNull android.net.Uri);
+ method @NonNull public static android.net.Uri setManageMode(@NonNull android.net.Uri);
+ field public static final String ACTION_DOCUMENT_ROOT_SETTINGS = "android.provider.action.DOCUMENT_ROOT_SETTINGS";
+ field public static final String ACTION_MANAGE_DOCUMENT = "android.provider.action.MANAGE_DOCUMENT";
+ field public static final String EXTRA_SHOW_ADVANCED = "android.provider.extra.SHOW_ADVANCED";
+ }
+
+ public static final class DocumentsContract.Root {
+ field public static final int FLAG_ADVANCED = 65536; // 0x10000
+ field public static final int FLAG_HAS_SETTINGS = 131072; // 0x20000
+ field public static final int FLAG_REMOVABLE_SD = 262144; // 0x40000
+ field public static final int FLAG_REMOVABLE_USB = 524288; // 0x80000
+ }
+
+ public final class MediaStore {
+ method @NonNull public static android.net.Uri rewriteToLegacy(@NonNull android.net.Uri);
+ method @NonNull @WorkerThread public static android.net.Uri scanFile(@NonNull android.content.ContentResolver, @NonNull java.io.File);
+ method @WorkerThread public static void scanVolume(@NonNull android.content.ContentResolver, @NonNull String);
+ method @WorkerThread public static void waitForIdle(@NonNull android.content.ContentResolver);
+ field public static final String AUTHORITY_LEGACY = "media_legacy";
+ field @NonNull public static final android.net.Uri AUTHORITY_LEGACY_URI;
+ }
+
+ public abstract class SearchIndexableData {
+ ctor public SearchIndexableData();
+ ctor public SearchIndexableData(android.content.Context);
+ field public String className;
+ field public android.content.Context context;
+ field public boolean enabled;
+ field public int iconResId;
+ field public String intentAction;
+ field public String intentTargetClass;
+ field public String intentTargetPackage;
+ field public String key;
+ field public java.util.Locale locale;
+ field public String packageName;
+ field public int rank;
+ field public int userId;
+ }
+
+ public class SearchIndexableResource extends android.provider.SearchIndexableData {
+ ctor public SearchIndexableResource(int, int, String, int);
+ ctor public SearchIndexableResource(android.content.Context);
+ field public int xmlResId;
+ }
+
+ public class SearchIndexablesContract {
+ ctor public SearchIndexablesContract();
+ field public static final int COLUMN_INDEX_NON_INDEXABLE_KEYS_KEY_VALUE = 0; // 0x0
+ field public static final int COLUMN_INDEX_RAW_CLASS_NAME = 7; // 0x7
+ field public static final int COLUMN_INDEX_RAW_ENTRIES = 4; // 0x4
+ field public static final int COLUMN_INDEX_RAW_ICON_RESID = 8; // 0x8
+ field public static final int COLUMN_INDEX_RAW_INTENT_ACTION = 9; // 0x9
+ field public static final int COLUMN_INDEX_RAW_INTENT_TARGET_CLASS = 11; // 0xb
+ field public static final int COLUMN_INDEX_RAW_INTENT_TARGET_PACKAGE = 10; // 0xa
+ field public static final int COLUMN_INDEX_RAW_KEY = 12; // 0xc
+ field public static final int COLUMN_INDEX_RAW_KEYWORDS = 5; // 0x5
+ field public static final int COLUMN_INDEX_RAW_RANK = 0; // 0x0
+ field public static final int COLUMN_INDEX_RAW_SCREEN_TITLE = 6; // 0x6
+ field public static final int COLUMN_INDEX_RAW_SUMMARY_OFF = 3; // 0x3
+ field public static final int COLUMN_INDEX_RAW_SUMMARY_ON = 2; // 0x2
+ field public static final int COLUMN_INDEX_RAW_TITLE = 1; // 0x1
+ field public static final int COLUMN_INDEX_RAW_USER_ID = 13; // 0xd
+ field public static final int COLUMN_INDEX_XML_RES_CLASS_NAME = 2; // 0x2
+ field public static final int COLUMN_INDEX_XML_RES_ICON_RESID = 3; // 0x3
+ field public static final int COLUMN_INDEX_XML_RES_INTENT_ACTION = 4; // 0x4
+ field public static final int COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS = 6; // 0x6
+ field public static final int COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE = 5; // 0x5
+ field public static final int COLUMN_INDEX_XML_RES_RANK = 0; // 0x0
+ field public static final int COLUMN_INDEX_XML_RES_RESID = 1; // 0x1
+ field public static final String DYNAMIC_INDEXABLES_RAW = "dynamic_indexables_raw";
+ field public static final String DYNAMIC_INDEXABLES_RAW_PATH = "settings/dynamic_indexables_raw";
+ field public static final String INDEXABLES_RAW = "indexables_raw";
+ field public static final String[] INDEXABLES_RAW_COLUMNS;
+ field public static final String INDEXABLES_RAW_PATH = "settings/indexables_raw";
+ field public static final String INDEXABLES_XML_RES = "indexables_xml_res";
+ field public static final String[] INDEXABLES_XML_RES_COLUMNS;
+ field public static final String INDEXABLES_XML_RES_PATH = "settings/indexables_xml_res";
+ field public static final String NON_INDEXABLES_KEYS = "non_indexables_key";
+ field public static final String[] NON_INDEXABLES_KEYS_COLUMNS;
+ field public static final String NON_INDEXABLES_KEYS_PATH = "settings/non_indexables_key";
+ field public static final String PROVIDER_INTERFACE = "android.content.action.SEARCH_INDEXABLES_PROVIDER";
+ field public static final String SLICE_URI_PAIRS = "slice_uri_pairs";
+ field @NonNull public static final String[] SLICE_URI_PAIRS_COLUMNS;
+ field public static final String SLICE_URI_PAIRS_PATH = "settings/slice_uri_pairs";
+ }
+
+ public static class SearchIndexablesContract.BaseColumns {
+ field public static final String COLUMN_CLASS_NAME = "className";
+ field public static final String COLUMN_ICON_RESID = "iconResId";
+ field public static final String COLUMN_INTENT_ACTION = "intentAction";
+ field public static final String COLUMN_INTENT_TARGET_CLASS = "intentTargetClass";
+ field public static final String COLUMN_INTENT_TARGET_PACKAGE = "intentTargetPackage";
+ field public static final String COLUMN_RANK = "rank";
+ }
+
+ public static final class SearchIndexablesContract.NonIndexableKey extends android.provider.SearchIndexablesContract.BaseColumns {
+ field public static final String COLUMN_KEY_VALUE = "key";
+ field public static final String MIME_TYPE = "vnd.android.cursor.dir/non_indexables_key";
+ }
+
+ public static final class SearchIndexablesContract.RawData extends android.provider.SearchIndexablesContract.BaseColumns {
+ field public static final String COLUMN_ENTRIES = "entries";
+ field public static final String COLUMN_KEY = "key";
+ field public static final String COLUMN_KEYWORDS = "keywords";
+ field public static final String COLUMN_SCREEN_TITLE = "screenTitle";
+ field public static final String COLUMN_SUMMARY_OFF = "summaryOff";
+ field public static final String COLUMN_SUMMARY_ON = "summaryOn";
+ field public static final String COLUMN_TITLE = "title";
+ field public static final String COLUMN_USER_ID = "user_id";
+ field public static final String MIME_TYPE = "vnd.android.cursor.dir/indexables_raw";
+ }
+
+ public static final class SearchIndexablesContract.SliceUriPairColumns {
+ field public static final String KEY = "key";
+ field public static final String SLICE_URI = "slice_uri";
+ }
+
+ public static final class SearchIndexablesContract.XmlResource extends android.provider.SearchIndexablesContract.BaseColumns {
+ field public static final String COLUMN_XML_RESID = "xmlResId";
+ field public static final String MIME_TYPE = "vnd.android.cursor.dir/indexables_xml_res";
+ }
+
+ public abstract class SearchIndexablesProvider extends android.content.ContentProvider {
+ ctor public SearchIndexablesProvider();
+ method public final int delete(android.net.Uri, String, String[]);
+ method public String getType(android.net.Uri);
+ method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
+ method public android.database.Cursor query(android.net.Uri, String[], String, String[], String);
+ method @Nullable public android.database.Cursor queryDynamicRawData(@Nullable String[]);
+ method public abstract android.database.Cursor queryNonIndexableKeys(String[]);
+ method public abstract android.database.Cursor queryRawData(String[]);
+ method @Nullable public android.database.Cursor querySliceUriPairs();
+ method public abstract android.database.Cursor queryXmlResources(String[]);
+ method public final int update(android.net.Uri, android.content.ContentValues, String, String[]);
+ }
+
+ public final class Settings {
+ method @Deprecated public static boolean checkAndNoteWriteSettingsOperation(@NonNull android.content.Context, int, @NonNull String, boolean);
+ method public static boolean checkAndNoteWriteSettingsOperation(@NonNull android.content.Context, int, @NonNull String, @Nullable String, boolean);
+ field public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS = "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
+ field public static final String ACTION_BUGREPORT_HANDLER_SETTINGS = "android.settings.BUGREPORT_HANDLER_SETTINGS";
+ field public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
+ field public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS = "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
+ field public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
+ field public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
+ field public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS = "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
+ field public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS = "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
+ field public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE = "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
+ field public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
+ field public static final String ACTION_TETHER_PROVISIONING_UI = "android.settings.TETHER_PROVISIONING_UI";
+ field public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS";
+ }
+
+ public static final class Settings.Global extends android.provider.Settings.NameValueTable {
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, @Nullable String, boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void resetToDefaults(@NonNull android.content.ContentResolver, @Nullable String);
+ field public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
+ field public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
+ field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages";
+ field public static final String CARRIER_APP_NAMES = "carrier_app_names";
+ field public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
+ field public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
+ field public static final String DEVICE_DEMO_MODE = "device_demo_mode";
+ field public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = "device_provisioning_mobile_data";
+ field public static final String EUICC_PROVISIONED = "euicc_provisioned";
+ field public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
+ field public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries";
+ field public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = "install_carrier_app_notification_persistent";
+ field public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = "install_carrier_app_notification_sleep_millis";
+ field public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
+ field public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
+ field public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
+ field public static final String TETHER_SUPPORTED = "tether_supported";
+ field public static final String THEATER_MODE_ON = "theater_mode_on";
+ field public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
+ field public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
+ field @Deprecated public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
+ }
+
+ public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, @Nullable String, boolean);
+ method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void resetToDefaults(@NonNull android.content.ContentResolver, @Nullable String);
+ field @Deprecated public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = "accessibility_display_magnification_navbar_enabled";
+ field public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
+ field public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = "autofill_field_classification";
+ field public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = "autofill_user_data_max_category_count";
+ field public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = "autofill_user_data_max_field_classification_size";
+ field public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = "autofill_user_data_max_user_data_size";
+ field public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = "autofill_user_data_max_value_length";
+ field public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = "autofill_user_data_min_value_length";
+ field public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled";
+ field public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
+ field public static final String DOZE_ALWAYS_ON = "doze_always_on";
+ field public static final String HUSH_GESTURE_USED = "hush_gesture_used";
+ field public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
+ field public static final String LAST_SETUP_SHOWN = "last_setup_shown";
+ field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis";
+ field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis";
+ field public static final int LOCATION_MODE_ON = 3; // 0x3
+ field @Deprecated public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = "location_permissions_upgrade_to_q_mode";
+ field public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications";
+ field public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = "lock_screen_show_notifications";
+ field public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
+ field public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES = "theme_customization_overlay_packages";
+ field public static final String USER_SETUP_COMPLETE = "user_setup_complete";
+ field public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; // 0xa
+ field public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; // 0x0
+ field public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; // 0x2
+ field public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; // 0x1
+ field public static final String USER_SETUP_PERSONALIZATION_STATE = "user_setup_personalization_state";
+ field public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
+ field public static final int VOLUME_HUSH_MUTE = 2; // 0x2
+ field public static final int VOLUME_HUSH_OFF = 0; // 0x0
+ field public static final int VOLUME_HUSH_VIBRATE = 1; // 0x1
+ }
+
+ public static final class Settings.System extends android.provider.Settings.NameValueTable {
+ method @RequiresPermission(android.Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, boolean);
+ }
+
+ public static final class Telephony.Carriers implements android.provider.BaseColumns {
+ field public static final String APN_SET_ID = "apn_set_id";
+ field public static final int CARRIER_EDITED = 4; // 0x4
+ field public static final String EDITED_STATUS = "edited";
+ field public static final int MATCH_ALL_APN_SET_ID = -1; // 0xffffffff
+ field public static final String MAX_CONNECTIONS = "max_conns";
+ field public static final String MODEM_PERSIST = "modem_cognitive";
+ field public static final String MTU = "mtu";
+ field public static final int NO_APN_SET_ID = 0; // 0x0
+ field public static final String TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";
+ field public static final int UNEDITED = 0; // 0x0
+ field public static final int USER_DELETED = 2; // 0x2
+ field public static final String USER_EDITABLE = "user_editable";
+ field public static final int USER_EDITED = 1; // 0x1
+ field public static final String USER_VISIBLE = "user_visible";
+ field public static final String WAIT_TIME_RETRY = "wait_time";
+ }
+
+ public static final class Telephony.CellBroadcasts implements android.provider.BaseColumns {
+ field @NonNull public static final String AUTHORITY_LEGACY = "cellbroadcast-legacy";
+ field @NonNull public static final android.net.Uri AUTHORITY_LEGACY_URI;
+ field @NonNull public static final String CALL_METHOD_GET_PREFERENCE = "get_preference";
+ field public static final String CID = "cid";
+ field public static final String CMAS_CATEGORY = "cmas_category";
+ field public static final String CMAS_CERTAINTY = "cmas_certainty";
+ field public static final String CMAS_MESSAGE_CLASS = "cmas_message_class";
+ field public static final String CMAS_RESPONSE_TYPE = "cmas_response_type";
+ field public static final String CMAS_SEVERITY = "cmas_severity";
+ field public static final String CMAS_URGENCY = "cmas_urgency";
+ field @NonNull public static final android.net.Uri CONTENT_URI;
+ field public static final String DATA_CODING_SCHEME = "dcs";
+ field public static final String DEFAULT_SORT_ORDER = "date DESC";
+ field public static final String DELIVERY_TIME = "date";
+ field public static final String ETWS_IS_PRIMARY = "etws_is_primary";
+ field public static final String ETWS_WARNING_TYPE = "etws_warning_type";
+ field public static final String GEOGRAPHICAL_SCOPE = "geo_scope";
+ field public static final String GEOMETRIES = "geometries";
+ field public static final String LAC = "lac";
+ field public static final String LANGUAGE_CODE = "language";
+ field public static final String LOCATION_CHECK_TIME = "location_check_time";
+ field public static final String MAXIMUM_WAIT_TIME = "maximum_wait_time";
+ field public static final String MESSAGE_BODY = "body";
+ field public static final String MESSAGE_BROADCASTED = "message_broadcasted";
+ field public static final String MESSAGE_DISPLAYED = "message_displayed";
+ field public static final String MESSAGE_FORMAT = "format";
+ field @NonNull @RequiresPermission(android.Manifest.permission.READ_CELL_BROADCASTS) public static final android.net.Uri MESSAGE_HISTORY_URI;
+ field public static final String MESSAGE_PRIORITY = "priority";
+ field public static final String MESSAGE_READ = "read";
+ field public static final String PLMN = "plmn";
+ field public static final String RECEIVED_TIME = "received_time";
+ field public static final String SERIAL_NUMBER = "serial_number";
+ field public static final String SERVICE_CATEGORY = "service_category";
+ field public static final String SLOT_INDEX = "slot_index";
+ field public static final String SUBSCRIPTION_ID = "sub_id";
+ }
+
+ public static final class Telephony.CellBroadcasts.Preference {
+ field @NonNull public static final String ENABLE_ALERT_VIBRATION_PREF = "enable_alert_vibrate";
+ field @NonNull public static final String ENABLE_AREA_UPDATE_INFO_PREF = "enable_area_update_info_alerts";
+ field @NonNull public static final String ENABLE_CMAS_AMBER_PREF = "enable_cmas_amber_alerts";
+ field @NonNull public static final String ENABLE_CMAS_EXTREME_THREAT_PREF = "enable_cmas_extreme_threat_alerts";
+ field @NonNull public static final String ENABLE_CMAS_IN_SECOND_LANGUAGE_PREF = "receive_cmas_in_second_language";
+ field @NonNull public static final String ENABLE_CMAS_PRESIDENTIAL_PREF = "enable_cmas_presidential_alerts";
+ field @NonNull public static final String ENABLE_CMAS_SEVERE_THREAT_PREF = "enable_cmas_severe_threat_alerts";
+ field @NonNull public static final String ENABLE_EMERGENCY_PERF = "enable_emergency_alerts";
+ field @NonNull public static final String ENABLE_PUBLIC_SAFETY_PREF = "enable_public_safety_messages";
+ field @NonNull public static final String ENABLE_STATE_LOCAL_TEST_PREF = "enable_state_local_test_alerts";
+ field @NonNull public static final String ENABLE_TEST_ALERT_PREF = "enable_test_alerts";
+ }
+
+ public static final class Telephony.Sms.Intents {
+ field public static final String ACTION_SMS_EMERGENCY_CB_RECEIVED = "android.provider.action.SMS_EMERGENCY_CB_RECEIVED";
+ }
+
+ public final class TimeZoneRulesDataContract {
+ field public static final String AUTHORITY = "com.android.timezone";
+ }
+
+ public static final class TimeZoneRulesDataContract.Operation {
+ field public static final String COLUMN_DISTRO_MAJOR_VERSION = "distro_major_version";
+ field public static final String COLUMN_DISTRO_MINOR_VERSION = "distro_minor_version";
+ field public static final String COLUMN_REVISION = "revision";
+ field public static final String COLUMN_RULES_VERSION = "rules_version";
+ field public static final String COLUMN_TYPE = "type";
+ field public static final android.net.Uri CONTENT_URI;
+ field public static final String TYPE_INSTALL = "INSTALL";
+ field public static final String TYPE_NO_OP = "NOOP";
+ field public static final String TYPE_UNINSTALL = "UNINSTALL";
+ }
+
+}
+
+package android.se.omapi {
+
+ public final class Reader {
+ method @RequiresPermission(android.Manifest.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION) public boolean reset();
+ }
+
+}
+
+package android.security.keystore {
+
+ public class AndroidKeyStoreProvider extends java.security.Provider {
+ method @NonNull public static java.security.KeyStore getKeyStoreForUid(int) throws java.security.KeyStoreException, java.security.NoSuchProviderException;
+ }
+
+ public abstract class AttestationUtils {
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static java.security.cert.X509Certificate[] attestDeviceIds(android.content.Context, @NonNull int[], @NonNull byte[]) throws android.security.keystore.DeviceIdAttestationException;
+ field public static final int ID_TYPE_IMEI = 2; // 0x2
+ field public static final int ID_TYPE_MEID = 3; // 0x3
+ field public static final int ID_TYPE_SERIAL = 1; // 0x1
+ field public static final int USE_INDIVIDUAL_ATTESTATION = 4; // 0x4
+ }
+
+ public class DeviceIdAttestationException extends java.lang.Exception {
+ ctor public DeviceIdAttestationException(@Nullable String);
+ ctor public DeviceIdAttestationException(@Nullable String, @Nullable Throwable);
+ }
+
+ public static final class KeyGenParameterSpec.Builder {
+ method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUid(int);
+ }
+
+}
+
+package android.security.keystore.recovery {
+
+ public class DecryptionFailedException extends java.security.GeneralSecurityException {
+ ctor public DecryptionFailedException(String);
+ }
+
+ public class InternalRecoveryServiceException extends java.security.GeneralSecurityException {
+ ctor public InternalRecoveryServiceException(String);
+ ctor public InternalRecoveryServiceException(String, Throwable);
+ }
+
+ public final class KeyChainProtectionParams implements android.os.Parcelable {
+ method public void clearSecret();
+ method public int describeContents();
+ method @NonNull public android.security.keystore.recovery.KeyDerivationParams getKeyDerivationParams();
+ method public int getLockScreenUiFormat();
+ method @NonNull public byte[] getSecret();
+ method public int getUserSecretType();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.security.keystore.recovery.KeyChainProtectionParams> CREATOR;
+ field public static final int TYPE_LOCKSCREEN = 100; // 0x64
+ field public static final int UI_FORMAT_PASSWORD = 2; // 0x2
+ field public static final int UI_FORMAT_PATTERN = 3; // 0x3
+ field public static final int UI_FORMAT_PIN = 1; // 0x1
+ }
+
+ public static class KeyChainProtectionParams.Builder {
+ ctor public KeyChainProtectionParams.Builder();
+ method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams build();
+ method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setKeyDerivationParams(@NonNull android.security.keystore.recovery.KeyDerivationParams);
+ method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setLockScreenUiFormat(int);
+ method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setSecret(@NonNull byte[]);
+ method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setUserSecretType(int);
+ }
+
+ public final class KeyChainSnapshot implements android.os.Parcelable {
+ method public int describeContents();
+ method public long getCounterId();
+ method @NonNull public byte[] getEncryptedRecoveryKeyBlob();
+ method @NonNull public java.util.List<android.security.keystore.recovery.KeyChainProtectionParams> getKeyChainProtectionParams();
+ method public int getMaxAttempts();
+ method @NonNull public byte[] getServerParams();
+ method public int getSnapshotVersion();
+ method @NonNull public java.security.cert.CertPath getTrustedHardwareCertPath();
+ method @NonNull public java.util.List<android.security.keystore.recovery.WrappedApplicationKey> getWrappedApplicationKeys();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.security.keystore.recovery.KeyChainSnapshot> CREATOR;
+ }
+
+ public final class KeyDerivationParams implements android.os.Parcelable {
+ method @NonNull public static android.security.keystore.recovery.KeyDerivationParams createScryptParams(@NonNull byte[], int);
+ method @NonNull public static android.security.keystore.recovery.KeyDerivationParams createSha256Params(@NonNull byte[]);
+ method public int describeContents();
+ method public int getAlgorithm();
+ method public int getMemoryDifficulty();
+ method @NonNull public byte[] getSalt();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int ALGORITHM_SCRYPT = 2; // 0x2
+ field public static final int ALGORITHM_SHA256 = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.security.keystore.recovery.KeyDerivationParams> CREATOR;
+ }
+
+ public class LockScreenRequiredException extends java.security.GeneralSecurityException {
+ ctor public LockScreenRequiredException(String);
+ }
+
+ public class RecoveryController {
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public android.security.keystore.recovery.RecoverySession createRecoverySession();
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key generateKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key generateKey(@NonNull String, @Nullable byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.util.List<java.lang.String> getAliases() throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public static android.security.keystore.recovery.RecoveryController getInstance(@NonNull android.content.Context);
+ method @Nullable @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key getKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException, java.security.UnrecoverableKeyException;
+ method @Nullable @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public android.security.keystore.recovery.KeyChainSnapshot getKeyChainSnapshot() throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public int[] getRecoverySecretTypes() throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public int getRecoveryStatus(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.util.Map<java.lang.String,java.security.cert.X509Certificate> getRootCertificates();
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key importKey(@NonNull String, @NonNull byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key importKey(@NonNull String, @NonNull byte[], @Nullable byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void initRecoveryService(@NonNull String, @NonNull byte[], @NonNull byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public static boolean isRecoverableKeyStoreEnabled(@NonNull android.content.Context);
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void removeKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setRecoverySecretTypes(@NonNull int[]) throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setRecoveryStatus(@NonNull String, int) throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setServerParams(@NonNull byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setSnapshotCreatedPendingIntent(@Nullable android.app.PendingIntent) throws android.security.keystore.recovery.InternalRecoveryServiceException;
+ field public static final int RECOVERY_STATUS_PERMANENT_FAILURE = 3; // 0x3
+ field public static final int RECOVERY_STATUS_SYNCED = 0; // 0x0
+ field public static final int RECOVERY_STATUS_SYNC_IN_PROGRESS = 1; // 0x1
+ }
+
+ public class RecoverySession implements java.lang.AutoCloseable {
+ method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void close();
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.util.Map<java.lang.String,java.security.Key> recoverKeyChainSnapshot(@NonNull byte[], @NonNull java.util.List<android.security.keystore.recovery.WrappedApplicationKey>) throws android.security.keystore.recovery.DecryptionFailedException, android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.SessionExpiredException;
+ method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public byte[] start(@NonNull String, @NonNull java.security.cert.CertPath, @NonNull byte[], @NonNull byte[], @NonNull java.util.List<android.security.keystore.recovery.KeyChainProtectionParams>) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
+ }
+
+ public class SessionExpiredException extends java.security.GeneralSecurityException {
+ ctor public SessionExpiredException(String);
+ }
+
+ public final class WrappedApplicationKey implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public String getAlias();
+ method @NonNull public byte[] getEncryptedKeyMaterial();
+ method @Nullable public byte[] getMetadata();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.security.keystore.recovery.WrappedApplicationKey> CREATOR;
+ }
+
+ public static class WrappedApplicationKey.Builder {
+ ctor public WrappedApplicationKey.Builder();
+ method @NonNull public android.security.keystore.recovery.WrappedApplicationKey build();
+ method @NonNull public android.security.keystore.recovery.WrappedApplicationKey.Builder setAlias(@NonNull String);
+ method @NonNull public android.security.keystore.recovery.WrappedApplicationKey.Builder setEncryptedKeyMaterial(@NonNull byte[]);
+ method @NonNull public android.security.keystore.recovery.WrappedApplicationKey.Builder setMetadata(@Nullable byte[]);
+ }
+
+}
+
+package android.service.appprediction {
+
+ public abstract class AppPredictionService extends android.app.Service {
+ ctor public AppPredictionService();
+ method @MainThread public abstract void onAppTargetEvent(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull android.app.prediction.AppTargetEvent);
+ method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
+ method public void onCreatePredictionSession(@NonNull android.app.prediction.AppPredictionContext, @NonNull android.app.prediction.AppPredictionSessionId);
+ method @MainThread public void onDestroyPredictionSession(@NonNull android.app.prediction.AppPredictionSessionId);
+ method @MainThread public abstract void onLaunchLocationShown(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull String, @NonNull java.util.List<android.app.prediction.AppTargetId>);
+ method @MainThread public abstract void onRequestPredictionUpdate(@NonNull android.app.prediction.AppPredictionSessionId);
+ method @MainThread public abstract void onSortAppTargets(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull java.util.List<android.app.prediction.AppTarget>, @NonNull android.os.CancellationSignal, @NonNull java.util.function.Consumer<java.util.List<android.app.prediction.AppTarget>>);
+ method @MainThread public void onStartPredictionUpdates();
+ method @MainThread public void onStopPredictionUpdates();
+ method public final void updatePredictions(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull java.util.List<android.app.prediction.AppTarget>);
+ }
+
+}
+
+package android.service.attention {
+
+ public abstract class AttentionService extends android.app.Service {
+ ctor public AttentionService();
+ method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
+ method public abstract void onCancelAttentionCheck(@NonNull android.service.attention.AttentionService.AttentionCallback);
+ method public abstract void onCheckAttention(@NonNull android.service.attention.AttentionService.AttentionCallback);
+ field public static final int ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6; // 0x6
+ field public static final int ATTENTION_FAILURE_CANCELLED = 3; // 0x3
+ field public static final int ATTENTION_FAILURE_PREEMPTED = 4; // 0x4
+ field public static final int ATTENTION_FAILURE_TIMED_OUT = 5; // 0x5
+ field public static final int ATTENTION_FAILURE_UNKNOWN = 2; // 0x2
+ field public static final int ATTENTION_SUCCESS_ABSENT = 0; // 0x0
+ field public static final int ATTENTION_SUCCESS_PRESENT = 1; // 0x1
+ field public static final String SERVICE_INTERFACE = "android.service.attention.AttentionService";
+ }
+
+ public static final class AttentionService.AttentionCallback {
+ method public void onFailure(int);
+ method public void onSuccess(int, long);
+ }
+
+}
+
+package android.service.autofill {
+
+ public abstract class AutofillFieldClassificationService extends android.app.Service {
+ ctor public AutofillFieldClassificationService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public float[][] onCalculateScores(@NonNull java.util.List<android.view.autofill.AutofillValue>, @NonNull java.util.List<java.lang.String>, @NonNull java.util.List<java.lang.String>, @Nullable String, @Nullable android.os.Bundle, @Nullable java.util.Map, @Nullable java.util.Map);
+ method @Deprecated @Nullable public float[][] onGetScores(@Nullable String, @Nullable android.os.Bundle, @NonNull java.util.List<android.view.autofill.AutofillValue>, @NonNull java.util.List<java.lang.String>);
+ field public static final String REQUIRED_ALGORITHM_CREDIT_CARD = "CREDIT_CARD";
+ field public static final String REQUIRED_ALGORITHM_EDIT_DISTANCE = "EDIT_DISTANCE";
+ field public static final String REQUIRED_ALGORITHM_EXACT_MATCH = "EXACT_MATCH";
+ field public static final String SERVICE_INTERFACE = "android.service.autofill.AutofillFieldClassificationService";
+ field public static final String SERVICE_META_DATA_KEY_AVAILABLE_ALGORITHMS = "android.autofill.field_classification.available_algorithms";
+ field public static final String SERVICE_META_DATA_KEY_DEFAULT_ALGORITHM = "android.autofill.field_classification.default_algorithm";
+ }
+
+ public static final class Dataset.Builder {
+ ctor public Dataset.Builder(@NonNull android.service.autofill.InlinePresentation);
+ method @NonNull public android.service.autofill.Dataset.Builder setContent(@NonNull android.view.autofill.AutofillId, @Nullable android.content.ClipData);
+ method @NonNull public android.service.autofill.Dataset.Builder setFieldInlinePresentation(@NonNull android.view.autofill.AutofillId, @Nullable android.view.autofill.AutofillValue, @Nullable java.util.regex.Pattern, @NonNull android.service.autofill.InlinePresentation);
+ }
+
+ public abstract class InlineSuggestionRenderService extends android.app.Service {
+ ctor public InlineSuggestionRenderService();
+ method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
+ method @NonNull public android.os.Bundle onGetInlineSuggestionsRendererInfo();
+ method @Nullable public android.view.View onRenderSuggestion(@NonNull android.service.autofill.InlinePresentation, int, int);
+ method public final void startIntentSender(@NonNull android.content.IntentSender);
+ field public static final String SERVICE_INTERFACE = "android.service.autofill.InlineSuggestionRenderService";
+ }
+
+}
+
+package android.service.autofill.augmented {
+
+ public abstract class AugmentedAutofillService extends android.app.Service {
+ ctor public AugmentedAutofillService();
+ method protected final void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]);
+ method protected void dump(@NonNull java.io.PrintWriter, @NonNull String[]);
+ method @Nullable public final android.service.autofill.FillEventHistory getFillEventHistory();
+ method public void onConnected();
+ method public void onDisconnected();
+ method public void onFillRequest(@NonNull android.service.autofill.augmented.FillRequest, @NonNull android.os.CancellationSignal, @NonNull android.service.autofill.augmented.FillController, @NonNull android.service.autofill.augmented.FillCallback);
+ method public final boolean requestAutofill(@NonNull android.content.ComponentName, @NonNull android.view.autofill.AutofillId);
+ field public static final String SERVICE_INTERFACE = "android.service.autofill.augmented.AugmentedAutofillService";
+ }
+
+ public final class FillCallback {
+ method public void onSuccess(@Nullable android.service.autofill.augmented.FillResponse);
+ }
+
+ public final class FillController {
+ method public void autofill(@NonNull java.util.List<android.util.Pair<android.view.autofill.AutofillId,android.view.autofill.AutofillValue>>);
+ }
+
+ public final class FillRequest {
+ method @NonNull public android.content.ComponentName getActivityComponent();
+ method @NonNull public android.view.autofill.AutofillId getFocusedId();
+ method @NonNull public android.view.autofill.AutofillValue getFocusedValue();
+ method @Nullable public android.view.inputmethod.InlineSuggestionsRequest getInlineSuggestionsRequest();
+ method @Nullable public android.service.autofill.augmented.PresentationParams getPresentationParams();
+ method public int getTaskId();
+ }
+
+ public final class FillResponse {
+ }
+
+ public static final class FillResponse.Builder {
+ ctor public FillResponse.Builder();
+ method @NonNull public android.service.autofill.augmented.FillResponse build();
+ method @NonNull public android.service.autofill.augmented.FillResponse.Builder setClientState(@NonNull android.os.Bundle);
+ method @NonNull public android.service.autofill.augmented.FillResponse.Builder setFillWindow(@NonNull android.service.autofill.augmented.FillWindow);
+ method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineSuggestions(@NonNull java.util.List<android.service.autofill.Dataset>);
+ }
+
+ public final class FillWindow implements java.lang.AutoCloseable {
+ ctor public FillWindow();
+ method public void destroy();
+ method public boolean update(@NonNull android.service.autofill.augmented.PresentationParams.Area, @NonNull android.view.View, long);
+ }
+
+ public abstract class PresentationParams {
+ method @Nullable public android.service.autofill.augmented.PresentationParams.Area getSuggestionArea();
+ }
+
+ public abstract static class PresentationParams.Area {
+ method @NonNull public android.graphics.Rect getBounds();
+ }
+
+}
+
+package android.service.carrier {
+
+ public abstract class ApnService extends android.app.Service {
+ ctor public ApnService();
+ method @NonNull public android.os.IBinder onBind(@Nullable android.content.Intent);
+ method @NonNull @WorkerThread public abstract java.util.List<android.content.ContentValues> onRestoreApns(int);
+ }
+
+}
+
+package android.service.contentcapture {
+
+ public final class ActivityEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.content.ComponentName getComponentName();
+ method public int getEventType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.contentcapture.ActivityEvent> CREATOR;
+ field public static final int TYPE_ACTIVITY_DESTROYED = 24; // 0x18
+ field public static final int TYPE_ACTIVITY_PAUSED = 2; // 0x2
+ field public static final int TYPE_ACTIVITY_RESUMED = 1; // 0x1
+ field public static final int TYPE_ACTIVITY_STOPPED = 23; // 0x17
+ }
+
+ public abstract class ContentCaptureService extends android.app.Service {
+ ctor public ContentCaptureService();
+ method public final void disableSelf();
+ method public void onActivityEvent(@NonNull android.service.contentcapture.ActivityEvent);
+ method public void onActivitySnapshot(@NonNull android.view.contentcapture.ContentCaptureSessionId, @NonNull android.service.contentcapture.SnapshotData);
+ method public void onConnected();
+ method public void onContentCaptureEvent(@NonNull android.view.contentcapture.ContentCaptureSessionId, @NonNull android.view.contentcapture.ContentCaptureEvent);
+ method public void onCreateContentCaptureSession(@NonNull android.view.contentcapture.ContentCaptureContext, @NonNull android.view.contentcapture.ContentCaptureSessionId);
+ method public void onDataRemovalRequest(@NonNull android.view.contentcapture.DataRemovalRequest);
+ method public void onDataShareRequest(@NonNull android.view.contentcapture.DataShareRequest, @NonNull android.service.contentcapture.DataShareCallback);
+ method public void onDestroyContentCaptureSession(@NonNull android.view.contentcapture.ContentCaptureSessionId);
+ method public void onDisconnected();
+ method public final void setContentCaptureConditions(@NonNull String, @Nullable java.util.Set<android.view.contentcapture.ContentCaptureCondition>);
+ method public final void setContentCaptureWhitelist(@Nullable java.util.Set<java.lang.String>, @Nullable java.util.Set<android.content.ComponentName>);
+ field public static final String SERVICE_INTERFACE = "android.service.contentcapture.ContentCaptureService";
+ field public static final String SERVICE_META_DATA = "android.content_capture";
+ }
+
+ public interface DataShareCallback {
+ method public void onAccept(@NonNull java.util.concurrent.Executor, @NonNull android.service.contentcapture.DataShareReadAdapter);
+ method public void onReject();
+ }
+
+ public interface DataShareReadAdapter {
+ method public void onError(int);
+ method public void onStart(@NonNull android.os.ParcelFileDescriptor);
+ }
+
+ public final class SnapshotData implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.app.assist.AssistContent getAssistContent();
+ method @NonNull public android.os.Bundle getAssistData();
+ method @NonNull public android.app.assist.AssistStructure getAssistStructure();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.contentcapture.SnapshotData> CREATOR;
+ }
+
+}
+
+package android.service.contentsuggestions {
+
+ public abstract class ContentSuggestionsService extends android.app.Service {
+ ctor public ContentSuggestionsService();
+ method public abstract void onClassifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback);
+ method public abstract void onNotifyInteraction(@NonNull String, @NonNull android.os.Bundle);
+ method public abstract void onProcessContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle);
+ method public abstract void onSuggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback);
+ field public static final String SERVICE_INTERFACE = "android.service.contentsuggestions.ContentSuggestionsService";
+ }
+
+}
+
+package android.service.dataloader {
+
+ public abstract class DataLoaderService extends android.app.Service {
+ ctor public DataLoaderService();
+ method @Nullable public android.service.dataloader.DataLoaderService.DataLoader onCreateDataLoader(@NonNull android.content.pm.DataLoaderParams);
+ }
+
+ public static interface DataLoaderService.DataLoader {
+ method public boolean onCreate(@NonNull android.content.pm.DataLoaderParams, @NonNull android.service.dataloader.DataLoaderService.FileSystemConnector);
+ method public boolean onPrepareImage(@NonNull java.util.Collection<android.content.pm.InstallationFile>, @NonNull java.util.Collection<java.lang.String>);
+ }
+
+ public static final class DataLoaderService.FileSystemConnector {
+ method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void writeData(@NonNull String, long, long, @NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
+ }
+
+}
+
+package android.service.euicc {
+
+ public final class DownloadSubscriptionResult implements android.os.Parcelable {
+ ctor public DownloadSubscriptionResult(int, int, int);
+ method public int describeContents();
+ method public int getCardId();
+ method public int getResolvableErrors();
+ method public int getResult();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.euicc.DownloadSubscriptionResult> CREATOR;
+ }
+
+ public final class EuiccProfileInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.service.carrier.CarrierIdentifier getCarrierIdentifier();
+ method public String getIccid();
+ method @Nullable public String getNickname();
+ method @android.service.euicc.EuiccProfileInfo.PolicyRule public int getPolicyRules();
+ method @android.service.euicc.EuiccProfileInfo.ProfileClass public int getProfileClass();
+ method public String getProfileName();
+ method public String getServiceProviderName();
+ method @android.service.euicc.EuiccProfileInfo.ProfileState public int getState();
+ method @Nullable public java.util.List<android.telephony.UiccAccessRule> getUiccAccessRules();
+ method public boolean hasPolicyRule(@android.service.euicc.EuiccProfileInfo.PolicyRule int);
+ method public boolean hasPolicyRules();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.euicc.EuiccProfileInfo> CREATOR;
+ field public static final int POLICY_RULE_DELETE_AFTER_DISABLING = 4; // 0x4
+ field public static final int POLICY_RULE_DO_NOT_DELETE = 2; // 0x2
+ field public static final int POLICY_RULE_DO_NOT_DISABLE = 1; // 0x1
+ field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2
+ field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1
+ field public static final int PROFILE_CLASS_TESTING = 0; // 0x0
+ field public static final int PROFILE_STATE_DISABLED = 0; // 0x0
+ field public static final int PROFILE_STATE_ENABLED = 1; // 0x1
+ }
+
+ public static final class EuiccProfileInfo.Builder {
+ ctor public EuiccProfileInfo.Builder(String);
+ ctor public EuiccProfileInfo.Builder(android.service.euicc.EuiccProfileInfo);
+ method public android.service.euicc.EuiccProfileInfo build();
+ method public android.service.euicc.EuiccProfileInfo.Builder setCarrierIdentifier(android.service.carrier.CarrierIdentifier);
+ method public android.service.euicc.EuiccProfileInfo.Builder setIccid(String);
+ method public android.service.euicc.EuiccProfileInfo.Builder setNickname(String);
+ method public android.service.euicc.EuiccProfileInfo.Builder setPolicyRules(@android.service.euicc.EuiccProfileInfo.PolicyRule int);
+ method public android.service.euicc.EuiccProfileInfo.Builder setProfileClass(@android.service.euicc.EuiccProfileInfo.ProfileClass int);
+ method public android.service.euicc.EuiccProfileInfo.Builder setProfileName(String);
+ method public android.service.euicc.EuiccProfileInfo.Builder setServiceProviderName(String);
+ method public android.service.euicc.EuiccProfileInfo.Builder setState(@android.service.euicc.EuiccProfileInfo.ProfileState int);
+ method public android.service.euicc.EuiccProfileInfo.Builder setUiccAccessRule(@Nullable java.util.List<android.telephony.UiccAccessRule>);
+ }
+
+ @IntDef(flag=true, prefix={"POLICY_RULE_"}, value={android.service.euicc.EuiccProfileInfo.POLICY_RULE_DO_NOT_DISABLE, android.service.euicc.EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE, android.service.euicc.EuiccProfileInfo.POLICY_RULE_DELETE_AFTER_DISABLING}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccProfileInfo.PolicyRule {
+ }
+
+ @IntDef(prefix={"PROFILE_CLASS_"}, value={android.service.euicc.EuiccProfileInfo.PROFILE_CLASS_TESTING, android.service.euicc.EuiccProfileInfo.PROFILE_CLASS_PROVISIONING, android.service.euicc.EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL, 0xffffffff}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccProfileInfo.ProfileClass {
+ }
+
+ @IntDef(prefix={"PROFILE_STATE_"}, value={android.service.euicc.EuiccProfileInfo.PROFILE_STATE_DISABLED, android.service.euicc.EuiccProfileInfo.PROFILE_STATE_ENABLED, 0xffffffff}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccProfileInfo.ProfileState {
+ }
+
+ public abstract class EuiccService extends android.app.Service {
+ ctor public EuiccService();
+ method public void dump(@NonNull java.io.PrintWriter);
+ method public int encodeSmdxSubjectAndReasonCode(@Nullable String, @Nullable String);
+ method @CallSuper public android.os.IBinder onBind(android.content.Intent);
+ method public abstract int onDeleteSubscription(int, String);
+ method public android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @Nullable android.os.Bundle);
+ method @Deprecated public int onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean);
+ method @Deprecated public abstract int onEraseSubscriptions(int);
+ method public int onEraseSubscriptions(int, @android.telephony.euicc.EuiccCardManager.ResetOption int);
+ method public abstract android.service.euicc.GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(int, boolean);
+ method public abstract android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, android.telephony.euicc.DownloadableSubscription, boolean);
+ method public abstract String onGetEid(int);
+ method @NonNull public abstract android.telephony.euicc.EuiccInfo onGetEuiccInfo(int);
+ method @NonNull public abstract android.service.euicc.GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int);
+ method @android.telephony.euicc.EuiccManager.OtaStatus public abstract int onGetOtaStatus(int);
+ method public abstract int onRetainSubscriptionsForFactoryReset(int);
+ method public abstract void onStartOtaIfNecessary(int, android.service.euicc.EuiccService.OtaStatusChangedCallback);
+ method public abstract int onSwitchToSubscription(int, @Nullable String, boolean);
+ method public abstract int onUpdateSubscriptionNickname(int, String, String);
+ field public static final String ACTION_BIND_CARRIER_PROVISIONING_SERVICE = "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE";
+ field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
+ field public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
+ field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
+ field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
+ field @Deprecated public static final String ACTION_RESOLVE_CONFIRMATION_CODE = "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
+ field public static final String ACTION_RESOLVE_DEACTIVATE_SIM = "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
+ field public static final String ACTION_RESOLVE_NO_PRIVILEGES = "android.service.euicc.action.RESOLVE_NO_PRIVILEGES";
+ field public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS = "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS";
+ field public static final String ACTION_START_CARRIER_ACTIVATION = "android.service.euicc.action.START_CARRIER_ACTIVATION";
+ field public static final String ACTION_START_EUICC_ACTIVATION = "android.service.euicc.action.START_EUICC_ACTIVATION";
+ field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
+ field public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI";
+ field public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
+ field public static final String EXTRA_RESOLUTION_ALLOW_POLICY_RULES = "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES";
+ field public static final String EXTRA_RESOLUTION_CALLING_PACKAGE = "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE";
+ field public static final String EXTRA_RESOLUTION_CARD_ID = "android.service.euicc.extra.RESOLUTION_CARD_ID";
+ field public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE = "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE";
+ field public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED = "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED";
+ field public static final String EXTRA_RESOLUTION_CONSENT = "android.service.euicc.extra.RESOLUTION_CONSENT";
+ field public static final String EXTRA_RESOLVABLE_ERRORS = "android.service.euicc.extra.RESOLVABLE_ERRORS";
+ field public static final int RESOLVABLE_ERROR_CONFIRMATION_CODE = 1; // 0x1
+ field public static final int RESOLVABLE_ERROR_POLICY_RULES = 2; // 0x2
+ field public static final int RESULT_FIRST_USER = 1; // 0x1
+ field public static final int RESULT_MUST_DEACTIVATE_SIM = -1; // 0xffffffff
+ field @Deprecated public static final int RESULT_NEED_CONFIRMATION_CODE = -2; // 0xfffffffe
+ field public static final int RESULT_OK = 0; // 0x0
+ field public static final int RESULT_RESOLVABLE_ERRORS = -2; // 0xfffffffe
+ }
+
+ public abstract static class EuiccService.OtaStatusChangedCallback {
+ ctor public EuiccService.OtaStatusChangedCallback();
+ method public abstract void onOtaStatusChanged(int);
+ }
+
+ public final class GetDefaultDownloadableSubscriptionListResult implements android.os.Parcelable {
+ ctor public GetDefaultDownloadableSubscriptionListResult(int, @Nullable android.telephony.euicc.DownloadableSubscription[]);
+ method public int describeContents();
+ method @Nullable public java.util.List<android.telephony.euicc.DownloadableSubscription> getDownloadableSubscriptions();
+ method public int getResult();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.euicc.GetDefaultDownloadableSubscriptionListResult> CREATOR;
+ }
+
+ public final class GetDownloadableSubscriptionMetadataResult implements android.os.Parcelable {
+ ctor public GetDownloadableSubscriptionMetadataResult(int, @Nullable android.telephony.euicc.DownloadableSubscription);
+ method public int describeContents();
+ method @Nullable public android.telephony.euicc.DownloadableSubscription getDownloadableSubscription();
+ method public int getResult();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.euicc.GetDownloadableSubscriptionMetadataResult> CREATOR;
+ }
+
+ public final class GetEuiccProfileInfoListResult implements android.os.Parcelable {
+ ctor public GetEuiccProfileInfoListResult(int, @Nullable android.service.euicc.EuiccProfileInfo[], boolean);
+ method public int describeContents();
+ method public boolean getIsRemovable();
+ method @Nullable public java.util.List<android.service.euicc.EuiccProfileInfo> getProfiles();
+ method public int getResult();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.euicc.GetEuiccProfileInfoListResult> CREATOR;
+ }
+
+}
+
+package android.service.notification {
+
+ public final class Adjustment implements android.os.Parcelable {
+ ctor public Adjustment(String, String, android.os.Bundle, CharSequence, int);
+ ctor public Adjustment(@NonNull String, @NonNull String, @NonNull android.os.Bundle, @NonNull CharSequence, @NonNull android.os.UserHandle);
+ ctor protected Adjustment(android.os.Parcel);
+ method public int describeContents();
+ method @NonNull public CharSequence getExplanation();
+ method @NonNull public String getKey();
+ method @NonNull public String getPackage();
+ method @NonNull public android.os.Bundle getSignals();
+ method public int getUser();
+ method @NonNull public android.os.UserHandle getUserHandle();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR;
+ field public static final String KEY_CONTEXTUAL_ACTIONS = "key_contextual_actions";
+ field public static final String KEY_IMPORTANCE = "key_importance";
+ field public static final String KEY_NOT_CONVERSATION = "key_not_conversation";
+ field public static final String KEY_PEOPLE = "key_people";
+ field public static final String KEY_RANKING_SCORE = "key_ranking_score";
+ field public static final String KEY_SNOOZE_CRITERIA = "key_snooze_criteria";
+ field public static final String KEY_TEXT_REPLIES = "key_text_replies";
+ field public static final String KEY_USER_SENTIMENT = "key_user_sentiment";
+ }
+
+ public abstract class NotificationAssistantService extends android.service.notification.NotificationListenerService {
+ ctor public NotificationAssistantService();
+ method public final void adjustNotification(@NonNull android.service.notification.Adjustment);
+ method public final void adjustNotifications(@NonNull java.util.List<android.service.notification.Adjustment>);
+ method public void onActionInvoked(@NonNull String, @NonNull android.app.Notification.Action, int);
+ method public void onAllowedAdjustmentsChanged();
+ method @NonNull public final android.os.IBinder onBind(@Nullable android.content.Intent);
+ method public void onNotificationDirectReplied(@NonNull String);
+ method @Nullable public abstract android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification);
+ method @Nullable public android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification, @NonNull android.app.NotificationChannel);
+ method public void onNotificationExpansionChanged(@NonNull String, boolean, boolean);
+ method public abstract void onNotificationSnoozedUntilContext(@NonNull android.service.notification.StatusBarNotification, @NonNull String);
+ method public void onNotificationVisibilityChanged(@NonNull String, boolean);
+ method public void onNotificationsSeen(@NonNull java.util.List<java.lang.String>);
+ method public void onPanelHidden();
+ method public void onPanelRevealed(int);
+ method public void onSuggestedReplySent(@NonNull String, @NonNull CharSequence, int);
+ method public final void unsnoozeNotification(@NonNull String);
+ field public static final String SERVICE_INTERFACE = "android.service.notification.NotificationAssistantService";
+ field public static final int SOURCE_FROM_APP = 0; // 0x0
+ field public static final int SOURCE_FROM_ASSISTANT = 1; // 0x1
+ }
+
+ public abstract class NotificationListenerService extends android.app.Service {
+ method public void onNotificationRemoved(@NonNull android.service.notification.StatusBarNotification, @NonNull android.service.notification.NotificationListenerService.RankingMap, @NonNull android.service.notification.NotificationStats, int);
+ }
+
+ public final class NotificationStats implements android.os.Parcelable {
+ ctor public NotificationStats();
+ ctor protected NotificationStats(android.os.Parcel);
+ method public int describeContents();
+ method public int getDismissalSentiment();
+ method public int getDismissalSurface();
+ method public boolean hasDirectReplied();
+ method public boolean hasExpanded();
+ method public boolean hasInteracted();
+ method public boolean hasSeen();
+ method public boolean hasSnoozed();
+ method public boolean hasViewedSettings();
+ method public void setDirectReplied();
+ method public void setDismissalSentiment(int);
+ method public void setDismissalSurface(int);
+ method public void setExpanded();
+ method public void setSeen();
+ method public void setSnoozed();
+ method public void setViewedSettings();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.notification.NotificationStats> CREATOR;
+ field public static final int DISMISSAL_AOD = 2; // 0x2
+ field public static final int DISMISSAL_NOT_DISMISSED = -1; // 0xffffffff
+ field public static final int DISMISSAL_OTHER = 0; // 0x0
+ field public static final int DISMISSAL_PEEK = 1; // 0x1
+ field public static final int DISMISSAL_SHADE = 3; // 0x3
+ field public static final int DISMISS_SENTIMENT_NEGATIVE = 0; // 0x0
+ field public static final int DISMISS_SENTIMENT_NEUTRAL = 1; // 0x1
+ field public static final int DISMISS_SENTIMENT_POSITIVE = 2; // 0x2
+ field public static final int DISMISS_SENTIMENT_UNKNOWN = -1000; // 0xfffffc18
+ }
+
+ public final class SnoozeCriterion implements android.os.Parcelable {
+ ctor public SnoozeCriterion(String, CharSequence, CharSequence);
+ ctor protected SnoozeCriterion(android.os.Parcel);
+ method public int describeContents();
+ method public CharSequence getConfirmation();
+ method public CharSequence getExplanation();
+ method public String getId();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.notification.SnoozeCriterion> CREATOR;
+ }
+
+}
+
+package android.service.oemlock {
+
+ public class OemLockManager {
+ method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) public String getLockName();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) public boolean isOemUnlockAllowedByCarrier();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USER_OEM_UNLOCK_STATE) public boolean isOemUnlockAllowedByUser();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) public void setOemUnlockAllowedByCarrier(boolean, @Nullable byte[]);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_USER_OEM_UNLOCK_STATE) public void setOemUnlockAllowedByUser(boolean);
+ }
+
+}
+
+package android.service.persistentdata {
+
+ public class PersistentDataBlockManager {
+ method @RequiresPermission("android.permission.ACCESS_PDB_STATE") public int getDataBlockSize();
+ method @android.service.persistentdata.PersistentDataBlockManager.FlashLockState @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) public int getFlashLockState();
+ method public long getMaximumDataBlockSize();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) public boolean getOemUnlockEnabled();
+ method public byte[] read();
+ method @Deprecated @RequiresPermission("android.permission.OEM_UNLOCK_STATE") public void setOemUnlockEnabled(boolean);
+ method @RequiresPermission("android.permission.OEM_UNLOCK_STATE") public void wipe();
+ method public int write(byte[]);
+ field public static final int FLASH_LOCK_LOCKED = 1; // 0x1
+ field public static final int FLASH_LOCK_UNKNOWN = -1; // 0xffffffff
+ field public static final int FLASH_LOCK_UNLOCKED = 0; // 0x0
+ }
+
+ @IntDef(prefix={"FLASH_LOCK_"}, value={android.service.persistentdata.PersistentDataBlockManager.FLASH_LOCK_UNKNOWN, android.service.persistentdata.PersistentDataBlockManager.FLASH_LOCK_LOCKED, android.service.persistentdata.PersistentDataBlockManager.FLASH_LOCK_UNLOCKED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PersistentDataBlockManager.FlashLockState {
+ }
+
+}
+
+package android.service.quicksettings {
+
+ public class TileService extends android.app.Service {
+ method public final void setStatusIcon(android.graphics.drawable.Icon, String);
+ }
+
+}
+
+package android.service.resolver {
+
+ public abstract class ResolverRankerService extends android.app.Service {
+ ctor public ResolverRankerService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method public void onPredictSharingProbabilities(java.util.List<android.service.resolver.ResolverTarget>);
+ method public void onTrainRankingModel(java.util.List<android.service.resolver.ResolverTarget>, int);
+ field public static final String BIND_PERMISSION = "android.permission.BIND_RESOLVER_RANKER_SERVICE";
+ field public static final String HOLD_PERMISSION = "android.permission.PROVIDE_RESOLVER_RANKER_SERVICE";
+ field public static final String SERVICE_INTERFACE = "android.service.resolver.ResolverRankerService";
+ }
+
+ public final class ResolverTarget implements android.os.Parcelable {
+ ctor public ResolverTarget();
+ method public int describeContents();
+ method public float getChooserScore();
+ method public float getLaunchScore();
+ method public float getRecencyScore();
+ method public float getSelectProbability();
+ method public float getTimeSpentScore();
+ method public void setChooserScore(float);
+ method public void setLaunchScore(float);
+ method public void setRecencyScore(float);
+ method public void setSelectProbability(float);
+ method public void setTimeSpentScore(float);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.resolver.ResolverTarget> CREATOR;
+ }
+
+}
+
+package android.service.settings.suggestions {
+
+ public final class Suggestion implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getFlags();
+ method public android.graphics.drawable.Icon getIcon();
+ method public String getId();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getSummary();
+ method public CharSequence getTitle();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.settings.suggestions.Suggestion> CREATOR;
+ field public static final int FLAG_HAS_BUTTON = 1; // 0x1
+ }
+
+ public static class Suggestion.Builder {
+ ctor public Suggestion.Builder(String);
+ method public android.service.settings.suggestions.Suggestion build();
+ method public android.service.settings.suggestions.Suggestion.Builder setFlags(int);
+ method public android.service.settings.suggestions.Suggestion.Builder setIcon(android.graphics.drawable.Icon);
+ method public android.service.settings.suggestions.Suggestion.Builder setPendingIntent(android.app.PendingIntent);
+ method public android.service.settings.suggestions.Suggestion.Builder setSummary(CharSequence);
+ method public android.service.settings.suggestions.Suggestion.Builder setTitle(CharSequence);
+ }
+
+ public abstract class SuggestionService extends android.app.Service {
+ ctor public SuggestionService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method public abstract java.util.List<android.service.settings.suggestions.Suggestion> onGetSuggestions();
+ method public abstract void onSuggestionDismissed(android.service.settings.suggestions.Suggestion);
+ method public abstract void onSuggestionLaunched(android.service.settings.suggestions.Suggestion);
+ }
+
+}
+
+package android.service.storage {
+
+ public abstract class ExternalStorageService extends android.app.Service {
+ ctor public ExternalStorageService();
+ method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
+ method public abstract void onEndSession(@NonNull String) throws java.io.IOException;
+ method public abstract void onStartSession(@NonNull String, int, @NonNull android.os.ParcelFileDescriptor, @NonNull java.io.File, @NonNull java.io.File) throws java.io.IOException;
+ method public abstract void onVolumeStateChanged(@NonNull android.os.storage.StorageVolume) throws java.io.IOException;
+ field public static final int FLAG_SESSION_ATTRIBUTE_INDEXABLE = 2; // 0x2
+ field public static final int FLAG_SESSION_TYPE_FUSE = 1; // 0x1
+ field public static final String SERVICE_INTERFACE = "android.service.storage.ExternalStorageService";
+ }
+
+}
+
+package android.service.textclassifier {
+
+ public abstract class TextClassifierService extends android.app.Service {
+ ctor public TextClassifierService();
+ method @NonNull public static android.view.textclassifier.TextClassifier getDefaultTextClassifierImplementation(@NonNull android.content.Context);
+ method @Deprecated public final android.view.textclassifier.TextClassifier getLocalTextClassifier();
+ method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
+ method @MainThread public abstract void onClassifyText(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextClassification.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextClassification>);
+ method public void onConnected();
+ method @MainThread public void onCreateTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext, @NonNull android.view.textclassifier.TextClassificationSessionId);
+ method @MainThread public void onDestroyTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationSessionId);
+ method @MainThread public void onDetectLanguage(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextLanguage.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextLanguage>);
+ method public void onDisconnected();
+ method @MainThread public abstract void onGenerateLinks(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextLinks.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextLinks>);
+ method @Deprecated @MainThread public void onSelectionEvent(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.SelectionEvent);
+ method @MainThread public void onSuggestConversationActions(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.ConversationActions.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.ConversationActions>);
+ method @MainThread public abstract void onSuggestSelection(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextSelection.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextSelection>);
+ method @MainThread public void onTextClassifierEvent(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextClassifierEvent);
+ field public static final String SERVICE_INTERFACE = "android.service.textclassifier.TextClassifierService";
+ }
+
+ public static interface TextClassifierService.Callback<T> {
+ method public void onFailure(@NonNull CharSequence);
+ method public void onSuccess(T);
+ }
+
+}
+
+package android.service.trust {
+
+ public class TrustAgentService extends android.app.Service {
+ ctor public TrustAgentService();
+ method public final void addEscrowToken(byte[], android.os.UserHandle);
+ method @Deprecated public final void grantTrust(CharSequence, long, boolean);
+ method public final void grantTrust(CharSequence, long, int);
+ method public final void isEscrowTokenActive(long, android.os.UserHandle);
+ method public final android.os.IBinder onBind(android.content.Intent);
+ method public boolean onConfigure(java.util.List<android.os.PersistableBundle>);
+ method public void onDeviceLocked();
+ method public void onDeviceUnlockLockout(long);
+ method public void onDeviceUnlocked();
+ method public void onEscrowTokenAdded(byte[], long, android.os.UserHandle);
+ method public void onEscrowTokenRemoved(long, boolean);
+ method public void onEscrowTokenStateReceived(long, int);
+ method public void onTrustTimeout();
+ method public void onUnlockAttempt(boolean);
+ method public final void removeEscrowToken(long, android.os.UserHandle);
+ method public final void revokeTrust();
+ method public final void setManagingTrust(boolean);
+ method public final void showKeyguardErrorMessage(@NonNull CharSequence);
+ method public final void unlockUserWithToken(long, byte[], android.os.UserHandle);
+ field public static final int FLAG_GRANT_TRUST_DISMISS_KEYGUARD = 2; // 0x2
+ field public static final int FLAG_GRANT_TRUST_INITIATED_BY_USER = 1; // 0x1
+ field public static final String SERVICE_INTERFACE = "android.service.trust.TrustAgentService";
+ field public static final int TOKEN_STATE_ACTIVE = 1; // 0x1
+ field public static final int TOKEN_STATE_INACTIVE = 0; // 0x0
+ field public static final String TRUST_AGENT_META_DATA = "android.service.trust.trustagent";
+ }
+
+}
+
+package android.service.voice {
+
+ public class AlwaysOnHotwordDetector {
+ method @Nullable public android.content.Intent createEnrollIntent();
+ method @Nullable public android.content.Intent createReEnrollIntent();
+ method @Nullable public android.content.Intent createUnEnrollIntent();
+ method @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public int getParameter(int);
+ method public int getSupportedAudioCapabilities();
+ method public int getSupportedRecognitionModes();
+ method @Nullable @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public android.service.voice.AlwaysOnHotwordDetector.ModelParamRange queryParameter(int);
+ method @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public int setParameter(int, int);
+ method @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public boolean startRecognition(int);
+ method @RequiresPermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD}) public boolean stopRecognition();
+ field public static final int AUDIO_CAPABILITY_ECHO_CANCELLATION = 1; // 0x1
+ field public static final int AUDIO_CAPABILITY_NOISE_SUPPRESSION = 2; // 0x2
+ field public static final int MODEL_PARAM_THRESHOLD_FACTOR = 0; // 0x0
+ field public static final int RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS = 2; // 0x2
+ field public static final int RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO = 1; // 0x1
+ field public static final int RECOGNITION_FLAG_ENABLE_AUDIO_ECHO_CANCELLATION = 4; // 0x4
+ field public static final int RECOGNITION_FLAG_ENABLE_AUDIO_NOISE_SUPPRESSION = 8; // 0x8
+ field public static final int RECOGNITION_MODE_USER_IDENTIFICATION = 2; // 0x2
+ field public static final int RECOGNITION_MODE_VOICE_TRIGGER = 1; // 0x1
+ field public static final int STATE_HARDWARE_UNAVAILABLE = -2; // 0xfffffffe
+ field public static final int STATE_KEYPHRASE_ENROLLED = 2; // 0x2
+ field public static final int STATE_KEYPHRASE_UNENROLLED = 1; // 0x1
+ field @Deprecated public static final int STATE_KEYPHRASE_UNSUPPORTED = -1; // 0xffffffff
+ }
+
+ public abstract static class AlwaysOnHotwordDetector.Callback {
+ ctor public AlwaysOnHotwordDetector.Callback();
+ method public abstract void onAvailabilityChanged(int);
+ method public abstract void onDetected(@NonNull android.service.voice.AlwaysOnHotwordDetector.EventPayload);
+ method public abstract void onError();
+ method public abstract void onRecognitionPaused();
+ method public abstract void onRecognitionResumed();
+ }
+
+ public static class AlwaysOnHotwordDetector.EventPayload {
+ method @Nullable public android.media.AudioFormat getCaptureAudioFormat();
+ method @Nullable public byte[] getTriggerAudio();
+ }
+
+ public static final class AlwaysOnHotwordDetector.ModelParamRange {
+ method public int getEnd();
+ method public int getStart();
+ }
+
+ public class VoiceInteractionService extends android.app.Service {
+ method @NonNull public final android.service.voice.AlwaysOnHotwordDetector createAlwaysOnHotwordDetector(String, java.util.Locale, android.service.voice.AlwaysOnHotwordDetector.Callback);
+ method @NonNull @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public final android.media.voice.KeyphraseModelManager createKeyphraseModelManager();
+ }
+
+}
+
+package android.service.wallpaper {
+
+ public class WallpaperService.Engine {
+ method public boolean isInAmbientMode();
+ method public void onAmbientModeChanged(boolean, long);
+ }
+
+}
+
+package android.service.watchdog {
+
+ public abstract class ExplicitHealthCheckService extends android.app.Service {
+ ctor public ExplicitHealthCheckService();
+ method public final void notifyHealthCheckPassed(@NonNull String);
+ method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
+ method public abstract void onCancelHealthCheck(@NonNull String);
+ method @NonNull public abstract java.util.List<java.lang.String> onGetRequestedPackages();
+ method @NonNull public abstract java.util.List<android.service.watchdog.ExplicitHealthCheckService.PackageConfig> onGetSupportedPackages();
+ method public abstract void onRequestHealthCheck(@NonNull String);
+ field public static final String BIND_PERMISSION = "android.permission.BIND_EXPLICIT_HEALTH_CHECK_SERVICE";
+ field public static final String SERVICE_INTERFACE = "android.service.watchdog.ExplicitHealthCheckService";
+ }
+
+ public static final class ExplicitHealthCheckService.PackageConfig implements android.os.Parcelable {
+ ctor public ExplicitHealthCheckService.PackageConfig(@NonNull String, long);
+ method public int describeContents();
+ method public long getHealthCheckTimeoutMillis();
+ method @NonNull public String getPackageName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.service.watchdog.ExplicitHealthCheckService.PackageConfig> CREATOR;
+ }
+
+}
+
+package android.telecom {
+
+ @Deprecated public class AudioState implements android.os.Parcelable {
+ ctor @Deprecated public AudioState(boolean, int, int);
+ ctor @Deprecated public AudioState(android.telecom.AudioState);
+ ctor @Deprecated public AudioState(android.telecom.CallAudioState);
+ method @Deprecated public static String audioRouteToString(int);
+ method @Deprecated public int describeContents();
+ method @Deprecated public int getRoute();
+ method @Deprecated public int getSupportedRouteMask();
+ method @Deprecated public boolean isMuted();
+ method @Deprecated public void writeToParcel(android.os.Parcel, int);
+ field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.telecom.AudioState> CREATOR;
+ field @Deprecated public static final int ROUTE_BLUETOOTH = 2; // 0x2
+ field @Deprecated public static final int ROUTE_EARPIECE = 1; // 0x1
+ field @Deprecated public static final int ROUTE_SPEAKER = 8; // 0x8
+ field @Deprecated public static final int ROUTE_WIRED_HEADSET = 4; // 0x4
+ field @Deprecated public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5
+ }
+
+ public final class Call {
+ method @Deprecated public void addListener(android.telecom.Call.Listener);
+ method public void enterBackgroundAudioProcessing();
+ method public void exitBackgroundAudioProcessing(boolean);
+ method @Deprecated public void removeListener(android.telecom.Call.Listener);
+ field @Deprecated public static final int STATE_PRE_DIAL_WAIT = 8; // 0x8
+ }
+
+ @Deprecated public abstract static class Call.Listener extends android.telecom.Call.Callback {
+ ctor @Deprecated public Call.Listener();
+ }
+
+ public static class CallScreeningService.CallResponse.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public android.telecom.CallScreeningService.CallResponse.Builder setShouldScreenCallViaAudioProcessing(boolean);
+ }
+
+ public abstract class Conference extends android.telecom.Conferenceable {
+ method @Deprecated public final android.telecom.AudioState getAudioState();
+ method @Deprecated public final long getConnectTimeMillis();
+ method public android.telecom.Connection getPrimaryConnection();
+ method @NonNull public final String getTelecomCallId();
+ method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public final void setAddress(@NonNull android.net.Uri, int);
+ method public final void setCallerDisplayName(@NonNull String, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setConferenceState(boolean);
+ method @Deprecated public final void setConnectTimeMillis(long);
+ }
+
+ public abstract class Connection extends android.telecom.Conferenceable {
+ method @Deprecated public final android.telecom.AudioState getAudioState();
+ method @IntRange(from=0) public final long getConnectTimeMillis();
+ method public final long getConnectionStartElapsedRealtimeMillis();
+ method @Nullable public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
+ method @Nullable public final String getTelecomCallId();
+ method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
+ method public final void resetConnectionTime();
+ method public void setCallDirection(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public final void setConnectTimeMillis(@IntRange(from=0) long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public final void setConnectionStartElapsedRealtimeMillis(long);
+ method public void setPhoneAccountHandle(@NonNull android.telecom.PhoneAccountHandle);
+ method public void setTelecomCallId(@NonNull String);
+ field public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 2097152; // 0x200000
+ field public static final int CAPABILITY_SPEED_UP_MT_AUDIO = 262144; // 0x40000
+ field public static final String EXTRA_DISABLE_ADD_CALL = "android.telecom.extra.DISABLE_ADD_CALL";
+ field public static final int PROPERTY_EMERGENCY_CALLBACK_MODE = 1; // 0x1
+ field public static final int PROPERTY_GENERIC_CONFERENCE = 2; // 0x2
+ field public static final int PROPERTY_IS_DOWNGRADED_CONFERENCE = 64; // 0x40
+ field public static final int PROPERTY_REMOTELY_HOSTED = 2048; // 0x800
+ }
+
+ public final class ConnectionRequest implements android.os.Parcelable {
+ method @Nullable public String getTelecomCallId();
+ }
+
+ public abstract class ConnectionService extends android.app.Service {
+ method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference);
+ }
+
+ public abstract class InCallService extends android.app.Service {
+ method @Deprecated public android.telecom.Phone getPhone();
+ method @Deprecated public void onPhoneCreated(android.telecom.Phone);
+ method @Deprecated public void onPhoneDestroyed(android.telecom.Phone);
+ }
+
+ public class ParcelableCallAnalytics implements android.os.Parcelable {
+ ctor public ParcelableCallAnalytics(long, long, int, boolean, boolean, int, int, boolean, String, boolean, java.util.List<android.telecom.ParcelableCallAnalytics.AnalyticsEvent>, java.util.List<android.telecom.ParcelableCallAnalytics.EventTiming>);
+ ctor public ParcelableCallAnalytics(android.os.Parcel);
+ method public java.util.List<android.telecom.ParcelableCallAnalytics.AnalyticsEvent> analyticsEvents();
+ method public int describeContents();
+ method public long getCallDurationMillis();
+ method public int getCallTechnologies();
+ method public int getCallTerminationCode();
+ method public int getCallType();
+ method public String getConnectionService();
+ method public java.util.List<android.telecom.ParcelableCallAnalytics.EventTiming> getEventTimings();
+ method public long getStartTimeMillis();
+ method public boolean isAdditionalCall();
+ method public boolean isCreatedFromExistingConnection();
+ method public boolean isEmergencyCall();
+ method public boolean isInterrupted();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALLTYPE_INCOMING = 1; // 0x1
+ field public static final int CALLTYPE_OUTGOING = 2; // 0x2
+ field public static final int CALLTYPE_UNKNOWN = 0; // 0x0
+ field public static final int CDMA_PHONE = 1; // 0x1
+ field @NonNull public static final android.os.Parcelable.Creator<android.telecom.ParcelableCallAnalytics> CREATOR;
+ field public static final int GSM_PHONE = 2; // 0x2
+ field public static final int IMS_PHONE = 4; // 0x4
+ field public static final long MILLIS_IN_1_SECOND = 1000L; // 0x3e8L
+ field public static final long MILLIS_IN_5_MINUTES = 300000L; // 0x493e0L
+ field public static final int SIP_PHONE = 8; // 0x8
+ field public static final int STILL_CONNECTED = -1; // 0xffffffff
+ field public static final int THIRD_PARTY_PHONE = 16; // 0x10
+ }
+
+ public static final class ParcelableCallAnalytics.AnalyticsEvent implements android.os.Parcelable {
+ ctor public ParcelableCallAnalytics.AnalyticsEvent(int, long);
+ method public int describeContents();
+ method public int getEventName();
+ method public long getTimeSinceLastEvent();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int AUDIO_ROUTE_BT = 204; // 0xcc
+ field public static final int AUDIO_ROUTE_EARPIECE = 205; // 0xcd
+ field public static final int AUDIO_ROUTE_HEADSET = 206; // 0xce
+ field public static final int AUDIO_ROUTE_SPEAKER = 207; // 0xcf
+ field public static final int BIND_CS = 5; // 0x5
+ field public static final int BLOCK_CHECK_FINISHED = 105; // 0x69
+ field public static final int BLOCK_CHECK_INITIATED = 104; // 0x68
+ field public static final int CONFERENCE_WITH = 300; // 0x12c
+ field @NonNull public static final android.os.Parcelable.Creator<android.telecom.ParcelableCallAnalytics.AnalyticsEvent> CREATOR;
+ field public static final int CS_BOUND = 6; // 0x6
+ field public static final int DIRECT_TO_VM_FINISHED = 103; // 0x67
+ field public static final int DIRECT_TO_VM_INITIATED = 102; // 0x66
+ field public static final int FILTERING_COMPLETED = 107; // 0x6b
+ field public static final int FILTERING_INITIATED = 106; // 0x6a
+ field public static final int FILTERING_TIMED_OUT = 108; // 0x6c
+ field public static final int MUTE = 202; // 0xca
+ field public static final int REMOTELY_HELD = 402; // 0x192
+ field public static final int REMOTELY_UNHELD = 403; // 0x193
+ field public static final int REQUEST_ACCEPT = 7; // 0x7
+ field public static final int REQUEST_HOLD = 400; // 0x190
+ field public static final int REQUEST_PULL = 500; // 0x1f4
+ field public static final int REQUEST_REJECT = 8; // 0x8
+ field public static final int REQUEST_UNHOLD = 401; // 0x191
+ field public static final int SCREENING_COMPLETED = 101; // 0x65
+ field public static final int SCREENING_SENT = 100; // 0x64
+ field public static final int SET_ACTIVE = 1; // 0x1
+ field public static final int SET_DIALING = 4; // 0x4
+ field public static final int SET_DISCONNECTED = 2; // 0x2
+ field public static final int SET_HOLD = 404; // 0x194
+ field public static final int SET_PARENT = 302; // 0x12e
+ field public static final int SET_SELECT_PHONE_ACCOUNT = 0; // 0x0
+ field public static final int SILENCE = 201; // 0xc9
+ field public static final int SKIP_RINGING = 200; // 0xc8
+ field public static final int SPLIT_CONFERENCE = 301; // 0x12d
+ field public static final int START_CONNECTION = 3; // 0x3
+ field public static final int SWAP = 405; // 0x195
+ field public static final int UNMUTE = 203; // 0xcb
+ }
+
+ public static final class ParcelableCallAnalytics.EventTiming implements android.os.Parcelable {
+ ctor public ParcelableCallAnalytics.EventTiming(int, long);
+ method public int describeContents();
+ method public int getName();
+ method public long getTime();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int ACCEPT_TIMING = 0; // 0x0
+ field public static final int BIND_CS_TIMING = 6; // 0x6
+ field public static final int BLOCK_CHECK_FINISHED_TIMING = 9; // 0x9
+ field @NonNull public static final android.os.Parcelable.Creator<android.telecom.ParcelableCallAnalytics.EventTiming> CREATOR;
+ field public static final int DIRECT_TO_VM_FINISHED_TIMING = 8; // 0x8
+ field public static final int DISCONNECT_TIMING = 2; // 0x2
+ field public static final int FILTERING_COMPLETED_TIMING = 10; // 0xa
+ field public static final int FILTERING_TIMED_OUT_TIMING = 11; // 0xb
+ field public static final int HOLD_TIMING = 3; // 0x3
+ field public static final int INVALID = 999999; // 0xf423f
+ field public static final int OUTGOING_TIME_TO_DIALING_TIMING = 5; // 0x5
+ field public static final int REJECT_TIMING = 1; // 0x1
+ field public static final int SCREENING_COMPLETED_TIMING = 7; // 0x7
+ field public static final int UNHOLD_TIMING = 4; // 0x4
+ }
+
+ @Deprecated public final class Phone {
+ method @Deprecated public void addListener(android.telecom.Phone.Listener);
+ method @Deprecated public boolean canAddCall();
+ method @Deprecated public android.telecom.AudioState getAudioState();
+ method @Deprecated public android.telecom.CallAudioState getCallAudioState();
+ method @Deprecated public java.util.List<android.telecom.Call> getCalls();
+ method @Deprecated public void removeListener(android.telecom.Phone.Listener);
+ method @Deprecated public void requestBluetoothAudio(String);
+ method @Deprecated public void setAudioRoute(int);
+ method @Deprecated public void setMuted(boolean);
+ }
+
+ @Deprecated public abstract static class Phone.Listener {
+ ctor @Deprecated public Phone.Listener();
+ method @Deprecated public void onAudioStateChanged(android.telecom.Phone, android.telecom.AudioState);
+ method @Deprecated public void onBringToForeground(android.telecom.Phone, boolean);
+ method @Deprecated public void onCallAdded(android.telecom.Phone, android.telecom.Call);
+ method @Deprecated public void onCallAudioStateChanged(android.telecom.Phone, android.telecom.CallAudioState);
+ method @Deprecated public void onCallRemoved(android.telecom.Phone, android.telecom.Call);
+ method @Deprecated public void onCanAddCallChanged(android.telecom.Phone, boolean);
+ method @Deprecated public void onSilenceRinger(android.telecom.Phone);
+ }
+
+ public final class PhoneAccount implements android.os.Parcelable {
+ field public static final int CAPABILITY_EMERGENCY_CALLS_ONLY = 128; // 0x80
+ field public static final int CAPABILITY_EMERGENCY_PREFERRED = 8192; // 0x2000
+ field public static final int CAPABILITY_EMERGENCY_VIDEO_CALLING = 512; // 0x200
+ field public static final int CAPABILITY_MULTI_USER = 32; // 0x20
+ field public static final String EXTRA_PLAY_CALL_RECORDING_TONE = "android.telecom.extra.PLAY_CALL_RECORDING_TONE";
+ field public static final String EXTRA_SORT_ORDER = "android.telecom.extra.SORT_ORDER";
+ }
+
+ public static class PhoneAccount.Builder {
+ method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telecom.PhoneAccount.Builder setGroupId(@NonNull String);
+ }
+
+ public class PhoneAccountSuggestionService extends android.app.Service {
+ ctor public PhoneAccountSuggestionService();
+ method public void onAccountSuggestionRequest(@NonNull String);
+ method public android.os.IBinder onBind(android.content.Intent);
+ method public final void suggestPhoneAccounts(@NonNull String, @NonNull java.util.List<android.telecom.PhoneAccountSuggestion>);
+ field public static final String SERVICE_INTERFACE = "android.telecom.PhoneAccountSuggestionService";
+ }
+
+ public final class RemoteConference {
+ method @Deprecated public void setAudioState(android.telecom.AudioState);
+ }
+
+ public final class RemoteConnection {
+ method @Deprecated public void setAudioState(android.telecom.AudioState);
+ }
+
+ public final class StatusHints implements android.os.Parcelable {
+ ctor @Deprecated public StatusHints(android.content.ComponentName, CharSequence, int, android.os.Bundle);
+ method @Deprecated public android.graphics.drawable.Drawable getIcon(android.content.Context);
+ method @Deprecated public int getIconResId();
+ method @Deprecated public android.content.ComponentName getPackageName();
+ }
+
+ public final class TelecomAnalytics implements android.os.Parcelable {
+ ctor public TelecomAnalytics(java.util.List<android.telecom.TelecomAnalytics.SessionTiming>, java.util.List<android.telecom.ParcelableCallAnalytics>);
+ method public int describeContents();
+ method public java.util.List<android.telecom.ParcelableCallAnalytics> getCallAnalytics();
+ method public java.util.List<android.telecom.TelecomAnalytics.SessionTiming> getSessionTimings();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telecom.TelecomAnalytics> CREATOR;
+ }
+
+ public static final class TelecomAnalytics.SessionTiming implements android.os.Parcelable {
+ ctor public TelecomAnalytics.SessionTiming(int, long);
+ method public int describeContents();
+ method public Integer getKey();
+ method public long getTime();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telecom.TelecomAnalytics.SessionTiming> CREATOR;
+ field public static final int CSW_ADD_CONFERENCE_CALL = 108; // 0x6c
+ field public static final int CSW_HANDLE_CREATE_CONNECTION_COMPLETE = 100; // 0x64
+ field public static final int CSW_REMOVE_CALL = 106; // 0x6a
+ field public static final int CSW_SET_ACTIVE = 101; // 0x65
+ field public static final int CSW_SET_DIALING = 103; // 0x67
+ field public static final int CSW_SET_DISCONNECTED = 104; // 0x68
+ field public static final int CSW_SET_IS_CONFERENCED = 107; // 0x6b
+ field public static final int CSW_SET_ON_HOLD = 105; // 0x69
+ field public static final int CSW_SET_RINGING = 102; // 0x66
+ field public static final int ICA_ANSWER_CALL = 1; // 0x1
+ field public static final int ICA_CONFERENCE = 8; // 0x8
+ field public static final int ICA_DISCONNECT_CALL = 3; // 0x3
+ field public static final int ICA_HOLD_CALL = 4; // 0x4
+ field public static final int ICA_MUTE = 6; // 0x6
+ field public static final int ICA_REJECT_CALL = 2; // 0x2
+ field public static final int ICA_SET_AUDIO_ROUTE = 7; // 0x7
+ field public static final int ICA_UNHOLD_CALL = 5; // 0x5
+ }
+
+ public class TelecomManager {
+ method public void addNewUnknownCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
+ method @Deprecated public void clearAccounts();
+ method public void clearPhoneAccounts();
+ method @NonNull public android.content.Intent createLaunchEmergencyDialerIntent(@Nullable String);
+ method @RequiresPermission(android.Manifest.permission.DUMP) public android.telecom.TelecomAnalytics dumpAnalytics();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enablePhoneAccount(android.telecom.PhoneAccountHandle, boolean);
+ method public java.util.List<android.telecom.PhoneAccountHandle> getAllPhoneAccountHandles();
+ method public java.util.List<android.telecom.PhoneAccount> getAllPhoneAccounts();
+ method public int getAllPhoneAccountsCount();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getCallCapablePhoneAccounts(boolean);
+ method public int getCallState();
+ method public android.telecom.PhoneAccountHandle getConnectionManager();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCurrentTtyMode();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDefaultDialerPackage(@NonNull android.os.UserHandle);
+ method @Deprecated public android.content.ComponentName getDefaultPhoneApp();
+ method @Deprecated public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage();
+ method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall();
+ method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle);
+ field public static final String ACTION_CURRENT_TTY_MODE_CHANGED = "android.telecom.action.CURRENT_TTY_MODE_CHANGED";
+ field public static final String ACTION_TTY_PREFERRED_MODE_CHANGED = "android.telecom.action.TTY_PREFERRED_MODE_CHANGED";
+ field public static final int CALL_SOURCE_EMERGENCY_DIALPAD = 1; // 0x1
+ field public static final int CALL_SOURCE_EMERGENCY_SHORTCUT = 2; // 0x2
+ field public static final int CALL_SOURCE_UNSPECIFIED = 0; // 0x0
+ field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
+ field public static final String EXTRA_CALL_SOURCE = "android.telecom.extra.CALL_SOURCE";
+ field public static final String EXTRA_CALL_TECHNOLOGY_TYPE = "android.telecom.extra.CALL_TECHNOLOGY_TYPE";
+ field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT";
+ field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";
+ field public static final String EXTRA_CURRENT_TTY_MODE = "android.telecom.extra.CURRENT_TTY_MODE";
+ field public static final String EXTRA_IS_USER_INTENT_EMERGENCY_CALL = "android.telecom.extra.IS_USER_INTENT_EMERGENCY_CALL";
+ field public static final String EXTRA_TTY_PREFERRED_MODE = "android.telecom.extra.TTY_PREFERRED_MODE";
+ field public static final String EXTRA_UNKNOWN_CALL_HANDLE = "android.telecom.extra.UNKNOWN_CALL_HANDLE";
+ field public static final int TTY_MODE_FULL = 1; // 0x1
+ field public static final int TTY_MODE_HCO = 2; // 0x2
+ field public static final int TTY_MODE_OFF = 0; // 0x0
+ field public static final int TTY_MODE_VCO = 3; // 0x3
+ }
+
+}
+
+package android.telephony {
+
+ public final class AccessNetworkConstants {
+ field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
+ }
+
+ public static final class AccessNetworkConstants.NgranBands {
+ method public static int getFrequencyRangeGroup(int);
+ field public static final int FREQUENCY_RANGE_GROUP_1 = 1; // 0x1
+ field public static final int FREQUENCY_RANGE_GROUP_2 = 2; // 0x2
+ field public static final int FREQUENCY_RANGE_GROUP_UNKNOWN = 0; // 0x0
+ }
+
+ public final class BarringInfo implements android.os.Parcelable {
+ ctor public BarringInfo();
+ method @NonNull public android.telephony.BarringInfo createLocationInfoSanitizedCopy();
+ }
+
+ public final class CallAttributes implements android.os.Parcelable {
+ ctor public CallAttributes(@NonNull android.telephony.PreciseCallState, int, @NonNull android.telephony.CallQuality);
+ method public int describeContents();
+ method @NonNull public android.telephony.CallQuality getCallQuality();
+ method public int getNetworkType();
+ method @NonNull public android.telephony.PreciseCallState getPreciseCallState();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
+ }
+
+ public final class CallForwardingInfo implements android.os.Parcelable {
+ ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
+ method public int describeContents();
+ method @Nullable public String getNumber();
+ method public int getReason();
+ method public int getTimeoutSeconds();
+ method public boolean isEnabled();
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
+ field public static final int REASON_ALL = 4; // 0x4
+ field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int REASON_BUSY = 1; // 0x1
+ field public static final int REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int REASON_NO_REPLY = 2; // 0x2
+ field public static final int REASON_UNCONDITIONAL = 0; // 0x0
+ }
+
+ public final class CallQuality implements android.os.Parcelable {
+ ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
+ ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
+ method public int describeContents();
+ method public int getAverageRelativeJitter();
+ method public int getAverageRoundTripTime();
+ method public int getCallDuration();
+ method public int getCodecType();
+ method public int getDownlinkCallQualityLevel();
+ method public int getMaxRelativeJitter();
+ method public int getNumRtpPacketsNotReceived();
+ method public int getNumRtpPacketsReceived();
+ method public int getNumRtpPacketsTransmitted();
+ method public int getNumRtpPacketsTransmittedLost();
+ method public int getUplinkCallQualityLevel();
+ method public boolean isIncomingSilenceDetectedAtCallSetup();
+ method public boolean isOutgoingSilenceDetectedAtCallSetup();
+ method public boolean isRtpInactivityDetected();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALL_QUALITY_BAD = 4; // 0x4
+ field public static final int CALL_QUALITY_EXCELLENT = 0; // 0x0
+ field public static final int CALL_QUALITY_FAIR = 2; // 0x2
+ field public static final int CALL_QUALITY_GOOD = 1; // 0x1
+ field public static final int CALL_QUALITY_NOT_AVAILABLE = 5; // 0x5
+ field public static final int CALL_QUALITY_POOR = 3; // 0x3
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallQuality> CREATOR;
+ }
+
+ public class CarrierConfigManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDefaultCarrierServicePackageName();
+ method @NonNull public static android.os.PersistableBundle getDefaultConfig();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void overrideConfig(int, @Nullable android.os.PersistableBundle);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void updateConfigForPhoneId(int, String);
+ field public static final String KEY_CARRIER_SETUP_APP_STRING = "carrier_setup_app_string";
+ field public static final String KEY_SUPPORT_CDMA_1X_VOICE_CALLS_BOOL = "support_cdma_1x_voice_calls_bool";
+ }
+
+ public static final class CarrierConfigManager.Wifi {
+ field public static final String KEY_HOTSPOT_MAX_CLIENT_COUNT = "wifi.hotspot_maximum_client_count";
+ field public static final String KEY_PREFIX = "wifi.";
+ }
+
+ public final class CarrierRestrictionRules implements android.os.Parcelable {
+ method @NonNull public java.util.List<java.lang.Boolean> areCarrierIdentifiersAllowed(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method public int describeContents();
+ method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers();
+ method public int getDefaultCarrierRestriction();
+ method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getExcludedCarriers();
+ method public int getMultiSimPolicy();
+ method public boolean isAllCarriersAllowed();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CARRIER_RESTRICTION_DEFAULT_ALLOWED = 1; // 0x1
+ field public static final int CARRIER_RESTRICTION_DEFAULT_NOT_ALLOWED = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CarrierRestrictionRules> CREATOR;
+ field public static final int MULTISIM_POLICY_NONE = 0; // 0x0
+ field public static final int MULTISIM_POLICY_ONE_VALID_SIM_MUST_BE_PRESENT = 1; // 0x1
+ }
+
+ public static final class CarrierRestrictionRules.Builder {
+ ctor public CarrierRestrictionRules.Builder();
+ method @NonNull public android.telephony.CarrierRestrictionRules build();
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllCarriersAllowed();
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllowedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setDefaultCarrierRestriction(int);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setExcludedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setMultiSimPolicy(int);
+ }
+
+ public class CbGeoUtils {
+ }
+
+ public static class CbGeoUtils.Circle implements android.telephony.CbGeoUtils.Geometry {
+ ctor public CbGeoUtils.Circle(@NonNull android.telephony.CbGeoUtils.LatLng, double);
+ method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
+ method @NonNull public android.telephony.CbGeoUtils.LatLng getCenter();
+ method public double getRadius();
+ }
+
+ public static interface CbGeoUtils.Geometry {
+ method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
+ }
+
+ public static class CbGeoUtils.LatLng {
+ ctor public CbGeoUtils.LatLng(double, double);
+ method public double distance(@NonNull android.telephony.CbGeoUtils.LatLng);
+ method @NonNull public android.telephony.CbGeoUtils.LatLng subtract(@NonNull android.telephony.CbGeoUtils.LatLng);
+ field public final double lat;
+ field public final double lng;
+ }
+
+ public static class CbGeoUtils.Polygon implements android.telephony.CbGeoUtils.Geometry {
+ ctor public CbGeoUtils.Polygon(@NonNull java.util.List<android.telephony.CbGeoUtils.LatLng>);
+ method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
+ method @NonNull public java.util.List<android.telephony.CbGeoUtils.LatLng> getVertices();
+ }
+
+ public class CellBroadcastIntents {
+ method public static void sendSmsCbReceivedBroadcast(@NonNull android.content.Context, @Nullable android.os.UserHandle, @NonNull android.telephony.SmsCbMessage, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, int);
+ field public static final String ACTION_AREA_INFO_UPDATED = "android.telephony.action.AREA_INFO_UPDATED";
+ }
+
+ public abstract class CellBroadcastService extends android.app.Service {
+ ctor public CellBroadcastService();
+ method @NonNull @WorkerThread public abstract CharSequence getCellBroadcastAreaInfo(int);
+ method @CallSuper public android.os.IBinder onBind(@Nullable android.content.Intent);
+ method public abstract void onCdmaCellBroadcastSms(int, @NonNull byte[], int);
+ method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>);
+ method public abstract void onGsmCellBroadcastSms(int, @NonNull byte[]);
+ field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService";
+ }
+
+ public abstract class CellIdentity implements android.os.Parcelable {
+ method @NonNull public abstract android.telephony.CellLocation asCellLocation();
+ method @NonNull public abstract android.telephony.CellIdentity sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityCdma extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.cdma.CdmaCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityCdma sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityGsm extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityGsm sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityLte extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityLte sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityNr extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.CellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityNr sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityTdscdma sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityWcdma extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityWcdma sanitizeLocationInfo();
+ }
+
+ public final class DataFailCause {
+ field @Deprecated public static final int VSNCP_APN_UNATHORIZED = 2238; // 0x8be
+ }
+
+ public final class DataSpecificRegistrationInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.DataSpecificRegistrationInfo> CREATOR;
+ }
+
+ public final class ImsiEncryptionInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getKeyIdentifier();
+ method @Nullable public java.security.PublicKey getPublicKey();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ImsiEncryptionInfo> CREATOR;
+ }
+
+ public final class LteVopsSupportInfo implements android.os.Parcelable {
+ ctor public LteVopsSupportInfo(int, int);
+ method public int describeContents();
+ method public int getEmcBearerSupport();
+ method public int getVopsSupport();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.LteVopsSupportInfo> CREATOR;
+ field public static final int LTE_STATUS_NOT_AVAILABLE = 1; // 0x1
+ field public static final int LTE_STATUS_NOT_SUPPORTED = 3; // 0x3
+ field public static final int LTE_STATUS_SUPPORTED = 2; // 0x2
+ }
+
+ public class MbmsDownloadSession implements java.lang.AutoCloseable {
+ field public static final String MBMS_DOWNLOAD_SERVICE_ACTION = "android.telephony.action.EmbmsDownload";
+ }
+
+ public class MbmsGroupCallSession implements java.lang.AutoCloseable {
+ field public static final String MBMS_GROUP_CALL_SERVICE_ACTION = "android.telephony.action.EmbmsGroupCall";
+ }
+
+ public class MbmsStreamingSession implements java.lang.AutoCloseable {
+ field public static final String MBMS_STREAMING_SERVICE_ACTION = "android.telephony.action.EmbmsStreaming";
+ }
+
+ public final class ModemActivityInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.telephony.ModemActivityInfo getDelta(@NonNull android.telephony.ModemActivityInfo);
+ method public long getIdleTimeMillis();
+ method public static int getNumTxPowerLevels();
+ method public long getReceiveTimeMillis();
+ method public long getSleepTimeMillis();
+ method public long getTimestampMillis();
+ method public long getTransmitDurationMillisAtPowerLevel(int);
+ method @NonNull public android.util.Range<java.lang.Integer> getTransmitPowerRange(int);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ModemActivityInfo> CREATOR;
+ field public static final int TX_POWER_LEVEL_0 = 0; // 0x0
+ field public static final int TX_POWER_LEVEL_1 = 1; // 0x1
+ field public static final int TX_POWER_LEVEL_2 = 2; // 0x2
+ field public static final int TX_POWER_LEVEL_3 = 3; // 0x3
+ field public static final int TX_POWER_LEVEL_4 = 4; // 0x4
+ }
+
+ public final class NetworkRegistrationInfo implements android.os.Parcelable {
+ method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
+ method public int getRegistrationState();
+ method public int getRejectCause();
+ method public int getRoamingType();
+ method public boolean isEmergencyEnabled();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int REGISTRATION_STATE_DENIED = 3; // 0x3
+ field public static final int REGISTRATION_STATE_HOME = 1; // 0x1
+ field public static final int REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING = 0; // 0x0
+ field public static final int REGISTRATION_STATE_NOT_REGISTERED_SEARCHING = 2; // 0x2
+ field public static final int REGISTRATION_STATE_ROAMING = 5; // 0x5
+ field public static final int REGISTRATION_STATE_UNKNOWN = 4; // 0x4
+ }
+
+ public static final class NetworkRegistrationInfo.Builder {
+ ctor public NetworkRegistrationInfo.Builder();
+ method @NonNull public android.telephony.NetworkRegistrationInfo build();
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAccessNetworkTechnology(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAvailableServices(@NonNull java.util.List<java.lang.Integer>);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setDomain(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setEmergencyOnly(boolean);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegisteredPlmn(@Nullable String);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegistrationState(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRejectCause(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setTransportType(int);
+ }
+
+ public abstract class NetworkService extends android.app.Service {
+ ctor public NetworkService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public abstract android.telephony.NetworkService.NetworkServiceProvider onCreateNetworkServiceProvider(int);
+ field public static final String SERVICE_INTERFACE = "android.telephony.NetworkService";
+ }
+
+ public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable {
+ ctor public NetworkService.NetworkServiceProvider(int);
+ method public abstract void close();
+ method public final int getSlotIndex();
+ method public final void notifyNetworkRegistrationInfoChanged();
+ method public void requestNetworkRegistrationInfo(int, @NonNull android.telephony.NetworkServiceCallback);
+ }
+
+ public class NetworkServiceCallback {
+ method public void onRequestNetworkRegistrationInfoComplete(int, @Nullable android.telephony.NetworkRegistrationInfo);
+ field public static final int RESULT_ERROR_BUSY = 3; // 0x3
+ field public static final int RESULT_ERROR_FAILED = 5; // 0x5
+ field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
+ field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
+ field public static final int RESULT_ERROR_UNSUPPORTED = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ public interface NumberVerificationCallback {
+ method public default void onCallReceived(@NonNull String);
+ method public default void onVerificationFailed(int);
+ field public static final int REASON_CONCURRENT_REQUESTS = 4; // 0x4
+ field public static final int REASON_IN_ECBM = 5; // 0x5
+ field public static final int REASON_IN_EMERGENCY_CALL = 6; // 0x6
+ field public static final int REASON_NETWORK_NOT_AVAILABLE = 2; // 0x2
+ field public static final int REASON_TIMED_OUT = 1; // 0x1
+ field public static final int REASON_TOO_MANY_CALLS = 3; // 0x3
+ field public static final int REASON_UNSPECIFIED = 0; // 0x0
+ }
+
+ public final class PhoneNumberRange implements android.os.Parcelable {
+ ctor public PhoneNumberRange(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
+ method public int describeContents();
+ method public boolean matches(@NonNull String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneNumberRange> CREATOR;
+ }
+
+ public class PhoneNumberUtils {
+ method @NonNull public static String getUsernameFromUriNumber(@NonNull String);
+ method public static boolean isUriNumber(@Nullable String);
+ method public static boolean isVoiceMailNumber(@NonNull android.content.Context, int, @Nullable String);
+ }
+
+ public class PhoneStateListener {
+ method public void onCallAttributesChanged(@NonNull android.telephony.CallAttributes);
+ method @Deprecated public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber);
+ method public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber, int);
+ method @Deprecated public void onOutgoingEmergencySms(@NonNull android.telephony.emergency.EmergencyNumber);
+ method public void onOutgoingEmergencySms(@NonNull android.telephony.emergency.EmergencyNumber, int);
+ method public void onPhysicalChannelConfigurationChanged(@NonNull java.util.List<android.telephony.PhysicalChannelConfig>);
+ method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseCallStateChanged(@NonNull android.telephony.PreciseCallState);
+ method public void onRadioPowerStateChanged(int);
+ method public void onSrvccStateChanged(int);
+ method public void onVoiceActivationStateChanged(int);
+ field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
+ field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_CALL = 268435456; // 0x10000000
+ field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_SMS = 536870912; // 0x20000000
+ field @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public static final long LISTEN_PHYSICAL_CHANNEL_CONFIGURATION = 4294967296L; // 0x100000000L
+ field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_CALL_STATE = 2048; // 0x800
+ field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_RADIO_POWER_STATE_CHANGED = 8388608; // 0x800000
+ field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_SRVCC_STATE_CHANGED = 16384; // 0x4000
+ field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_VOICE_ACTIVATION_STATE = 131072; // 0x20000
+ }
+
+ public final class PhysicalChannelConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getCellBandwidthDownlink();
+ method public int getChannelNumber();
+ method public int getConnectionStatus();
+ method public int getNetworkType();
+ method @IntRange(from=0, to=1007) public int getPhysicalCellId();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CHANNEL_NUMBER_UNKNOWN = -1; // 0xffffffff
+ field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
+ field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
+ field public static final int CONNECTION_UNKNOWN = -1; // 0xffffffff
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhysicalChannelConfig> CREATOR;
+ field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public final class PreciseCallState implements android.os.Parcelable {
+ ctor public PreciseCallState(int, int, int, int, int);
+ method public int describeContents();
+ method public int getBackgroundCallState();
+ method public int getForegroundCallState();
+ method public int getRingingCallState();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PreciseCallState> CREATOR;
+ field public static final int PRECISE_CALL_STATE_ACTIVE = 1; // 0x1
+ field public static final int PRECISE_CALL_STATE_ALERTING = 4; // 0x4
+ field public static final int PRECISE_CALL_STATE_DIALING = 3; // 0x3
+ field public static final int PRECISE_CALL_STATE_DISCONNECTED = 7; // 0x7
+ field public static final int PRECISE_CALL_STATE_DISCONNECTING = 8; // 0x8
+ field public static final int PRECISE_CALL_STATE_HOLDING = 2; // 0x2
+ field public static final int PRECISE_CALL_STATE_IDLE = 0; // 0x0
+ field public static final int PRECISE_CALL_STATE_INCOMING = 5; // 0x5
+ field public static final int PRECISE_CALL_STATE_NOT_VALID = -1; // 0xffffffff
+ field public static final int PRECISE_CALL_STATE_WAITING = 6; // 0x6
+ }
+
+ public final class PreciseDataConnectionState implements android.os.Parcelable {
+ method @Deprecated @NonNull public String getDataConnectionApn();
+ method @Deprecated public int getDataConnectionApnTypeBitMask();
+ method @Deprecated public int getDataConnectionFailCause();
+ method @Deprecated public int getDataConnectionState();
+ method public int getId();
+ }
+
+ public final class PreciseDisconnectCause {
+ field public static final int ACCESS_CLASS_BLOCKED = 260; // 0x104
+ field public static final int ACCESS_INFORMATION_DISCARDED = 43; // 0x2b
+ field public static final int ACM_LIMIT_EXCEEDED = 68; // 0x44
+ field public static final int BEARER_CAPABILITY_NOT_AUTHORIZED = 57; // 0x39
+ field public static final int BEARER_NOT_AVAIL = 58; // 0x3a
+ field public static final int BEARER_SERVICE_NOT_IMPLEMENTED = 65; // 0x41
+ field public static final int BUSY = 17; // 0x11
+ field public static final int CALL_BARRED = 240; // 0xf0
+ field public static final int CALL_REJECTED = 21; // 0x15
+ field public static final int CDMA_ACCESS_BLOCKED = 1009; // 0x3f1
+ field public static final int CDMA_ACCESS_FAILURE = 1006; // 0x3ee
+ field public static final int CDMA_DROP = 1001; // 0x3e9
+ field public static final int CDMA_INTERCEPT = 1002; // 0x3ea
+ field public static final int CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000; // 0x3e8
+ field public static final int CDMA_NOT_EMERGENCY = 1008; // 0x3f0
+ field public static final int CDMA_PREEMPTED = 1007; // 0x3ef
+ field public static final int CDMA_REORDER = 1003; // 0x3eb
+ field public static final int CDMA_RETRY_ORDER = 1005; // 0x3ed
+ field public static final int CDMA_SO_REJECT = 1004; // 0x3ec
+ field public static final int CHANNEL_NOT_AVAIL = 44; // 0x2c
+ field public static final int CHANNEL_UNACCEPTABLE = 6; // 0x6
+ field public static final int CONDITIONAL_IE_ERROR = 100; // 0x64
+ field public static final int DESTINATION_OUT_OF_ORDER = 27; // 0x1b
+ field public static final int ERROR_UNSPECIFIED = 65535; // 0xffff
+ field public static final int FACILITY_REJECTED = 29; // 0x1d
+ field public static final int FDN_BLOCKED = 241; // 0xf1
+ field public static final int IMEI_NOT_ACCEPTED = 243; // 0xf3
+ field public static final int IMSI_UNKNOWN_IN_VLR = 242; // 0xf2
+ field public static final int INCOMING_CALLS_BARRED_WITHIN_CUG = 55; // 0x37
+ field public static final int INCOMPATIBLE_DESTINATION = 88; // 0x58
+ field public static final int INFORMATION_ELEMENT_NON_EXISTENT = 99; // 0x63
+ field public static final int INTERWORKING_UNSPECIFIED = 127; // 0x7f
+ field public static final int INVALID_MANDATORY_INFORMATION = 96; // 0x60
+ field public static final int INVALID_NUMBER_FORMAT = 28; // 0x1c
+ field public static final int INVALID_TRANSACTION_IDENTIFIER = 81; // 0x51
+ field public static final int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101; // 0x65
+ field public static final int MESSAGE_TYPE_NON_IMPLEMENTED = 97; // 0x61
+ field public static final int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98; // 0x62
+ field public static final int NETWORK_DETACH = 261; // 0x105
+ field public static final int NETWORK_OUT_OF_ORDER = 38; // 0x26
+ field public static final int NETWORK_REJECT = 252; // 0xfc
+ field public static final int NETWORK_RESP_TIMEOUT = 251; // 0xfb
+ field public static final int NORMAL = 16; // 0x10
+ field public static final int NORMAL_UNSPECIFIED = 31; // 0x1f
+ field public static final int NOT_VALID = -1; // 0xffffffff
+ field public static final int NO_ANSWER_FROM_USER = 19; // 0x13
+ field public static final int NO_CIRCUIT_AVAIL = 34; // 0x22
+ field public static final int NO_DISCONNECT_CAUSE_AVAILABLE = 0; // 0x0
+ field public static final int NO_ROUTE_TO_DESTINATION = 3; // 0x3
+ field public static final int NO_USER_RESPONDING = 18; // 0x12
+ field public static final int NO_VALID_SIM = 249; // 0xf9
+ field public static final int NUMBER_CHANGED = 22; // 0x16
+ field public static final int OEM_CAUSE_1 = 61441; // 0xf001
+ field public static final int OEM_CAUSE_10 = 61450; // 0xf00a
+ field public static final int OEM_CAUSE_11 = 61451; // 0xf00b
+ field public static final int OEM_CAUSE_12 = 61452; // 0xf00c
+ field public static final int OEM_CAUSE_13 = 61453; // 0xf00d
+ field public static final int OEM_CAUSE_14 = 61454; // 0xf00e
+ field public static final int OEM_CAUSE_15 = 61455; // 0xf00f
+ field public static final int OEM_CAUSE_2 = 61442; // 0xf002
+ field public static final int OEM_CAUSE_3 = 61443; // 0xf003
+ field public static final int OEM_CAUSE_4 = 61444; // 0xf004
+ field public static final int OEM_CAUSE_5 = 61445; // 0xf005
+ field public static final int OEM_CAUSE_6 = 61446; // 0xf006
+ field public static final int OEM_CAUSE_7 = 61447; // 0xf007
+ field public static final int OEM_CAUSE_8 = 61448; // 0xf008
+ field public static final int OEM_CAUSE_9 = 61449; // 0xf009
+ field public static final int ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70; // 0x46
+ field public static final int OPERATOR_DETERMINED_BARRING = 8; // 0x8
+ field public static final int OUT_OF_SRV = 248; // 0xf8
+ field public static final int PREEMPTION = 25; // 0x19
+ field public static final int PROTOCOL_ERROR_UNSPECIFIED = 111; // 0x6f
+ field public static final int QOS_NOT_AVAIL = 49; // 0x31
+ field public static final int RADIO_ACCESS_FAILURE = 253; // 0xfd
+ field public static final int RADIO_INTERNAL_ERROR = 250; // 0xfa
+ field public static final int RADIO_LINK_FAILURE = 254; // 0xfe
+ field public static final int RADIO_LINK_LOST = 255; // 0xff
+ field public static final int RADIO_OFF = 247; // 0xf7
+ field public static final int RADIO_RELEASE_ABNORMAL = 259; // 0x103
+ field public static final int RADIO_RELEASE_NORMAL = 258; // 0x102
+ field public static final int RADIO_SETUP_FAILURE = 257; // 0x101
+ field public static final int RADIO_UPLINK_FAILURE = 256; // 0x100
+ field public static final int RECOVERY_ON_TIMER_EXPIRED = 102; // 0x66
+ field public static final int REQUESTED_FACILITY_NOT_IMPLEMENTED = 69; // 0x45
+ field public static final int REQUESTED_FACILITY_NOT_SUBSCRIBED = 50; // 0x32
+ field public static final int RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47; // 0x2f
+ field public static final int SEMANTICALLY_INCORRECT_MESSAGE = 95; // 0x5f
+ field public static final int SERVICE_OPTION_NOT_AVAILABLE = 63; // 0x3f
+ field public static final int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79; // 0x4f
+ field public static final int STATUS_ENQUIRY = 30; // 0x1e
+ field public static final int SWITCHING_CONGESTION = 42; // 0x2a
+ field public static final int TEMPORARY_FAILURE = 41; // 0x29
+ field public static final int UNOBTAINABLE_NUMBER = 1; // 0x1
+ field public static final int USER_NOT_MEMBER_OF_CUG = 87; // 0x57
+ }
+
+ public class ServiceState implements android.os.Parcelable {
+ method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(int);
+ field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
+ field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
+ field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
+ field public static final int ROAMING_TYPE_UNKNOWN = 1; // 0x1
+ }
+
+ public final class SmsCbCmasInfo implements android.os.Parcelable {
+ ctor public SmsCbCmasInfo(int, int, int, int, int, int);
+ method public int describeContents();
+ method public int getCategory();
+ method public int getCertainty();
+ method public int getMessageClass();
+ method public int getResponseType();
+ method public int getSeverity();
+ method public int getUrgency();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CMAS_CATEGORY_CBRNE = 10; // 0xa
+ field public static final int CMAS_CATEGORY_ENV = 7; // 0x7
+ field public static final int CMAS_CATEGORY_FIRE = 5; // 0x5
+ field public static final int CMAS_CATEGORY_GEO = 0; // 0x0
+ field public static final int CMAS_CATEGORY_HEALTH = 6; // 0x6
+ field public static final int CMAS_CATEGORY_INFRA = 9; // 0x9
+ field public static final int CMAS_CATEGORY_MET = 1; // 0x1
+ field public static final int CMAS_CATEGORY_OTHER = 11; // 0xb
+ field public static final int CMAS_CATEGORY_RESCUE = 4; // 0x4
+ field public static final int CMAS_CATEGORY_SAFETY = 2; // 0x2
+ field public static final int CMAS_CATEGORY_SECURITY = 3; // 0x3
+ field public static final int CMAS_CATEGORY_TRANSPORT = 8; // 0x8
+ field public static final int CMAS_CATEGORY_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_CERTAINTY_LIKELY = 1; // 0x1
+ field public static final int CMAS_CERTAINTY_OBSERVED = 0; // 0x0
+ field public static final int CMAS_CERTAINTY_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_CLASS_CHILD_ABDUCTION_EMERGENCY = 3; // 0x3
+ field public static final int CMAS_CLASS_CMAS_EXERCISE = 5; // 0x5
+ field public static final int CMAS_CLASS_EXTREME_THREAT = 1; // 0x1
+ field public static final int CMAS_CLASS_OPERATOR_DEFINED_USE = 6; // 0x6
+ field public static final int CMAS_CLASS_PRESIDENTIAL_LEVEL_ALERT = 0; // 0x0
+ field public static final int CMAS_CLASS_REQUIRED_MONTHLY_TEST = 4; // 0x4
+ field public static final int CMAS_CLASS_SEVERE_THREAT = 2; // 0x2
+ field public static final int CMAS_CLASS_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_RESPONSE_TYPE_ASSESS = 6; // 0x6
+ field public static final int CMAS_RESPONSE_TYPE_AVOID = 5; // 0x5
+ field public static final int CMAS_RESPONSE_TYPE_EVACUATE = 1; // 0x1
+ field public static final int CMAS_RESPONSE_TYPE_EXECUTE = 3; // 0x3
+ field public static final int CMAS_RESPONSE_TYPE_MONITOR = 4; // 0x4
+ field public static final int CMAS_RESPONSE_TYPE_NONE = 7; // 0x7
+ field public static final int CMAS_RESPONSE_TYPE_PREPARE = 2; // 0x2
+ field public static final int CMAS_RESPONSE_TYPE_SHELTER = 0; // 0x0
+ field public static final int CMAS_RESPONSE_TYPE_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_SEVERITY_EXTREME = 0; // 0x0
+ field public static final int CMAS_SEVERITY_SEVERE = 1; // 0x1
+ field public static final int CMAS_SEVERITY_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_URGENCY_EXPECTED = 1; // 0x1
+ field public static final int CMAS_URGENCY_IMMEDIATE = 0; // 0x0
+ field public static final int CMAS_URGENCY_UNKNOWN = -1; // 0xffffffff
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbCmasInfo> CREATOR;
+ }
+
+ public final class SmsCbEtwsInfo implements android.os.Parcelable {
+ ctor public SmsCbEtwsInfo(int, boolean, boolean, boolean, @Nullable byte[]);
+ method public int describeContents();
+ method @Nullable public byte[] getPrimaryNotificationSignature();
+ method public long getPrimaryNotificationTimestamp();
+ method public int getWarningType();
+ method public boolean isEmergencyUserAlert();
+ method public boolean isPopupAlert();
+ method public boolean isPrimary();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbEtwsInfo> CREATOR;
+ field public static final int ETWS_WARNING_TYPE_EARTHQUAKE = 0; // 0x0
+ field public static final int ETWS_WARNING_TYPE_EARTHQUAKE_AND_TSUNAMI = 2; // 0x2
+ field public static final int ETWS_WARNING_TYPE_OTHER_EMERGENCY = 4; // 0x4
+ field public static final int ETWS_WARNING_TYPE_TEST_MESSAGE = 3; // 0x3
+ field public static final int ETWS_WARNING_TYPE_TSUNAMI = 1; // 0x1
+ field public static final int ETWS_WARNING_TYPE_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public final class SmsCbLocation implements android.os.Parcelable {
+ ctor public SmsCbLocation(@NonNull String, int, int);
+ method public int describeContents();
+ method public int getCid();
+ method public int getLac();
+ method @NonNull public String getPlmn();
+ method public boolean isInLocationArea(@NonNull android.telephony.SmsCbLocation);
+ method public boolean isInLocationArea(@Nullable String, int, int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbLocation> CREATOR;
+ }
+
+ public final class SmsCbMessage implements android.os.Parcelable {
+ ctor public SmsCbMessage(int, int, int, @NonNull android.telephony.SmsCbLocation, int, @Nullable String, int, @Nullable String, int, @Nullable android.telephony.SmsCbEtwsInfo, @Nullable android.telephony.SmsCbCmasInfo, int, @Nullable java.util.List<android.telephony.CbGeoUtils.Geometry>, long, int, int);
+ method @NonNull public static android.telephony.SmsCbMessage createFromCursor(@NonNull android.database.Cursor);
+ method public int describeContents();
+ method @Nullable public android.telephony.SmsCbCmasInfo getCmasWarningInfo();
+ method @NonNull public android.content.ContentValues getContentValues();
+ method public int getDataCodingScheme();
+ method @Nullable public android.telephony.SmsCbEtwsInfo getEtwsWarningInfo();
+ method public int getGeographicalScope();
+ method @NonNull public java.util.List<android.telephony.CbGeoUtils.Geometry> getGeometries();
+ method @Nullable public String getLanguageCode();
+ method @NonNull public android.telephony.SmsCbLocation getLocation();
+ method public int getMaximumWaitingDuration();
+ method @Nullable public String getMessageBody();
+ method public int getMessageFormat();
+ method public int getMessagePriority();
+ method public long getReceivedTime();
+ method public int getSerialNumber();
+ method public int getServiceCategory();
+ method public int getSlotIndex();
+ method public int getSubscriptionId();
+ method public boolean isCmasMessage();
+ method public boolean isEmergencyMessage();
+ method public boolean isEtwsMessage();
+ method public boolean needGeoFencingCheck();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbMessage> CREATOR;
+ field public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE = 3; // 0x3
+ field public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE_IMMEDIATE = 0; // 0x0
+ field public static final int GEOGRAPHICAL_SCOPE_LOCATION_AREA_WIDE = 2; // 0x2
+ field public static final int GEOGRAPHICAL_SCOPE_PLMN_WIDE = 1; // 0x1
+ field public static final int MAXIMUM_WAIT_TIME_NOT_SET = 255; // 0xff
+ field public static final int MESSAGE_FORMAT_3GPP = 1; // 0x1
+ field public static final int MESSAGE_FORMAT_3GPP2 = 2; // 0x2
+ field public static final int MESSAGE_PRIORITY_EMERGENCY = 3; // 0x3
+ field public static final int MESSAGE_PRIORITY_INTERACTIVE = 1; // 0x1
+ field public static final int MESSAGE_PRIORITY_NORMAL = 0; // 0x0
+ field public static final int MESSAGE_PRIORITY_URGENT = 2; // 0x2
+ }
+
+ public final class SmsManager {
+ method public boolean disableCellBroadcastRange(int, int, int);
+ method public boolean enableCellBroadcastRange(int, int, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getPremiumSmsConsent(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void sendMultipartTextMessageWithoutPersisting(String, String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPremiumSmsConsent(@NonNull String, int);
+ field public static final int PREMIUM_SMS_CONSENT_ALWAYS_ALLOW = 3; // 0x3
+ field public static final int PREMIUM_SMS_CONSENT_ASK_USER = 1; // 0x1
+ field public static final int PREMIUM_SMS_CONSENT_NEVER_ALLOW = 2; // 0x2
+ field public static final int PREMIUM_SMS_CONSENT_UNKNOWN = 0; // 0x0
+ }
+
+ public class SmsMessage {
+ method @Nullable public static android.telephony.SmsMessage createFromNativeSmsSubmitPdu(@NonNull byte[], boolean);
+ method @Nullable public static android.telephony.SmsMessage.SubmitPdu getSmsPdu(int, int, @Nullable String, @NonNull String, @NonNull String, long);
+ method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static byte[] getSubmitPduEncodedMessage(boolean, @NonNull String, @NonNull String, int, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0, to=255) int, @IntRange(from=1, to=255) int, @IntRange(from=1, to=255) int);
+ }
+
+ public class SubscriptionInfo implements android.os.Parcelable {
+ method public boolean areUiccApplicationsEnabled();
+ method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
+ method public int getProfileClass();
+ method public boolean isGroupDisabled();
+ }
+
+ public class SubscriptionManager {
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean canDisablePhysicalSubscription();
+ method public boolean canManageSubscription(@NonNull android.telephony.SubscriptionInfo, @NonNull String);
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int[] getActiveSubscriptionIdList();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForIcc(@NonNull String);
+ method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int[] getCompleteActiveSubscriptionIdList();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
+ method @NonNull public static android.content.res.Resources getResourcesForSubId(@NonNull android.content.Context, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int);
+ method public void requestEmbeddedSubscriptionInfoListRefresh();
+ method public void requestEmbeddedSubscriptionInfoListRefresh(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultDataSubId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultSmsSubId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultVoiceSubscriptionId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUiccApplicationsEnabled(int, boolean);
+ field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED";
+ field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
+ field @Deprecated public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff
+ field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2
+ field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1
+ field public static final int PROFILE_CLASS_TESTING = 0; // 0x0
+ field public static final int PROFILE_CLASS_UNSET = -1; // 0xffffffff
+ field @NonNull public static final android.net.Uri VT_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_MODE_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ROAMING_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ROAMING_MODE_CONTENT_URI;
+ }
+
+ public static class SubscriptionPlan.Builder {
+ method @Deprecated public static android.telephony.SubscriptionPlan.Builder createRecurringDaily(java.time.ZonedDateTime);
+ method @Deprecated public static android.telephony.SubscriptionPlan.Builder createRecurringMonthly(java.time.ZonedDateTime);
+ method @Deprecated public static android.telephony.SubscriptionPlan.Builder createRecurringWeekly(java.time.ZonedDateTime);
+ }
+
+ public final class TelephonyHistogram implements android.os.Parcelable {
+ ctor public TelephonyHistogram(int, int, int);
+ ctor public TelephonyHistogram(android.telephony.TelephonyHistogram);
+ ctor public TelephonyHistogram(android.os.Parcel);
+ method public void addTimeTaken(int);
+ method public int describeContents();
+ method public int getAverageTime();
+ method public int getBucketCount();
+ method public int[] getBucketCounters();
+ method public int[] getBucketEndPoints();
+ method public int getCategory();
+ method public int getId();
+ method public int getMaxTime();
+ method public int getMinTime();
+ method public int getSampleCount();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.TelephonyHistogram> CREATOR;
+ field public static final int TELEPHONY_CATEGORY_RIL = 1; // 0x1
+ }
+
+ public class TelephonyManager {
+ method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String);
+ method public int checkCarrierPrivilegesForPackage(String);
+ method public int checkCarrierPrivilegesForPackageAnyPhone(String);
+ method public void dial(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean disableDataConnectivity();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableDataConnectivity();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableModemForSlot(int, boolean);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableVideoCalling(boolean);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
+ method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
+ method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
+ method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCarrierPrivilegeStatus(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<java.lang.String> getCarrierPrivilegedPackagesForAllActiveSubscriptions();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CarrierRestrictionRules getCarrierRestrictionRules();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCdmaEnhancedRoamingIndicatorDisplayNumber();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin(int);
+ method public String getCdmaPrlVersion();
+ method public int getCurrentPhoneType();
+ method public int getCurrentPhoneType(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getDataActivationState();
+ method @Deprecated public boolean getDataEnabled();
+ method @Deprecated public boolean getDataEnabled(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getDefaultRespondViaMessageApplication();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
+ method public int getMaxNumberOfSimultaneouslyActiveSims();
+ method public static long getMaxNumberVerificationTimeoutMillis();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String[] getMergedImsisFromGroup();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmask();
+ method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
+ method public int getSimApplicationState();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimApplicationState(int);
+ method public int getSimCardState();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimCardState(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Locale getSimLocale();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getSupportedRadioAccessFamily();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.UiccSlotInfo[] getUiccSlotsInfo();
+ method @Nullable public android.os.Bundle getVisualVoicemailSettings();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoiceActivationState();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handlePinMmi(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handlePinMmiForSubscriber(int, String);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean iccCloseLogicalChannelBySlot(int, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannelBySlot(int, @Nullable String, int);
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduBasicChannelBySlot(int, int, int, int, int, int, @Nullable String);
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduLogicalChannelBySlot(int, int, int, int, int, int, int, @Nullable String);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAnyRadioPoweredOn();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApnMetered(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApplicationOnUicc(int);
+ method public boolean isDataConnectivityPossible();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean isIccLockEnabled();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isLteCdmaEvdoGsmWcdmaEnabled();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isMobileDataPolicyEnabled(int);
+ method public boolean isNrDualConnectivityEnabled();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isOpportunisticNetworkEnabled();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isTetheringApnRequired();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean matchesCurrentSimOperator(@NonNull String, int, @Nullable String);
+ method public boolean needsOtaServiceProvisioning();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void reportDefaultNetworkStatus(boolean);
+ method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.MODIFY_PHONE_STATE}) public void requestCellInfoUpdate(@NonNull android.os.WorkSource, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestModemActivityInfo(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.telephony.ModemActivityInfo,android.telephony.TelephonyManager.ModemActivityInfoException>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetAllCarrierActions();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetCarrierKeysForImsiEncryption();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void resetIms(int);
+ method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void resetOtaEmergencyNumberDbFilePath();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean resetRadioConfig();
+ method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabledStatus(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean);
+ method public int setNrDualConnectivityState(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunisticNetworkState(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmask(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRadioEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadioPower(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>);
+ method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff();
+ method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateOtaEmergencyNumberDbFilePath(@NonNull android.os.ParcelFileDescriptor);
+ method public void updateServiceLocation();
+ field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED";
+ field public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
+ field public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
+ field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE";
+ field public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
+ field public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
+ field public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE = "com.android.omadm.service.CONFIGURATION_UPDATE";
+ field public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS = "android.telephony.action.SHOW_NOTICE_ECM_BLOCK_OTHERS";
+ field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
+ field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
+ field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
+ field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
+ field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
+ field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
+ field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
+ field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
+ field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
+ field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
+ field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
+ field public static final int ENABLE_NR_DUAL_CONNECTIVITY_INVALID_STATE = 4; // 0x4
+ field public static final int ENABLE_NR_DUAL_CONNECTIVITY_NOT_SUPPORTED = 1; // 0x1
+ field public static final int ENABLE_NR_DUAL_CONNECTIVITY_RADIO_ERROR = 3; // 0x3
+ field public static final int ENABLE_NR_DUAL_CONNECTIVITY_RADIO_NOT_AVAILABLE = 2; // 0x2
+ field public static final int ENABLE_NR_DUAL_CONNECTIVITY_SUCCESS = 0; // 0x0
+ field public static final String EXTRA_ANOMALY_DESCRIPTION = "android.telephony.extra.ANOMALY_DESCRIPTION";
+ field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID";
+ field public static final String EXTRA_PHONE_IN_ECM_STATE = "android.telephony.extra.PHONE_IN_ECM_STATE";
+ field public static final String EXTRA_PHONE_IN_EMERGENCY_CALL = "android.telephony.extra.PHONE_IN_EMERGENCY_CALL";
+ field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
+ field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
+ field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
+ field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
+ field public static final int KEY_TYPE_EPDG = 1; // 0x1
+ field public static final int KEY_TYPE_WLAN = 2; // 0x2
+ field public static final int MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL = 1; // 0x1
+ field public static final int MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED = 2; // 0x2
+ field public static final long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L
+ field public static final long NETWORK_TYPE_BITMASK_CDMA = 8L; // 0x8L
+ field public static final long NETWORK_TYPE_BITMASK_EDGE = 2L; // 0x2L
+ field public static final long NETWORK_TYPE_BITMASK_EHRPD = 8192L; // 0x2000L
+ field public static final long NETWORK_TYPE_BITMASK_EVDO_0 = 16L; // 0x10L
+ field public static final long NETWORK_TYPE_BITMASK_EVDO_A = 32L; // 0x20L
+ field public static final long NETWORK_TYPE_BITMASK_EVDO_B = 2048L; // 0x800L
+ field public static final long NETWORK_TYPE_BITMASK_GPRS = 1L; // 0x1L
+ field public static final long NETWORK_TYPE_BITMASK_GSM = 32768L; // 0x8000L
+ field public static final long NETWORK_TYPE_BITMASK_HSDPA = 128L; // 0x80L
+ field public static final long NETWORK_TYPE_BITMASK_HSPA = 512L; // 0x200L
+ field public static final long NETWORK_TYPE_BITMASK_HSPAP = 16384L; // 0x4000L
+ field public static final long NETWORK_TYPE_BITMASK_HSUPA = 256L; // 0x100L
+ field public static final long NETWORK_TYPE_BITMASK_IWLAN = 131072L; // 0x20000L
+ field public static final long NETWORK_TYPE_BITMASK_LTE = 4096L; // 0x1000L
+ field public static final long NETWORK_TYPE_BITMASK_LTE_CA = 262144L; // 0x40000L
+ field public static final long NETWORK_TYPE_BITMASK_NR = 524288L; // 0x80000L
+ field public static final long NETWORK_TYPE_BITMASK_TD_SCDMA = 65536L; // 0x10000L
+ field public static final long NETWORK_TYPE_BITMASK_UMTS = 4L; // 0x4L
+ field public static final long NETWORK_TYPE_BITMASK_UNKNOWN = 0L; // 0x0L
+ field public static final int NR_DUAL_CONNECTIVITY_DISABLE = 2; // 0x2
+ field public static final int NR_DUAL_CONNECTIVITY_DISABLE_IMMEDIATE = 3; // 0x3
+ field public static final int NR_DUAL_CONNECTIVITY_ENABLE = 1; // 0x1
+ field public static final int RADIO_POWER_OFF = 0; // 0x0
+ field public static final int RADIO_POWER_ON = 1; // 0x1
+ field public static final int RADIO_POWER_UNAVAILABLE = 2; // 0x2
+ field public static final int SET_CARRIER_RESTRICTION_ERROR = 2; // 0x2
+ field public static final int SET_CARRIER_RESTRICTION_NOT_SUPPORTED = 1; // 0x1
+ field public static final int SET_CARRIER_RESTRICTION_SUCCESS = 0; // 0x0
+ field public static final int SIM_ACTIVATION_STATE_ACTIVATED = 2; // 0x2
+ field public static final int SIM_ACTIVATION_STATE_ACTIVATING = 1; // 0x1
+ field public static final int SIM_ACTIVATION_STATE_DEACTIVATED = 3; // 0x3
+ field public static final int SIM_ACTIVATION_STATE_RESTRICTED = 4; // 0x4
+ field public static final int SIM_ACTIVATION_STATE_UNKNOWN = 0; // 0x0
+ field public static final int SIM_STATE_LOADED = 10; // 0xa
+ field public static final int SIM_STATE_PRESENT = 11; // 0xb
+ field public static final int SRVCC_STATE_HANDOVER_CANCELED = 3; // 0x3
+ field public static final int SRVCC_STATE_HANDOVER_COMPLETED = 1; // 0x1
+ field public static final int SRVCC_STATE_HANDOVER_FAILED = 2; // 0x2
+ field public static final int SRVCC_STATE_HANDOVER_NONE = -1; // 0xffffffff
+ field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
+ }
+
+ public static interface TelephonyManager.CallForwardingInfoCallback {
+ method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
+ method public void onError(int);
+ field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
+ field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
+ field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ public static class TelephonyManager.ModemActivityInfoException extends java.lang.Exception {
+ method public int getErrorCode();
+ field public static final int ERROR_INVALID_INFO_RECEIVED = 2; // 0x2
+ field public static final int ERROR_MODEM_RESPONSE_ERROR = 3; // 0x3
+ field public static final int ERROR_PHONE_NOT_AVAILABLE = 1; // 0x1
+ field public static final int ERROR_UNKNOWN = 0; // 0x0
+ }
+
+ public final class UiccAccessRule implements android.os.Parcelable {
+ ctor public UiccAccessRule(byte[], @Nullable String, long);
+ method public int describeContents();
+ method public int getCarrierPrivilegeStatus(android.content.pm.PackageInfo);
+ method public int getCarrierPrivilegeStatus(android.content.pm.Signature, String);
+ method public String getCertificateHexString();
+ method @Nullable public String getPackageName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.UiccAccessRule> CREATOR;
+ }
+
+ public class UiccSlotInfo implements android.os.Parcelable {
+ ctor @Deprecated public UiccSlotInfo(boolean, boolean, String, int, int, boolean);
+ method public int describeContents();
+ method public String getCardId();
+ method public int getCardStateInfo();
+ method public boolean getIsActive();
+ method public boolean getIsEuicc();
+ method public boolean getIsExtendedApduSupported();
+ method public int getLogicalSlotIdx();
+ method public boolean isRemovable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CARD_STATE_INFO_ABSENT = 1; // 0x1
+ field public static final int CARD_STATE_INFO_ERROR = 3; // 0x3
+ field public static final int CARD_STATE_INFO_PRESENT = 2; // 0x2
+ field public static final int CARD_STATE_INFO_RESTRICTED = 4; // 0x4
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.UiccSlotInfo> CREATOR;
+ }
+
+ public abstract class VisualVoicemailService extends android.app.Service {
+ method public static final void sendVisualVoicemailSms(android.content.Context, android.telecom.PhoneAccountHandle, String, short, String, android.app.PendingIntent);
+ method public static final void setSmsFilterSettings(android.content.Context, android.telecom.PhoneAccountHandle, android.telephony.VisualVoicemailSmsFilterSettings);
+ }
+
+}
+
+package android.telephony.cdma {
+
+ public final class CdmaSmsCbProgramData implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getCategory();
+ method public int getOperation();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY = 4099; // 0x1003
+ field public static final int CATEGORY_CMAS_EXTREME_THREAT = 4097; // 0x1001
+ field public static final int CATEGORY_CMAS_LAST_RESERVED_VALUE = 4351; // 0x10ff
+ field public static final int CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT = 4096; // 0x1000
+ field public static final int CATEGORY_CMAS_SEVERE_THREAT = 4098; // 0x1002
+ field public static final int CATEGORY_CMAS_TEST_MESSAGE = 4100; // 0x1004
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.cdma.CdmaSmsCbProgramData> CREATOR;
+ field public static final int OPERATION_ADD_CATEGORY = 1; // 0x1
+ field public static final int OPERATION_CLEAR_CATEGORIES = 2; // 0x2
+ field public static final int OPERATION_DELETE_CATEGORY = 0; // 0x0
+ }
+
+}
+
+package android.telephony.data {
+
+ public final class DataCallResponse implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.net.LinkAddress> getAddresses();
+ method public int getCause();
+ method @NonNull public java.util.List<java.net.InetAddress> getDnsAddresses();
+ method @NonNull public java.util.List<java.net.InetAddress> getGatewayAddresses();
+ method public int getHandoverFailureMode();
+ method public int getId();
+ method @NonNull public String getInterfaceName();
+ method public int getLinkStatus();
+ method @Deprecated public int getMtu();
+ method public int getMtuV4();
+ method public int getMtuV6();
+ method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
+ method public int getProtocolType();
+ method public long getRetryIntervalMillis();
+ method @Deprecated public int getSuggestedRetryTime();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
+ field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
+ field public static final int HANDOVER_FAILURE_MODE_LEGACY = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; // 0x2
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; // 0x3
+ field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = -1; // 0xffffffff
+ field public static final int LINK_STATUS_ACTIVE = 2; // 0x2
+ field public static final int LINK_STATUS_DORMANT = 1; // 0x1
+ field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
+ field public static final int LINK_STATUS_UNKNOWN = -1; // 0xffffffff
+ field public static final int RETRY_INTERVAL_UNDEFINED = -1; // 0xffffffff
+ }
+
+ public static final class DataCallResponse.Builder {
+ ctor public DataCallResponse.Builder();
+ method @NonNull public android.telephony.data.DataCallResponse build();
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setAddresses(@NonNull java.util.List<android.net.LinkAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setCause(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setDnsAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setGatewayAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setHandoverFailureMode(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setId(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setInterfaceName(@NonNull String);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setLinkStatus(int);
+ method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setMtu(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV4(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryIntervalMillis(long);
+ method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
+ }
+
+ public final class DataProfile implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public String getApn();
+ method public int getAuthType();
+ method public int getBearerBitmask();
+ method @Deprecated public int getMtu();
+ method public int getMtuV4();
+ method public int getMtuV6();
+ method @Nullable public String getPassword();
+ method public int getProfileId();
+ method public int getProtocolType();
+ method public int getRoamingProtocolType();
+ method public int getSupportedApnTypesBitmask();
+ method public int getType();
+ method @Nullable public String getUserName();
+ method public boolean isEnabled();
+ method public boolean isPersistent();
+ method public boolean isPreferred();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataProfile> CREATOR;
+ field public static final int TYPE_3GPP = 1; // 0x1
+ field public static final int TYPE_3GPP2 = 2; // 0x2
+ field public static final int TYPE_COMMON = 0; // 0x0
+ }
+
+ public static final class DataProfile.Builder {
+ ctor public DataProfile.Builder();
+ method @NonNull public android.telephony.data.DataProfile build();
+ method @NonNull public android.telephony.data.DataProfile.Builder enable(boolean);
+ method @NonNull public android.telephony.data.DataProfile.Builder setApn(@NonNull String);
+ method @NonNull public android.telephony.data.DataProfile.Builder setAuthType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setBearerBitmask(int);
+ method @Deprecated @NonNull public android.telephony.data.DataProfile.Builder setMtu(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setMtuV4(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setMtuV6(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setPassword(@NonNull String);
+ method @NonNull public android.telephony.data.DataProfile.Builder setPersistent(boolean);
+ method @NonNull public android.telephony.data.DataProfile.Builder setPreferred(boolean);
+ method @NonNull public android.telephony.data.DataProfile.Builder setProfileId(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setProtocolType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setRoamingProtocolType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setSupportedApnTypesBitmask(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setUserName(@NonNull String);
+ }
+
+ public abstract class DataService extends android.app.Service {
+ ctor public DataService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public abstract android.telephony.data.DataService.DataServiceProvider onCreateDataServiceProvider(int);
+ field public static final int REQUEST_REASON_HANDOVER = 3; // 0x3
+ field public static final int REQUEST_REASON_NORMAL = 1; // 0x1
+ field public static final int REQUEST_REASON_SHUTDOWN = 2; // 0x2
+ field public static final int REQUEST_REASON_UNKNOWN = 0; // 0x0
+ field public static final String SERVICE_INTERFACE = "android.telephony.data.DataService";
+ }
+
+ public abstract class DataService.DataServiceProvider implements java.lang.AutoCloseable {
+ ctor public DataService.DataServiceProvider(int);
+ method public abstract void close();
+ method public void deactivateDataCall(int, int, @Nullable android.telephony.data.DataServiceCallback);
+ method public final int getSlotIndex();
+ method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
+ method public void requestDataCallList(@NonNull android.telephony.data.DataServiceCallback);
+ method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @NonNull android.telephony.data.DataServiceCallback);
+ method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @NonNull android.telephony.data.DataServiceCallback);
+ method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @NonNull android.telephony.data.DataServiceCallback);
+ }
+
+ public class DataServiceCallback {
+ method public void onDataCallListChanged(@NonNull java.util.List<android.telephony.data.DataCallResponse>);
+ method public void onDeactivateDataCallComplete(int);
+ method public void onRequestDataCallListComplete(int, @NonNull java.util.List<android.telephony.data.DataCallResponse>);
+ method public void onSetDataProfileComplete(int);
+ method public void onSetInitialAttachApnComplete(int);
+ method public void onSetupDataCallComplete(int, @Nullable android.telephony.data.DataCallResponse);
+ field public static final int RESULT_ERROR_BUSY = 3; // 0x3
+ field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
+ field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
+ field public static final int RESULT_ERROR_UNSUPPORTED = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ public abstract class QualifiedNetworksService extends android.app.Service {
+ ctor public QualifiedNetworksService();
+ method @NonNull public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityProvider onCreateNetworkAvailabilityProvider(int);
+ field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService";
+ }
+
+ public abstract class QualifiedNetworksService.NetworkAvailabilityProvider implements java.lang.AutoCloseable {
+ ctor public QualifiedNetworksService.NetworkAvailabilityProvider(int);
+ method public abstract void close();
+ method public final int getSlotIndex();
+ method public final void updateQualifiedNetworkTypes(int, @NonNull java.util.List<java.lang.Integer>);
+ }
+
+}
+
+package android.telephony.euicc {
+
+ public final class DownloadableSubscription implements android.os.Parcelable {
+ method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
+ method @Nullable public String getCarrierName();
+ }
+
+ public static final class DownloadableSubscription.Builder {
+ ctor public DownloadableSubscription.Builder();
+ ctor public DownloadableSubscription.Builder(android.telephony.euicc.DownloadableSubscription);
+ method public android.telephony.euicc.DownloadableSubscription build();
+ method public android.telephony.euicc.DownloadableSubscription.Builder setAccessRules(java.util.List<android.telephony.UiccAccessRule>);
+ method public android.telephony.euicc.DownloadableSubscription.Builder setCarrierName(String);
+ method public android.telephony.euicc.DownloadableSubscription.Builder setConfirmationCode(String);
+ method public android.telephony.euicc.DownloadableSubscription.Builder setEncodedActivationCode(String);
+ }
+
+ public class EuiccCardManager {
+ method public void authenticateServer(String, String, byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void cancelSession(String, byte[], @android.telephony.euicc.EuiccCardManager.CancelReason int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void deleteProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void disableProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void listNotifications(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
+ method public void loadBoundProfilePackage(String, byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void prepareDownload(String, @Nullable byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void removeNotificationFromList(String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void requestAllProfiles(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo[]>);
+ method public void requestDefaultSmdpAddress(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
+ method public void requestEuiccChallenge(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void requestEuiccInfo1(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void requestEuiccInfo2(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void requestProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
+ method public void requestRulesAuthTable(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccRulesAuthTable>);
+ method public void requestSmdsAddress(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
+ method public void resetMemory(String, @android.telephony.euicc.EuiccCardManager.ResetOption int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void retrieveNotification(String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification>);
+ method public void retrieveNotificationList(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
+ method public void setDefaultSmdpAddress(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void setNickname(String, String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void switchToProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
+ field public static final int CANCEL_REASON_END_USER_REJECTED = 0; // 0x0
+ field public static final int CANCEL_REASON_POSTPONED = 1; // 0x1
+ field public static final int CANCEL_REASON_PPR_NOT_ALLOWED = 3; // 0x3
+ field public static final int CANCEL_REASON_TIMEOUT = 2; // 0x2
+ field public static final int RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES = 2; // 0x2
+ field public static final int RESET_OPTION_DELETE_OPERATIONAL_PROFILES = 1; // 0x1
+ field public static final int RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS = 4; // 0x4
+ field public static final int RESULT_CALLER_NOT_ALLOWED = -3; // 0xfffffffd
+ field public static final int RESULT_EUICC_NOT_FOUND = -2; // 0xfffffffe
+ field public static final int RESULT_OK = 0; // 0x0
+ field public static final int RESULT_UNKNOWN_ERROR = -1; // 0xffffffff
+ }
+
+ @IntDef(prefix={"CANCEL_REASON_"}, value={android.telephony.euicc.EuiccCardManager.CANCEL_REASON_END_USER_REJECTED, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_POSTPONED, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_TIMEOUT, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_PPR_NOT_ALLOWED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccCardManager.CancelReason {
+ }
+
+ @IntDef(flag=true, prefix={"RESET_OPTION_"}, value={android.telephony.euicc.EuiccCardManager.RESET_OPTION_DELETE_OPERATIONAL_PROFILES, android.telephony.euicc.EuiccCardManager.RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES, android.telephony.euicc.EuiccCardManager.RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccCardManager.ResetOption {
+ }
+
+ public static interface EuiccCardManager.ResultCallback<T> {
+ method public void onComplete(int, T);
+ }
+
+ public class EuiccManager {
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void continueOperation(android.content.Intent, android.os.Bundle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(@NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(@android.telephony.euicc.EuiccCardManager.ResetOption int, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDefaultDownloadableSubscriptionList(android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDownloadableSubscriptionMetadata(android.telephony.euicc.DownloadableSubscription, android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public int getOtaStatus();
+ method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List<java.lang.String> getSupportedCountries();
+ method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List<java.lang.String> getUnsupportedCountries();
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public boolean isSupportedCountry(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setSupportedCountries(@NonNull java.util.List<java.lang.String>);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setUnsupportedCountries(@NonNull java.util.List<java.lang.String>);
+ field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
+ field @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public static final String ACTION_OTA_STATUS_CHANGED = "android.telephony.euicc.action.OTA_STATUS_CHANGED";
+ field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
+ field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
+ field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
+ field public static final int EUICC_ACTIVATION_TYPE_ACCOUNT_REQUIRED = 4; // 0x4
+ field public static final int EUICC_ACTIVATION_TYPE_BACKUP = 2; // 0x2
+ field public static final int EUICC_ACTIVATION_TYPE_DEFAULT = 1; // 0x1
+ field public static final int EUICC_ACTIVATION_TYPE_TRANSFER = 3; // 0x3
+ field public static final int EUICC_OTA_FAILED = 2; // 0x2
+ field public static final int EUICC_OTA_IN_PROGRESS = 1; // 0x1
+ field public static final int EUICC_OTA_NOT_NEEDED = 4; // 0x4
+ field public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5; // 0x5
+ field public static final int EUICC_OTA_SUCCEEDED = 3; // 0x3
+ field public static final String EXTRA_ACTIVATION_TYPE = "android.telephony.euicc.extra.ACTIVATION_TYPE";
+ field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
+ field public static final String EXTRA_ENABLE_SUBSCRIPTION = "android.telephony.euicc.extra.ENABLE_SUBSCRIPTION";
+ field public static final String EXTRA_FORCE_PROVISION = "android.telephony.euicc.extra.FORCE_PROVISION";
+ field public static final String EXTRA_FROM_SUBSCRIPTION_ID = "android.telephony.euicc.extra.FROM_SUBSCRIPTION_ID";
+ field public static final String EXTRA_PHYSICAL_SLOT_ID = "android.telephony.euicc.extra.PHYSICAL_SLOT_ID";
+ field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.euicc.extra.SUBSCRIPTION_ID";
+ field public static final String EXTRA_SUBSCRIPTION_NICKNAME = "android.telephony.euicc.extra.SUBSCRIPTION_NICKNAME";
+ }
+
+ @IntDef(prefix={"EUICC_OTA_"}, value={android.telephony.euicc.EuiccManager.EUICC_OTA_IN_PROGRESS, android.telephony.euicc.EuiccManager.EUICC_OTA_FAILED, android.telephony.euicc.EuiccManager.EUICC_OTA_SUCCEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_NOT_NEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_STATUS_UNAVAILABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccManager.OtaStatus {
+ }
+
+ public final class EuiccNotification implements android.os.Parcelable {
+ ctor public EuiccNotification(int, String, @android.telephony.euicc.EuiccNotification.Event int, @Nullable byte[]);
+ method public int describeContents();
+ method @Nullable public byte[] getData();
+ method @android.telephony.euicc.EuiccNotification.Event public int getEvent();
+ method public int getSeq();
+ method public String getTargetAddr();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @android.telephony.euicc.EuiccNotification.Event public static final int ALL_EVENTS = 15; // 0xf
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccNotification> CREATOR;
+ field public static final int EVENT_DELETE = 8; // 0x8
+ field public static final int EVENT_DISABLE = 4; // 0x4
+ field public static final int EVENT_ENABLE = 2; // 0x2
+ field public static final int EVENT_INSTALL = 1; // 0x1
+ }
+
+ @IntDef(flag=true, prefix={"EVENT_"}, value={android.telephony.euicc.EuiccNotification.EVENT_INSTALL, android.telephony.euicc.EuiccNotification.EVENT_ENABLE, android.telephony.euicc.EuiccNotification.EVENT_DISABLE, android.telephony.euicc.EuiccNotification.EVENT_DELETE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccNotification.Event {
+ }
+
+ public final class EuiccRulesAuthTable implements android.os.Parcelable {
+ method public int describeContents();
+ method public int findIndex(@android.service.euicc.EuiccProfileInfo.PolicyRule int, android.service.carrier.CarrierIdentifier);
+ method public boolean hasPolicyRuleFlag(int, @android.telephony.euicc.EuiccRulesAuthTable.PolicyRuleFlag int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccRulesAuthTable> CREATOR;
+ field public static final int POLICY_RULE_FLAG_CONSENT_REQUIRED = 1; // 0x1
+ }
+
+ public static final class EuiccRulesAuthTable.Builder {
+ ctor public EuiccRulesAuthTable.Builder(int);
+ method public android.telephony.euicc.EuiccRulesAuthTable.Builder add(int, java.util.List<android.service.carrier.CarrierIdentifier>, int);
+ method public android.telephony.euicc.EuiccRulesAuthTable build();
+ }
+
+ @IntDef(flag=true, prefix={"POLICY_RULE_FLAG_"}, value={android.telephony.euicc.EuiccRulesAuthTable.POLICY_RULE_FLAG_CONSENT_REQUIRED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccRulesAuthTable.PolicyRuleFlag {
+ }
+
+}
+
+package android.telephony.ims {
+
+ public final class AudioCodecAttributes implements android.os.Parcelable {
+ ctor public AudioCodecAttributes(float, @NonNull android.util.Range<java.lang.Float>, float, @NonNull android.util.Range<java.lang.Float>);
+ method public int describeContents();
+ method public float getBandwidthKhz();
+ method @NonNull public android.util.Range<java.lang.Float> getBandwidthRangeKhz();
+ method public float getBitrateKbps();
+ method @NonNull public android.util.Range<java.lang.Float> getBitrateRangeKbps();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.AudioCodecAttributes> CREATOR;
+ }
+
+ public final class ImsCallForwardInfo implements android.os.Parcelable {
+ ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
+ method public int describeContents();
+ method public int getCondition();
+ method public String getNumber();
+ method public int getServiceClass();
+ method public int getStatus();
+ method public int getTimeSeconds();
+ method public int getToA();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CDIV_CF_REASON_ALL = 4; // 0x4
+ field public static final int CDIV_CF_REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int CDIV_CF_REASON_BUSY = 1; // 0x1
+ field public static final int CDIV_CF_REASON_NOT_LOGGED_IN = 6; // 0x6
+ field public static final int CDIV_CF_REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int CDIV_CF_REASON_NO_REPLY = 2; // 0x2
+ field public static final int CDIV_CF_REASON_UNCONDITIONAL = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallForwardInfo> CREATOR;
+ field public static final int STATUS_ACTIVE = 1; // 0x1
+ field public static final int STATUS_NOT_ACTIVE = 0; // 0x0
+ field public static final int TYPE_OF_ADDRESS_INTERNATIONAL = 145; // 0x91
+ field public static final int TYPE_OF_ADDRESS_UNKNOWN = 129; // 0x81
+ }
+
+ public final class ImsCallProfile implements android.os.Parcelable {
+ ctor public ImsCallProfile();
+ ctor public ImsCallProfile(int, int);
+ ctor public ImsCallProfile(int, int, android.os.Bundle, android.telephony.ims.ImsStreamMediaProfile);
+ method public int describeContents();
+ method public String getCallExtra(String);
+ method public String getCallExtra(String, String);
+ method public boolean getCallExtraBoolean(String);
+ method public boolean getCallExtraBoolean(String, boolean);
+ method public int getCallExtraInt(String);
+ method public int getCallExtraInt(String, int);
+ method public android.os.Bundle getCallExtras();
+ method public int getCallType();
+ method public static int getCallTypeFromVideoState(int);
+ method public int getCallerNumberVerificationStatus();
+ method public int getEmergencyCallRouting();
+ method public int getEmergencyServiceCategories();
+ method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
+ method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile();
+ method @NonNull public android.os.Bundle getProprietaryCallExtras();
+ method public int getRestrictCause();
+ method public int getServiceType();
+ method public static int getVideoStateFromCallType(int);
+ method public static int getVideoStateFromImsCallProfile(android.telephony.ims.ImsCallProfile);
+ method public boolean hasKnownUserIntentEmergency();
+ method public boolean isEmergencyCallTesting();
+ method public boolean isVideoCall();
+ method public boolean isVideoPaused();
+ method public static int presentationToOir(int);
+ method public void setCallExtra(String, String);
+ method public void setCallExtraBoolean(String, boolean);
+ method public void setCallExtraInt(String, int);
+ method public void setCallRestrictCause(int);
+ method public void setCallerNumberVerificationStatus(int);
+ method public void setEmergencyCallRouting(int);
+ method public void setEmergencyCallTesting(boolean);
+ method public void setEmergencyServiceCategories(int);
+ method public void setEmergencyUrns(@NonNull java.util.List<java.lang.String>);
+ method public void setHasKnownUserIntentEmergency(boolean);
+ method public void updateCallExtras(android.telephony.ims.ImsCallProfile);
+ method public void updateCallType(android.telephony.ims.ImsCallProfile);
+ method public void updateMediaProfile(android.telephony.ims.ImsCallProfile);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALL_RESTRICT_CAUSE_DISABLED = 2; // 0x2
+ field public static final int CALL_RESTRICT_CAUSE_HD = 3; // 0x3
+ field public static final int CALL_RESTRICT_CAUSE_NONE = 0; // 0x0
+ field public static final int CALL_RESTRICT_CAUSE_RAT = 1; // 0x1
+ field public static final int CALL_TYPE_VIDEO_N_VOICE = 3; // 0x3
+ field public static final int CALL_TYPE_VOICE = 2; // 0x2
+ field public static final int CALL_TYPE_VOICE_N_VIDEO = 1; // 0x1
+ field public static final int CALL_TYPE_VS = 8; // 0x8
+ field public static final int CALL_TYPE_VS_RX = 10; // 0xa
+ field public static final int CALL_TYPE_VS_TX = 9; // 0x9
+ field public static final int CALL_TYPE_VT = 4; // 0x4
+ field public static final int CALL_TYPE_VT_NODIR = 7; // 0x7
+ field public static final int CALL_TYPE_VT_RX = 6; // 0x6
+ field public static final int CALL_TYPE_VT_TX = 5; // 0x5
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallProfile> CREATOR;
+ field public static final int DIALSTRING_NORMAL = 0; // 0x0
+ field public static final int DIALSTRING_SS_CONF = 1; // 0x1
+ field public static final int DIALSTRING_USSD = 2; // 0x2
+ field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo";
+ field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS";
+ field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE";
+ field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE";
+ field @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech";
+ field public static final String EXTRA_CHILD_NUMBER = "ChildNum";
+ field public static final String EXTRA_CNA = "cna";
+ field public static final String EXTRA_CNAP = "cnap";
+ field public static final String EXTRA_CODEC = "Codec";
+ field public static final String EXTRA_DIALSTRING = "dialstring";
+ field public static final String EXTRA_DISPLAY_TEXT = "DisplayText";
+ field public static final String EXTRA_EMERGENCY_CALL = "e_call";
+ field public static final String EXTRA_FORWARDED_NUMBER = "android.telephony.ims.extra.FORWARDED_NUMBER";
+ field public static final String EXTRA_IS_CALL_PULL = "CallPull";
+ field public static final String EXTRA_OI = "oi";
+ field public static final String EXTRA_OIR = "oir";
+ field public static final String EXTRA_REMOTE_URI = "remote_uri";
+ field public static final String EXTRA_USSD = "ussd";
+ field public static final int OIR_DEFAULT = 0; // 0x0
+ field public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2; // 0x2
+ field public static final int OIR_PRESENTATION_PAYPHONE = 4; // 0x4
+ field public static final int OIR_PRESENTATION_RESTRICTED = 1; // 0x1
+ field public static final int OIR_PRESENTATION_UNKNOWN = 3; // 0x3
+ field public static final int SERVICE_TYPE_EMERGENCY = 2; // 0x2
+ field public static final int SERVICE_TYPE_NONE = 0; // 0x0
+ field public static final int SERVICE_TYPE_NORMAL = 1; // 0x1
+ field public static final int VERIFICATION_STATUS_FAILED = 2; // 0x2
+ field public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0; // 0x0
+ field public static final int VERIFICATION_STATUS_PASSED = 1; // 0x1
+ }
+
+ public class ImsCallSessionListener {
+ method public void callQualityChanged(@NonNull android.telephony.CallQuality);
+ method public void callSessionConferenceExtendFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionConferenceExtendReceived(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
+ method public void callSessionConferenceExtended(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
+ method public void callSessionConferenceStateUpdated(android.telephony.ims.ImsConferenceState);
+ method @Deprecated public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo);
+ method @Deprecated public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo);
+ method public void callSessionHeld(android.telephony.ims.ImsCallProfile);
+ method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionInitiated(android.telephony.ims.ImsCallProfile);
+ method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionInviteParticipantsRequestDelivered();
+ method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
+ method @Deprecated public void callSessionMayHandover(int, int);
+ method public void callSessionMergeComplete(android.telephony.ims.stub.ImsCallSessionImplBase);
+ method public void callSessionMergeFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionMergeStarted(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
+ method public void callSessionMultipartyStateChanged(boolean);
+ method public void callSessionProgressing(android.telephony.ims.ImsStreamMediaProfile);
+ method public void callSessionRemoveParticipantsRequestDelivered();
+ method public void callSessionRemoveParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionResumeFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionResumeReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionResumed(android.telephony.ims.ImsCallProfile);
+ method public void callSessionRttAudioIndicatorChanged(@NonNull android.telephony.ims.ImsStreamMediaProfile);
+ method public void callSessionRttMessageReceived(String);
+ method public void callSessionRttModifyRequestReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionRttModifyResponseReceived(int);
+ method public void callSessionSuppServiceReceived(android.telephony.ims.ImsSuppServiceNotification);
+ method public void callSessionTerminated(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionTtyModeReceived(int);
+ method public void callSessionUpdateFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionUpdateReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionUpdated(android.telephony.ims.ImsCallProfile);
+ method public void callSessionUssdMessageReceived(int, String);
+ method public void onHandover(int, int, @Nullable android.telephony.ims.ImsReasonInfo);
+ method public void onHandoverFailed(int, int, @NonNull android.telephony.ims.ImsReasonInfo);
+ method public void onMayHandover(int, int);
+ }
+
+ public final class ImsConferenceState implements android.os.Parcelable {
+ method public int describeContents();
+ method public static int getConnectionStateForStatus(String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsConferenceState> CREATOR;
+ field public static final String DISPLAY_TEXT = "display-text";
+ field public static final String ENDPOINT = "endpoint";
+ field public static final String SIP_STATUS_CODE = "sipstatuscode";
+ field public static final String STATUS = "status";
+ field public static final String STATUS_ALERTING = "alerting";
+ field public static final String STATUS_CONNECTED = "connected";
+ field public static final String STATUS_CONNECT_FAIL = "connect-fail";
+ field public static final String STATUS_DIALING_IN = "dialing-in";
+ field public static final String STATUS_DIALING_OUT = "dialing-out";
+ field public static final String STATUS_DISCONNECTED = "disconnected";
+ field public static final String STATUS_DISCONNECTING = "disconnecting";
+ field public static final String STATUS_MUTED_VIA_FOCUS = "muted-via-focus";
+ field public static final String STATUS_ON_HOLD = "on-hold";
+ field public static final String STATUS_PENDING = "pending";
+ field public static final String STATUS_SEND_ONLY = "sendonly";
+ field public static final String STATUS_SEND_RECV = "sendrecv";
+ field public static final String USER = "user";
+ field public final java.util.HashMap<java.lang.String,android.os.Bundle> mParticipants;
+ }
+
+ public final class ImsException extends java.lang.Exception {
+ ctor public ImsException(@Nullable String);
+ ctor public ImsException(@Nullable String, int);
+ ctor public ImsException(@Nullable String, int, @Nullable Throwable);
+ }
+
+ public final class ImsExternalCallState implements android.os.Parcelable {
+ ctor public ImsExternalCallState(@NonNull String, @NonNull android.net.Uri, @Nullable android.net.Uri, boolean, int, int, boolean);
+ method public int describeContents();
+ method @NonNull public android.net.Uri getAddress();
+ method public int getCallId();
+ method public int getCallState();
+ method public int getCallType();
+ method @Nullable public android.net.Uri getLocalAddress();
+ method public boolean isCallHeld();
+ method public boolean isCallPullable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALL_STATE_CONFIRMED = 1; // 0x1
+ field public static final int CALL_STATE_TERMINATED = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsExternalCallState> CREATOR;
+ }
+
+ public class ImsManager {
+ method @NonNull public android.telephony.ims.SipDelegateManager getSipDelegateManager(int);
+ }
+
+ public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
+ method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getFeatureState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getRegistrationState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAvailable(int, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCapable(int, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void isSupported(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>) throws android.telephony.ims.ImsException;
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRttCapabilitySetting(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiModeSetting(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiNonPersistent(boolean, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingModeSetting(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSettingEnabled(boolean);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback);
+ }
+
+ @Deprecated public static class ImsMmTelManager.RegistrationCallback extends android.telephony.ims.RegistrationManager.RegistrationCallback {
+ ctor @Deprecated public ImsMmTelManager.RegistrationCallback();
+ }
+
+ public final class ImsReasonInfo implements android.os.Parcelable {
+ field public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED = "Forbidden. Not Authorized for Service";
+ }
+
+ public class ImsService extends android.app.Service {
+ ctor public ImsService();
+ method public android.telephony.ims.feature.MmTelFeature createMmTelFeature(int);
+ method public android.telephony.ims.feature.RcsFeature createRcsFeature(int);
+ method public void disableIms(int);
+ method public void enableIms(int);
+ method public android.telephony.ims.stub.ImsConfigImplBase getConfig(int);
+ method public long getImsServiceCapabilities();
+ method public android.telephony.ims.stub.ImsRegistrationImplBase getRegistration(int);
+ method @Nullable public android.telephony.ims.stub.SipTransportImplBase getSipTransport(int);
+ method public final void onUpdateSupportedImsFeatures(android.telephony.ims.stub.ImsFeatureConfiguration) throws android.os.RemoteException;
+ method public android.telephony.ims.stub.ImsFeatureConfiguration querySupportedImsFeatures();
+ method public void readyForFeatureCreation();
+ field public static final long CAPABILITY_SIP_DELEGATE_CREATION = 2L; // 0x2L
+ }
+
+ public final class ImsSsData implements android.os.Parcelable {
+ ctor public ImsSsData(int, int, int, int, int);
+ method public int describeContents();
+ method @Nullable public java.util.List<android.telephony.ims.ImsCallForwardInfo> getCallForwardInfo();
+ method public int getRequestType();
+ method public int getResult();
+ method public int getServiceClass();
+ method public int getServiceType();
+ method @NonNull public java.util.List<android.telephony.ims.ImsSsInfo> getSuppServiceInfo();
+ method public int getTeleserviceType();
+ method public boolean isTypeBarring();
+ method public boolean isTypeCf();
+ method public boolean isTypeClip();
+ method public boolean isTypeClir();
+ method public boolean isTypeColp();
+ method public boolean isTypeColr();
+ method public boolean isTypeCw();
+ method public boolean isTypeIcb();
+ method public boolean isTypeInterrogation();
+ method public boolean isTypeUnConditional();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsData> CREATOR;
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final int SERVICE_CLASS_DATA = 2; // 0x2
+ field public static final int SERVICE_CLASS_DATA_CIRCUIT_ASYNC = 32; // 0x20
+ field public static final int SERVICE_CLASS_DATA_CIRCUIT_SYNC = 16; // 0x10
+ field public static final int SERVICE_CLASS_DATA_PACKET_ACCESS = 64; // 0x40
+ field public static final int SERVICE_CLASS_DATA_PAD = 128; // 0x80
+ field public static final int SERVICE_CLASS_FAX = 4; // 0x4
+ field public static final int SERVICE_CLASS_NONE = 0; // 0x0
+ field public static final int SERVICE_CLASS_SMS = 8; // 0x8
+ field public static final int SERVICE_CLASS_VOICE = 1; // 0x1
+ field public static final int SS_ACTIVATION = 0; // 0x0
+ field public static final int SS_ALL_BARRING = 18; // 0x12
+ field public static final int SS_ALL_DATA_TELESERVICES = 3; // 0x3
+ field public static final int SS_ALL_TELESERVICES_EXCEPT_SMS = 5; // 0x5
+ field public static final int SS_ALL_TELESEVICES = 1; // 0x1
+ field public static final int SS_ALL_TELE_AND_BEARER_SERVICES = 0; // 0x0
+ field public static final int SS_BAIC = 16; // 0x10
+ field public static final int SS_BAIC_ROAMING = 17; // 0x11
+ field public static final int SS_BAOC = 13; // 0xd
+ field public static final int SS_BAOIC = 14; // 0xe
+ field public static final int SS_BAOIC_EXC_HOME = 15; // 0xf
+ field public static final int SS_CFU = 0; // 0x0
+ field public static final int SS_CFUT = 6; // 0x6
+ field public static final int SS_CF_ALL = 4; // 0x4
+ field public static final int SS_CF_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int SS_CF_BUSY = 1; // 0x1
+ field public static final int SS_CF_NOT_REACHABLE = 3; // 0x3
+ field public static final int SS_CF_NO_REPLY = 2; // 0x2
+ field public static final int SS_CLIP = 7; // 0x7
+ field public static final int SS_CLIR = 8; // 0x8
+ field public static final int SS_CNAP = 11; // 0xb
+ field public static final int SS_COLP = 9; // 0x9
+ field public static final int SS_COLR = 10; // 0xa
+ field public static final int SS_DEACTIVATION = 1; // 0x1
+ field public static final int SS_ERASURE = 4; // 0x4
+ field public static final int SS_INCOMING_BARRING = 20; // 0x14
+ field public static final int SS_INCOMING_BARRING_ANONYMOUS = 22; // 0x16
+ field public static final int SS_INCOMING_BARRING_DN = 21; // 0x15
+ field public static final int SS_INTERROGATION = 2; // 0x2
+ field public static final int SS_OUTGOING_BARRING = 19; // 0x13
+ field public static final int SS_REGISTRATION = 3; // 0x3
+ field public static final int SS_SMS_SERVICES = 4; // 0x4
+ field public static final int SS_TELEPHONY = 2; // 0x2
+ field public static final int SS_WAIT = 12; // 0xc
+ }
+
+ public static final class ImsSsData.Builder {
+ ctor public ImsSsData.Builder(int, int, int, int, int);
+ method @NonNull public android.telephony.ims.ImsSsData build();
+ method @NonNull public android.telephony.ims.ImsSsData.Builder setCallForwardingInfo(@NonNull java.util.List<android.telephony.ims.ImsCallForwardInfo>);
+ method @NonNull public android.telephony.ims.ImsSsData.Builder setSuppServiceInfo(@NonNull java.util.List<android.telephony.ims.ImsSsInfo>);
+ }
+
+ public final class ImsSsInfo implements android.os.Parcelable {
+ ctor @Deprecated public ImsSsInfo(int, @Nullable String);
+ method public int describeContents();
+ method public int getClirInterrogationStatus();
+ method public int getClirOutgoingState();
+ method @Deprecated public String getIcbNum();
+ method @Nullable public String getIncomingCommunicationBarringNumber();
+ method public int getProvisionStatus();
+ method public int getStatus();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CLIR_OUTGOING_DEFAULT = 0; // 0x0
+ field public static final int CLIR_OUTGOING_INVOCATION = 1; // 0x1
+ field public static final int CLIR_OUTGOING_SUPPRESSION = 2; // 0x2
+ field public static final int CLIR_STATUS_NOT_PROVISIONED = 0; // 0x0
+ field public static final int CLIR_STATUS_PROVISIONED_PERMANENT = 1; // 0x1
+ field public static final int CLIR_STATUS_TEMPORARILY_ALLOWED = 4; // 0x4
+ field public static final int CLIR_STATUS_TEMPORARILY_RESTRICTED = 3; // 0x3
+ field public static final int CLIR_STATUS_UNKNOWN = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsInfo> CREATOR;
+ field public static final int DISABLED = 0; // 0x0
+ field public static final int ENABLED = 1; // 0x1
+ field public static final int NOT_REGISTERED = -1; // 0xffffffff
+ field public static final int SERVICE_NOT_PROVISIONED = 0; // 0x0
+ field public static final int SERVICE_PROVISIONED = 1; // 0x1
+ field public static final int SERVICE_PROVISIONING_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public static final class ImsSsInfo.Builder {
+ ctor public ImsSsInfo.Builder(int);
+ method @NonNull public android.telephony.ims.ImsSsInfo build();
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirInterrogationStatus(int);
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirOutgoingState(int);
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setIncomingCommunicationBarringNumber(@NonNull String);
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setProvisionStatus(int);
+ }
+
+ public final class ImsStreamMediaProfile implements android.os.Parcelable {
+ ctor public ImsStreamMediaProfile(int, int, int, int, int);
+ method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
+ method public int describeContents();
+ method @Nullable public android.telephony.ims.AudioCodecAttributes getAudioCodecAttributes();
+ method public int getAudioDirection();
+ method public int getAudioQuality();
+ method public int getRttMode();
+ method public int getVideoDirection();
+ method public int getVideoQuality();
+ method public boolean isReceivingRttAudio();
+ method public boolean isRttCall();
+ method public void setAudioCodecAttributes(@NonNull android.telephony.ims.AudioCodecAttributes);
+ method public void setReceivingRttAudio(boolean);
+ method public void setRttMode(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int AUDIO_QUALITY_AMR = 1; // 0x1
+ field public static final int AUDIO_QUALITY_AMR_WB = 2; // 0x2
+ field public static final int AUDIO_QUALITY_EVRC = 4; // 0x4
+ field public static final int AUDIO_QUALITY_EVRC_B = 5; // 0x5
+ field public static final int AUDIO_QUALITY_EVRC_NW = 7; // 0x7
+ field public static final int AUDIO_QUALITY_EVRC_WB = 6; // 0x6
+ field public static final int AUDIO_QUALITY_EVS_FB = 20; // 0x14
+ field public static final int AUDIO_QUALITY_EVS_NB = 17; // 0x11
+ field public static final int AUDIO_QUALITY_EVS_SWB = 19; // 0x13
+ field public static final int AUDIO_QUALITY_EVS_WB = 18; // 0x12
+ field public static final int AUDIO_QUALITY_G711A = 13; // 0xd
+ field public static final int AUDIO_QUALITY_G711AB = 15; // 0xf
+ field public static final int AUDIO_QUALITY_G711U = 11; // 0xb
+ field public static final int AUDIO_QUALITY_G722 = 14; // 0xe
+ field public static final int AUDIO_QUALITY_G723 = 12; // 0xc
+ field public static final int AUDIO_QUALITY_G729 = 16; // 0x10
+ field public static final int AUDIO_QUALITY_GSM_EFR = 8; // 0x8
+ field public static final int AUDIO_QUALITY_GSM_FR = 9; // 0x9
+ field public static final int AUDIO_QUALITY_GSM_HR = 10; // 0xa
+ field public static final int AUDIO_QUALITY_NONE = 0; // 0x0
+ field public static final int AUDIO_QUALITY_QCELP13K = 3; // 0x3
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsStreamMediaProfile> CREATOR;
+ field public static final int DIRECTION_INACTIVE = 0; // 0x0
+ field public static final int DIRECTION_INVALID = -1; // 0xffffffff
+ field public static final int DIRECTION_RECEIVE = 1; // 0x1
+ field public static final int DIRECTION_SEND = 2; // 0x2
+ field public static final int DIRECTION_SEND_RECEIVE = 3; // 0x3
+ field public static final int RTT_MODE_DISABLED = 0; // 0x0
+ field public static final int RTT_MODE_FULL = 1; // 0x1
+ field public static final int VIDEO_QUALITY_NONE = 0; // 0x0
+ field public static final int VIDEO_QUALITY_QCIF = 1; // 0x1
+ field public static final int VIDEO_QUALITY_QVGA_LANDSCAPE = 2; // 0x2
+ field public static final int VIDEO_QUALITY_QVGA_PORTRAIT = 4; // 0x4
+ field public static final int VIDEO_QUALITY_VGA_LANDSCAPE = 8; // 0x8
+ field public static final int VIDEO_QUALITY_VGA_PORTRAIT = 16; // 0x10
+ }
+
+ public final class ImsSuppServiceNotification implements android.os.Parcelable {
+ ctor public ImsSuppServiceNotification(int, int, int, int, String, String[]);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSuppServiceNotification> CREATOR;
+ field public final int code;
+ field public final String[] history;
+ field public final int index;
+ field public final int notificationType;
+ field public final String number;
+ field public final int type;
+ }
+
+ public class ImsUtListener {
+ method public void onLineIdentificationSupplementaryServiceResponse(int, @NonNull android.telephony.ims.ImsSsInfo);
+ method public void onSupplementaryServiceIndication(android.telephony.ims.ImsSsData);
+ method public void onUtConfigurationCallBarringQueried(int, android.telephony.ims.ImsSsInfo[]);
+ method public void onUtConfigurationCallForwardQueried(int, android.telephony.ims.ImsCallForwardInfo[]);
+ method public void onUtConfigurationCallWaitingQueried(int, android.telephony.ims.ImsSsInfo[]);
+ method @Deprecated public void onUtConfigurationQueried(int, android.os.Bundle);
+ method public void onUtConfigurationQueryFailed(int, android.telephony.ims.ImsReasonInfo);
+ method public void onUtConfigurationUpdateFailed(int, android.telephony.ims.ImsReasonInfo);
+ method public void onUtConfigurationUpdated(int);
+ field @Deprecated public static final String BUNDLE_KEY_CLIR = "queryClir";
+ field @Deprecated public static final String BUNDLE_KEY_SSINFO = "imsSsInfo";
+ }
+
+ public abstract class ImsVideoCallProvider {
+ ctor public ImsVideoCallProvider();
+ method public void changeCallDataUsage(long);
+ method public void changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities);
+ method public void changePeerDimensions(int, int);
+ method public void changeVideoQuality(int);
+ method public void handleCallSessionEvent(int);
+ method public abstract void onRequestCallDataUsage();
+ method public abstract void onRequestCameraCapabilities();
+ method public abstract void onSendSessionModifyRequest(android.telecom.VideoProfile, android.telecom.VideoProfile);
+ method public abstract void onSendSessionModifyResponse(android.telecom.VideoProfile);
+ method public abstract void onSetCamera(String);
+ method public void onSetCamera(String, int);
+ method public abstract void onSetDeviceOrientation(int);
+ method public abstract void onSetDisplaySurface(android.view.Surface);
+ method public abstract void onSetPauseImage(android.net.Uri);
+ method public abstract void onSetPreviewSurface(android.view.Surface);
+ method public abstract void onSetZoom(float);
+ method public void receiveSessionModifyRequest(android.telecom.VideoProfile);
+ method public void receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile);
+ }
+
+ public class ProvisioningManager {
+ method @NonNull public static android.telephony.ims.ProvisioningManager createForSubscriptionId(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public int getProvisioningIntValue(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean getProvisioningStatusForCapability(int, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public String getProvisioningStringValue(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean getRcsProvisioningStatusForCapability(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerProvisioningChangedCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ProvisioningManager.Callback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningIntValue(int, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void setProvisioningStatusForCapability(int, int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningStringValue(int, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void setRcsProvisioningStatusForCapability(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterProvisioningChangedCallback(@NonNull android.telephony.ims.ProvisioningManager.Callback);
+ field public static final int KEY_VOICE_OVER_WIFI_ENTITLEMENT_ID = 67; // 0x43
+ field public static final int KEY_VOICE_OVER_WIFI_MODE_OVERRIDE = 27; // 0x1b
+ field public static final int KEY_VOICE_OVER_WIFI_ROAMING_ENABLED_OVERRIDE = 26; // 0x1a
+ field public static final int PROVISIONING_VALUE_DISABLED = 0; // 0x0
+ field public static final int PROVISIONING_VALUE_ENABLED = 1; // 0x1
+ field public static final String STRING_QUERY_RESULT_ERROR_GENERIC = "STRING_QUERY_RESULT_ERROR_GENERIC";
+ field public static final String STRING_QUERY_RESULT_ERROR_NOT_READY = "STRING_QUERY_RESULT_ERROR_NOT_READY";
+ }
+
+ public static class ProvisioningManager.Callback {
+ ctor public ProvisioningManager.Callback();
+ method public void onProvisioningIntChanged(int, int);
+ method public void onProvisioningStringChanged(int, @NonNull String);
+ }
+
+ public class RcsUceAdapter {
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
+ }
+
+ public class SipDelegateManager {
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSupported() throws android.telephony.ims.ImsException;
+ }
+
+}
+
+package android.telephony.ims.feature {
+
+ public final class CapabilityChangeRequest implements android.os.Parcelable {
+ method public void addCapabilitiesToDisableForTech(int, int);
+ method public void addCapabilitiesToEnableForTech(int, int);
+ method public int describeContents();
+ method public java.util.List<android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair> getCapabilitiesToDisable();
+ method public java.util.List<android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair> getCapabilitiesToEnable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.feature.CapabilityChangeRequest> CREATOR;
+ }
+
+ public static class CapabilityChangeRequest.CapabilityPair {
+ ctor public CapabilityChangeRequest.CapabilityPair(int, int);
+ method public int getCapability();
+ method public int getRadioTech();
+ }
+
+ public abstract class ImsFeature {
+ ctor public ImsFeature();
+ method public abstract void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method public int getFeatureState();
+ method public final int getSlotIndex();
+ method public abstract void onFeatureReady();
+ method public abstract void onFeatureRemoved();
+ method public final void setFeatureState(int);
+ field public static final int CAPABILITY_ERROR_GENERIC = -1; // 0xffffffff
+ field public static final int CAPABILITY_SUCCESS = 0; // 0x0
+ field public static final int FEATURE_EMERGENCY_MMTEL = 0; // 0x0
+ field public static final int FEATURE_MMTEL = 1; // 0x1
+ field public static final int FEATURE_RCS = 2; // 0x2
+ field public static final int STATE_INITIALIZING = 1; // 0x1
+ field public static final int STATE_READY = 2; // 0x2
+ field public static final int STATE_UNAVAILABLE = 0; // 0x0
+ }
+
+ @Deprecated public static class ImsFeature.Capabilities {
+ field @Deprecated protected int mCapabilities;
+ }
+
+ protected static class ImsFeature.CapabilityCallbackProxy {
+ method public void onChangeCapabilityConfigurationError(int, int, int);
+ }
+
+ public class MmTelFeature extends android.telephony.ims.feature.ImsFeature {
+ ctor public MmTelFeature();
+ method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method @Nullable public android.telephony.ims.ImsCallProfile createCallProfile(int, int);
+ method @Nullable public android.telephony.ims.stub.ImsCallSessionImplBase createCallSession(@NonNull android.telephony.ims.ImsCallProfile);
+ method @NonNull public android.telephony.ims.stub.ImsEcbmImplBase getEcbm();
+ method @NonNull public android.telephony.ims.stub.ImsMultiEndpointImplBase getMultiEndpoint();
+ method @NonNull public android.telephony.ims.stub.ImsSmsImplBase getSmsImplementation();
+ method @NonNull public android.telephony.ims.stub.ImsUtImplBase getUt();
+ method public final void notifyCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
+ method public final void notifyIncomingCall(@NonNull android.telephony.ims.stub.ImsCallSessionImplBase, @NonNull android.os.Bundle);
+ method public final void notifyRejectedCall(@NonNull android.telephony.ims.ImsCallProfile, @NonNull android.telephony.ims.ImsReasonInfo);
+ method public final void notifyVoiceMessageCountUpdate(int);
+ method public void onFeatureReady();
+ method public void onFeatureRemoved();
+ method public boolean queryCapabilityConfiguration(int, int);
+ method @NonNull public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus();
+ method public void setUiTtyMode(int, @Nullable android.os.Message);
+ method public int shouldProcessCall(@NonNull String[]);
+ field public static final String EXTRA_IS_UNKNOWN_CALL = "android.telephony.ims.feature.extra.IS_UNKNOWN_CALL";
+ field public static final String EXTRA_IS_USSD = "android.telephony.ims.feature.extra.IS_USSD";
+ field public static final int PROCESS_CALL_CSFB = 1; // 0x1
+ field public static final int PROCESS_CALL_IMS = 0; // 0x0
+ }
+
+ public static class MmTelFeature.MmTelCapabilities extends android.telephony.ims.feature.ImsFeature.Capabilities {
+ ctor public MmTelFeature.MmTelCapabilities();
+ ctor @Deprecated public MmTelFeature.MmTelCapabilities(android.telephony.ims.feature.ImsFeature.Capabilities);
+ ctor public MmTelFeature.MmTelCapabilities(int);
+ method public final void addCapabilities(int);
+ method public final void removeCapabilities(int);
+ }
+
+ public class RcsFeature extends android.telephony.ims.feature.ImsFeature {
+ ctor public RcsFeature();
+ method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method public void onFeatureReady();
+ method public void onFeatureRemoved();
+ }
+
+}
+
+package android.telephony.ims.stub {
+
+ public class ImsCallSessionImplBase implements java.lang.AutoCloseable {
+ ctor public ImsCallSessionImplBase();
+ method public void accept(int, android.telephony.ims.ImsStreamMediaProfile);
+ method public void close();
+ method public void deflect(String);
+ method public void extendToConference(String[]);
+ method public String getCallId();
+ method public android.telephony.ims.ImsCallProfile getCallProfile();
+ method public android.telephony.ims.ImsVideoCallProvider getImsVideoCallProvider();
+ method public android.telephony.ims.ImsCallProfile getLocalCallProfile();
+ method public String getProperty(String);
+ method public android.telephony.ims.ImsCallProfile getRemoteCallProfile();
+ method public int getState();
+ method public void hold(android.telephony.ims.ImsStreamMediaProfile);
+ method public void inviteParticipants(String[]);
+ method public boolean isInCall();
+ method public boolean isMultiparty();
+ method public void merge();
+ method public void reject(int);
+ method public void removeParticipants(String[]);
+ method public void resume(android.telephony.ims.ImsStreamMediaProfile);
+ method public void sendDtmf(char, android.os.Message);
+ method public void sendRttMessage(String);
+ method public void sendRttModifyRequest(android.telephony.ims.ImsCallProfile);
+ method public void sendRttModifyResponse(boolean);
+ method public void sendUssd(String);
+ method public void setListener(android.telephony.ims.ImsCallSessionListener);
+ method public void setMute(boolean);
+ method public void start(String, android.telephony.ims.ImsCallProfile);
+ method public void startConference(String[], android.telephony.ims.ImsCallProfile);
+ method public void startDtmf(char);
+ method public void stopDtmf();
+ method public void terminate(int);
+ method public void update(int, android.telephony.ims.ImsStreamMediaProfile);
+ field public static final int USSD_MODE_NOTIFY = 0; // 0x0
+ field public static final int USSD_MODE_REQUEST = 1; // 0x1
+ }
+
+ public static class ImsCallSessionImplBase.State {
+ method public static String toString(int);
+ field public static final int ESTABLISHED = 4; // 0x4
+ field public static final int ESTABLISHING = 3; // 0x3
+ field public static final int IDLE = 0; // 0x0
+ field public static final int INITIATED = 1; // 0x1
+ field public static final int INVALID = -1; // 0xffffffff
+ field public static final int NEGOTIATING = 2; // 0x2
+ field public static final int REESTABLISHING = 6; // 0x6
+ field public static final int RENEGOTIATING = 5; // 0x5
+ field public static final int TERMINATED = 8; // 0x8
+ field public static final int TERMINATING = 7; // 0x7
+ }
+
+ public class ImsConfigImplBase {
+ ctor public ImsConfigImplBase();
+ method public int getConfigInt(int);
+ method public String getConfigString(int);
+ method public final void notifyProvisionedValueChanged(int, int);
+ method public final void notifyProvisionedValueChanged(int, String);
+ method public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);
+ method public int setConfig(int, int);
+ method public int setConfig(int, String);
+ field public static final int CONFIG_RESULT_FAILED = 1; // 0x1
+ field public static final int CONFIG_RESULT_SUCCESS = 0; // 0x0
+ field public static final int CONFIG_RESULT_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public class ImsEcbmImplBase {
+ ctor public ImsEcbmImplBase();
+ method public final void enteredEcbm();
+ method public void exitEmergencyCallbackMode();
+ method public final void exitedEcbm();
+ }
+
+ public final class ImsFeatureConfiguration implements android.os.Parcelable {
+ method public int describeContents();
+ method public java.util.Set<android.telephony.ims.stub.ImsFeatureConfiguration.FeatureSlotPair> getServiceFeatures();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.stub.ImsFeatureConfiguration> CREATOR;
+ }
+
+ public static class ImsFeatureConfiguration.Builder {
+ ctor public ImsFeatureConfiguration.Builder();
+ method public android.telephony.ims.stub.ImsFeatureConfiguration.Builder addFeature(int, int);
+ method public android.telephony.ims.stub.ImsFeatureConfiguration build();
+ }
+
+ public static final class ImsFeatureConfiguration.FeatureSlotPair {
+ ctor public ImsFeatureConfiguration.FeatureSlotPair(int, int);
+ field public final int featureType;
+ field public final int slotId;
+ }
+
+ public class ImsMultiEndpointImplBase {
+ ctor public ImsMultiEndpointImplBase();
+ method public final void onImsExternalCallStateUpdate(java.util.List<android.telephony.ims.ImsExternalCallState>);
+ method public void requestImsExternalCallStateInfo();
+ }
+
+ public class ImsRegistrationImplBase {
+ ctor public ImsRegistrationImplBase();
+ method public final void onDeregistered(android.telephony.ims.ImsReasonInfo);
+ method public final void onRegistered(int);
+ method public final void onRegistering(int);
+ method public final void onSubscriberAssociatedUriChanged(android.net.Uri[]);
+ method public final void onTechnologyChangeFailed(int, android.telephony.ims.ImsReasonInfo);
+ field public static final int REGISTRATION_TECH_IWLAN = 1; // 0x1
+ field public static final int REGISTRATION_TECH_LTE = 0; // 0x0
+ field public static final int REGISTRATION_TECH_NONE = -1; // 0xffffffff
+ }
+
+ public class ImsSmsImplBase {
+ ctor public ImsSmsImplBase();
+ method public void acknowledgeSms(int, @IntRange(from=0, to=65535) int, int);
+ method public void acknowledgeSmsReport(int, @IntRange(from=0, to=65535) int, int);
+ method public String getSmsFormat();
+ method public void onReady();
+ method @Deprecated public final void onSendSmsResult(int, @IntRange(from=0, to=65535) int, int, int) throws java.lang.RuntimeException;
+ method public final void onSendSmsResultError(int, @IntRange(from=0, to=65535) int, int, int, int) throws java.lang.RuntimeException;
+ method public final void onSendSmsResultSuccess(int, @IntRange(from=0, to=65535) int) throws java.lang.RuntimeException;
+ method public final void onSmsReceived(int, String, byte[]) throws java.lang.RuntimeException;
+ method @Deprecated public final void onSmsStatusReportReceived(int, @IntRange(from=0, to=65535) int, String, byte[]) throws java.lang.RuntimeException;
+ method public final void onSmsStatusReportReceived(int, String, byte[]) throws java.lang.RuntimeException;
+ method public void sendSms(int, @IntRange(from=0, to=65535) int, String, String, boolean, byte[]);
+ field public static final int DELIVER_STATUS_ERROR_GENERIC = 2; // 0x2
+ field public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3; // 0x3
+ field public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4; // 0x4
+ field public static final int DELIVER_STATUS_OK = 1; // 0x1
+ field public static final int RESULT_NO_NETWORK_ERROR = -1; // 0xffffffff
+ field public static final int SEND_STATUS_ERROR = 2; // 0x2
+ field public static final int SEND_STATUS_ERROR_FALLBACK = 4; // 0x4
+ field public static final int SEND_STATUS_ERROR_RETRY = 3; // 0x3
+ field public static final int SEND_STATUS_OK = 1; // 0x1
+ field public static final int STATUS_REPORT_STATUS_ERROR = 2; // 0x2
+ field public static final int STATUS_REPORT_STATUS_OK = 1; // 0x1
+ }
+
+ public class ImsUtImplBase {
+ ctor public ImsUtImplBase();
+ method public void close();
+ method public int queryCFForServiceClass(int, String, int);
+ method public int queryCallBarring(int);
+ method public int queryCallBarringForServiceClass(int, int);
+ method public int queryCallForward(int, String);
+ method public int queryCallWaiting();
+ method public int queryClip();
+ method public int queryClir();
+ method public int queryColp();
+ method public int queryColr();
+ method public void setListener(android.telephony.ims.ImsUtListener);
+ method public int transact(android.os.Bundle);
+ method public int updateCallBarring(int, int, String[]);
+ method public int updateCallBarringForServiceClass(int, int, String[], int);
+ method public int updateCallForward(int, int, String, int, int);
+ method public int updateCallWaiting(boolean, int);
+ method public int updateClip(boolean);
+ method public int updateClir(int);
+ method public int updateColp(boolean);
+ method public int updateColr(int);
+ }
+
+ public class SipTransportImplBase {
+ ctor public SipTransportImplBase(@NonNull java.util.concurrent.Executor);
+ }
+
+}
+
+package android.telephony.mbms {
+
+ public static class DownloadRequest.Builder {
+ method public android.telephony.mbms.DownloadRequest.Builder setServiceId(String);
+ }
+
+ public final class FileInfo implements android.os.Parcelable {
+ ctor public FileInfo(android.net.Uri, String);
+ }
+
+ public final class FileServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
+ ctor public FileServiceInfo(java.util.Map<java.util.Locale,java.lang.String>, String, java.util.List<java.util.Locale>, String, java.util.Date, java.util.Date, java.util.List<android.telephony.mbms.FileInfo>);
+ }
+
+ public class MbmsDownloadReceiver extends android.content.BroadcastReceiver {
+ field public static final int RESULT_APP_NOTIFICATION_ERROR = 6; // 0x6
+ field public static final int RESULT_BAD_TEMP_FILE_ROOT = 3; // 0x3
+ field public static final int RESULT_DOWNLOAD_FINALIZATION_ERROR = 4; // 0x4
+ field public static final int RESULT_INVALID_ACTION = 1; // 0x1
+ field public static final int RESULT_MALFORMED_INTENT = 2; // 0x2
+ field public static final int RESULT_OK = 0; // 0x0
+ field public static final int RESULT_TEMP_FILE_GENERATION_ERROR = 5; // 0x5
+ }
+
+ public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
+ ctor public StreamingServiceInfo(java.util.Map<java.util.Locale,java.lang.String>, String, java.util.List<java.util.Locale>, String, java.util.Date, java.util.Date);
+ }
+
+ public final class UriPathPair implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.net.Uri getContentUri();
+ method public android.net.Uri getFilePathUri();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.mbms.UriPathPair> CREATOR;
+ }
+
+}
+
+package android.telephony.mbms.vendor {
+
+ public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
+ ctor public MbmsDownloadServiceBase();
+ method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
+ method public int addServiceAnnouncement(int, @NonNull byte[]);
+ method public int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
+ method public android.os.IBinder asBinder();
+ method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
+ method public void dispose(int) throws android.os.RemoteException;
+ method public int download(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
+ method public int initialize(int, android.telephony.mbms.MbmsDownloadSessionCallback) throws android.os.RemoteException;
+ method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(int) throws android.os.RemoteException;
+ method public void onAppCallbackDied(int, int);
+ method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
+ method public int removeProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
+ method public int removeStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
+ method public int requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
+ method public int requestUpdateFileServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
+ method public int resetDownloadKnowledge(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
+ method public int setTempFileRootDirectory(int, String) throws android.os.RemoteException;
+ }
+
+ public class MbmsGroupCallServiceBase extends android.app.Service {
+ ctor public MbmsGroupCallServiceBase();
+ method public void dispose(int) throws android.os.RemoteException;
+ method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
+ method public void onAppCallbackDied(int, int);
+ method public android.os.IBinder onBind(android.content.Intent);
+ method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
+ method public void stopGroupCall(int, long);
+ method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
+ }
+
+ public class MbmsStreamingServiceBase extends android.os.Binder implements android.os.IInterface {
+ ctor public MbmsStreamingServiceBase();
+ method public android.os.IBinder asBinder();
+ method public void dispose(int) throws android.os.RemoteException;
+ method @Nullable public android.net.Uri getPlaybackUri(int, String) throws android.os.RemoteException;
+ method public int initialize(android.telephony.mbms.MbmsStreamingSessionCallback, int) throws android.os.RemoteException;
+ method public void onAppCallbackDied(int, int);
+ method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
+ method public int requestUpdateStreamingServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
+ method public int startStreaming(int, String, android.telephony.mbms.StreamingServiceCallback) throws android.os.RemoteException;
+ method public void stopStreaming(int, String) throws android.os.RemoteException;
+ }
+
+ public class VendorUtils {
+ ctor public VendorUtils();
+ method public static android.content.ComponentName getAppReceiverFromPackageName(android.content.Context, String);
+ field public static final String ACTION_CLEANUP = "android.telephony.mbms.action.CLEANUP";
+ field public static final String ACTION_DOWNLOAD_RESULT_INTERNAL = "android.telephony.mbms.action.DOWNLOAD_RESULT_INTERNAL";
+ field public static final String ACTION_FILE_DESCRIPTOR_REQUEST = "android.telephony.mbms.action.FILE_DESCRIPTOR_REQUEST";
+ field public static final String EXTRA_FD_COUNT = "android.telephony.mbms.extra.FD_COUNT";
+ field public static final String EXTRA_FINAL_URI = "android.telephony.mbms.extra.FINAL_URI";
+ field public static final String EXTRA_FREE_URI_LIST = "android.telephony.mbms.extra.FREE_URI_LIST";
+ field public static final String EXTRA_PAUSED_LIST = "android.telephony.mbms.extra.PAUSED_LIST";
+ field public static final String EXTRA_PAUSED_URI_LIST = "android.telephony.mbms.extra.PAUSED_URI_LIST";
+ field public static final String EXTRA_SERVICE_ID = "android.telephony.mbms.extra.SERVICE_ID";
+ field public static final String EXTRA_TEMP_FILES_IN_USE = "android.telephony.mbms.extra.TEMP_FILES_IN_USE";
+ field public static final String EXTRA_TEMP_FILE_ROOT = "android.telephony.mbms.extra.TEMP_FILE_ROOT";
+ field public static final String EXTRA_TEMP_LIST = "android.telephony.mbms.extra.TEMP_LIST";
+ }
+
+}
+
+package android.util {
+
+ public class EventLog {
+ method public static void readEventsOnWrapping(int[], long, java.util.Collection<android.util.EventLog.Event>) throws java.io.IOException;
+ }
+
+ public static final class EventLog.Event {
+ method public int getUid();
+ }
+
+ public final class StatsEvent {
+ method @NonNull public static android.util.StatsEvent.Builder newBuilder();
+ }
+
+ public static final class StatsEvent.Builder {
+ method @NonNull public android.util.StatsEvent.Builder addBooleanAnnotation(byte, boolean);
+ method @NonNull public android.util.StatsEvent.Builder addIntAnnotation(byte, int);
+ method @NonNull public android.util.StatsEvent build();
+ method @NonNull public android.util.StatsEvent.Builder setAtomId(int);
+ method @NonNull public android.util.StatsEvent.Builder usePooledBuffer();
+ method @NonNull public android.util.StatsEvent.Builder writeAttributionChain(@NonNull int[], @NonNull String[]);
+ method @NonNull public android.util.StatsEvent.Builder writeBoolean(boolean);
+ method @NonNull public android.util.StatsEvent.Builder writeByteArray(@NonNull byte[]);
+ method @NonNull public android.util.StatsEvent.Builder writeFloat(float);
+ method @NonNull public android.util.StatsEvent.Builder writeInt(int);
+ method @NonNull public android.util.StatsEvent.Builder writeKeyValuePairs(@Nullable android.util.SparseIntArray, @Nullable android.util.SparseLongArray, @Nullable android.util.SparseArray<java.lang.String>, @Nullable android.util.SparseArray<java.lang.Float>);
+ method @NonNull public android.util.StatsEvent.Builder writeLong(long);
+ method @NonNull public android.util.StatsEvent.Builder writeString(@NonNull String);
+ }
+
+ public final class StatsLog {
+ method public static void write(@NonNull android.util.StatsEvent);
+ method public static void writeRaw(@NonNull byte[], int);
+ }
+
+}
+
+package android.view {
+
+ public abstract class Window {
+ method public void addSystemFlags(@android.view.WindowManager.LayoutParams.SystemFlags int);
+ }
+
+ public interface WindowManager extends android.view.ViewManager {
+ method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public android.graphics.Region getCurrentImeTouchRegion();
+ }
+
+ public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
+ method public final long getUserActivityTimeout();
+ method public final void setUserActivityTimeout(long);
+ field @RequiresPermission(android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS) public static final int SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 524288; // 0x80000
+ field @RequiresPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW) public static final int SYSTEM_FLAG_SHOW_FOR_ALL_USERS = 16; // 0x10
+ }
+
+ @IntDef(flag=true, prefix={"SYSTEM_FLAG_"}, value={android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, android.view.WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface WindowManager.LayoutParams.SystemFlags {
+ }
+
+}
+
+package android.view.accessibility {
+
+ public final class AccessibilityManager {
+ method public int getAccessibilityWindowId(@Nullable android.os.IBinder);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void performAccessibilityShortcut();
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void registerSystemAction(@NonNull android.app.RemoteAction, int);
+ method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void unregisterSystemAction(int);
+ }
+
+}
+
+package android.view.autofill {
+
+ public final class AutofillManager {
+ method public void setAugmentedAutofillWhitelist(@Nullable java.util.Set<java.lang.String>, @Nullable java.util.Set<android.content.ComponentName>);
+ }
+
+}
+
+package android.view.contentcapture {
+
+ public final class ContentCaptureContext implements android.os.Parcelable {
+ method @Nullable public android.content.ComponentName getActivityComponent();
+ method public int getDisplayId();
+ method public int getFlags();
+ method @Nullable public android.view.contentcapture.ContentCaptureSessionId getParentSessionId();
+ method public int getTaskId();
+ field public static final int FLAG_DISABLED_BY_APP = 1; // 0x1
+ field public static final int FLAG_DISABLED_BY_FLAG_SECURE = 2; // 0x2
+ field public static final int FLAG_RECONNECTED = 4; // 0x4
+ }
+
+ public final class ContentCaptureEvent implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public android.view.contentcapture.ContentCaptureContext getContentCaptureContext();
+ method public long getEventTime();
+ method @Nullable public android.view.autofill.AutofillId getId();
+ method @Nullable public java.util.List<android.view.autofill.AutofillId> getIds();
+ method @Nullable public android.graphics.Insets getInsets();
+ method @Nullable public CharSequence getText();
+ method public int getType();
+ method @Nullable public android.view.contentcapture.ViewNode getViewNode();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.view.contentcapture.ContentCaptureEvent> CREATOR;
+ field public static final int TYPE_CONTEXT_UPDATED = 6; // 0x6
+ field public static final int TYPE_SESSION_PAUSED = 8; // 0x8
+ field public static final int TYPE_SESSION_RESUMED = 7; // 0x7
+ field public static final int TYPE_VIEW_APPEARED = 1; // 0x1
+ field public static final int TYPE_VIEW_DISAPPEARED = 2; // 0x2
+ field public static final int TYPE_VIEW_INSETS_CHANGED = 9; // 0x9
+ field public static final int TYPE_VIEW_TEXT_CHANGED = 3; // 0x3
+ field public static final int TYPE_VIEW_TREE_APPEARED = 5; // 0x5
+ field public static final int TYPE_VIEW_TREE_APPEARING = 4; // 0x4
+ }
+
+ public final class ContentCaptureManager {
+ method public boolean isContentCaptureFeatureEnabled();
+ field public static final int NO_SESSION_ID = 0; // 0x0
+ }
+
+ public final class ViewNode extends android.app.assist.AssistStructure.ViewNode {
+ method @Nullable public android.view.autofill.AutofillId getParentAutofillId();
+ }
+
+}
+
+package android.webkit {
+
+ public abstract class CookieManager {
+ method protected abstract boolean allowFileSchemeCookiesImpl();
+ method public abstract String getCookie(String, boolean);
+ method public String getCookie(android.net.WebAddress);
+ method public abstract boolean hasCookies(boolean);
+ method protected abstract void setAcceptFileSchemeCookiesImpl(boolean);
+ }
+
+ public class FindActionModeCallback implements android.view.ActionMode.Callback android.text.TextWatcher android.view.View.OnClickListener android.webkit.WebView.FindListener {
+ ctor public FindActionModeCallback(android.content.Context);
+ method public void afterTextChanged(android.text.Editable);
+ method public void beforeTextChanged(CharSequence, int, int, int);
+ method public void findAll();
+ method public void finish();
+ method public int getActionModeGlobalBottom();
+ method public boolean onActionItemClicked(android.view.ActionMode, android.view.MenuItem);
+ method public void onClick(android.view.View);
+ method public boolean onCreateActionMode(android.view.ActionMode, android.view.Menu);
+ method public void onDestroyActionMode(android.view.ActionMode);
+ method public void onFindResultReceived(int, int, boolean);
+ method public boolean onPrepareActionMode(android.view.ActionMode, android.view.Menu);
+ method public void onTextChanged(CharSequence, int, int, int);
+ method public void setText(String);
+ method public void setWebView(@NonNull android.webkit.WebView);
+ method public void showSoftInput();
+ method public void updateMatchCount(int, int, boolean);
+ }
+
+ public static class FindActionModeCallback.NoAction implements android.view.ActionMode.Callback {
+ ctor public FindActionModeCallback.NoAction();
+ method public boolean onActionItemClicked(android.view.ActionMode, android.view.MenuItem);
+ method public boolean onCreateActionMode(android.view.ActionMode, android.view.Menu);
+ method public void onDestroyActionMode(android.view.ActionMode);
+ method public boolean onPrepareActionMode(android.view.ActionMode, android.view.Menu);
+ }
+
+ public class GeolocationPermissions {
+ ctor public GeolocationPermissions();
+ }
+
+ public class HttpAuthHandler extends android.os.Handler {
+ ctor public HttpAuthHandler();
+ }
+
+ public class JsDialogHelper {
+ ctor public JsDialogHelper(android.webkit.JsPromptResult, int, String, String, String);
+ ctor public JsDialogHelper(android.webkit.JsPromptResult, android.os.Message);
+ method public boolean invokeCallback(android.webkit.WebChromeClient, android.webkit.WebView);
+ method public void showDialog(android.content.Context);
+ field public static final int ALERT = 1; // 0x1
+ field public static final int CONFIRM = 2; // 0x2
+ field public static final int PROMPT = 3; // 0x3
+ field public static final int UNLOAD = 4; // 0x4
+ }
+
+ public class JsPromptResult extends android.webkit.JsResult {
+ ctor public JsPromptResult(android.webkit.JsResult.ResultReceiver);
+ method public String getStringResult();
+ }
+
+ public class JsResult {
+ ctor public JsResult(android.webkit.JsResult.ResultReceiver);
+ method public final boolean getResult();
+ }
+
+ public static interface JsResult.ResultReceiver {
+ method public void onJsResultComplete(android.webkit.JsResult);
+ }
+
+ public interface PacProcessor {
+ method @NonNull public static android.webkit.PacProcessor createInstance();
+ method @Nullable public String findProxyForUrl(@NonNull String);
+ method @NonNull public static android.webkit.PacProcessor getInstance();
+ method @Nullable public default android.net.Network getNetwork();
+ method public default void release();
+ method public default void setNetwork(@Nullable android.net.Network);
+ method public boolean setProxyScript(@NonNull String);
+ }
+
+ public class SslErrorHandler extends android.os.Handler {
+ ctor public SslErrorHandler();
+ }
+
+ @Deprecated public abstract class TokenBindingService {
+ ctor @Deprecated public TokenBindingService();
+ }
+
+ public class WebChromeClient {
+ method @Deprecated public void openFileChooser(android.webkit.ValueCallback<android.net.Uri>, String, String);
+ }
+
+ public abstract class WebHistoryItem implements java.lang.Cloneable {
+ method @Deprecated public abstract int getId();
+ }
+
+ @Deprecated public abstract class WebIconDatabase {
+ method @Deprecated public abstract void bulkRequestIconForPageUrl(android.content.ContentResolver, String, android.webkit.WebIconDatabase.IconListener);
+ }
+
+ public abstract class WebMessagePort {
+ ctor public WebMessagePort();
+ }
+
+ public abstract class WebResourceError {
+ ctor public WebResourceError();
+ }
+
+ public class WebResourceResponse {
+ ctor public WebResourceResponse(boolean, String, String, int, String, java.util.Map<java.lang.String,java.lang.String>, java.io.InputStream);
+ }
+
+ public abstract class WebSettings {
+ method public abstract boolean getAcceptThirdPartyCookies();
+ method @Deprecated public abstract boolean getNavDump();
+ method @Deprecated public abstract boolean getPluginsEnabled();
+ method @Deprecated public abstract boolean getUseWebViewBackgroundForOverscrollBackground();
+ method @Deprecated public abstract int getUserAgent();
+ method public abstract boolean getVideoOverlayForEmbeddedEncryptedVideoEnabled();
+ method public abstract void setAcceptThirdPartyCookies(boolean);
+ method @Deprecated public abstract void setNavDump(boolean);
+ method @Deprecated public abstract void setPluginsEnabled(boolean);
+ method @Deprecated public abstract void setUseWebViewBackgroundForOverscrollBackground(boolean);
+ method @Deprecated public abstract void setUserAgent(int);
+ method public abstract void setVideoOverlayForEmbeddedEncryptedVideoEnabled(boolean);
+ }
+
+ public class WebStorage {
+ ctor public WebStorage();
+ }
+
+ public static class WebStorage.Origin {
+ ctor protected WebStorage.Origin(String, long, long);
+ }
+
+ public class WebView extends android.widget.AbsoluteLayout implements android.view.ViewGroup.OnHierarchyChangeListener android.view.ViewTreeObserver.OnGlobalFocusChangeListener {
+ method public android.webkit.WebViewProvider getWebViewProvider();
+ }
+
+ public static class WebView.HitTestResult {
+ ctor public WebView.HitTestResult();
+ method public void setExtra(String);
+ method public void setType(int);
+ }
+
+ public class WebView.PrivateAccess {
+ ctor public WebView.PrivateAccess();
+ method public void awakenScrollBars(int);
+ method public void awakenScrollBars(int, boolean);
+ method public float getHorizontalScrollFactor();
+ method public int getHorizontalScrollbarHeight();
+ method public float getVerticalScrollFactor();
+ method public void onScrollChanged(int, int, int, int);
+ method public void overScrollBy(int, int, int, int, int, int, int, int, boolean);
+ method public void setMeasuredDimension(int, int);
+ method public void setScrollXRaw(int);
+ method public void setScrollYRaw(int);
+ method public void super_computeScroll();
+ method public boolean super_dispatchKeyEvent(android.view.KeyEvent);
+ method public int super_getScrollBarStyle();
+ method @Nullable public android.view.WindowInsets super_onApplyWindowInsets(@Nullable android.view.WindowInsets);
+ method public void super_onDrawVerticalScrollBar(android.graphics.Canvas, android.graphics.drawable.Drawable, int, int, int, int);
+ method public boolean super_onGenericMotionEvent(android.view.MotionEvent);
+ method public boolean super_onHoverEvent(android.view.MotionEvent);
+ method public boolean super_performAccessibilityAction(int, android.os.Bundle);
+ method public boolean super_performLongClick();
+ method public boolean super_requestFocus(int, android.graphics.Rect);
+ method public void super_scrollTo(int, int);
+ method public boolean super_setFrame(int, int, int, int);
+ method public void super_setLayoutParams(android.view.ViewGroup.LayoutParams);
+ method public void super_startActivityForResult(android.content.Intent, int);
+ }
+
+ public final class WebViewDelegate {
+ method public void addWebViewAssetPath(android.content.Context);
+ method @Deprecated public void callDrawGlFunction(android.graphics.Canvas, long);
+ method @Deprecated public void callDrawGlFunction(@NonNull android.graphics.Canvas, long, @Nullable Runnable);
+ method @Deprecated public boolean canInvokeDrawGlFunctor(android.view.View);
+ method @Deprecated public void detachDrawGlFunctor(android.view.View, long);
+ method public void drawWebViewFunctor(@NonNull android.graphics.Canvas, int);
+ method public android.app.Application getApplication();
+ method public String getDataDirectorySuffix();
+ method public String getErrorString(android.content.Context, int);
+ method public int getPackageId(android.content.res.Resources, String);
+ method @Deprecated public void invokeDrawGlFunctor(android.view.View, long, boolean);
+ method public boolean isMultiProcessEnabled();
+ method public boolean isTraceTagEnabled();
+ method public void setOnTraceEnabledChangeListener(android.webkit.WebViewDelegate.OnTraceEnabledChangeListener);
+ }
+
+ public static interface WebViewDelegate.OnTraceEnabledChangeListener {
+ method public void onTraceEnabledChange(boolean);
+ }
+
+ public final class WebViewFactory {
+ ctor public WebViewFactory();
+ method public static android.content.pm.PackageInfo getLoadedPackageInfo();
+ method public static int loadWebViewNativeLibraryFromPackage(String, ClassLoader);
+ method public static void prepareWebViewInZygote();
+ field public static final int LIBLOAD_ADDRESS_SPACE_NOT_RESERVED = 2; // 0x2
+ field public static final int LIBLOAD_FAILED_JNI_CALL = 7; // 0x7
+ field public static final int LIBLOAD_FAILED_LISTING_WEBVIEW_PACKAGES = 4; // 0x4
+ field public static final int LIBLOAD_FAILED_TO_FIND_NAMESPACE = 10; // 0xa
+ field public static final int LIBLOAD_FAILED_TO_LOAD_LIBRARY = 6; // 0x6
+ field public static final int LIBLOAD_FAILED_TO_OPEN_RELRO_FILE = 5; // 0x5
+ field public static final int LIBLOAD_FAILED_WAITING_FOR_RELRO = 3; // 0x3
+ field public static final int LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN = 8; // 0x8
+ field public static final int LIBLOAD_SUCCESS = 0; // 0x0
+ field public static final int LIBLOAD_WRONG_PACKAGE_NAME = 1; // 0x1
+ }
+
+ public interface WebViewFactoryProvider {
+ method @NonNull public default android.webkit.PacProcessor createPacProcessor();
+ method public android.webkit.WebViewProvider createWebView(android.webkit.WebView, android.webkit.WebView.PrivateAccess);
+ method public android.webkit.CookieManager getCookieManager();
+ method public android.webkit.GeolocationPermissions getGeolocationPermissions();
+ method @NonNull public default android.webkit.PacProcessor getPacProcessor();
+ method public android.webkit.ServiceWorkerController getServiceWorkerController();
+ method public android.webkit.WebViewFactoryProvider.Statics getStatics();
+ method @Deprecated public android.webkit.TokenBindingService getTokenBindingService();
+ method public android.webkit.TracingController getTracingController();
+ method public android.webkit.WebIconDatabase getWebIconDatabase();
+ method public android.webkit.WebStorage getWebStorage();
+ method public ClassLoader getWebViewClassLoader();
+ method public android.webkit.WebViewDatabase getWebViewDatabase(android.content.Context);
+ }
+
+ public static interface WebViewFactoryProvider.Statics {
+ method public void clearClientCertPreferences(Runnable);
+ method public void enableSlowWholeDocumentDraw();
+ method public String findAddress(String);
+ method public void freeMemoryForTests();
+ method public String getDefaultUserAgent(android.content.Context);
+ method @NonNull public android.net.Uri getSafeBrowsingPrivacyPolicyUrl();
+ method public void initSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>);
+ method public android.net.Uri[] parseFileChooserResult(int, android.content.Intent);
+ method public void setSafeBrowsingWhitelist(java.util.List<java.lang.String>, android.webkit.ValueCallback<java.lang.Boolean>);
+ method public void setWebContentsDebuggingEnabled(boolean);
+ }
+
+ public interface WebViewProvider {
+ method public void addJavascriptInterface(Object, String);
+ method public boolean canGoBack();
+ method public boolean canGoBackOrForward(int);
+ method public boolean canGoForward();
+ method public boolean canZoomIn();
+ method public boolean canZoomOut();
+ method public android.graphics.Picture capturePicture();
+ method public void clearCache(boolean);
+ method public void clearFormData();
+ method public void clearHistory();
+ method public void clearMatches();
+ method public void clearSslPreferences();
+ method public void clearView();
+ method public android.webkit.WebBackForwardList copyBackForwardList();
+ method public android.print.PrintDocumentAdapter createPrintDocumentAdapter(String);
+ method public android.webkit.WebMessagePort[] createWebMessageChannel();
+ method public void destroy();
+ method public void documentHasImages(android.os.Message);
+ method public void dumpViewHierarchyWithProperties(java.io.BufferedWriter, int);
+ method public void evaluateJavaScript(String, android.webkit.ValueCallback<java.lang.String>);
+ method public int findAll(String);
+ method public void findAllAsync(String);
+ method public android.view.View findHierarchyView(String, int);
+ method public void findNext(boolean);
+ method public void flingScroll(int, int);
+ method public void freeMemory();
+ method public android.net.http.SslCertificate getCertificate();
+ method public int getContentHeight();
+ method public int getContentWidth();
+ method public android.graphics.Bitmap getFavicon();
+ method public android.webkit.WebView.HitTestResult getHitTestResult();
+ method public String[] getHttpAuthUsernamePassword(String, String);
+ method public String getOriginalUrl();
+ method public int getProgress();
+ method public boolean getRendererPriorityWaivedWhenNotVisible();
+ method public int getRendererRequestedPriority();
+ method public float getScale();
+ method public android.webkit.WebViewProvider.ScrollDelegate getScrollDelegate();
+ method public android.webkit.WebSettings getSettings();
+ method @NonNull public default android.view.textclassifier.TextClassifier getTextClassifier();
+ method public String getTitle();
+ method public String getTouchIconUrl();
+ method public String getUrl();
+ method public android.webkit.WebViewProvider.ViewDelegate getViewDelegate();
+ method public int getVisibleTitleHeight();
+ method public android.webkit.WebChromeClient getWebChromeClient();
+ method public android.webkit.WebViewClient getWebViewClient();
+ method @Nullable public android.webkit.WebViewRenderProcess getWebViewRenderProcess();
+ method @Nullable public android.webkit.WebViewRenderProcessClient getWebViewRenderProcessClient();
+ method public android.view.View getZoomControls();
+ method public void goBack();
+ method public void goBackOrForward(int);
+ method public void goForward();
+ method public void init(java.util.Map<java.lang.String,java.lang.Object>, boolean);
+ method public void insertVisualStateCallback(long, android.webkit.WebView.VisualStateCallback);
+ method public void invokeZoomPicker();
+ method public boolean isPaused();
+ method public boolean isPrivateBrowsingEnabled();
+ method public void loadData(String, String, String);
+ method public void loadDataWithBaseURL(String, String, String, String, String);
+ method public void loadUrl(String, java.util.Map<java.lang.String,java.lang.String>);
+ method public void loadUrl(String);
+ method public void notifyFindDialogDismissed();
+ method public void onPause();
+ method public void onResume();
+ method public boolean overlayHorizontalScrollbar();
+ method public boolean overlayVerticalScrollbar();
+ method public boolean pageDown(boolean);
+ method public boolean pageUp(boolean);
+ method public void pauseTimers();
+ method public void postMessageToMainFrame(android.webkit.WebMessage, android.net.Uri);
+ method public void postUrl(String, byte[]);
+ method public void reload();
+ method public void removeJavascriptInterface(String);
+ method public void requestFocusNodeHref(android.os.Message);
+ method public void requestImageRef(android.os.Message);
+ method public boolean restorePicture(android.os.Bundle, java.io.File);
+ method public android.webkit.WebBackForwardList restoreState(android.os.Bundle);
+ method public void resumeTimers();
+ method public void savePassword(String, String, String);
+ method public boolean savePicture(android.os.Bundle, java.io.File);
+ method public android.webkit.WebBackForwardList saveState(android.os.Bundle);
+ method public void saveWebArchive(String);
+ method public void saveWebArchive(String, boolean, android.webkit.ValueCallback<java.lang.String>);
+ method public void setCertificate(android.net.http.SslCertificate);
+ method public void setDownloadListener(android.webkit.DownloadListener);
+ method public void setFindListener(android.webkit.WebView.FindListener);
+ method public void setHorizontalScrollbarOverlay(boolean);
+ method public void setHttpAuthUsernamePassword(String, String, String, String);
+ method public void setInitialScale(int);
+ method public void setMapTrackballToArrowKeys(boolean);
+ method public void setNetworkAvailable(boolean);
+ method public void setPictureListener(android.webkit.WebView.PictureListener);
+ method public void setRendererPriorityPolicy(int, boolean);
+ method public default void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier);
+ method public void setVerticalScrollbarOverlay(boolean);
+ method public void setWebChromeClient(android.webkit.WebChromeClient);
+ method public void setWebViewClient(android.webkit.WebViewClient);
+ method public void setWebViewRenderProcessClient(@Nullable java.util.concurrent.Executor, @Nullable android.webkit.WebViewRenderProcessClient);
+ method public boolean showFindDialog(String, boolean);
+ method public void stopLoading();
+ method public boolean zoomBy(float);
+ method public boolean zoomIn();
+ method public boolean zoomOut();
+ }
+
+ public static interface WebViewProvider.ScrollDelegate {
+ method public int computeHorizontalScrollOffset();
+ method public int computeHorizontalScrollRange();
+ method public void computeScroll();
+ method public int computeVerticalScrollExtent();
+ method public int computeVerticalScrollOffset();
+ method public int computeVerticalScrollRange();
+ }
+
+ public static interface WebViewProvider.ViewDelegate {
+ method public default void autofill(android.util.SparseArray<android.view.autofill.AutofillValue>);
+ method public boolean dispatchKeyEvent(android.view.KeyEvent);
+ method public android.view.View findFocus(android.view.View);
+ method public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider();
+ method public android.os.Handler getHandler(android.os.Handler);
+ method public default boolean isVisibleToUserForAutofill(int);
+ method public void onActivityResult(int, int, android.content.Intent);
+ method @Nullable public default android.view.WindowInsets onApplyWindowInsets(@Nullable android.view.WindowInsets);
+ method public void onAttachedToWindow();
+ method public default boolean onCheckIsTextEditor();
+ method public void onConfigurationChanged(android.content.res.Configuration);
+ method public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo);
+ method public void onDetachedFromWindow();
+ method public boolean onDragEvent(android.view.DragEvent);
+ method public void onDraw(android.graphics.Canvas);
+ method public void onDrawVerticalScrollBar(android.graphics.Canvas, android.graphics.drawable.Drawable, int, int, int, int);
+ method public void onFinishTemporaryDetach();
+ method public void onFocusChanged(boolean, int, android.graphics.Rect);
+ method public boolean onGenericMotionEvent(android.view.MotionEvent);
+ method public boolean onHoverEvent(android.view.MotionEvent);
+ method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
+ method public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo);
+ method public boolean onKeyDown(int, android.view.KeyEvent);
+ method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
+ method public boolean onKeyUp(int, android.view.KeyEvent);
+ method public void onMeasure(int, int);
+ method public default void onMovedToDisplay(int, android.content.res.Configuration);
+ method public void onOverScrolled(int, int, boolean, boolean);
+ method public default void onProvideAutofillVirtualStructure(android.view.ViewStructure, int);
+ method public default void onProvideContentCaptureStructure(@NonNull android.view.ViewStructure, int);
+ method public void onProvideVirtualStructure(android.view.ViewStructure);
+ method public void onScrollChanged(int, int, int, int);
+ method public void onSizeChanged(int, int, int, int);
+ method public void onStartTemporaryDetach();
+ method public boolean onTouchEvent(android.view.MotionEvent);
+ method public boolean onTrackballEvent(android.view.MotionEvent);
+ method public void onVisibilityChanged(android.view.View, int);
+ method public void onWindowFocusChanged(boolean);
+ method public void onWindowVisibilityChanged(int);
+ method public boolean performAccessibilityAction(int, android.os.Bundle);
+ method public boolean performLongClick();
+ method public void preDispatchDraw(android.graphics.Canvas);
+ method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
+ method public boolean requestFocus(int, android.graphics.Rect);
+ method public void setBackgroundColor(int);
+ method public boolean setFrame(int, int, int, int);
+ method public void setLayerType(int, android.graphics.Paint);
+ method public void setLayoutParams(android.view.ViewGroup.LayoutParams);
+ method public void setOverScrollMode(int);
+ method public void setScrollBarStyle(int);
+ method public boolean shouldDelayChildPressedState();
+ }
+
+ public final class WebViewProviderInfo implements android.os.Parcelable {
+ ctor public WebViewProviderInfo(String, String, boolean, boolean, String[]);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.webkit.WebViewProviderInfo> CREATOR;
+ field public final boolean availableByDefault;
+ field public final String description;
+ field public final boolean isFallback;
+ field public final String packageName;
+ field public final android.content.pm.Signature[] signatures;
+ }
+
+ public final class WebViewUpdateService {
+ method public static android.webkit.WebViewProviderInfo[] getAllWebViewPackages();
+ method public static String getCurrentWebViewPackageName();
+ method public static android.webkit.WebViewProviderInfo[] getValidWebViewPackages();
+ }
+
+}
+
diff --git a/api/system-lint-baseline.txt b/api/system-lint-baseline.txt
new file mode 100644
index 000000000000..cb885296e72a
--- /dev/null
+++ b/api/system-lint-baseline.txt
@@ -0,0 +1,571 @@
+// Baseline format: 1.0
+AcronymName: android.net.NetworkCapabilities#setSSID(String):
+
+
+
+AcronymName: android.telephony.ims.stub.ImsUtImplBase#queryCFForServiceClass(int, String, int):
+ Acronyms should not be capitalized in method names: was `queryCFForServiceClass`, should this be `queryCfForServiceClass`?
+
+
+ActionValue: android.location.Location#EXTRA_NO_GPS_LOCATION:
+
+ActionValue: android.net.wifi.WifiManager#ACTION_LINK_CONFIGURATION_CHANGED:
+
+ActionValue: android.net.wifi.WifiManager#EXTRA_WIFI_AP_FAILURE_DESCRIPTION:
+ Inconsistent extra value; expected `android.net.wifi.extra.WIFI_AP_FAILURE_DESCRIPTION`, was `wifi_ap_error_description`
+
+ActionValue: android.net.TetheringManager#ACTION_TETHER_STATE_CHANGED:
+
+ActionValue: android.net.TetheringManager#EXTRA_ACTIVE_TETHER:
+
+ActionValue: android.net.TetheringManager#EXTRA_AVAILABLE_TETHER:
+
+ActionValue: android.net.TetheringManager#EXTRA_ERRORED_TETHER:
+
+ActionValue: android.net.wifi.WifiManager#ACTION_LINK_CONFIGURATION_CHANGED:
+
+
+
+ArrayReturn: android.bluetooth.BluetoothCodecStatus#BluetoothCodecStatus(android.bluetooth.BluetoothCodecConfig, android.bluetooth.BluetoothCodecConfig[], android.bluetooth.BluetoothCodecConfig[]) parameter #1:
+
+ArrayReturn: android.bluetooth.BluetoothCodecStatus#BluetoothCodecStatus(android.bluetooth.BluetoothCodecConfig, android.bluetooth.BluetoothCodecConfig[], android.bluetooth.BluetoothCodecConfig[]) parameter #2:
+
+ArrayReturn: android.bluetooth.BluetoothCodecStatus#getCodecsLocalCapabilities():
+
+ArrayReturn: android.bluetooth.BluetoothCodecStatus#getCodecsSelectableCapabilities():
+
+ArrayReturn: android.bluetooth.BluetoothUuid#containsAnyUuid(android.os.ParcelUuid[], android.os.ParcelUuid[]) parameter #0:
+
+ArrayReturn: android.bluetooth.BluetoothUuid#containsAnyUuid(android.os.ParcelUuid[], android.os.ParcelUuid[]) parameter #1:
+
+ArrayReturn: android.media.tv.tuner.Tuner.FilterCallback#onFilterEvent(android.media.tv.tuner.Tuner.Filter, android.media.tv.tuner.filter.FilterEvent[]) parameter #1:
+
+ArrayReturn: android.net.NetworkScoreManager#requestScores(android.net.NetworkKey[]) parameter #0:
+
+ArrayReturn: android.view.contentcapture.ViewNode#getAutofillOptions():
+
+
+
+BuilderSetStyle: android.net.IpSecTransform.Builder#buildTunnelModeTransform(java.net.InetAddress, android.net.IpSecManager.SecurityParameterIndex):
+ Builder methods names should use setFoo() / addFoo() / clearFoo() style: method android.net.IpSecTransform.Builder.buildTunnelModeTransform(java.net.InetAddress,android.net.IpSecManager.SecurityParameterIndex)
+
+
+ExecutorRegistration: android.media.MediaPlayer#setOnImsRxNoticeListener(android.media.MediaPlayer.OnImsRxNoticeListener, android.os.Handler):
+ Registration methods should have overload that accepts delivery Executor: `setOnImsRxNoticeListener`
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#deletePersistentGroup(android.net.wifi.p2p.WifiP2pManager.Channel, int, android.net.wifi.p2p.WifiP2pManager.ActionListener):
+
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#factoryReset(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.ActionListener):
+
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#listen(android.net.wifi.p2p.WifiP2pManager.Channel, boolean, android.net.wifi.p2p.WifiP2pManager.ActionListener):
+
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#requestPersistentGroupInfo(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pManager.PersistentGroupInfoListener):
+
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#setDeviceName(android.net.wifi.p2p.WifiP2pManager.Channel, String, android.net.wifi.p2p.WifiP2pManager.ActionListener):
+
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#setWfdInfo(android.net.wifi.p2p.WifiP2pManager.Channel, android.net.wifi.p2p.WifiP2pWfdInfo, android.net.wifi.p2p.WifiP2pManager.ActionListener):
+
+ExecutorRegistration: android.net.wifi.p2p.WifiP2pManager#setWifiP2pChannels(android.net.wifi.p2p.WifiP2pManager.Channel, int, int, android.net.wifi.p2p.WifiP2pManager.ActionListener):
+
+
+
+GenericException: android.app.prediction.AppPredictor#finalize():
+
+GenericException: android.hardware.location.ContextHubClient#finalize():
+
+GenericException: android.net.IpSecManager.IpSecTunnelInterface#finalize():
+
+GenericException: android.service.autofill.augmented.FillWindow#finalize():
+
+
+
+IntentBuilderName: android.content.Context#registerReceiverForAllUsers(android.content.BroadcastReceiver, android.content.IntentFilter, String, android.os.Handler):
+
+
+
+IntentName: android.net.wifi.WifiManager#WIFI_COUNTRY_CODE_CHANGED_ACTION:
+ Intent action constant name must be ACTION_FOO: WIFI_COUNTRY_CODE_CHANGED_ACTION
+
+
+KotlinKeyword: android.app.Notification#when:
+
+
+
+KotlinOperator: android.telephony.CbGeoUtils.Geometry#contains(android.telephony.CbGeoUtils.LatLng):
+
+
+
+MissingGetterMatchingBuilder: android.net.wifi.rtt.RangingRequest.Builder#addResponder(android.net.wifi.rtt.ResponderConfig):
+ android.net.wifi.rtt.RangingRequest does not declare a `getResponders()` method matching method android.net.wifi.rtt.RangingRequest.Builder.addResponder(android.net.wifi.rtt.ResponderConfig)
+MissingGetterMatchingBuilder: android.security.keystore.KeyGenParameterSpec.Builder#setUid(int):
+ android.security.keystore.KeyGenParameterSpec does not declare a `getUid()` method matching method android.security.keystore.KeyGenParameterSpec.Builder.setUid(int)
+MissingGetterMatchingBuilder: android.service.autofill.Dataset.Builder#setFieldInlinePresentation(android.view.autofill.AutofillId, android.view.autofill.AutofillValue, java.util.regex.Pattern, android.service.autofill.InlinePresentation):
+ android.service.autofill.Dataset does not declare a `getFieldInlinePresentation()` method matching method android.service.autofill.Dataset.Builder.setFieldInlinePresentation(android.view.autofill.AutofillId,android.view.autofill.AutofillValue,java.util.regex.Pattern,android.service.autofill.InlinePresentation)
+MissingGetterMatchingBuilder: android.telecom.CallScreeningService.CallResponse.Builder#setShouldScreenCallViaAudioProcessing(boolean):
+ android.telecom.CallScreeningService.CallResponse does not declare a `shouldScreenCallViaAudioProcessing()` method matching method android.telecom.CallScreeningService.CallResponse.Builder.setShouldScreenCallViaAudioProcessing(boolean)
+MissingGetterMatchingBuilder: android.telephony.mbms.DownloadRequest.Builder#setServiceId(String):
+ android.telephony.mbms.DownloadRequest does not declare a `getServiceId()` method matching method android.telephony.mbms.DownloadRequest.Builder.setServiceId(String)
+
+
+MissingNullability: android.hardware.soundtrigger.SoundTrigger.ModuleProperties#toString():
+
+MissingNullability: android.hardware.soundtrigger.SoundTrigger.ModuleProperties#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.media.session.MediaSessionManager.Callback#onAddressedPlayerChanged(android.content.ComponentName) parameter #0:
+
+MissingNullability: android.media.session.MediaSessionManager.Callback#onAddressedPlayerChanged(android.media.session.MediaSession.Token) parameter #0:
+
+MissingNullability: android.media.session.MediaSessionManager.Callback#onMediaKeyEventDispatched(android.view.KeyEvent, android.content.ComponentName) parameter #0:
+
+MissingNullability: android.media.session.MediaSessionManager.Callback#onMediaKeyEventDispatched(android.view.KeyEvent, android.content.ComponentName) parameter #1:
+
+MissingNullability: android.media.session.MediaSessionManager.Callback#onMediaKeyEventDispatched(android.view.KeyEvent, android.media.session.MediaSession.Token) parameter #0:
+
+MissingNullability: android.media.session.MediaSessionManager.Callback#onMediaKeyEventDispatched(android.view.KeyEvent, android.media.session.MediaSession.Token) parameter #1:
+
+MissingNullability: android.media.soundtrigger.SoundTriggerDetectionService#onUnbind(android.content.Intent) parameter #0:
+
+MissingNullability: android.media.tv.TvRecordingClient.RecordingCallback#onEvent(String, String, android.os.Bundle) parameter #0:
+
+MissingNullability: android.media.tv.TvRecordingClient.RecordingCallback#onEvent(String, String, android.os.Bundle) parameter #1:
+
+MissingNullability: android.media.tv.TvRecordingClient.RecordingCallback#onEvent(String, String, android.os.Bundle) parameter #2:
+
+MissingNullability: android.net.wifi.rtt.RangingRequest.Builder#addResponder(android.net.wifi.rtt.ResponderConfig):
+
+MissingNullability: android.printservice.recommendation.RecommendationService#attachBaseContext(android.content.Context) parameter #0:
+
+MissingNullability: android.provider.ContactsContract.MetadataSync#CONTENT_URI:
+
+MissingNullability: android.provider.ContactsContract.MetadataSync#METADATA_AUTHORITY_URI:
+
+MissingNullability: android.provider.ContactsContract.MetadataSyncState#CONTENT_URI:
+
+MissingNullability: android.provider.SearchIndexablesProvider#attachInfo(android.content.Context, android.content.pm.ProviderInfo) parameter #0:
+
+MissingNullability: android.provider.SearchIndexablesProvider#attachInfo(android.content.Context, android.content.pm.ProviderInfo) parameter #1:
+
+MissingNullability: android.service.autofill.augmented.AugmentedAutofillService#onUnbind(android.content.Intent) parameter #0:
+
+MissingNullability: android.service.contentcapture.ContentCaptureService#dump(java.io.FileDescriptor, java.io.PrintWriter, String[]) parameter #0:
+
+MissingNullability: android.service.contentcapture.ContentCaptureService#dump(java.io.FileDescriptor, java.io.PrintWriter, String[]) parameter #1:
+
+MissingNullability: android.service.contentcapture.ContentCaptureService#dump(java.io.FileDescriptor, java.io.PrintWriter, String[]) parameter #2:
+
+MissingNullability: android.service.notification.NotificationAssistantService#attachBaseContext(android.content.Context) parameter #0:
+
+MissingNullability: android.telecom.CallScreeningService.CallResponse.Builder#setShouldScreenCallFurther(boolean):
+
+MissingNullability: android.telephony.CallerInfo#toString():
+
+MissingNullability: android.telephony.CellBroadcastService#onBind(android.content.Intent):
+
+MissingNullability: android.telephony.CellBroadcastService#onBind(android.content.Intent) parameter #0:
+
+MissingNullability: android.telephony.CellBroadcastService#onCdmaCellBroadcastSms(int, byte[]) parameter #1:
+
+MissingNullability: android.telephony.CellBroadcastService#onCdmaCellBroadcastSms(int, byte[], int) parameter #1:
+
+MissingNullability: android.telephony.CellBroadcastService#onGsmCellBroadcastSms(int, byte[]) parameter #1:
+
+MissingNullability: android.telephony.ModemActivityInfo#toString():
+
+MissingNullability: android.telephony.ModemActivityInfo#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.telephony.NetworkService#onUnbind(android.content.Intent) parameter #0:
+
+MissingNullability: android.telephony.SmsCbCmasInfo#toString():
+
+MissingNullability: android.telephony.SmsCbCmasInfo#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.telephony.SmsCbEtwsInfo#toString():
+
+MissingNullability: android.telephony.SmsCbEtwsInfo#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.telephony.SmsCbLocation#equals(Object) parameter #0:
+
+MissingNullability: android.telephony.SmsCbLocation#toString():
+
+MissingNullability: android.telephony.SmsCbLocation#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.telephony.SmsCbMessage#toString():
+
+MissingNullability: android.telephony.SmsCbMessage#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.telephony.SubscriptionPlan.Builder#createRecurringDaily(java.time.ZonedDateTime) parameter #0:
+
+MissingNullability: android.telephony.SubscriptionPlan.Builder#createRecurringMonthly(java.time.ZonedDateTime) parameter #0:
+
+MissingNullability: android.telephony.SubscriptionPlan.Builder#createRecurringWeekly(java.time.ZonedDateTime) parameter #0:
+
+MissingNullability: android.telephony.cdma.CdmaSmsCbProgramData#toString():
+
+MissingNullability: android.telephony.cdma.CdmaSmsCbProgramData#writeToParcel(android.os.Parcel, int) parameter #0:
+
+MissingNullability: android.telephony.data.DataService#onUnbind(android.content.Intent) parameter #0:
+
+MissingNullability: android.telephony.ims.stub.ImsSmsImplBase#onSmsStatusReportReceived(int, String, byte[]) parameter #1:
+
+MissingNullability: android.telephony.ims.stub.ImsSmsImplBase#onSmsStatusReportReceived(int, String, byte[]) parameter #2:
+
+MissingNullability: android.telephony.ims.stub.ImsUtImplBase#queryCFForServiceClass(int, String, int) parameter #1:
+ Missing nullability on parameter `number` in method `queryCFForServiceClass`
+MissingNullability: android.telephony.mbms.DownloadRequest.Builder#setServiceId(String):
+
+MissingNullability: android.telephony.mbms.DownloadRequest.Builder#setServiceId(String) parameter #0:
+
+
+
+MutableBareField: android.net.IpConfiguration#httpProxy:
+
+MutableBareField: android.net.IpConfiguration#ipAssignment:
+
+MutableBareField: android.net.IpConfiguration#proxySettings:
+
+MutableBareField: android.net.IpConfiguration#staticIpConfiguration:
+
+MutableBareField: android.net.wifi.WifiConfiguration#allowAutojoin:
+
+MutableBareField: android.net.wifi.WifiConfiguration#carrierId:
+
+MutableBareField: android.net.wifi.WifiConfiguration#fromWifiNetworkSpecifier:
+
+MutableBareField: android.net.wifi.WifiConfiguration#fromWifiNetworkSuggestion:
+
+MutableBareField: android.net.wifi.WifiConfiguration#macRandomizationSetting:
+
+MutableBareField: android.net.wifi.WifiConfiguration#meteredOverride:
+
+MutableBareField: android.net.wifi.WifiConfiguration#requirePmf:
+
+MutableBareField: android.net.wifi.WifiConfiguration#saePasswordId:
+
+MutableBareField: android.net.wifi.WifiConfiguration#shareThisAp:
+
+MutableBareField: android.net.wifi.WifiConfiguration#shared:
+
+MutableBareField: android.net.wifi.WifiConfiguration#subscriptionId:
+ Bare field subscriptionId must be marked final, or moved behind accessors if mutable
+
+MutableBareField: android.net.wifi.WifiScanner.ScanSettings#type:
+
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#htSupport2g:
+ Bare field htSupport2g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#htSupport5g:
+ Bare field htSupport5g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#sapHeSupport2g:
+ Bare field sapHeSupport2g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#sapHeSupport5g:
+ Bare field sapHeSupport5g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#staHeSupport2g:
+ Bare field staHeSupport2g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#staHeSupport5g:
+ Bare field staHeSupport5g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#vhtSupport2g:
+ Bare field vhtSupport2g must be marked final, or moved behind accessors if mutable
+MutableBareField: android.net.wifi.wificond.WifiNl80211Manager.WifiGenerationCapabilities#vhtSupport5g:
+ Bare field vhtSupport5g must be marked final, or moved behind accessors if mutable
+
+
+NoClone: android.service.contentcapture.ContentCaptureService#dump(java.io.FileDescriptor, java.io.PrintWriter, String[]) parameter #0:
+
+
+
+NoSettingsProvider: android.provider.Settings.Global#TETHER_OFFLOAD_DISABLED:
+
+NoSettingsProvider: android.provider.Settings.Global#TETHER_SUPPORTED:
+
+
+
+NotCloseable: android.bluetooth.BluetoothA2dpSink:
+
+NotCloseable: android.bluetooth.BluetoothMap:
+
+NotCloseable: android.bluetooth.BluetoothPan:
+
+NotCloseable: android.bluetooth.BluetoothPbap:
+
+
+
+OnNameExpected: android.content.ContentProvider#checkUriPermission(android.net.Uri, int, int):
+
+
+
+PairedRegistration: android.net.wifi.nl80211.WifiNl80211Manager#registerApCallback(String, java.util.concurrent.Executor, android.net.wifi.nl80211.WifiNl80211Manager.SoftApCallback):
+
+
+
+ProtectedMember: android.printservice.recommendation.RecommendationService#attachBaseContext(android.content.Context):
+
+ProtectedMember: android.service.contentcapture.ContentCaptureService#dump(java.io.FileDescriptor, java.io.PrintWriter, String[]):
+
+ProtectedMember: android.service.notification.NotificationAssistantService#attachBaseContext(android.content.Context):
+
+
+
+SamShouldBeLast: android.accounts.AccountManager#addAccount(String, String, String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean):
+
+SamShouldBeLast: android.accounts.AccountManager#addOnAccountsUpdatedListener(android.accounts.OnAccountsUpdateListener, android.os.Handler, boolean, String[]):
+
+SamShouldBeLast: android.accounts.AccountManager#confirmCredentials(android.accounts.Account, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#editProperties(String, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#finishSession(android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#getAccountsByTypeAndFeatures(String, String[], android.accounts.AccountManagerCallback<android.accounts.Account[]>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#getAuthToken(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#getAuthToken(android.accounts.Account, String, android.os.Bundle, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#getAuthToken(android.accounts.Account, String, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#getAuthTokenByFeatures(String, String, String[], android.app.Activity, android.os.Bundle, android.os.Bundle, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#hasFeatures(android.accounts.Account, String[], android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#isCredentialsUpdateSuggested(android.accounts.Account, String, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#removeAccount(android.accounts.Account, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#removeAccount(android.accounts.Account, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#renameAccount(android.accounts.Account, String, android.accounts.AccountManagerCallback<android.accounts.Account>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#startAddAccountSession(String, String, String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#startUpdateCredentialsSession(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.accounts.AccountManager#updateCredentials(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
+
+SamShouldBeLast: android.app.AlarmManager#set(int, long, String, android.app.AlarmManager.OnAlarmListener, android.os.Handler):
+
+SamShouldBeLast: android.app.AlarmManager#setExact(int, long, String, android.app.AlarmManager.OnAlarmListener, android.os.Handler):
+
+SamShouldBeLast: android.app.AlarmManager#setWindow(int, long, long, String, android.app.AlarmManager.OnAlarmListener, android.os.Handler):
+
+SamShouldBeLast: android.app.WallpaperInfo#dump(android.util.Printer, String):
+
+SamShouldBeLast: android.app.WallpaperManager#addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler):
+
+SamShouldBeLast: android.app.admin.DevicePolicyManager#installSystemUpdate(android.content.ComponentName, android.net.Uri, java.util.concurrent.Executor, android.app.admin.DevicePolicyManager.InstallSystemUpdateCallback):
+
+SamShouldBeLast: android.content.Context#bindIsolatedService(android.content.Intent, int, String, java.util.concurrent.Executor, android.content.ServiceConnection):
+
+SamShouldBeLast: android.content.Context#bindService(android.content.Intent, int, java.util.concurrent.Executor, android.content.ServiceConnection):
+
+SamShouldBeLast: android.content.ContextWrapper#bindIsolatedService(android.content.Intent, int, String, java.util.concurrent.Executor, android.content.ServiceConnection):
+
+SamShouldBeLast: android.content.ContextWrapper#bindService(android.content.Intent, int, java.util.concurrent.Executor, android.content.ServiceConnection):
+
+SamShouldBeLast: android.content.IntentFilter#dump(android.util.Printer, String):
+
+SamShouldBeLast: android.content.pm.ApplicationInfo#dump(android.util.Printer, String):
+
+SamShouldBeLast: android.content.pm.LauncherApps#registerPackageInstallerSessionCallback(java.util.concurrent.Executor, android.content.pm.PackageInstaller.SessionCallback):
+
+SamShouldBeLast: android.content.pm.PackageItemInfo#dumpBack(android.util.Printer, String):
+
+SamShouldBeLast: android.content.pm.PackageItemInfo#dumpFront(android.util.Printer, String):
+
+SamShouldBeLast: android.content.pm.ResolveInfo#dump(android.util.Printer, String):
+
+SamShouldBeLast: android.location.Location#dump(android.util.Printer, String):
+
+SamShouldBeLast: android.location.LocationManager#addNmeaListener(android.location.OnNmeaMessageListener, android.os.Handler):
+
+SamShouldBeLast: android.location.LocationManager#registerGnssMeasurementsCallback(java.util.concurrent.Executor, android.location.GnssMeasurementsEvent.Callback):
+
+SamShouldBeLast: android.location.LocationManager#registerGnssNavigationMessageCallback(java.util.concurrent.Executor, android.location.GnssNavigationMessage.Callback):
+
+SamShouldBeLast: android.location.LocationManager#registerGnssStatusCallback(java.util.concurrent.Executor, android.location.GnssStatus.Callback):
+
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, android.location.LocationListener, android.os.Looper):
+
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(String, long, float, java.util.concurrent.Executor, android.location.LocationListener):
+
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(android.location.LocationRequest, java.util.concurrent.Executor, android.location.LocationListener):
+
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, android.location.LocationListener, android.os.Looper):
+
+SamShouldBeLast: android.location.LocationManager#requestLocationUpdates(long, float, android.location.Criteria, java.util.concurrent.Executor, android.location.LocationListener):
+
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(String, android.location.LocationListener, android.os.Looper):
+
+SamShouldBeLast: android.location.LocationManager#requestSingleUpdate(android.location.Criteria, android.location.LocationListener, android.os.Looper):
+
+SamShouldBeLast: android.media.AudioFocusRequest.Builder#setOnAudioFocusChangeListener(android.media.AudioManager.OnAudioFocusChangeListener, android.os.Handler):
+
+SamShouldBeLast: android.media.AudioManager#requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int):
+
+SamShouldBeLast: android.media.AudioRecord#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
+
+SamShouldBeLast: android.media.AudioRecord#registerAudioRecordingCallback(java.util.concurrent.Executor, android.media.AudioManager.AudioRecordingCallback):
+
+SamShouldBeLast: android.media.AudioRecordingMonitor#registerAudioRecordingCallback(java.util.concurrent.Executor, android.media.AudioManager.AudioRecordingCallback):
+
+SamShouldBeLast: android.media.AudioRouting#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
+
+SamShouldBeLast: android.media.AudioTrack#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioTrack.addOnRoutingChangedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.media.MediaPlayer#setOnImsRxNoticeListener(android.media.MediaPlayer.OnImsRxNoticeListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.media.MediaPlayer.setOnImsRxNoticeListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.media.MediaRecorder#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
+
+SamShouldBeLast: android.media.MediaRecorder#registerAudioRecordingCallback(java.util.concurrent.Executor, android.media.AudioManager.AudioRecordingCallback):
+
+SamShouldBeLast: android.media.session.MediaSessionManager#addOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, android.content.ComponentName):
+
+SamShouldBeLast: android.media.session.MediaSessionManager#addOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, android.content.ComponentName, android.os.Handler):
+
+SamShouldBeLast: android.media.session.MediaSessionManager#addOnSession2TokensChangedListener(android.media.session.MediaSessionManager.OnSession2TokensChangedListener, android.os.Handler):
+
+SamShouldBeLast: android.media.session.MediaSessionManager#registerCallback(java.util.concurrent.Executor, android.media.session.MediaSessionManager.Callback):
+
+SamShouldBeLast: android.net.ConnectivityManager#createSocketKeepalive(android.net.Network, android.net.IpSecManager.UdpEncapsulationSocket, java.net.InetAddress, java.net.InetAddress, java.util.concurrent.Executor, android.net.SocketKeepalive.Callback):
+
+SamShouldBeLast: android.net.wifi.WifiManager#startLocalOnlyHotspot(android.net.wifi.SoftApConfiguration, java.util.concurrent.Executor, android.net.wifi.WifiManager.LocalOnlyHotspotCallback):
+
+SamShouldBeLast: android.net.wifi.rtt.WifiRttManager#startRanging(android.net.wifi.rtt.RangingRequest, java.util.concurrent.Executor, android.net.wifi.rtt.RangingResultCallback):
+
+SamShouldBeLast: android.nfc.NfcAdapter#enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle):
+
+SamShouldBeLast: android.nfc.NfcAdapter#ignore(android.nfc.Tag, int, android.nfc.NfcAdapter.OnTagRemovedListener, android.os.Handler):
+
+SamShouldBeLast: android.nfc.NfcAdapter#setBeamPushUrisCallback(android.nfc.NfcAdapter.CreateBeamUrisCallback, android.app.Activity):
+
+SamShouldBeLast: android.nfc.NfcAdapter#setNdefPushMessageCallback(android.nfc.NfcAdapter.CreateNdefMessageCallback, android.app.Activity, android.app.Activity...):
+
+SamShouldBeLast: android.nfc.NfcAdapter#setOnNdefPushCompleteCallback(android.nfc.NfcAdapter.OnNdefPushCompleteCallback, android.app.Activity, android.app.Activity...):
+
+SamShouldBeLast: android.os.Binder#attachInterface(android.os.IInterface, String):
+
+SamShouldBeLast: android.os.Binder#linkToDeath(android.os.IBinder.DeathRecipient, int):
+
+SamShouldBeLast: android.os.Binder#unlinkToDeath(android.os.IBinder.DeathRecipient, int):
+
+SamShouldBeLast: android.os.Handler#dump(android.util.Printer, String):
+
+SamShouldBeLast: android.os.Handler#postAtTime(Runnable, Object, long):
+
+SamShouldBeLast: android.os.Handler#postAtTime(Runnable, long):
+
+SamShouldBeLast: android.os.Handler#postDelayed(Runnable, Object, long):
+
+SamShouldBeLast: android.os.Handler#postDelayed(Runnable, long):
+
+SamShouldBeLast: android.os.Handler#removeCallbacks(Runnable, Object):
+
+SamShouldBeLast: android.os.IBinder#linkToDeath(android.os.IBinder.DeathRecipient, int):
+
+SamShouldBeLast: android.os.IBinder#unlinkToDeath(android.os.IBinder.DeathRecipient, int):
+
+SamShouldBeLast: android.os.RecoverySystem#verifyPackage(java.io.File, android.os.RecoverySystem.ProgressListener, java.io.File):
+
+SamShouldBeLast: android.telephony.MbmsDownloadSession#addProgressListener(android.telephony.mbms.DownloadRequest, java.util.concurrent.Executor, android.telephony.mbms.DownloadProgressListener):
+
+SamShouldBeLast: android.telephony.MbmsDownloadSession#addStatusListener(android.telephony.mbms.DownloadRequest, java.util.concurrent.Executor, android.telephony.mbms.DownloadStatusListener):
+
+SamShouldBeLast: android.telephony.MbmsDownloadSession#create(android.content.Context, java.util.concurrent.Executor, android.telephony.mbms.MbmsDownloadSessionCallback):
+
+SamShouldBeLast: android.telephony.MbmsDownloadSession#create(android.content.Context, java.util.concurrent.Executor, int, android.telephony.mbms.MbmsDownloadSessionCallback):
+
+SamShouldBeLast: android.telephony.MbmsGroupCallSession#create(android.content.Context, int, java.util.concurrent.Executor, android.telephony.mbms.MbmsGroupCallSessionCallback):
+
+SamShouldBeLast: android.telephony.MbmsGroupCallSession#create(android.content.Context, java.util.concurrent.Executor, android.telephony.mbms.MbmsGroupCallSessionCallback):
+
+SamShouldBeLast: android.telephony.MbmsGroupCallSession#startGroupCall(long, java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>, java.util.concurrent.Executor, android.telephony.mbms.GroupCallCallback):
+
+SamShouldBeLast: android.telephony.MbmsStreamingSession#create(android.content.Context, java.util.concurrent.Executor, android.telephony.mbms.MbmsStreamingSessionCallback):
+
+SamShouldBeLast: android.telephony.MbmsStreamingSession#create(android.content.Context, java.util.concurrent.Executor, int, android.telephony.mbms.MbmsStreamingSessionCallback):
+
+SamShouldBeLast: android.telephony.MbmsStreamingSession#startStreaming(android.telephony.mbms.StreamingServiceInfo, java.util.concurrent.Executor, android.telephony.mbms.StreamingServiceCallback):
+
+SamShouldBeLast: android.telephony.SmsManager#getSmsMessagesForFinancialApp(android.os.Bundle, java.util.concurrent.Executor, android.telephony.SmsManager.FinancialSmsCallback):
+
+SamShouldBeLast: android.telephony.SubscriptionManager#addOnOpportunisticSubscriptionsChangedListener(java.util.concurrent.Executor, android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener):
+
+SamShouldBeLast: android.telephony.TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor, android.telephony.TelephonyManager.CellInfoCallback):
+
+SamShouldBeLast: android.telephony.TelephonyManager#requestNetworkScan(android.telephony.NetworkScanRequest, java.util.concurrent.Executor, android.telephony.TelephonyScanManager.NetworkScanCallback):
+
+SamShouldBeLast: android.telephony.TelephonyManager#setPreferredOpportunisticDataSubscription(int, boolean, java.util.concurrent.Executor, java.util.function.Consumer<java.lang.Integer>):
+
+SamShouldBeLast: android.telephony.TelephonyManager#updateAvailableNetworks(java.util.List<android.telephony.AvailableNetworkInfo>, java.util.concurrent.Executor, java.util.function.Consumer<java.lang.Integer>):
+
+SamShouldBeLast: android.view.View#postDelayed(Runnable, long):
+
+SamShouldBeLast: android.view.View#postOnAnimationDelayed(Runnable, long):
+
+SamShouldBeLast: android.view.View#scheduleDrawable(android.graphics.drawable.Drawable, Runnable, long):
+
+SamShouldBeLast: android.view.Window#addOnFrameMetricsAvailableListener(android.view.Window.OnFrameMetricsAvailableListener, android.os.Handler):
+
+SamShouldBeLast: android.view.accessibility.AccessibilityManager#addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener, android.os.Handler):
+
+SamShouldBeLast: android.view.accessibility.AccessibilityManager#addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener, android.os.Handler):
+
+SamShouldBeLast: android.webkit.WebChromeClient#onShowFileChooser(android.webkit.WebView, android.webkit.ValueCallback<android.net.Uri[]>, android.webkit.WebChromeClient.FileChooserParams):
+
+SamShouldBeLast: android.webkit.WebView#setWebViewRenderProcessClient(java.util.concurrent.Executor, android.webkit.WebViewRenderProcessClient):
+
+
+
+ServiceName: android.Manifest.permission#BIND_ATTENTION_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_AUGMENTED_AUTOFILL_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_CELL_BROADCAST_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_CONTENT_CAPTURE_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_CONTENT_SUGGESTIONS_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_EUICC_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_EXTERNAL_STORAGE_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_IMS_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_NETWORK_RECOMMENDATION_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_NOTIFICATION_ASSISTANT_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_PRINT_RECOMMENDATION_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_RESOLVER_RANKER_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_SETTINGS_SUGGESTIONS_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_SOUND_TRIGGER_DETECTION_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_TELEPHONY_DATA_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_TELEPHONY_NETWORK_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_TEXTCLASSIFIER_SERVICE:
+
+ServiceName: android.Manifest.permission#BIND_TV_REMOTE_SERVICE:
+
+ServiceName: android.Manifest.permission#PROVIDE_RESOLVER_RANKER_SERVICE:
+
+ServiceName: android.Manifest.permission#REQUEST_NOTIFICATION_ASSISTANT_SERVICE:
+
+ServiceName: android.provider.DeviceConfig#NAMESPACE_PACKAGE_MANAGER_SERVICE:
+
+
+
+UserHandle: android.companion.CompanionDeviceManager#isDeviceAssociated(String, android.net.MacAddress, android.os.UserHandle):
+
+
+
+UserHandleName: android.telephony.CellBroadcastIntents#sendOrderedBroadcastForBackgroundReceivers(android.content.Context, android.os.UserHandle, android.content.Intent, String, String, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle):
+
diff --git a/boot/Android.bp b/boot/Android.bp
index e8d88a531b5b..ebda8baab034 100644
--- a/boot/Android.bp
+++ b/boot/Android.bp
@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+soong_namespace {}
+
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
diff --git a/cmds/app_process/Android.bp b/cmds/app_process/Android.bp
index a1575173ded6..42f0b3f4813d 100644
--- a/cmds/app_process/Android.bp
+++ b/cmds/app_process/Android.bp
@@ -42,6 +42,7 @@ cc_binary {
shared_libs: [
"libandroid_runtime",
+ "libbase",
"libbinder",
"libcutils",
"libdl",
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 12083b6fe20b..002df808501c 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -21,8 +21,11 @@
#include <cutils/properties.h>
#include <cutils/trace.h>
#include <android_runtime/AndroidRuntime.h>
+#include <android-base/properties.h>
#include <private/android_filesystem_config.h> // for AID_SYSTEM
+using android::base::GetProperty;
+
namespace android {
static void app_usage()
@@ -172,6 +175,13 @@ static const char ZYGOTE_NICE_NAME[] = "zygote";
int main(int argc, char* const argv[])
{
+ std::string bootmode = GetProperty("ro.bootmode", "");
+
+ if ((strncmp(bootmode.c_str(), "ffbm-00", 7) == 0)
+ || (strncmp(bootmode.c_str(), "ffbm-01", 7) == 0)) {
+ return 0;
+ }
+
if (!LOG_NDEBUG) {
String8 argv_String;
for (int i = 0; i < argc; ++i) {
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 6c8cab7783b6..53a2ebcdb061 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -271,7 +271,9 @@ static void* decodeImage(const void* encodedData, size_t dataLength, AndroidBitm
const size_t size = outInfo->stride * outInfo->height;
void* pixels = malloc(size);
int result = AImageDecoder_decodeImage(decoder, pixels, outInfo->stride, size);
- AImageDecoder_delete(decoder);
+ // TODO(b/180130969) Fix ~ImageDecoder() so that AImageDecoder_delete stops
+ // causing a segfault, then add back this call to AImageDecoder_delete().
+ //AImageDecoder_delete(decoder);
if (result != ANDROID_IMAGE_DECODER_SUCCESS) {
free(pixels);
@@ -669,6 +671,17 @@ void BootAnimation::findBootAnimationFile() {
}
}
+ std::string custAnimProp = !mShuttingDown ?
+ android::base::GetProperty("persist.sys.customanim.boot", ""):
+ android::base::GetProperty("persist.sys.customanim.shutdown", "");
+ const char *custAnim = custAnimProp.c_str();
+ ALOGD("Animation customzation path: %s", custAnim);
+ if (access(custAnim, R_OK) == 0) {
+ mZipFileName = custAnim;
+ ALOGD("%sAnimation customzation path: %s", mShuttingDown ? "Shutdown" : "Boot", mZipFileName.c_str());
+ return;
+ }
+
const bool playDarkAnim = android::base::GetIntProperty("ro.boot.theme", 0) == 1;
static const std::vector<std::string> bootFiles = {
APEX_BOOTANIMATION_FILE, playDarkAnim ? PRODUCT_BOOTANIMATION_DARK_FILE : PRODUCT_BOOTANIMATION_FILE,
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 3aa17f0865b4..16c5253427a8 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -14031,6 +14031,7 @@ package android.telephony.ims.stub {
public class ImsUtImplBase {
ctor public ImsUtImplBase();
method public void close();
+ method public int queryCFForServiceClass(int, String, int);
method public int queryCallBarring(int);
method public int queryCallBarringForServiceClass(int, int);
method public int queryCallForward(int, String);
diff --git a/core/api/system-lint-baseline.txt b/core/api/system-lint-baseline.txt
index b435acfccde8..5f3225a01811 100644
--- a/core/api/system-lint-baseline.txt
+++ b/core/api/system-lint-baseline.txt
@@ -1,4 +1,8 @@
// Baseline format: 1.0
+AcronymName: android.telephony.ims.stub.ImsUtImplBase#queryCFForServiceClass(int, String, int):
+ Acronyms should not be capitalized in method names: was `queryCFForServiceClass`, should this be `queryCfForServiceClass`?
+
+
ArrayReturn: android.view.contentcapture.ViewNode#getAutofillOptions():
@@ -81,6 +85,9 @@ MissingNullability: android.telephony.SubscriptionPlan.Builder#createRecurringWe
MissingNullability: android.telephony.data.DataService#onUnbind(android.content.Intent) parameter #0:
+MissingNullability: android.telephony.ims.stub.ImsUtImplBase#queryCFForServiceClass(int, String, int) parameter #1:
+ Missing nullability on parameter `number` in method `queryCFForServiceClass`
+
MissingNullability: android.telephony.mbms.DownloadRequest.Builder#setServiceId(String):
MissingNullability: android.telephony.mbms.DownloadRequest.Builder#setServiceId(String) parameter #0:
diff --git a/core/api/test-lint-baseline.txt b/core/api/test-lint-baseline.txt
index 5409165542f4..0aeba4854866 100644
--- a/core/api/test-lint-baseline.txt
+++ b/core/api/test-lint-baseline.txt
@@ -2013,6 +2013,8 @@ MissingNullability: android.telephony.ims.stub.ImsSmsImplBase#sendSms(int, int,
MissingNullability: android.telephony.ims.stub.ImsUtImplBase#queryCallForward(int, String) parameter #1:
+MissingNullability: android.telephony.ims.stub.ImsUtImplBase#queryCFForServiceClass(int, String, int) parameter #1:
+
MissingNullability: android.telephony.ims.stub.ImsUtImplBase#setListener(android.telephony.ims.ImsUtListener) parameter #0:
MissingNullability: android.telephony.ims.stub.ImsUtImplBase#transact(android.os.Bundle) parameter #0:
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java
index 79fb86365b74..3183c172bac5 100644
--- a/core/java/android/accounts/AccountManager.java
+++ b/core/java/android/accounts/AccountManager.java
@@ -608,6 +608,7 @@ public class AccountManager {
* @return The account's password, null if none or if the account doesn't exist
*/
public String getPassword(final Account account) {
+ android.util.SeempLog.record(22);
if (account == null) throw new IllegalArgumentException("account is null");
try {
return mService.getPassword(account);
@@ -638,6 +639,7 @@ public class AccountManager {
* @return The user data, null if the account, key doesn't exist, or the user is locked
*/
public String getUserData(final Account account, final String key) {
+ android.util.SeempLog.record(23);
return mUserDataCache.query(new AccountKeyData(account,key));
}
@@ -877,6 +879,7 @@ public class AccountManager {
return new Future2Task<String>(handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.getAuthTokenLabel(mResponse, accountType, authTokenType);
}
@@ -921,6 +924,7 @@ public class AccountManager {
return new Future2Task<Boolean>(handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.hasFeatures(mResponse, account, features, mContext.getOpPackageName());
}
@Override
@@ -981,6 +985,7 @@ public class AccountManager {
return new Future2Task<Account[]>(handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.getAccountsByFeatures(mResponse, type, features,
mContext.getOpPackageName());
}
@@ -1025,6 +1030,7 @@ public class AccountManager {
* already exists, the account is null, the user is locked, or another error occurs.
*/
public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
+ android.util.SeempLog.record(24);
if (account == null) throw new IllegalArgumentException("account is null");
try {
return mService.addAccountExplicitly(
@@ -1243,6 +1249,7 @@ public class AccountManager {
return new Future2Task<Account>(handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.renameAccount(mResponse, account, newName);
}
@Override
@@ -1304,6 +1311,7 @@ public class AccountManager {
@Deprecated
public AccountManagerFuture<Boolean> removeAccount(final Account account,
AccountManagerCallback<Boolean> callback, Handler handler) {
+ android.util.SeempLog.record(25);
return removeAccountAsUser(account, callback, handler, mContext.getUser());
}
@@ -1351,6 +1359,7 @@ public class AccountManager {
@UserHandleAware
public AccountManagerFuture<Bundle> removeAccount(final Account account,
final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) {
+ android.util.SeempLog.record(28);
return removeAccountAsUser(account, activity, callback, handler, mContext.getUser());
}
@@ -1370,6 +1379,7 @@ public class AccountManager {
return new Future2Task<Boolean>(handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.removeAccountAsUser(mResponse, account, false, userHandle.getIdentifier());
}
@Override
@@ -1396,6 +1406,7 @@ public class AccountManager {
return new AmsTask(activity, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(34);
mService.removeAccountAsUser(mResponse, account, activity != null,
userHandle.getIdentifier());
}
@@ -1509,6 +1520,7 @@ public class AccountManager {
* @param password The password to set, null to clear the password
*/
public void setPassword(final Account account, final String password) {
+ android.util.SeempLog.record(26);
if (account == null) throw new IllegalArgumentException("account is null");
try {
mService.setPassword(account, password);
@@ -1537,6 +1549,7 @@ public class AccountManager {
* @param account The account whose password to clear
*/
public void clearPassword(final Account account) {
+ android.util.SeempLog.record(27);
if (account == null) throw new IllegalArgumentException("account is null");
try {
mService.clearPassword(account);
@@ -1564,6 +1577,7 @@ public class AccountManager {
* @param value String value to set, {@code null} to clear this user data key
*/
public void setUserData(final Account account, final String key, final String value) {
+ android.util.SeempLog.record(28);
if (account == null) throw new IllegalArgumentException("account is null");
if (key == null) throw new IllegalArgumentException("key is null");
try {
@@ -1714,6 +1728,7 @@ public class AccountManager {
return new AmsTask(activity, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.getAuthToken(mResponse, account, authTokenType,
false /* notifyOnAuthFailure */, true /* expectActivityLaunch */,
optionsIn);
@@ -1885,6 +1900,7 @@ public class AccountManager {
return new AmsTask(null, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.getAuthToken(mResponse, account, authTokenType,
notifyAuthFailure, false /* expectActivityLaunch */, optionsIn);
}
@@ -1947,6 +1963,7 @@ public class AccountManager {
final Bundle addAccountOptions,
final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) {
if (Process.myUserHandle().equals(mContext.getUser())) {
+ android.util.SeempLog.record(29);
if (accountType == null) throw new IllegalArgumentException("accountType is null");
final Bundle optionsIn = new Bundle();
if (addAccountOptions != null) {
@@ -1957,6 +1974,7 @@ public class AccountManager {
return new AmsTask(activity, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.addAccount(mResponse, accountType, authTokenType,
requiredFeatures, activity != null, optionsIn);
}
@@ -1986,6 +2004,7 @@ public class AccountManager {
return new AmsTask(activity, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.addAccountAsUser(mResponse, accountType, authTokenType,
requiredFeatures, activity != null, optionsIn, userHandle.getIdentifier());
}
@@ -2035,6 +2054,7 @@ public class AccountManager {
return new Future2Task<Boolean>(handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(34);
mService.copyAccountToUser(
mResponse, account, fromUser.getIdentifier(), toUser.getIdentifier());
}
@@ -2134,6 +2154,7 @@ public class AccountManager {
return new AmsTask(activity, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.confirmCredentialsAsUser(mResponse, account, options, activity != null,
userId);
}
@@ -2247,10 +2268,12 @@ public class AccountManager {
public AccountManagerFuture<Bundle> editProperties(final String accountType,
final Activity activity, final AccountManagerCallback<Bundle> callback,
final Handler handler) {
+ android.util.SeempLog.record(30);
if (accountType == null) throw new IllegalArgumentException("accountType is null");
return new AmsTask(activity, handler, callback) {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
mService.editProperties(mResponse, accountType, activity != null);
}
}.start();
@@ -2677,6 +2700,7 @@ public class AccountManager {
@Override
public void doWork() throws RemoteException {
+ android.util.SeempLog.record(31);
getAccountByTypeAndFeatures(mAccountType, mFeatures,
new AccountManagerCallback<Bundle>() {
@Override
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index 7be4c3e1465b..4aa219f5c472 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -639,6 +639,9 @@ public abstract class ActivityManagerInternal {
*/
public abstract @TempAllowListType int getPushMessagingOverQuotaBehavior();
+ // Starts a process as empty.
+ public abstract int startActivityAsUserEmpty(Bundle options);
+
/**
* Returns the capability of the given uid
*/
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 8af74edb88ff..d255870ecc5c 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -157,6 +157,7 @@ import android.system.StructStat;
import android.telephony.TelephonyFrameworkInitializer;
import android.util.AndroidRuntimeException;
import android.util.ArrayMap;
+import android.util.BoostFramework;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
@@ -6464,6 +6465,8 @@ public final class ActivityThread extends ClientTransactionHandler
@UnsupportedAppUsage
private void handleBindApplication(AppBindData data) {
+ long st_bindApp = SystemClock.uptimeMillis();
+ BoostFramework ux_perf = null;
// Register the UI Thread as a sensitive thread to the runtime.
VMRuntime.registerSensitiveThread();
// In the case the stack depth property exists, pass it down to the runtime.
@@ -6576,10 +6579,17 @@ public final class ActivityThread extends ClientTransactionHandler
/**
* Switch this process to density compatibility mode if needed.
*/
- if ((data.appInfo.flags&ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES)
+ if ((data.appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES)
== 0) {
mDensityCompatMode = true;
Bitmap.setDefaultDensity(DisplayMetrics.DENSITY_DEFAULT);
+ } else {
+ int overrideDensity = data.appInfo.getOverrideDensity();
+ if(overrideDensity != 0) {
+ Log.d(TAG, "override app density from " + DisplayMetrics.DENSITY_DEVICE + " to " + overrideDensity);
+ mDensityCompatMode = true;
+ Bitmap.setDefaultDensity(overrideDensity);
+ }
}
mConfigurationController.updateDefaultDensity(data.config.densityDpi);
@@ -6678,6 +6688,15 @@ public final class ActivityThread extends ClientTransactionHandler
}
if (!Process.isIsolated()) {
+ final int old_mask = StrictMode.allowThreadDiskWritesMask();
+ try {
+ ux_perf = new BoostFramework(appContext);
+ } finally {
+ StrictMode.setThreadPolicyMask(old_mask);
+ }
+ }
+
+ if (!Process.isIsolated()) {
final int oldMask = StrictMode.allowThreadDiskWritesMask();
try {
setupGraphicsSupport(appContext);
@@ -6796,6 +6815,28 @@ public final class ActivityThread extends ClientTransactionHandler
throw e.rethrowFromSystemServer();
}
}
+ long end_bindApp = SystemClock.uptimeMillis();
+ int bindApp_dur = (int) (end_bindApp - st_bindApp);
+ String pkg_name = null;
+ if (appContext != null) {
+ pkg_name = appContext.getPackageName();
+ }
+ if (ux_perf != null && !Process.isIsolated() && pkg_name != null) {
+ String pkgDir = null;
+ try
+ {
+ String codePath = appContext.getPackageCodePath();
+ pkgDir = codePath.substring(0, codePath.lastIndexOf('/'));
+ }
+ catch(Exception e)
+ {
+ Slog.e(TAG, "HeavyGameThread () : Exception_1 = " + e);
+ }
+ ux_perf.perfUXEngine_events(BoostFramework.UXE_EVENT_BINDAPP, 0,
+ pkg_name,
+ bindApp_dur,
+ pkgDir);
+ }
}
private void handleSetContentCaptureOptionsCallback(String packageName) {
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index fd6fa57b9e8d..a445267b36a9 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -509,6 +509,7 @@ public class Instrumentation {
*/
@NonNull
public Activity startActivitySync(@NonNull Intent intent, @Nullable Bundle options) {
+ android.util.SeempLog.record_str(376, intent.toString());
validateNotAppThread();
final Activity activity;
@@ -1722,6 +1723,7 @@ public class Instrumentation {
public ActivityResult execStartActivity(
Context who, IBinder contextThread, IBinder token, Activity target,
Intent intent, int requestCode, Bundle options) {
+ android.util.SeempLog.record_str(377, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
Uri referrer = target != null ? target.onProvideReferrer() : null;
if (referrer != null) {
@@ -1797,6 +1799,7 @@ public class Instrumentation {
public int execStartActivitiesAsUser(Context who, IBinder contextThread,
IBinder token, Activity target, Intent[] intents, Bundle options,
int userId) {
+ android.util.SeempLog.record_str(378, intents.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
@@ -1871,6 +1874,7 @@ public class Instrumentation {
public ActivityResult execStartActivity(
Context who, IBinder contextThread, IBinder token, String target,
Intent intent, int requestCode, Bundle options) {
+ android.util.SeempLog.record_str(377, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
@@ -1941,6 +1945,7 @@ public class Instrumentation {
public ActivityResult execStartActivity(
Context who, IBinder contextThread, IBinder token, String resultWho,
Intent intent, int requestCode, Bundle options, UserHandle user) {
+ android.util.SeempLog.record_str(377, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
@@ -2040,6 +2045,7 @@ public class Instrumentation {
public void execStartActivityFromAppTask(
Context who, IBinder contextThread, IAppTask appTask,
Intent intent, Bundle options) {
+ android.util.SeempLog.record_str(380, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java
index 0136a35e3975..2150fc9dc0e7 100644
--- a/core/java/android/app/PendingIntent.java
+++ b/core/java/android/app/PendingIntent.java
@@ -51,8 +51,10 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.UserHandle;
+import android.os.SystemProperties;
import android.util.AndroidException;
import android.util.ArraySet;
+import android.util.Log;
import android.util.proto.ProtoOutputStream;
import com.android.internal.os.IResultReceiver;
@@ -140,6 +142,7 @@ public final class PendingIntent implements Parcelable {
@EnabledAfter(targetSdkVersion = android.os.Build.VERSION_CODES.R)
static final long PENDING_INTENT_EXPLICIT_MUTABILITY_REQUIRED = 160794467L;
+
/** @hide */
@IntDef(flag = true,
value = {
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index fca4c698c49c..0ffbd63df308 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -680,7 +680,7 @@ public class WallpaperManager {
cmProxy.doColorManagement(decoder, info);
}
}));
- } catch (OutOfMemoryError | IOException e) {
+ } catch (OutOfMemoryError | IOException | ArrayIndexOutOfBoundsException e) {
Log.w(TAG, "Can't decode file", e);
}
}
@@ -1488,18 +1488,27 @@ public class WallpaperManager {
mContext.getUserId());
if (fd != null) {
FileOutputStream fos = null;
- boolean ok = false;
+ final Bitmap tmp = BitmapFactory.decodeStream(resources.openRawResource(resid));
try {
- fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
- copyStreamToWallpaperFile(resources.openRawResource(resid), fos);
- // The 'close()' is the trigger for any server-side image manipulation,
- // so we must do that before waiting for completion.
- fos.close();
- completion.waitForCompletion();
+ // If the stream can't be decoded, treat it as an invalid input.
+ if (tmp != null) {
+ fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
+ tmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
+ // The 'close()' is the trigger for any server-side image manipulation,
+ // so we must do that before waiting for completion.
+ fos.close();
+ completion.waitForCompletion();
+ } else {
+ throw new IllegalArgumentException(
+ "Resource 0x" + Integer.toHexString(resid) + " is invalid");
+ }
} finally {
// Might be redundant but completion shouldn't wait unless the write
// succeeded; this is a fallback if it threw past the close+wait.
IoUtils.closeQuietly(fos);
+ if (tmp != null) {
+ tmp.recycle();
+ }
}
}
} catch (RemoteException e) {
@@ -1741,13 +1750,22 @@ public class WallpaperManager {
result, which, completion, mContext.getUserId());
if (fd != null) {
FileOutputStream fos = null;
+ final Bitmap tmp = BitmapFactory.decodeStream(bitmapData);
try {
- fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
- copyStreamToWallpaperFile(bitmapData, fos);
- fos.close();
- completion.waitForCompletion();
+ // If the stream can't be decoded, treat it as an invalid input.
+ if (tmp != null) {
+ fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
+ tmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
+ fos.close();
+ completion.waitForCompletion();
+ } else {
+ throw new IllegalArgumentException("InputStream is invalid");
+ }
} finally {
IoUtils.closeQuietly(fos);
+ if (tmp != null) {
+ tmp.recycle();
+ }
}
}
} catch (RemoteException e) {
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 5094498dbee5..76e743f155dc 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -84,7 +84,9 @@ import java.util.WeakHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-
+import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
/**
* Represents the local device Bluetooth adapter. The {@link BluetoothAdapter}
* lets you perform fundamental Bluetooth tasks, such as initiate
@@ -829,6 +831,7 @@ public final class BluetoothAdapter {
*/
@RequiresNoPermission
public BluetoothDevice getRemoteDevice(String address) {
+ android.util.SeempLog.record(62);
final BluetoothDevice res = new BluetoothDevice(address);
res.setAttributionSource(mAttributionSource);
return res;
@@ -847,6 +850,7 @@ public final class BluetoothAdapter {
*/
@RequiresNoPermission
public BluetoothDevice getRemoteDevice(byte[] address) {
+ android.util.SeempLog.record(62);
if (address == null || address.length != 6) {
throw new IllegalArgumentException("Bluetooth address must have 6 bytes");
}
@@ -1054,7 +1058,10 @@ public final class BluetoothAdapter {
@SuppressLint("AndroidFrameworkRequiresPermission")
protected Integer recompute(Void query) {
try {
- return mService.getState();
+ if (mService != null) {
+ return mService.getState();
+ }
+ return BluetoothAdapter.STATE_OFF;
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1110,6 +1117,7 @@ public final class BluetoothAdapter {
@RequiresNoPermission
@AdapterState
public int getState() {
+ android.util.SeempLog.record(63);
int state = getStateInternal();
// Consider all internal states as OFF
@@ -1195,6 +1203,7 @@ public final class BluetoothAdapter {
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public boolean enable() {
+ android.util.SeempLog.record(56);
if (isEnabled()) {
if (DBG) {
Log.d(TAG, "enable(): BT already enabled!");
@@ -1234,6 +1243,7 @@ public final class BluetoothAdapter {
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public boolean disable() {
+ android.util.SeempLog.record(57);
try {
return mManagerService.disable(mAttributionSource, true);
} catch (RemoteException e) {
@@ -1253,6 +1263,7 @@ public final class BluetoothAdapter {
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public boolean disable(boolean persist) {
+ android.util.SeempLog.record(57);
try {
return mManagerService.disable(mAttributionSource, persist);
@@ -1328,13 +1339,14 @@ public final class BluetoothAdapter {
public boolean factoryReset() {
try {
mServiceLock.readLock().lock();
- if (mService != null && mService.factoryReset(mAttributionSource)
- && mManagerService != null
- && mManagerService.onFactoryReset(mAttributionSource)) {
- return true;
+ if (mManagerService != null) {
+ SystemProperties.set("persist.bluetooth.factoryreset", "true");
+ /* factoryReset handles both bluetooth reset and config remove
+ * functionality, hence remove onFactoryReset call to avoid redundant code
+ */
+ return mManagerService.factoryReset();
}
Log.e(TAG, "factoryReset(): Setting persist.bluetooth.factoryreset to retry later");
- SystemProperties.set("persist.bluetooth.factoryreset", "true");
} catch (RemoteException e) {
Log.e(TAG, "", e);
} finally {
@@ -1818,6 +1830,7 @@ public final class BluetoothAdapter {
@RequiresBluetoothLocationPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)
public boolean startDiscovery() {
+ android.util.SeempLog.record(58);
if (getState() != STATE_ON) {
return false;
}
@@ -2003,7 +2016,21 @@ public final class BluetoothAdapter {
return false;
}
-
+ /** @hide */
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean isBroadcastActive() {
+ try {
+ mServiceLock.readLock().lock();
+ if (mService != null) {
+ return mService.isBroadcastActive(mAttributionSource);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ } finally {
+ mServiceLock.readLock().unlock();
+ }
+ return false;
+ }
/**
* Connects all enabled and supported bluetooth profiles between the local and remote device.
* Connection is asynchronous and you should listen to each profile's broadcast intent
@@ -2308,6 +2335,13 @@ public final class BluetoothAdapter {
}
/**
+ * @hide
+ */
+ public void btCmdGetFunctionCallmap(boolean isdump) {
+ Log.d(TAG, "btCmdGetFunctionCallmap: " + isdump);
+ }
+
+ /**
* Return true if Hearing Aid Profile is supported.
*
* @return true if phone supports Hearing Aid Profile
@@ -2481,6 +2515,7 @@ public final class BluetoothAdapter {
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public Set<BluetoothDevice> getBondedDevices() {
+ android.util.SeempLog.record(61);
if (getState() != STATE_ON) {
return toDeviceSet(Arrays.asList());
}
@@ -2661,6 +2696,7 @@ public final class BluetoothAdapter {
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
@SuppressLint("AndroidFrameworkRequiresPermission")
public int getProfileConnectionState(int profile) {
+ android.util.SeempLog.record(64);
if (getState() != STATE_ON) {
return BluetoothProfile.STATE_DISCONNECTED;
}
@@ -2790,6 +2826,7 @@ public final class BluetoothAdapter {
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String name, UUID uuid)
throws IOException {
+ android.util.SeempLog.record(59);
return createNewRfcommSocketAndRecord(name, uuid, false, false);
}
@@ -2987,6 +3024,92 @@ public final class BluetoothAdapter {
return null;
}
+ private void closeBCProfile(BluetoothProfile proxy) {
+ Class<?> bshClass = null;
+ Method bshClose = null;
+ try {
+ bshClass = Class.forName("android.bluetooth.BluetoothSyncHelper");
+ } catch (ClassNotFoundException ex) {
+ Log.e(TAG, "no BSH: exists");
+ bshClass = null;
+ }
+ if (bshClass != null) {
+ Log.d(TAG, "Able to get BSH class handle");
+ try {
+ bshClose = bshClass.getDeclaredMethod("close", null);
+ } catch (NoSuchMethodException e) {
+ Log.e(TAG, "no BSH:isSupported method exists");
+ }
+ if (bshClose != null) {
+ try {
+ bshClose.invoke(proxy, null);
+ } catch(IllegalAccessException e) {
+ Log.e(TAG, "bshClose IllegalAccessException");
+ } catch (InvocationTargetException e) {
+ Log.e(TAG, "bshClose InvocationTargetException");
+ }
+ }
+ }
+ Log.d(TAG, "CloseBCProfile returns");
+ }
+
+ private boolean getBCProfile(Context context, BluetoothProfile.ServiceListener sl) {
+ boolean ret = true;
+ boolean isProfileSupported = false;
+ Class<?> bshClass = null;
+ Method bshSupported = null;
+ Constructor bshCons = null;
+ Object bshObj = null;
+ try {
+ bshClass = Class.forName("android.bluetooth.BluetoothSyncHelper");
+ } catch (ClassNotFoundException ex) {
+ Log.e(TAG, "no BSH: exists");
+ bshClass = null;
+ }
+ if (bshClass != null) {
+ Log.d(TAG, "Able to get BSH class handle");
+ try {
+ bshSupported = bshClass.getDeclaredMethod("isSupported", null);
+ } catch (NoSuchMethodException e) {
+ Log.e(TAG, "no BSH:isSupported method exists: gdm");
+ }
+ try {
+ bshCons =
+ bshClass.getDeclaredConstructor(
+ new Class[]{Context.class,
+ BluetoothProfile.ServiceListener.class});
+ } catch (NoSuchMethodException ex) {
+ Log.e(TAG, "bshCons: NoSuchMethodException: gdm" + ex);
+ }
+ }
+ if (bshClass != null && bshSupported != null && bshCons != null) {
+ try {
+ isProfileSupported = (boolean)bshSupported.invoke(null, null);
+ } catch(IllegalAccessException e) {
+ Log.e(TAG, "BSH:isSupported IllegalAccessException");
+ } catch (InvocationTargetException e) {
+ Log.e(TAG, "BSH:isSupported InvocationTargetException");
+ }
+ if (isProfileSupported) {
+ try {
+ bshObj = bshCons.newInstance(
+ context, sl);
+ } catch (InstantiationException ex) {
+ Log.e(TAG, "bshCons InstantiationException:" + ex);
+ } catch (IllegalAccessException ex) {
+ Log.e(TAG, "bshCons InstantiationException:" + ex);
+ } catch (InvocationTargetException ex) {
+ Log.e(TAG, "bshCons InvocationTargetException:" + ex);
+ }
+ }
+ }
+ if (bshObj == null) {
+ ret = false;
+ }
+ Log.d(TAG, "getBCService returns" + ret);
+ return ret;
+ }
+
/**
* Get the profile proxy object associated with the profile.
*
@@ -3034,6 +3157,9 @@ public final class BluetoothAdapter {
} else if (profile == BluetoothProfile.PBAP) {
BluetoothPbap pbap = new BluetoothPbap(context, listener, this);
return true;
+ } else if (profile == BluetoothProfile.DUN) {
+ BluetoothDun dun = new BluetoothDun(context, listener);
+ return true;
} else if (profile == BluetoothProfile.HEALTH) {
Log.e(TAG, "getProfileProxy(): BluetoothHealth is deprecated");
return false;
@@ -3056,12 +3182,22 @@ public final class BluetoothAdapter {
} else if (profile == BluetoothProfile.HID_DEVICE) {
BluetoothHidDevice hidDevice = new BluetoothHidDevice(context, listener, this);
return true;
+ } else if (profile == BluetoothProfile.BROADCAST) {
+ return getBroadcastProfile(context, listener);
+ } else if (profile == BluetoothProfile.BC_PROFILE) {
+ return getBCProfile(context, listener);
} else if (profile == BluetoothProfile.HEARING_AID) {
if (isHearingAidProfileSupported()) {
BluetoothHearingAid hearingAid = new BluetoothHearingAid(context, listener, this);
return true;
}
return false;
+ } else if (profile == BluetoothProfile.GROUP_CLIENT) {
+ BluetoothDeviceGroup groupClient = new BluetoothDeviceGroup(context, listener);
+ return true;
+ } else if (profile == BluetoothProfile.VCP) {
+ BluetoothVcp vcp = new BluetoothVcp(context, listener);
+ return true;
} else if (profile == BluetoothProfile.LE_AUDIO) {
BluetoothLeAudio leAudio = new BluetoothLeAudio(context, listener, this);
return true;
@@ -3118,6 +3254,10 @@ public final class BluetoothAdapter {
BluetoothPbap pbap = (BluetoothPbap) proxy;
pbap.close();
break;
+ case BluetoothProfile.DUN:
+ BluetoothDun dun = (BluetoothDun)proxy;
+ dun.close();
+ break;
case BluetoothProfile.GATT:
BluetoothGatt gatt = (BluetoothGatt) proxy;
gatt.close();
@@ -3150,6 +3290,12 @@ public final class BluetoothAdapter {
BluetoothHidDevice hidDevice = (BluetoothHidDevice) proxy;
hidDevice.close();
break;
+ case BluetoothProfile.BROADCAST:
+ closeBroadcastProfile(proxy);
+ break;
+ case BluetoothProfile.BC_PROFILE:
+ closeBCProfile(proxy);
+ break;
case BluetoothProfile.HEARING_AID:
BluetoothHearingAid hearingAid = (BluetoothHearingAid) proxy;
hearingAid.close();
@@ -3157,6 +3303,71 @@ public final class BluetoothAdapter {
case BluetoothProfile.LE_AUDIO:
BluetoothLeAudio leAudio = (BluetoothLeAudio) proxy;
leAudio.close();
+ break;
+ case BluetoothProfile.GROUP_CLIENT:
+ BluetoothDeviceGroup groupClient = (BluetoothDeviceGroup) proxy;
+ groupClient.close();
+ break;
+ case BluetoothProfile.VCP:
+ BluetoothVcp vcp = (BluetoothVcp) proxy;
+ vcp.close();
+ break;
+ }
+ }
+ private boolean getBroadcastProfile(Context context,
+ BluetoothProfile.ServiceListener listener) {
+ boolean ret = true;
+ Class<?> broadcastClass = null;
+ Constructor bcastConstructor = null;
+ Object broadcastObj = null;
+ try {
+ broadcastClass = Class.forName("android.bluetooth.BluetoothBroadcast");
+ } catch (ClassNotFoundException ex) {
+ Log.e(TAG, "no BluetoothBroadcast: exists");
+ }
+ if (broadcastClass != null) {
+ try {
+ bcastConstructor =
+ broadcastClass.getDeclaredConstructor(new Class[]{Context.class,
+ BluetoothProfile.ServiceListener.class});
+ } catch (NoSuchMethodException ex) {
+ Log.e(TAG, "bcastConstructor: NoSuchMethodException: gdm" + ex);
+ }
+ }
+ if (bcastConstructor != null) {
+ try {
+ broadcastObj = bcastConstructor.newInstance(context, listener);
+ } catch (InstantiationException | IllegalAccessException |
+ InvocationTargetException ex) {
+ ex.printStackTrace();
+ }
+ }
+ if (broadcastObj == null) {
+ return false;
+ }
+ return true;
+ }
+ private void closeBroadcastProfile(BluetoothProfile proxy) {
+ Class<?> broadcastClass = null;
+ Method broadcastClose = null;
+ try {
+ broadcastClass = Class.forName("android.bluetooth.BluetootBroadcast");
+ } catch (ClassNotFoundException ex) {
+ Log.e(TAG, "no BluetoothBroadcast: exists");
+ }
+ if (broadcastClass != null) {
+ try {
+ broadcastClose = broadcastClass.getDeclaredMethod("close", null);
+ } catch (NoSuchMethodException e) {
+ Log.e(TAG, "no Broadcast:close method exists");
+ }
+ if (broadcastClose != null) {
+ try {
+ broadcastClose.invoke(proxy, null);
+ } catch(IllegalAccessException | InvocationTargetException ex) {
+ ex.printStackTrace();
+ }
+ }
}
}
@@ -3244,8 +3455,10 @@ public final class BluetoothAdapter {
synchronized (mBluetoothConnectionCallbackExecutorMap) {
if (!mBluetoothConnectionCallbackExecutorMap.isEmpty()) {
try {
- mService.registerBluetoothConnectionCallback(mConnectionCallback,
- mAttributionSource);
+ if (mService != null) {
+ mService.registerBluetoothConnectionCallback
+ (mConnectionCallback, mAttributionSource);
+ }
} catch (RemoteException e) {
Log.e(TAG, "onBluetoothServiceUp: Failed to register bluetooth"
+ "connection callback", e);
@@ -3253,7 +3466,6 @@ public final class BluetoothAdapter {
}
}
}
-
public void onBluetoothServiceDown() {
synchronized (mServiceLock.writeLock()) {
mService = null;
@@ -3267,8 +3479,8 @@ public final class BluetoothAdapter {
mBluetoothLeScanner.cleanup();
}
}
+ Log.d(TAG, "onBluetoothServiceDown: Finished sending callbacks to registered clients");
}
-
public void onBrEdrDown() {
}
};
@@ -3497,6 +3709,22 @@ public final class BluetoothAdapter {
}
}
+ /**
+ * @hide
+ */
+ public void unregisterAdapter() {
+ try {
+ //mServiceLock.writeLock().lock();
+ if (mManagerService != null){
+ mManagerService.unregisterAdapter(mManagerCallback);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ } finally {
+ //mServiceLock.writeLock().unlock();
+ }
+ }
+
private Set<BluetoothDevice> toDeviceSet(List<BluetoothDevice> devices) {
Set<BluetoothDevice> deviceSet = new HashSet<BluetoothDevice>(devices);
return Collections.unmodifiableSet(deviceSet);
diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java
index 7fe18a0704ba..1d19c9431e69 100755..100644
--- a/core/java/android/bluetooth/BluetoothClass.java
+++ b/core/java/android/bluetooth/BluetoothClass.java
@@ -119,6 +119,11 @@ public final class BluetoothClass implements Parcelable {
private static final int BITMASK = 0xFFE000;
public static final int LIMITED_DISCOVERABILITY = 0x002000;
+ /**
+ * @hide
+ */
+ public static final int GROUP = 0x004000;
+
public static final int POSITIONING = 0x010000;
public static final int NETWORKING = 0x020000;
public static final int RENDER = 0x040000;
diff --git a/core/java/android/bluetooth/BluetoothCodecConfig.java b/core/java/android/bluetooth/BluetoothCodecConfig.java
index 1d0bf97c34eb..1184d20107ba 100644
--- a/core/java/android/bluetooth/BluetoothCodecConfig.java
+++ b/core/java/android/bluetooth/BluetoothCodecConfig.java
@@ -46,7 +46,9 @@ public final class BluetoothCodecConfig implements Parcelable {
SOURCE_CODEC_TYPE_APTX,
SOURCE_CODEC_TYPE_APTX_HD,
SOURCE_CODEC_TYPE_LDAC,
- SOURCE_CODEC_TYPE_MAX,
+ SOURCE_CODEC_TYPE_APTX_ADAPTIVE,
+ SOURCE_CODEC_TYPE_APTX_TWSP,
+ SOURCE_QVA_CODEC_TYPE_MAX,
SOURCE_CODEC_TYPE_INVALID
})
@Retention(RetentionPolicy.SOURCE)
@@ -71,6 +73,22 @@ public final class BluetoothCodecConfig implements Parcelable {
public static final int SOURCE_CODEC_TYPE_MAX = 5;
@UnsupportedAppUsage
+ public static final int SOURCE_CODEC_TYPE_APTX_ADAPTIVE = SOURCE_CODEC_TYPE_MAX;
+
+ @UnsupportedAppUsage
+ public static final int SOURCE_CODEC_TYPE_APTX_TWSP = SOURCE_CODEC_TYPE_MAX + 1;
+
+ @UnsupportedAppUsage
+ public static final int SOURCE_QVA_CODEC_TYPE_MAX = SOURCE_CODEC_TYPE_MAX + 2;
+
+ /* CELT is not an A2DP Codec and only used to fetch encoder
+ ** format for BA usecase, moving out of a2dp codec value list
+ */
+ @UnsupportedAppUsage
+ public static final int SOURCE_CODEC_TYPE_CELT = 8;
+
+ public static final int SOURCE_CODEC_TYPE_LC3 = 9;
+
public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000;
/** @hide */
@@ -126,6 +144,14 @@ public final class BluetoothCodecConfig implements Parcelable {
@UnsupportedAppUsage
public static final int SAMPLE_RATE_192000 = 0x1 << 5;
+ public static final int SAMPLE_RATE_16000 = 0x1 << 6;
+
+ public static final int SAMPLE_RATE_24000 = 0x1 << 7;
+
+ public static final int SAMPLE_RATE_32000 = 0x1 << 8;
+
+ public static final int SAMPLE_RATE_8000 = 0x1 << 9;
+
/** @hide */
@IntDef(prefix = "BITS_PER_SAMPLE_", value = {
@@ -167,6 +193,7 @@ public final class BluetoothCodecConfig implements Parcelable {
@UnsupportedAppUsage
public static final int CHANNEL_MODE_STEREO = 0x1 << 1;
+ public static final int CHANNEL_MODE_JOINT_STEREO = 0x1 << 2;
private final @SourceCodecType int mCodecType;
private @CodecPriority int mCodecPriority;
@@ -403,6 +430,10 @@ public final class BluetoothCodecConfig implements Parcelable {
return "aptX HD";
case SOURCE_CODEC_TYPE_LDAC:
return "LDAC";
+ case SOURCE_CODEC_TYPE_APTX_ADAPTIVE:
+ return "aptX Adaptive";
+ case SOURCE_CODEC_TYPE_APTX_TWSP:
+ return "aptX TWS+";
case SOURCE_CODEC_TYPE_INVALID:
return "INVALID CODEC";
default:
@@ -652,6 +683,10 @@ public final class BluetoothCodecConfig implements Parcelable {
if (mCodecSpecific1 != other.mCodecSpecific1) {
return false;
}
+ case SOURCE_CODEC_TYPE_APTX_ADAPTIVE:
+ if (other.mCodecSpecific4 > 0) {
+ return false;
+ }
// fall through
default:
return true;
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 5a5fac4a7664..7b8c061deefc 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -1,4 +1,39 @@
/*
+ * Copyright (C) 2017, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the
+ * disclaimer below) provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -218,6 +253,18 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final String ACTION_BOND_STATE_CHANGED =
"android.bluetooth.device.action.BOND_STATE_CHANGED";
+ /**
+ * Broadcast Action: Broadcast details of IOT device when an IOT
+ * related issue is observed.
+ * <p>Always contains the extra fields {@link #EXTRA_NAME}.
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
+ * @hide
+ **/
+
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_REMOTE_ISSUE_OCCURRED =
+ "org.codeaurora.intent.bluetooth.action.REMOTE_ISSUE_OCCURRED";
+
/**
* Broadcast Action: Indicates the battery level of a remote device has
* been retrieved for the first time, or changed since the last retrieval
@@ -259,6 +306,17 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final int BATTERY_LEVEL_BLUETOOTH_OFF = -100;
/**
+ * Broadcast Action: Indicates the remote devices are TWS plus earbuds pair.
+ * <p>Always contains the extra fields {@link #EXTRA_TWS_PLUS_DEVICE1},
+ * {@link #EXTRA_TWS_PLUS_DEVICE2}.
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
+ * @hide
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_TWS_PLUS_DEVICE_PAIR =
+ "android.bluetooth.device.action.TWS_PLUS_DEVICE_PAIR";
+
+ /**
* Used as a Parcelable {@link BluetoothDevice} extra field in every intent
* broadcast by this class. It contains the {@link BluetoothDevice} that
* the intent applies to.
@@ -272,6 +330,77 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final String EXTRA_NAME = "android.bluetooth.device.extra.NAME";
/**
+ * Used as a Parcelable {@link BluetoothQualityReport} extra field in
+ * {@link #ACTION_REMOTE_ISSUE_OCCURRED} intent. It contains the {@link BluetoothQualityReport}.
+ * @hide
+ */
+ public static final String EXTRA_BQR = "android.bluetooth.qti.extra.EXTRA_BQR";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED}
+ * intents. It contains the type of IOT issue that occurred.
+ * @hide
+ */
+ public static final String EXTRA_ISSUE_TYPE = "android.bluetooth.qti.extra.ERROR_TYPE";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the details of details of the issue.
+ * @hide
+ */
+ public static final String EXTRA_ERROR_CODE = "android.bluetooth.qti.extra.ERROR_CODE";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the SoC event mask when issue occurred.
+ * @hide
+ */
+ public static final String EXTRA_ERROR_EVENT_MASK = "android.bluetooth.qti.extra.ERROR_EVENT_MASK";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the LMP Version of IOT device.
+ * @hide
+ */
+ public static final String EXTRA_LMP_VERSION = "android.bluetooth.qti.extra.EXTRA_LMP_VERSION";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the LMP Sub Version of IOT device.
+ * @hide
+ */
+ public static final String EXTRA_LMP_SUBVER = "android.bluetooth.qti.extra.EXTRA_LMP_SUBVER";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the Manufacturer ID of IOT device.
+ * @hide
+ */
+ public static final String EXTRA_MANUFACTURER = "android.bluetooth.qti.extra.EXTRA_MANUFACTURER";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the Power level.
+ * @hide
+ */
+ public static final String EXTRA_POWER_LEVEL = "android.bluetooth.qti.extra.EXTRA_POWER_LEVEL";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the Link Quality of the connection.
+ * @hide
+ */
+ public static final String EXTRA_LINK_QUALITY = "android.bluetooth.qti.extra.EXTRA_LINK_QUALITY";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_REMOTE_ISSUE_OCCURRED} intents.
+ * It contains the coutnt of glitches occured since last broadcast.
+ * @hide
+ */
+ public static final String EXTRA_GLITCH_COUNT = "android.bluetooth.qti.extra.EXTRA_GLITCH_COUNT";
+
+
+ /**
* Used as an optional short extra field in {@link #ACTION_FOUND} intents.
* Contains the RSSI value of the remote device as reported by the
* Bluetooth hardware.
@@ -303,6 +432,23 @@ public final class BluetoothDevice implements Parcelable, Attributable {
*/
public static final String EXTRA_PREVIOUS_BOND_STATE =
"android.bluetooth.device.extra.PREVIOUS_BOND_STATE";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_TWS+_DEVICE_PAIR}
+ * intents. It contains the first TWS+ earbud address of pair.
+ * @hide
+ */
+ public static final String EXTRA_TWS_PLUS_DEVICE1 =
+ "android.bluetooth.device.extra.EXTRA_TWS_PLUS_DEVICE1";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_TWS+_DEVICE_PAIR}
+ * intents. It contains the second TWS+ earbud address of pair.
+ * @hide
+ */
+ public static final String EXTRA_TWS_PLUS_DEVICE2 =
+ "android.bluetooth.device.extra.EXTRA_TWS_PLUS_DEVICE2";
+
/**
* Indicates the remote device is not bonded (paired).
* <p>There is no shared link key with the remote device, so communication
@@ -1111,10 +1257,12 @@ public final class BluetoothDevice implements Parcelable, Attributable {
/*package*/
@UnsupportedAppUsage
static IBluetooth getService() {
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ IBluetooth tService = adapter.getBluetoothService(sStateChangeCallback);
+
synchronized (BluetoothDevice.class) {
if (sService == null) {
- BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
- sService = adapter.getBluetoothService(sStateChangeCallback);
+ sService = tService;
}
}
return sService;
@@ -1125,9 +1273,10 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public void onBluetoothServiceUp(IBluetooth bluetoothService)
throws RemoteException {
synchronized (BluetoothDevice.class) {
- if (sService == null) {
- sService = bluetoothService;
+ if (sService != null) {
+ Log.w(TAG, "sService is not NULL");
}
+ sService = bluetoothService;
}
}
@@ -1496,6 +1645,16 @@ public final class BluetoothDevice implements Parcelable, Attributable {
Log.w(TAG, "BT not enabled, createBondOutOfBand failed");
return false;
}
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if (adapter != null &&
+ (((transport == TRANSPORT_LE || transport == TRANSPORT_AUTO)
+ && !adapter.isLeEnabled())
+ || ((transport == TRANSPORT_BREDR || transport == TRANSPORT_AUTO)
+ && !isBluetoothEnabled()))) {
+ Log.w(TAG, "creatBond() initiated in improper adapter state : " + adapter.getState()
+ + " transport = " + transport);
+ return false;
+ }
try {
return service.createBond(
this, transport, remoteP192Data, remoteP256Data, mAttributionSource);
@@ -1530,6 +1689,25 @@ public final class BluetoothDevice implements Parcelable, Attributable {
return false;
}
+ /** @hide */
+ @UnsupportedAppUsage
+ @RequiresLegacyBluetoothPermission
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public void setBondingInitiatedLocally(boolean localInitiated) {
+ final IBluetooth service = sService;
+ if (service == null) {
+ Log.w(TAG, "BT not enabled, setBondingInitiatedLocally failed");
+ return;
+ }
+ try {
+ service.setBondingInitiatedLocally(this, localInitiated, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "", e);
+ }
+ return;
+ }
+
/**
* Cancel an in-progress bonding request started with {@link #createBond}.
*
@@ -1572,6 +1750,13 @@ public final class BluetoothDevice implements Parcelable, Attributable {
Log.e(TAG, "BT not enabled. Cannot remove Remote Device bond");
return false;
}
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if (adapter != null && !adapter.isLeEnabled()) {
+ Log.w(TAG, "removeBond() initiated in improper adapter state : "
+ + adapter.getState());
+ return false;
+ }
+
try {
Log.i(TAG, "removeBond() for device " + getAddress()
+ " called by pid: " + Process.myPid()
@@ -1839,6 +2024,47 @@ public final class BluetoothDevice implements Parcelable, Attributable {
}
/**
+ * Returns whether if the device is TWS+ device.
+ *
+ * @return True if the devcie is TWS+ device.
+ * @hide
+ */
+ @RequiresLegacyBluetoothPermission
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean isTwsPlusDevice() {
+ if (sService == null) {
+ Log.e(TAG, "BT not enabled. Cannot query remote device sdp records");
+ return false;
+ }
+ try {
+ return sService.isTwsPlusDevice(this, mAttributionSource);
+ } catch (RemoteException e) {Log.e(TAG, "", e);}
+ return false;
+ }
+
+ /**
+ * Get the TWS+ peer address of the remote device.
+ *
+ * @return the TWS+ peer address of the remote device if available, otherwise
+ * null.
+ * @hide
+ */
+ @RequiresLegacyBluetoothPermission
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public String getTwsPlusPeerAddress() {
+ if (sService == null) {
+ Log.e(TAG, "BT not enabled. Cannot get Remote Device name");
+ return null;
+ }
+ try {
+ return sService.getTwsPlusPeerAddress(this, mAttributionSource);
+ } catch (RemoteException e) {Log.e(TAG, "", e);}
+ return null;
+ }
+
+ /**
* Set the pin during pairing when the pairing method is {@link #PAIRING_VARIANT_PIN}
*
* @return true pin has been set false for error
@@ -2539,6 +2765,48 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public BluetoothGatt connectGatt(Context context, boolean autoConnect,
BluetoothGattCallback callback, int transport,
boolean opportunistic, int phy, Handler handler) {
+ return connectGatt(context, autoConnect, callback, transport, opportunistic,
+ phy, handler, false);
+ }
+
+ /**
+ * Connect to GATT Server hosted by this device. Caller acts as GATT client.
+ * The callback is used to deliver results to Caller, such as connection status as well
+ * as any further GATT client operations.
+ * The method returns a BluetoothGatt instance. You can use BluetoothGatt to conduct
+ * GATT client operations.
+ *
+ * @param callback GATT callback handler that will receive asynchronous callbacks.
+ * @param autoConnect Whether to directly connect to the remote device (false) or to
+ * automatically connect as soon as the remote device becomes available (true).
+ * @param transport preferred transport for GATT connections to remote dual-mode devices {@link
+ * BluetoothDevice#TRANSPORT_AUTO} or {@link BluetoothDevice#TRANSPORT_BREDR} or {@link
+ * BluetoothDevice#TRANSPORT_LE}
+ * @param opportunistic Whether this GATT client is opportunistic. An opportunistic GATT client
+ * does not hold a GATT connection. It automatically disconnects when no other GATT connections
+ * are active for the remote device.
+ * @param phy preferred PHY for connections to remote LE device. Bitwise OR of any of {@link
+ * BluetoothDevice#PHY_LE_1M_MASK}, {@link BluetoothDevice#PHY_LE_2M_MASK}, an d{@link
+ * BluetoothDevice#PHY_LE_CODED_MASK}. This option does not take effect if {@code autoConnect}
+ * is set to true.
+ * @param handler The handler to use for the callback. If {@code null}, callbacks will happen on
+ * an un-specified background thread.
+ * @param eattSupport specifies whether client app needs EATT channel for client operations.
+ * If both local and remote devices support EATT and local app asks for EATT, GATT client
+ * operations will be performed using EATT channel.
+ * If either local or remote device doesn't support EATT but local App asks for EATT, GATT
+ * client operations will be performed using unenhanced ATT channel.
+ *
+ * @return A BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client
+ * operations.
+ *
+ * @throws NullPointerException if callback is null
+ *
+ * @hide
+ */
+ public BluetoothGatt connectGatt(Context context, boolean autoConnect,
+ BluetoothGattCallback callback, int transport, boolean opportunistic,
+ int phy, Handler handler, boolean eattSupport) {
if (callback == null) {
throw new NullPointerException("callback is null");
}
@@ -2555,7 +2823,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
}
BluetoothGatt gatt = new BluetoothGatt(
iGatt, this, transport, opportunistic, phy, mAttributionSource);
- gatt.connect(autoConnect, callback, handler);
+ gatt.connect(autoConnect, callback, handler, eattSupport);
return gatt;
} catch (RemoteException e) {
Log.e(TAG, "", e);
@@ -2701,4 +2969,42 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static @MetadataKey int getMaxMetadataKey() {
return METADATA_UNTETHERED_CASE_LOW_BATTERY_THRESHOLD;
}
+
+ /**
+ * Returns Device type.
+ *
+ * @return device type.
+ * @hide
+ */
+ @RequiresPermission(allOf = {
+ android.Manifest.permission.BLUETOOTH_CONNECT,
+ android.Manifest.permission.BLUETOOTH_PRIVILEGED,
+ })
+ public int getDeviceType() {
+ if (sService == null) {
+ Log.e(TAG, "getDeviceType query remote device info failed");
+ return -1;
+ }
+ try {
+ return sService.getDeviceType(this, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "getDeviceType fail ", e);
+ }
+ return -1;
+ }
+
+ /**
+ * Used as a String extra field in {@link #ACTION_BOND_STATE_CHANGED} intents.
+ * It contains the Group ID of IOT device.
+ * @hide
+ */
+ public static final String EXTRA_GROUP_ID = "android.bluetooth.qti.extra.GROUP_ID";
+
+ /**
+ * Used as a String extra field in {@link #ACTION_BOND_STATE_CHANGED} intents.
+ * It contains the IGNORE DEVICE flag of IOT device.
+ * @hide
+ */
+ public static final String EXTRA_IS_PRIVATE_ADDRESS =
+ "android.bluetooth.qti.extra.IS_PRIVATE_ADDRESS";
}
diff --git a/core/java/android/bluetooth/BluetoothDeviceGroup.java b/core/java/android/bluetooth/BluetoothDeviceGroup.java
new file mode 100644
index 000000000000..e271fac12b45
--- /dev/null
+++ b/core/java/android/bluetooth/BluetoothDeviceGroup.java
@@ -0,0 +1,892 @@
+/******************************************************************************
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package android.bluetooth;
+
+import android.annotation.RequiresPermission;
+import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
+import android.bluetooth.annotations.RequiresBluetoothScanPermission;
+import android.compat.annotation.UnsupportedAppUsage;
+import android.content.AttributionSource;
+import android.annotation.SdkConstant;
+import android.annotation.SdkConstant.SdkConstantType;
+import android.bluetooth.IBluetoothGroupCallback;
+import android.content.Context;
+import android.os.Binder;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.ParcelUuid;
+import android.os.RemoteException;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+
+/**
+ * This class provides the public APIs to perform operations of
+ * the Group Identification Profile.
+ *
+ * <p> This class provides functionalities to enable communication with remote
+ * devices which are grouped together to achieve common use cases in
+ * synchronized manner.
+ * <p> BluetoothDeviceGroup is a proxy object for controlling the Bluetooth Group
+ * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get the BluetoothDeviceGroup
+ * proxy object. Use {@link BluetoothAdapter#closeProfileProxy} to close connection
+ * of the BluetoothDeviceGroup proxy object with the profile service.
+ * <p> BluetoothDeviceGroup proxy object can be used to identify and fetch Device Group.
+ * Also, API’s are exposed to get exclusive access of group devices for critical
+ * operations. Implement BluetoothGroupCallback to get results invoked API's.
+ *
+ * @hide
+ */
+
+
+public final class BluetoothDeviceGroup implements BluetoothProfile {
+ private static final String TAG = "BluetoothDeviceGroup";
+ private static final boolean DBG = true;
+ private static final boolean VDBG = false;
+
+ /** Group Client App is registerd for callbacks successfully */
+ public static final int APP_REGISTRATION_SUCCESSFUL = 0;
+ /** Group Client App registration failed for callbacks */
+ public static final int APP_REGISTRATION_FAILED = 1;
+
+ /** Group Discovery Status when discovery is started */
+ public static final int GROUP_DISCOVERY_STARTED = 0x00;
+
+ /** Group Discovery Status when discovery is stopped */
+ public static final int GROUP_DISCOVERY_STOPPED = 0x01;
+
+ /** When Application starts Group discovery */
+ public static final int DISCOVERY_STARTED_BY_APPL = 0x00;
+
+ /** When Application stops Group discovery */
+ public static final int DISCOVERY_STOPPED_BY_APPL = 0x01;
+
+ /** When Group discovery is started as a result of
+ * change in Group property. */
+ public static final int DISCOVERY_STARTED_GROUP_PROP_CHANGED = 0x02;
+
+ /** When all devices of Group are discovered */
+ public static final int DISCOVERY_COMPLETED = 0x03;
+
+ /** Group discovery by timeeut. Group device not found in 10 sec. */
+ public static final int DISCOVERY_STOPPED_BY_TIMEOUT = 0x04;
+
+ /** Invalid params are provided for Group discovery */
+ public static final int DISCOVERY_NOT_STARTED_INVALID_PARAMS = 0x05;
+
+ /** Value to release Exclusive Access */
+ public static final int ACCESS_RELEASED = 0x01;
+
+ /** Value to acquire Exclusive Access */
+ public static final int ACCESS_GRANTED = 0x02;
+
+ /** When exclusive access is changed to #ACCESS_RELEASED for all reqested Group devices */
+ public static final int EXCLUSIVE_ACCESS_RELEASED = 0x00;
+
+ /** When exclusive access of the Group device is changed to #ACCESS_RELEASED by timeout */
+ public static final int EXCLUSIVE_ACCESS_RELEASED_BY_TIMEOUT = 0x01;
+
+ /** When exclusive access of all requested Group devices is changed to #ACCESS_GRANTED */
+ public static final int ALL_DEVICES_GRANTED_ACCESS = 0x02;
+
+ /** When exclusive access of some of the requested Group devices is changed to #ACCESS_GRANTED
+ * because of timeout in #setExclusiveAccess operation */
+ public static final int SOME_GRANTED_ACCESS_REASON_TIMEOUT = 0x03;
+
+ /** When access value of some of the requested Group devices is changed to #ACCESS_GRANTED
+ * because some of the Group devices were disconnected */
+ public static final int SOME_GRANTED_ACCESS_REASON_DISCONNECTION = 0x04;
+
+ /** When Exclusive Access couldnt be fetched as one of the Group devices denied
+ * to set value to #ACCESS_DENIED*/
+ public static final int ACCESS_DENIED = 0x05;
+
+ /** Suggests that invalid parameters are passed in #setExclusiveAccess request*/
+ public static final int INVALID_ACCESS_REQ_PARAMS = 0x06;
+
+ /** Invalid Group ID */
+ public static final int INVALID_GROUP_ID = 0x10;
+
+ /** MIN GROUP_ID Value*/
+ public static final int GROUP_ID_MIN = 0x00;
+ /** MAX GROUP_ID Value*/
+ public static final int GROUP_ID_MAX = 0x0F;
+
+ /** Invalid APP ID */
+ public static final int INVALID_APP_ID = 0x10;
+
+ /** MIN APP_ID Value*/
+ public static final int APP_ID_MIN = 0x00;
+ /** MAX APP_ID Value*/
+ public static final int APP_ID_MAX = 0x0F;
+
+ public static final String ACTION_CONNECTION_STATE_CHANGED =
+ "android.bluetooth.group.profile.action.CONNECTION_STATE_CHANGED";
+
+ private int mAppId;
+ private boolean mAppRegistered = false;
+ private Handler mHandler;
+ private BluetoothGroupCallback mCallback;
+
+ private BluetoothAdapter mAdapter;
+ private final AttributionSource mAttributionSource;
+ private final BluetoothProfileConnector<IBluetoothDeviceGroup> mProfileConnector =
+ new BluetoothProfileConnector(this, BluetoothProfile.GROUP_CLIENT,
+ "BluetoothDeviceGroup", IBluetoothDeviceGroup.class.getName()) {
+ @Override
+ public IBluetoothDeviceGroup getServiceInterface(IBinder service) {
+ return IBluetoothDeviceGroup.Stub.asInterface(Binder.allowBlocking(service));
+ }
+ };
+
+ /**
+ * Creates a BluetoothDeviceGroup proxy object for interacting with the local
+ * Bluetooth Service which handles Group operations.
+ * @hide
+ */
+ /*package*/ BluetoothDeviceGroup(Context context, ServiceListener listener) {
+ mProfileConnector.connect(context, listener);
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
+ mAttributionSource = mAdapter.getAttributionSource();
+ IBluetoothManager mgr = mAdapter.getBluetoothManager();
+ if (mgr != null) {
+ try {
+ mgr.registerStateChangeCallback(mBluetoothStateChangeCallback);
+ } catch (RemoteException re) {
+ Log.e(TAG, "", re);
+ }
+ }
+ }
+
+ private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback =
+ new IBluetoothStateChangeCallback.Stub() {
+ public void onBluetoothStateChange(boolean up) {
+ if (!up) {
+ mAppRegistered = false;
+ }
+ }
+ };
+
+ /**
+ * Close this BluetoothGroupDevice client object.
+ *
+ * Application should call this method as soon as it is done with
+ * Group operations.
+ */
+ /*package*/ void close() {
+ if (VDBG) log("close()");
+
+ mAppRegistered = false;
+ final IBluetoothDeviceGroup service = getService();
+ if (service != null) {
+ try {
+ service.unregisterGroupClientApp(mAppId, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ }
+
+ mProfileConnector.disconnect();
+ }
+
+ /**
+ * @hide
+ */
+ private IBluetoothDeviceGroup getService() {
+ return mProfileConnector.getService();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void finalize() {
+ close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<BluetoothDevice> getConnectedDevices() {
+ if (VDBG) log("getConnectedDevices()");
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
+ if (VDBG) log("getDevicesMatchingStates()");
+
+ return null;
+ }
+
+ private boolean isEnabled() {
+ return mAdapter.getState() == BluetoothAdapter.STATE_ON;
+ }
+
+ private static boolean isValidDevice(BluetoothDevice device) {
+ return device != null &&
+ BluetoothAdapter.checkBluetoothAddress(device.getAddress());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getConnectionState(BluetoothDevice device) {
+ if (VDBG) log("getState(" + device + ")");
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+
+ private final IBluetoothGroupCallback.Stub mBluetoothGroupCallback =
+ new IBluetoothGroupCallback.Stub() {
+
+ @Override
+ public void onGroupClientAppRegistered(int status, int appId) {
+ if (DBG) {
+ Log.d(TAG, "onGroupClientAppRegistered() - status=" + status
+ + " appId = " + appId);
+ }
+
+ if (status != APP_REGISTRATION_SUCCESSFUL) {
+ mAppRegistered = false;
+ }
+
+ mAppId = appId;
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onGroupClientAppRegistered(status, appId);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onGroupClientAppUnregistered(int status) {
+ if (DBG) {
+ Log.d(TAG, "onGroupClientAppUnregistered() - status=" + status
+ + " mAppId=" + mAppId);
+ }
+ }
+
+ @Override
+ public void onConnectionStateChanged (int state, BluetoothDevice device) {
+ if (DBG) {
+ Log.d(TAG, "onConnectionStateChanged() - state = " + state
+ + " device = " + device);
+ }
+
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onConnectionStateChanged(state, device);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onNewGroupFound(int groupId, BluetoothDevice device,
+ ParcelUuid uuid) {
+ if (DBG) {
+ Log.d(TAG, "onNewGroupFound() - appId = " + mAppId +
+ ", groupId = " + groupId + ", device: " + device +
+ ", Including service UUID: " + uuid.toString());
+ }
+
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onNewGroupFound(groupId, device, uuid.getUuid());
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onGroupDiscoveryStatusChanged(int groupId, int status, int reason) {
+ if (DBG) {
+ Log.d(TAG, "onGroupDiscoveryStatusChanged() - appId = " + mAppId +
+ ", groupId = " + groupId + ", status: " + status +
+ ", reason: " + reason);
+ }
+
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onGroupDiscoveryStatusChanged(groupId, status, reason);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onGroupDeviceFound(int groupId, BluetoothDevice device) {
+ if (DBG) {
+ Log.d(TAG, "onGroupDeviceFound() - appId = " + mAppId + ", device = " + device);
+ }
+
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onGroupDeviceFound(groupId, device);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onExclusiveAccessChanged(int groupId, int value, int status,
+ List<BluetoothDevice> devices) {
+ if (DBG) {
+ Log.d(TAG, "onExclusiveAccessChanged() - appId = " + mAppId
+ + ", groupId = " + groupId + ", value = " + value
+ + " accessStatus = " + status + ", devices: " + devices);
+ }
+
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onExclusiveAccessChanged(groupId, value, status, devices);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onExclusiveAccessStatusFetched(int groupId, int accessValue) {
+ }
+
+ @Override
+ public void onExclusiveAccessAvailable (int groupId, BluetoothDevice device) {
+ if (DBG) {
+ Log.d(TAG, "onExclusiveAccessAvailable() - appId = " + mAppId
+ + ", groupId = " + groupId + ", device: " + device);
+ }
+
+ runOrQueueCallback(new Runnable() {
+ @Override
+ public void run() {
+ final BluetoothGroupCallback callback = mCallback;
+ if (callback != null) {
+ callback.onExclusiveAccessAvailable(groupId, device);
+ }
+ }
+ });
+ }
+ };
+
+ /**
+ * Registers callbacks to be received by application on completion of
+ * required operations.
+ *
+ * @param callbacks Reference of BluetoothGroupCallback implemented in
+ * application.
+ * @param handler handler that will receive asynchronous callbacks.
+ * @return true, if operation was initiated successfully.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean registerGroupClientApp(BluetoothGroupCallback callbacks, Handler handler) {
+ if (DBG) log("registerGroupClientApp() mAppRegistered = " + mAppRegistered);
+
+ /* Check if app is trying multiple registrations */
+ if (mAppRegistered) {
+ Log.e(TAG, "App already registered.");
+ return false;
+ }
+
+ mHandler = handler;
+ mCallback = callbacks;
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy not attached to Profile Service. Can't register App.");
+ return false;
+ }
+
+ mAppRegistered = true;
+ try {
+ UUID uuid = UUID.randomUUID();
+ service.registerGroupClientApp(new ParcelUuid(uuid), mBluetoothGroupCallback,
+ mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ /**
+ * Starts discovery of the remaining Group devices which are part of the group.
+ *
+ * <p> This API should be called when onNewGroupFound() is received in the
+ * application and when given group is the required device group. This
+ * API can also be used to rediscover the undiscovered Group devices.
+ *
+ * <p> To the application that started group discovery,
+ * {@link BluetoothGroupCallback#onGroupDeviceFound} callback will be given when
+ * a new Group device is found and {@link BluetoothGroupCallback#onGroupDiscoveryStatusChanged}
+ * callback will be given when discovery is started.
+ *
+ * @param groupId Identifier of the Group for which group
+ * discovery has to be started.
+ * @return true, if operation was initiated successfully.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean startGroupDiscovery(int groupId) {
+ if (DBG) log("startGroupDiscovery() : groupId = " + groupId);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't start group discovery");
+ return false;
+ }
+
+ try {
+ UUID uuid = UUID.randomUUID();
+ service.startGroupDiscovery(mAppId ,groupId, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ /**
+ * Stops ongoing group discovery for Group identified by groupId.
+ *
+ * <p> {@link BluetoothGroupCallback#onGroupDiscoveryStatusChanged} is given
+ * when group discovery is stopped.
+ *
+ * @param groupId Identifier of the Group for which group
+ * discovery has to be stopped.
+ * @return true, if operation was initiated successfully.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean stopGroupDiscovery(int groupId) {
+ if (DBG) log("stopGroupDiscovery() : groupId = " + groupId);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't Stop group discovery");
+ return false;
+ }
+
+ try {
+ service.stopGroupDiscovery(mAppId ,groupId, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ /**
+ * Fetches already discovered Groups.
+ *
+ * @return List of DeviceGroup that are already discovered.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public List<DeviceGroup> getDiscoveredGroups() {
+ return getDiscoveredGroups(false);
+ }
+
+ /**
+ * Fetches already discovered device groups.
+ *
+ * @param mPublicAddr All discovered device groups with public address of devices.
+ * @return List of Device Groups that are already discovered.
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public List<DeviceGroup> getDiscoveredGroups(boolean mPublicAddr) {
+ if (DBG) log("getDiscoveredGroups()");
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return null;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't fetch Groups.");
+ return null;
+ }
+
+ try {
+ List<DeviceGroup> groups = service.getDiscoveredGroups(mPublicAddr, mAttributionSource);
+ return groups;
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+
+ return null;
+ }
+
+ /**
+ * Fetch details of a already discovered Group identified by groupId.
+ *
+ * @param groupId Identifier of the Group for which Group details are required.
+ * @return Required DeviceGroup.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public DeviceGroup getGroup(int groupId) {
+ return getGroup(groupId, false);
+ }
+
+ /**
+ * Fetch details of a already discovered Group identified by groupId.
+ *
+ * @param groupId Identifier of the device group for which group
+ * details are required.
+ * @param mPublicAddr DeviceGroup with Public Address of the group devices.
+ * @return Required DeviceGroup.
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public DeviceGroup getGroup(int groupId, boolean mPublicAddr) {
+ if (DBG) log("getGroup() : groupId = " + groupId);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return null;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't fetch Group.");
+ return null;
+ }
+
+ try {
+ DeviceGroup group = service.getDeviceGroup(groupId, mPublicAddr, mAttributionSource);
+ return group;
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+
+ return null;
+ }
+
+ /**
+ * Get Group Identifier of the remote device to which it belongs.
+ *
+ * @param device BluetoothDevice instance of the remote device.
+ * @param uuid ParcelUuid of the primary service in which this
+ * Group Service is included.
+ * @return Group identifier of the required device.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getRemoteDeviceGroupId (BluetoothDevice device, ParcelUuid uuid) {
+ return getRemoteDeviceGroupId(device, uuid, false);
+ }
+
+ /**
+ * Get Group Identifier of the remote device to which it belongs.
+ *
+ * @param device BluetoothDevice instance of the remote device.
+ * @param uuid ParcelUuid of the primary service in which this
+ * Group Service is included.
+ * @param mPublicAddr Suggests that group identifier is required for passed
+ * public address of the remote device.
+ * @return Group identifier of the required group for the device
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getRemoteDeviceGroupId (BluetoothDevice device, ParcelUuid uuid,
+ boolean mPublicAddr) {
+ if (DBG) log("getRemoteDeviceGroupId() : device = " + device);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return INVALID_GROUP_ID;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service." +
+ "Can't get group id for device.");
+ return INVALID_GROUP_ID;
+ }
+
+ try {
+ return service.getRemoteDeviceGroupId(device, uuid, mPublicAddr, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return INVALID_GROUP_ID;
+ }
+
+ /**
+ * Suggests whether discovery for a given Group is ongoing.
+ *
+ * @param groupId Identifier of the Group for which discovery
+ * status is to be known.
+ * @return true, if group discovery is ongoing for mentioned group.
+ * Otherwise, false.
+ */
+ @RequiresBluetoothScanPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN)
+ public boolean isGroupDiscoveryInProgress (int groupId) {
+ if (DBG) log("isGroupDiscoveryInProgress() : groupId = " + groupId);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service.Can't get discovery status.");
+ return false;
+ }
+
+ try {
+ return service.isGroupDiscoveryInProgress(groupId, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return false;
+ }
+
+ /**
+ * Acquires/Releases exclusive access of a given Group or subgroup.
+ * The result of this operation is returned in
+ * {@link BluetoothGroupCallback#onExclusiveAccessChanged} callback.
+ *
+ * @param groupId Identifier of the Group.
+ * @param devices List of BluetoothDevice for which access has to be changed.
+ * If this parameter is passed as null, all Group devices in the
+ * mentioned group will be considered for request.
+ * @param value Access which required to be changed.
+ * 0x01 – Access released ({@link #ACCESS_RELEASED}).
+ * 0x02 - Access granted ({@link #ACCESS_GRANTED}).
+ * @return true, if operation was initiated successfully.
+ */
+ @RequiresPermission(allOf = {
+ android.Manifest.permission.BLUETOOTH_CONNECT,
+ android.Manifest.permission.BLUETOOTH_PRIVILEGED,
+ })
+ public boolean setExclusiveAccess(int groupId, List<BluetoothDevice> devices, int value) {
+ if (DBG) log("setExclusiveAccess() : groupId = " + groupId +
+ ", access value: " + value);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't proceed.");
+ return false;
+ }
+
+ try {
+ service.setExclusiveAccess(mAppId, groupId, devices, value, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ /**
+ * Returns Status of the exclusive access for mentioned Group.
+ *
+ * @param groupId Identifier of the Group.
+ * @param devices List of BluetoothDevice for which access value has to be known.
+ * If this parameter is passed as null, all Group devices in the
+ * mentioned group will be queried for access status.
+ * @return true, if operation was initiated successfully.
+ * @hide
+ */
+ @RequiresPermission(allOf = {
+ android.Manifest.permission.BLUETOOTH_CONNECT,
+ android.Manifest.permission.BLUETOOTH_PRIVILEGED,
+ })
+ public boolean getExclusiveAccessStatus (int groupId, List<BluetoothDevice> devices) {
+ if (DBG) log("getExclusiveAccessStatus() : groupId = " + groupId);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service." +
+ " Can't get exclusive access status.");
+ return false;
+ }
+
+ try {
+ service.getExclusiveAccessStatus(mAppId, groupId, devices, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ /**
+ * Creates GATT Connection with remote device for Group Operations.
+ *
+ * <p> This API acts as trigger to start service discovery to identify
+ * new device group on remote device once connection has been established
+ * successfully. Application calling connect will get
+ * {@link BluetoothGroupCallback#onNewGroupFoundcallback} after
+ * {@link #onConnectionStateChanged} (once connection has been established
+ * and group discovery is completed.)
+ *
+ * @param device BluetoothDevice instance od remote device with which
+ * Connection is required to be established.
+ * @return true, if operation was initiated successfully.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean connect (BluetoothDevice device) {
+ if (DBG) log("connect : device = " + device);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't connect.");
+ return false;
+ }
+
+ try {
+ service.connect(mAppId, device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ /**
+ * Initiates GATT disconnection for Group Operations.
+ *
+ * @param device BluetoothDevice instance of remote device.
+ * This API must be called if application is not
+ * interested in any Group operations.
+ * @return true, if operation was initiated successfully.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean disconnect (BluetoothDevice device) {
+ if (DBG) log("disconnect : device = " + device);
+
+ if (!mAppRegistered) {
+ Log.e(TAG, "App not registered for Group operations." +
+ " Register App using registerGroupClientApp");
+ return false;
+ }
+
+ final IBluetoothDeviceGroup service = getService();
+ if (service == null) {
+ Log.e(TAG, "Proxy is not attached to Profile Service. Can't disconnect");
+ return false;
+ }
+
+ try {
+ service.disconnect(mAppId, device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ }
+ return true;
+ }
+
+ private static void log(String msg) {
+ Log.d(TAG, msg);
+ }
+
+ /**
+ * Queue the runnable on a {@link Handler} provided by the user, or execute the runnable
+ * immediately if no Handler was provided.
+ */
+ private void runOrQueueCallback(final Runnable cb) {
+ if (mHandler == null) {
+ try {
+ cb.run();
+ } catch (Exception ex) {
+ Log.w(TAG, "Unhandled exception in callback", ex);
+ }
+ } else {
+ mHandler.post(cb);
+ }
+ }
+}
diff --git a/core/java/android/bluetooth/BluetoothDun.java b/core/java/android/bluetooth/BluetoothDun.java
new file mode 100644
index 000000000000..cbf44e54dd77
--- /dev/null
+++ b/core/java/android/bluetooth/BluetoothDun.java
@@ -0,0 +1,296 @@
+/*
+*Copyright (c) 2018, The Linux Foundation. All rights reserved.
+*
+*Redistribution and use in source and binary forms, with or without
+*modification, are permitted provided that the following conditions are
+*met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of The Linux Foundation nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+*THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+*WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+*ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+*BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+*CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+*SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+*WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+*OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+*IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+package android.bluetooth;
+
+import android.annotation.SdkConstant;
+import android.annotation.SdkConstant.SdkConstantType;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class provides the APIs to control the Bluetooth Dun
+ * Profile.
+ *
+ *<p>BluetoothDun is a proxy object for controlling the Bluetooth DUN
+ * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get
+ * the BluetoothDun proxy object.
+ *
+ *<p>Each method is protected with its appropriate permission.
+ *@hide
+ */
+public final class BluetoothDun implements BluetoothProfile {
+ private static final String TAG = "BluetoothDun";
+ private static final boolean DBG = false;
+ private static final boolean VDBG = false;
+
+ /**
+ * Intent used to broadcast the change in connection state of the Dun
+ * profile.
+ *
+ * <p>This intent will have 3 extras:
+ * <ul>
+ * <li> {@link #EXTRA_STATE} - The current state of the profile. </li>
+ * <li> {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile.</li>
+ * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li>
+ * </ul>
+ *
+ * <p>{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of
+ * {@link #STATE_DISCONNECTED}, {@link #STATE_CONNECTED}.
+ *
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to
+ * receive.
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_CONNECTION_STATE_CHANGED =
+ "codeaurora.bluetooth.dun.profile.action.CONNECTION_STATE_CHANGED";
+
+ private Context mContext;
+ private ServiceListener mServiceListener;
+ private BluetoothAdapter mAdapter;
+ private IBluetoothDun mDunService;
+
+ /**
+ * Create a BluetoothDun proxy object for interacting with the local
+ * Bluetooth Service which handles the Dun profile
+ *
+ */
+ /*package*/ BluetoothDun(Context context, ServiceListener l) {
+ mContext = context;
+ mServiceListener = l;
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
+ try {
+ mAdapter.getBluetoothManager().registerStateChangeCallback(mStateChangeCallback);
+ } catch (RemoteException re) {
+ Log.w(TAG,"Unable to register BluetoothStateChangeCallback",re);
+ }
+ Log.d(TAG, "BluetoothDun() call bindService");
+ doBind();
+ }
+
+ boolean doBind() {
+ Intent intent = new Intent(IBluetoothDun.class.getName());
+ ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
+ intent.setComponent(comp);
+ if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
+ android.os.Process.myUserHandle())) {
+ Log.e(TAG, "Could not bind to Bluetooth Dun Service with " + intent);
+ return false;
+ }
+ return true;
+ }
+
+
+ /*package*/ void close() {
+ if (VDBG) log("close()");
+ mServiceListener = null;
+ IBluetoothManager mgr = mAdapter.getBluetoothManager();
+ if (mgr != null) {
+ try {
+ mgr.unregisterStateChangeCallback(mStateChangeCallback);
+ } catch (RemoteException re) {
+ Log.w(TAG,"Unable to unregister BluetoothStateChangeCallback",re);
+ }
+ }
+
+ synchronized (mConnection) {
+ if ( mDunService != null) {
+ try {
+ mDunService = null;
+ mContext.unbindService(mConnection);
+ } catch (Exception re) {
+ Log.e(TAG,"",re);
+ }
+ }
+ }
+ }
+
+ protected void finalize() {
+ close();
+ }
+
+ private IBluetoothStateChangeCallback mStateChangeCallback =
+ new IBluetoothStateChangeCallback.Stub() {
+
+ @Override
+ public void onBluetoothStateChange(boolean on) {
+ //Handle enable request to bind again.
+ Log.d(TAG, "onBluetoothStateChange on: " + on);
+ if (on) {
+ try {
+ if (mDunService == null) {
+ Log.d(TAG, "onBluetoothStateChange call bindService");
+ doBind();
+ }
+ } catch (IllegalStateException e) {
+ Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e);
+ } catch (SecurityException e) {
+ Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e);
+ }
+ } else {
+ if (VDBG) Log.d(TAG,"Unbinding service...");
+ synchronized (mConnection) {
+ if ( mDunService != null) {
+ try {
+ mDunService = null;
+ mContext.unbindService(mConnection);
+ } catch (Exception re) {
+ Log.e(TAG,"",re);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Initiate disconnection from DUN server.
+ *
+ * <p> Once the disconnection is initiated by any device either local host
+ * or remote device, the state will transition from {@link #STATE_CONNECTED}
+ * to {@link #STATE_DISCONNECTED}.
+ *
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}
+ * permission.
+ *
+ * @param device Remote Bluetooth Device
+ * @return false on immediate error,
+ * true otherwise
+ * @hide
+ */
+ public boolean disconnect(BluetoothDevice device) {
+ if (DBG) log("disconnect(" + device + ")");
+ if (mDunService != null && isEnabled() &&
+ isValidDevice(device)) {
+ try {
+ return mDunService.disconnect(device);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return false;
+ }
+ }
+ if (mDunService == null) Log.w(TAG, "Proxy not attached to service");
+ return false;
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public List<BluetoothDevice> getConnectedDevices() {
+ if (VDBG) log("getConnectedDevices()");
+ if (mDunService != null && isEnabled()) {
+ try {
+ return mDunService.getConnectedDevices();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return new ArrayList<BluetoothDevice>();
+ }
+ }
+ if (mDunService == null) Log.w(TAG, "Proxy not attached to service");
+ return new ArrayList<BluetoothDevice>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
+ if (VDBG) log("getDevicesMatchingStates()");
+ if (mDunService != null && isEnabled()) {
+ try {
+ return mDunService.getDevicesMatchingConnectionStates(states);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return new ArrayList<BluetoothDevice>();
+ }
+ }
+ if (mDunService == null) Log.w(TAG, "Proxy not attached to service");
+ return new ArrayList<BluetoothDevice>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getConnectionState(BluetoothDevice device) {
+ if (VDBG) log("getState(" + device + ")");
+ if (mDunService != null && isEnabled()
+ && isValidDevice(device)) {
+ try {
+ return mDunService.getConnectionState(device);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+ }
+ if (mDunService == null) Log.w(TAG, "Proxy not attached to service");
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+
+ private ServiceConnection mConnection = new ServiceConnection() {
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ if (DBG) Log.d(TAG, "BluetoothDUN Proxy object connected");
+ mDunService = IBluetoothDun.Stub.asInterface(service);
+
+ if (mServiceListener != null) {
+ mServiceListener.onServiceConnected(BluetoothProfile.DUN,
+ BluetoothDun.this);
+ }
+ }
+ public void onServiceDisconnected(ComponentName className) {
+ if (DBG) Log.d(TAG, "BluetoothDUN Proxy object disconnected");
+ mDunService = null;
+ if (mServiceListener != null) {
+ mServiceListener.onServiceDisconnected(BluetoothProfile.DUN);
+ }
+ }
+ };
+
+ private boolean isEnabled() {
+ if (mAdapter.getState() == BluetoothAdapter.STATE_ON) return true;
+ return false;
+ }
+
+ private boolean isValidDevice(BluetoothDevice device) {
+ if (device == null) return false;
+
+ if (BluetoothAdapter.checkBluetoothAddress(device.getAddress())) return true;
+ return false;
+ }
+
+ private static void log(String msg) {
+ Log.d(TAG, msg);
+ }
+}
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index aea82102ca36..5d4f2ae87b48 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -927,9 +927,45 @@ public final class BluetoothGatt implements BluetoothProfile {
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
/*package*/ boolean connect(Boolean autoConnect, BluetoothGattCallback callback,
Handler handler) {
+ return connect(autoConnect, callback, handler, false);
+ }
+
+ /**
+ * Initiate a connection to a Bluetooth GATT capable device.
+ *
+ * <p>The connection may not be established right away, but will be
+ * completed when the remote device is available. A
+ * {@link BluetoothGattCallback#onConnectionStateChange} callback will be
+ * invoked when the connection state changes as a result of this function.
+ *
+ * <p>The autoConnect parameter determines whether to actively connect to
+ * the remote device, or rather passively scan and finalize the connection
+ * when the remote device is in range/available. Generally, the first ever
+ * connection to a device should be direct (autoConnect set to false) and
+ * subsequent connections to known devices should be invoked with the
+ * autoConnect parameter set to true.
+ *
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
+ *
+ * @param device Remote device to connect to
+ * @param autoConnect Whether to directly connect to the remote device (false) or to
+ * automatically connect as soon as the remote device becomes available (true).
+ * @param eattSupport specifies whether client app needs EATT channel for client operations.
+ * If both local and remote devices support EATT and local app asks for EATT, GATT client
+ * operations will be performed using EATT channel.
+ * If either local or remote device doesn't support EATT but local App asks for EATT, GATT
+ * client operations will be performed using unenhanced ATT channel.
+ * @return true, if the connection attempt was initiated successfully
+ *
+ * @hide
+ */
+ @UnsupportedAppUsage
+ /*package*/ boolean connect(Boolean autoConnect, BluetoothGattCallback callback,
+ Handler handler, boolean eattSupport) {
if (DBG) {
Log.d(TAG,
- "connect() - device: " + mDevice.getAddress() + ", auto: " + autoConnect);
+ "connect() - device: " + mDevice.getAddress() + ", auto: " + autoConnect
+ + ", eattSupport: " + eattSupport);
}
synchronized (mStateLock) {
if (mConnState != CONN_STATE_IDLE) {
@@ -940,7 +976,7 @@ public final class BluetoothGatt implements BluetoothProfile {
mAutoConnect = autoConnect;
- if (!registerApp(callback, handler)) {
+ if (!registerApp(callback, handler, eattSupport)) {
synchronized (mStateLock) {
mConnState = CONN_STATE_IDLE;
}
diff --git a/core/java/android/bluetooth/BluetoothGroupCallback.java b/core/java/android/bluetooth/BluetoothGroupCallback.java
new file mode 100644
index 000000000000..a818cc77fd3a
--- /dev/null
+++ b/core/java/android/bluetooth/BluetoothGroupCallback.java
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package android.bluetooth;
+
+import java.util.UUID;
+import java.util.List;
+/**
+ * This abstract class is used to implement {@link BluetoothDeviceGroup} callbacks.
+ * @hide
+ */
+public abstract class BluetoothGroupCallback {
+ /**
+ * This Callback gives connection state changed with specific group device.
+ *
+ * @param state Connection state of the {@link BluetoothProfile} group device.
+ * @param device Remote device for which connection state has changed.
+ */
+ public void onConnectionStateChanged (int state, BluetoothDevice device) {
+ }
+
+ /**
+ * This callback is given when application is registered for Group operation
+ * callbacks. This callback is given after {@link BluetoothDeviceGroup#registerGroupClientApp}
+ * is called.
+ *
+ * @param status Status of the group client app registration.
+ * @param appId Identifier of the application for group operations.
+ */
+ public void onGroupClientAppRegistered(int status, int appId) {
+ }
+
+ /**
+ * This callback is triggered when a new device group has been identified
+ * from one of the connected device. After this callback is received, application
+ * can choose to trigger discovery of device group using API
+ * {@link BluetoothDeviceGroup#startGroupDiscovery}
+ *
+ * @param groupId Identifier of the Device Group.
+ * @param device Remote device with which Device Group is found.
+ * @param uuid UUID of the primary Service for this Device Group Service.
+ */
+ public void onNewGroupFound (int groupId, BluetoothDevice device, UUID uuid) {
+ }
+
+ /**
+ * This Callback is triggered when device group discovery is either started/stopped.
+ *
+ * @param groupId Identifier of the device group.
+ * @param status Device Group Discovery status.
+ * {@link BluetoothDeviceGroup#GROUP_DISCOVERY_STARTED}
+ * or {@link BluetoothDeviceGroup#GROUP_DISCOVERY_STOPPED}.
+ * @param reason Reason for change in the discovery status.
+ */
+ public void onGroupDiscoveryStatusChanged (int groupId, int status, int reason) {
+ }
+
+ /**
+ * This callback is triggered when new group device has been found after group
+ * discovery has been started. This callback is given on discovery of every
+ * new group device.
+ *
+ * @param groupId Identifier of the device group.
+ * @param device {@link BluetoothDevice} instance of discovered group device.
+ */
+ public void onGroupDeviceFound (int groupId, BluetoothDevice device) {
+ }
+
+ /**
+ * This callback is triggered after exclusive access status of the group
+ * or subgroup has been changed after the request from application.
+ *
+ * @param groupId Identifier of the device group.
+ * @param value Changed value of the exclusive access.
+ * @param status Status associated with the exclusive access.
+ * @param devices List of devices for which exclusive access has been changed.
+ */
+ public void onExclusiveAccessChanged (int groupId, int value, int status,
+ List<BluetoothDevice> devices) {
+ }
+
+ /**
+ * This callback gives access status of requested group/subgroup once
+ * it is fetched.
+ *
+ * @param groupId Identifier of the device group.
+ * @param accessStatus Value of the Exclusive Access.
+ */
+ public void onExclusiveAccessStatusFetched (int groupId, int accessStatus) {
+ }
+
+ /**
+ * This callback is given to application when exclusive access is available
+ * for the device of a given group for which was denied earlier.
+ * <p> Exclusive Access is considered available when group device sends notification
+ * for access changed to BluetoothDeviceGroup#ACCESS_RELEASED. This callback is
+ * given to the application which has requested the access earlier and the request
+ * had failed as one of the group device had DENIED the access.
+ *
+ * @param groupId Identifier of the device group.
+ * @param device {@link BluetoothDevice} which has exclusive access available.
+ */
+ public void onExclusiveAccessAvailable (int groupId, BluetoothDevice device) {
+ }
+
+} \ No newline at end of file
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java
index b594ae34436e..aadd036250fe 100644
--- a/core/java/android/bluetooth/BluetoothHeadset.java
+++ b/core/java/android/bluetooth/BluetoothHeadset.java
@@ -43,8 +43,11 @@ import android.os.RemoteException;
import android.util.CloseGuard;
import android.util.Log;
+import com.android.internal.annotations.GuardedBy;
+
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* Public API for controlling the Bluetooth Headset Service. This includes both
@@ -270,6 +273,13 @@ public final class BluetoothHeadset implements BluetoothProfile {
public static final String VENDOR_SPECIFIC_HEADSET_EVENT_XEVENT_BATTERY_LEVEL = "BATTERY";
/**
+ * Headset state when SCO audio is disconnecting.
+ *
+ * @hide
+ */
+ public static final int STATE_AUDIO_DISCONNECTING = 13;
+
+ /**
* Headset state when SCO audio is not connected.
* This state can be one of
* {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of
@@ -294,6 +304,41 @@ public final class BluetoothHeadset implements BluetoothProfile {
public static final int STATE_AUDIO_CONNECTED = 12;
/**
+ * Intent used to broadcast the Battery status of TWS+ devices
+ *
+ * <p>This intent will have 2 extras:
+ * <ul>
+ * <li> {@link #EXTRA_HF_TWSP_BATTERY_STATE} - Current Battey state of TWS+
+ * device. 0 for Discharging, 1 for Charging
+ * <\li>
+ * <li> {@link #EXTRA_HF_TWSP_BATTERY_LEVEL} - Current Battey charging level
+ * in percentage of TWS+ device.
+ * <\li>
+ *
+ * @hide
+ */
+ public static final String ACTION_HF_TWSP_BATTERY_STATE_CHANGED =
+ "android.bluetooth.headset.action.HF_TWSP_BATTERY_STATE_CHANGED";
+
+ /**
+ * A int extra field in {@link #EXTRA_HF_TWSP_BATTERY_STATE}
+ * intents that contains the battery state of TWS+ device
+ *
+ * @hide
+ */
+ public static final String EXTRA_HF_TWSP_BATTERY_STATE =
+ "android.bluetooth.headset.extra.HF_TWSP_BATTERY_STATE";
+
+ /**
+ * A int extra field in {@link #EXTRA_HF_TWSP_BATTERY_LEVEL}
+ * intents that contains the value of battery level in percentage for TWS+ device
+ * @hide
+ */
+ public static final String EXTRA_HF_TWSP_BATTERY_LEVEL =
+ "android.bluetooth.headset.extra.HF_TWSP_BATTERY_LEVEL";
+
+
+ /**
* Intent used to broadcast the headset's indicator status
*
* <p>This intent will have 3 extras:
@@ -344,7 +389,8 @@ public final class BluetoothHeadset implements BluetoothProfile {
private Context mContext;
private ServiceListener mServiceListener;
- private volatile IBluetoothHeadset mService;
+ private final ReentrantReadWriteLock mServiceLock = new ReentrantReadWriteLock();
+ @GuardedBy("mServiceLock") private IBluetoothHeadset mService;
private final BluetoothAdapter mAdapter;
private final AttributionSource mAttributionSource;
@@ -395,7 +441,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
private boolean doBind() {
synchronized (mConnection) {
if (mService == null) {
- if (VDBG) Log.d(TAG, "Binding service...");
+ if (DBG) Log.d(TAG, "Binding service...");
try {
return mAdapter.getBluetoothManager().bindBluetoothProfileService(
BluetoothProfile.HEADSET, mConnection);
@@ -409,15 +455,17 @@ public final class BluetoothHeadset implements BluetoothProfile {
private void doUnbind() {
synchronized (mConnection) {
+ if (DBG) Log.d(TAG, "Unbinding service...");
if (mService != null) {
- if (VDBG) Log.d(TAG, "Unbinding service...");
try {
mAdapter.getBluetoothManager().unbindBluetoothProfileService(
BluetoothProfile.HEADSET, mConnection);
} catch (RemoteException e) {
Log.e(TAG, "Unable to unbind HeadsetService", e);
} finally {
+ mServiceLock.writeLock().lock();
mService = null;
+ mServiceLock.writeLock().unlock();
}
}
}
@@ -542,19 +590,24 @@ public final class BluetoothHeadset implements BluetoothProfile {
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public List<BluetoothDevice> getConnectedDevices() {
if (VDBG) log("getConnectedDevices()");
- final IBluetoothHeadset service = mService;
- if (service != null && isEnabled()) {
- try {
- return Attributable.setAttributionSource(
- service.getConnectedDevicesWithAttribution(mAttributionSource),
- mAttributionSource);
- } catch (RemoteException e) {
- Log.e(TAG, Log.getStackTraceString(new Throwable()));
- return new ArrayList<BluetoothDevice>();
+ try {
+ mServiceLock.readLock().lock();
+ final IBluetoothHeadset service = mService;
+ if (service != null && isEnabled()) {
+ try {
+ return Attributable.setAttributionSource(
+ service.getConnectedDevicesWithAttribution(mAttributionSource),
+ mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, Log.getStackTraceString(new Throwable()));
+ return new ArrayList<BluetoothDevice>();
+ }
}
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return new ArrayList<BluetoothDevice>();
+ } finally {
+ mServiceLock.readLock().unlock();
}
- if (service == null) Log.w(TAG, "Proxy not attached to service");
- return new ArrayList<BluetoothDevice>();
}
/**
@@ -872,14 +925,19 @@ public final class BluetoothHeadset implements BluetoothProfile {
public boolean isAudioConnected(BluetoothDevice device) {
if (VDBG) log("isAudioConnected()");
final IBluetoothHeadset service = mService;
- if (service != null && isEnabled() && isValidDevice(device)) {
- try {
- return service.isAudioConnected(device, mAttributionSource);
- } catch (RemoteException e) {
- Log.e(TAG, Log.getStackTraceString(new Throwable()));
+ try {
+ mServiceLock.readLock().lock();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ return service.isAudioConnected(device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, Log.getStackTraceString(new Throwable()));
+ }
}
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ } finally {
+ mServiceLock.readLock().unlock();
}
- if (service == null) Log.w(TAG, "Proxy not attached to service");
return false;
}
@@ -1381,17 +1439,26 @@ public final class BluetoothHeadset implements BluetoothProfile {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
if (DBG) Log.d(TAG, "Proxy object connected");
- mService = IBluetoothHeadset.Stub.asInterface(Binder.allowBlocking(service));
- mHandler.sendMessage(mHandler.obtainMessage(
- MESSAGE_HEADSET_SERVICE_CONNECTED));
+ try {
+ mServiceLock.writeLock().lock();
+ mService = IBluetoothHeadset.Stub.asInterface(Binder.allowBlocking(service));
+ mHandler.sendMessage(mHandler.obtainMessage(
+ MESSAGE_HEADSET_SERVICE_CONNECTED));
+ } finally {
+ mServiceLock.writeLock().unlock();
+ }
}
@Override
public void onServiceDisconnected(ComponentName className) {
if (DBG) Log.d(TAG, "Proxy object disconnected");
- doUnbind();
- mHandler.sendMessage(mHandler.obtainMessage(
- MESSAGE_HEADSET_SERVICE_DISCONNECTED));
+ try {
+ mServiceLock.writeLock().lock();
+ mHandler.sendMessage(mHandler.obtainMessage(
+ MESSAGE_HEADSET_SERVICE_DISCONNECTED));
+ } finally {
+ mServiceLock.writeLock().unlock();
+ }
}
};
@@ -1433,4 +1500,60 @@ public final class BluetoothHeadset implements BluetoothProfile {
}
}
};
+
+ /**
+ * Notify Headset of phone state change.
+ * This is a backdoor for phone app to call BluetoothHeadset since
+ * there is currently not a good way to get precise call state change outside
+ * of phone app.
+ *
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(allOf = {
+ android.Manifest.permission.BLUETOOTH_CONNECT,
+ android.Manifest.permission.MODIFY_PHONE_STATE,
+ })
+ public void phoneStateChangedDsDa(int numActive, int numHeld, int callState, String number,
+ int type, String name) {
+ final IBluetoothHeadset service = mService;
+ if (service != null && isEnabled()) {
+ try {
+ service.phoneStateChangedDsDa(numActive, numHeld, callState, number, type, name,
+ mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, e.toString());
+ }
+ } else {
+ Log.w(TAG, "Proxy not attached to service");
+ if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
+ }
+ }
+
+ /**
+ * Send Headset of CLCC response
+ *
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(allOf = {
+ android.Manifest.permission.BLUETOOTH_CONNECT,
+ android.Manifest.permission.MODIFY_PHONE_STATE,
+ })
+ public void clccResponseDsDa(int index, int direction, int status, int mode, boolean mpty,
+ String number, int type) {
+ final IBluetoothHeadset service = mService;
+ if (service != null && isEnabled()) {
+ try {
+ service.clccResponseDsDa(index, direction, status, mode, mpty, number, type,
+ mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, e.toString());
+ }
+ } else {
+ Log.w(TAG, "Proxy not attached to service");
+ if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
+ }
+ }
+
}
diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java
index 161c843f0398..5f9d953bd730 100644
--- a/core/java/android/bluetooth/BluetoothProfile.java
+++ b/core/java/android/bluetooth/BluetoothProfile.java
@@ -213,12 +213,60 @@ public interface BluetoothProfile {
int LE_AUDIO = 22;
/**
+ * DUN
+ * @hide
+ */
+ public static final int DUN = 23;
+
+ /**
+ * Group Operation Profile (Client Role)
+ * @hide
+ */
+ public int GROUP_CLIENT = 24;
+
+ /**
+ * Broadcast
+ * @hide
+ */
+ public int BROADCAST = 25;
+
+ /**
+ * VCP
+ * @hide
+ */
+ public static final int VCP = 26;
+
+ /**
+ * BC_PROFILE
+ * @hide
+ */
+ public static final int BC_PROFILE = 27;
+
+ /**
+ * PC_PROFILE
+ * @hide
+ */
+ public static final int PC_PROFILE = 28;
+
+ /**
+ * CC_SERVER
+ * @hide
+ */
+ public static final int CC_SERVER = 29;
+
+ /**
+ * MCP_SERVER
+ * @hide
+ */
+ public static final int MCP_SERVER = 30;
+
+ /**
* Max profile ID. This value should be updated whenever a new profile is added to match
* the largest value assigned to a profile.
*
* @hide
*/
- int MAX_PROFILE_ID = 22;
+ int MAX_PROFILE_ID = 30;
/**
* Default priority for devices that we try to auto-connect to and
@@ -416,6 +464,10 @@ public interface BluetoothProfile {
return "OPP";
case HEARING_AID:
return "HEARING_AID";
+ case BROADCAST:
+ return "BROADCAST";
+ case VCP:
+ return "VCP";
default:
return "UNKNOWN_PROFILE";
}
diff --git a/core/java/android/bluetooth/BluetoothQualityReport.java b/core/java/android/bluetooth/BluetoothQualityReport.java
new file mode 100644
index 000000000000..e9ed008b6954
--- /dev/null
+++ b/core/java/android/bluetooth/BluetoothQualityReport.java
@@ -0,0 +1,1447 @@
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package android.bluetooth;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+import java.nio.BufferUnderflowException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.Arrays;
+
+/**
+ * This class provides the public APIs to access the data of BQR event reported
+ * from firmware side. Currently it supports five event types: Quality monitor event,
+ * Approaching LSTO event, A2DP choppy event, SCO choppy event and Connect fail event.
+ * To know which kind of event is wrapped in this {@link BluetoothQualityReport} object,
+ * you need to call {@link #getQualityReportId}.
+ * <ul>
+ * <li> For Quality monitor event, you can call {@link #getBqrCommon} to get a
+ * {@link BluetoothQualityReport.BqrCommon} object, and call {@link #getBqrVsCommon} to get a
+ * {@link BluetoothQualityReport.BqrVsCommon} object.
+ * <li> For Approaching LSTO event, you can call {@link #getBqrCommon} to get a
+ * {@link BluetoothQualityReport.BqrCommon} object, and call {@link #getBqrVsCommon} to get a
+ * {@link BluetoothQualityReport.BqrVsCommon} object, and call {@link #getBqrVsLsto} to get a
+ * {@link BluetoothQualityReport.BqrVsLsto} object.
+ * <li> For A2DP choppy event, you can call {@link #getBqrCommon} to get a
+ * {@link BluetoothQualityReport.BqrCommon} object, and call {@link #getBqrVsCommon} to get a
+ * {@link BluetoothQualityReport.BqrVsCommon} object, and call {@link #getBqrVsA2dpChoppy} to
+ * get a {@link BluetoothQualityReport.BqrVsA2dpChoppy} object.
+ * <li> For SCO choppy event, you can call {@link #getBqrCommon} to get a
+ * {@link BluetoothQualityReport.BqrCommon} object, and call {@link #getBqrVsCommon} to get a
+ * {@link BluetoothQualityReport.BqrVsCommon} object, and call {@link #getBqrVsScoChoppy} to
+ * get a {@link BluetoothQualityReport.BqrVsScoChoppy} object.
+ * <li> For Connect fail event, you can call {@link #getBqrCommon} to get a
+ * {@link BluetoothQualityReport.BqrCommon} object, and call {@link #getBqrVsCommon} to get a
+ * {@link BluetoothQualityReport.BqrVsCommon} object, and call {@link #getBqrVsConnectFail} to
+ * get a {@link BluetoothQualityReport.BqrVsConnectFail} object.
+ * </ul>
+ *
+ * @hide
+ */
+public final class BluetoothQualityReport implements Parcelable {
+ private static final String TAG = "BluetoothQualityReport";
+
+ public static final int QUALITY_REPORT_ID_MONITOR = 0x01;
+ public static final int QUALITY_REPORT_ID_APPROACH_LSTO = 0x02;
+ public static final int QUALITY_REPORT_ID_A2DP_CHOPPY = 0x03;
+ public static final int QUALITY_REPORT_ID_SCO_CHOPPY = 0x04;
+ /* Vendor Specific Report IDs from 0x20 */
+ public static final int QUALITY_REPORT_ID_CONN_FAIL = 0x20;
+
+ private String mAddr;
+ private int mLmpVer;
+ private int mLmpSubVer;
+ private int mManufacturerId;
+ private String mName;
+ private int mBluetoothClass;
+
+ private BqrCommon mBqrCommon;
+
+ private BqrVsCommon mBqrVsCommon;
+ private BqrVsLsto mBqrVsLsto;
+ private BqrVsA2dpChoppy mBqrVsA2dpChoppy;
+ private BqrVsScoChoppy mBqrVsScoChoppy;
+ private BqrVsConnectFail mBqrVsConnectFail;
+
+ enum PacketType {
+ INVALID, TYPE_ID, TYPE_NULL, TYPE_POLL, TYPE_FHS, TYPE_HV1, TYPE_HV2, TYPE_HV3,
+ TYPE_DV, TYPE_EV3, TYPE_EV4, TYPE_EV5, TYPE_2EV3, TYPE_2EV5, TYPE_3EV3, TYPE_3EV5,
+ TYPE_DM1, TYPE_DH1, TYPE_DM3, TYPE_DH3, TYPE_DM5, TYPE_DH5, TYPE_AUX1, TYPE_2DH1,
+ TYPE_2DH3, TYPE_2DH5, TYPE_3DH1, TYPE_3DH3, TYPE_3DH5;
+
+ private static PacketType[] sAllValues = values();
+
+ static PacketType fromOrdinal(int n) {
+ if (n < sAllValues.length) {
+ return sAllValues[n];
+ }
+ return INVALID;
+ }
+ }
+
+ enum ConnState {
+ CONN_IDLE(0x00), CONN_ACTIVE(0x81), CONN_HOLD(0x02), CONN_SNIFF_IDLE(0x03),
+ CONN_SNIFF_ACTIVE(0x84), CONN_SNIFF_MASTER_TRANSITION(0x85), CONN_PARK(0x06),
+ CONN_PARK_PEND(0x47), CONN_UNPARK_PEND(0x08), CONN_UNPARK_ACTIVE(0x89),
+ CONN_DISCONNECT_PENDING(0x4A), CONN_PAGING(0x0B), CONN_PAGE_SCAN(0x0C),
+ CONN_LOCAL_LOOPBACK(0x0D), CONN_LE_ACTIVE(0x0E), CONN_ANT_ACTIVE(0x0F),
+ CONN_TRIGGER_SCAN(0x10), CONN_RECONNECTING(0x11), CONN_SEMI_CONN(0x12);
+
+ private int mValue;
+ private static ConnState[] sAllStates = values();
+
+ private ConnState(int val) {
+ mValue = val;
+ }
+
+ public static String getName(int val) {
+ for (ConnState state: sAllStates) {
+ if (state.mValue == val) {
+ return state.toString();
+ }
+ }
+ return "INVALID";
+ }
+ }
+
+ enum LinkQuality {
+ ULTRA_HIGH, HIGH, STANDARD, MEDIUM, LOW, INVALID;
+
+ private static LinkQuality[] sAllValues = values();
+
+ static LinkQuality fromOrdinal(int n) {
+ if (n < sAllValues.length - 1) {
+ return sAllValues[n];
+ }
+ return INVALID;
+ }
+ }
+
+ enum AirMode {
+ uLaw, aLaw, CVSD, transparent_msbc, INVALID;
+
+ private static AirMode[] sAllValues = values();
+
+ static AirMode fromOrdinal(int n) {
+ if (n < sAllValues.length - 1) {
+ return sAllValues[n];
+ }
+ return INVALID;
+ }
+ }
+
+ public BluetoothQualityReport(String remoteAddr, int lmpVer, int lmpSubVer,
+ int manufacturerId, String remoteName, int remoteCoD, byte[] rawData) {
+ if (!BluetoothAdapter.checkBluetoothAddress(remoteAddr)) {
+ Log.d(TAG, "remote addr is invalid");
+ mAddr = "00:00:00:00:00:00";
+ } else {
+ mAddr = remoteAddr;
+ }
+
+ mLmpVer = lmpVer;
+ mLmpSubVer = lmpSubVer;
+ mManufacturerId = manufacturerId;
+ if (remoteName == null) {
+ Log.d(TAG, "remote name is null");
+ mName = "";
+ } else {
+ mName = remoteName;
+ }
+ mBluetoothClass = remoteCoD;
+
+ mBqrCommon = new BqrCommon(rawData, 0);
+
+ mBqrVsCommon = new BqrVsCommon(rawData, BqrCommon.BQR_COMMON_LEN);
+ int id = mBqrCommon.getQualityReportId();
+ if (id == QUALITY_REPORT_ID_MONITOR)
+ return;
+
+ int vsPartOffset = BqrCommon.BQR_COMMON_LEN + mBqrVsCommon.getLength();
+ if (id == QUALITY_REPORT_ID_APPROACH_LSTO) {
+ mBqrVsLsto = new BqrVsLsto(rawData, vsPartOffset);
+ } else if (id == QUALITY_REPORT_ID_A2DP_CHOPPY) {
+ mBqrVsA2dpChoppy = new BqrVsA2dpChoppy(rawData, vsPartOffset);
+ } else if (id == QUALITY_REPORT_ID_SCO_CHOPPY) {
+ mBqrVsScoChoppy = new BqrVsScoChoppy(rawData, vsPartOffset);
+ } else if (id == QUALITY_REPORT_ID_CONN_FAIL) {
+ mBqrVsConnectFail = new BqrVsConnectFail(rawData, vsPartOffset);
+ } else {
+ throw new IllegalArgumentException(TAG + ": unkown quality report id:" + id);
+ }
+ }
+
+ private BluetoothQualityReport(Parcel in) {
+ mBqrCommon = new BqrCommon(in);
+ mAddr = in.readString();
+ mLmpVer = in.readInt();
+ mLmpSubVer = in.readInt();
+ mManufacturerId = in.readInt();
+ mName = in.readString();
+ mBluetoothClass = in.readInt();
+
+ mBqrVsCommon = new BqrVsCommon(in);
+ int id = mBqrCommon.getQualityReportId();
+ if (id == QUALITY_REPORT_ID_APPROACH_LSTO) {
+ mBqrVsLsto = new BqrVsLsto(in);
+ } else if (id == QUALITY_REPORT_ID_A2DP_CHOPPY) {
+ mBqrVsA2dpChoppy = new BqrVsA2dpChoppy(in);
+ } else if (id == QUALITY_REPORT_ID_SCO_CHOPPY) {
+ mBqrVsScoChoppy = new BqrVsScoChoppy(in);
+ } else if (id == QUALITY_REPORT_ID_CONN_FAIL) {
+ mBqrVsConnectFail = new BqrVsConnectFail(in);
+ }
+ }
+
+ /**
+ * Get the quality report id.
+ * @return the id, is one of {@link #QUALITY_REPORT_ID_MONITOR},
+ * {@link #QUALITY_REPORT_ID_APPROACH_LSTO}, {@link #QUALITY_REPORT_ID_A2DP_CHOPPY},
+ * {@link #QUALITY_REPORT_ID_SCO_CHOPPY}, {@link #QUALITY_REPORT_ID_CONN_FAIL}.
+ */
+ public int getQualityReportId() {
+ return mBqrCommon.getQualityReportId();
+ }
+
+ /**
+ * Get the string of the quality report id.
+ * @return the string of the id.
+ */
+ public String getQualityReportIdStr() {
+ int id = mBqrCommon.getQualityReportId();
+ switch (id) {
+ case QUALITY_REPORT_ID_MONITOR:
+ return "Quality monitor";
+ case QUALITY_REPORT_ID_APPROACH_LSTO:
+ return "Approaching LSTO";
+ case QUALITY_REPORT_ID_A2DP_CHOPPY:
+ return "A2DP choppy";
+ case QUALITY_REPORT_ID_SCO_CHOPPY:
+ return "SCO choppy";
+ case QUALITY_REPORT_ID_CONN_FAIL:
+ return "Connect fail";
+ default:
+ return "INVALID";
+ }
+ }
+
+ /**
+ * Get bluetooth address of remote device in this report.
+ * @return bluetooth address of remote device.
+ */
+ public String getAddress() {
+ return mAddr;
+ }
+
+ /**
+ * Get LMP version of remote device in this report.
+ * @return LMP version of remote device.
+ */
+ public int getLmpVersion() {
+ return mLmpVer;
+ }
+
+ /**
+ * Get LMP subVersion of remote device in this report.
+ * @return LMP subVersion of remote device.
+ */
+ public int getLmpSubVersion() {
+ return mLmpSubVer;
+ }
+
+ /**
+ * Get manufacturer id of remote device in this report.
+ * @return manufacturer id of remote device.
+ */
+ public int getManufacturerId() {
+ return mManufacturerId;
+ }
+
+ /**
+ * Get the name of remote device in this report.
+ * @return the name of remote device.
+ */
+ public String getName() {
+ return mName;
+ }
+
+ /**
+ * Get the class of remote device in this report.
+ * @return the class of remote device.
+ */
+ public int getBluetoothClass() {
+ return mBluetoothClass;
+ }
+
+ /**
+ * Get the {@link BluetoothQualityReport.BqrCommon} object.
+ * @return the {@link BluetoothQualityReport.BqrCommon} object.
+ */
+ public BqrCommon getBqrCommon() {
+ return mBqrCommon;
+ }
+
+ /**
+ * Get the {@link BluetoothQualityReport.BqrVsCommon} object.
+ * @return the {@link BluetoothQualityReport.BqrVsCommon} object.
+ */
+ public BqrVsCommon getBqrVsCommon() {
+ return mBqrVsCommon;
+ }
+
+ /**
+ * Get the {@link BluetoothQualityReport.BqrVsLsto} object.
+ * @return the {@link BluetoothQualityReport.BqrVsLsto} object
+ * or null if report id is not {@link #QUALITY_REPORT_ID_APPROACH_LSTO}.
+ */
+ public BqrVsLsto getBqrVsLsto() {
+ return mBqrVsLsto;
+ }
+
+ /**
+ * Get the {@link BluetoothQualityReport.BqrVsA2dpChoppy} object.
+ * @return the {@link BluetoothQualityReport.BqrVsA2dpChoppy} object
+ * or null if report id is not {@link #QUALITY_REPORT_ID_A2DP_CHOPPY}.
+ */
+ public BqrVsA2dpChoppy getBqrVsA2dpChoppy() {
+ return mBqrVsA2dpChoppy;
+ }
+
+ /**
+ * Get the {@link BluetoothQualityReport.BqrVsScoChoppy} object.
+ * @return the {@link BluetoothQualityReport.BqrVsScoChoppy} object
+ * or null if report id is not {@link #QUALITY_REPORT_ID_SCO_CHOPPY}.
+ */
+ public BqrVsScoChoppy getBqrVsScoChoppy() {
+ return mBqrVsScoChoppy;
+ }
+
+ /**
+ * Get the {@link BluetoothQualityReport.BqrVsConnectFail} object.
+ * @return the {@link BluetoothQualityReport.BqrVsConnectFail} object
+ * or null if report id is not {@link #QUALITY_REPORT_ID_CONN_FAIL}.
+ */
+ public BqrVsConnectFail getBqrVsConnectFail() {
+ return mBqrVsConnectFail;
+ }
+
+ public static final @android.annotation.NonNull Parcelable.Creator<BluetoothQualityReport> CREATOR =
+ new Parcelable.Creator<BluetoothQualityReport>() {
+ public BluetoothQualityReport createFromParcel(Parcel in) {
+ return new BluetoothQualityReport(in);
+ }
+
+ public BluetoothQualityReport[] newArray(int size) {
+ return new BluetoothQualityReport[size];
+ }
+ };
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ mBqrCommon.writeToParcel(out, flags);
+ out.writeString(mAddr);
+ out.writeInt(mLmpVer);
+ out.writeInt(mLmpSubVer);
+ out.writeInt(mManufacturerId);
+ out.writeString(mName);
+ out.writeInt(mBluetoothClass);
+ mBqrVsCommon.writeToParcel(out, flags);
+ int id = mBqrCommon.getQualityReportId();
+ if (id == QUALITY_REPORT_ID_APPROACH_LSTO) {
+ mBqrVsLsto.writeToParcel(out, flags);
+ } else if (id == QUALITY_REPORT_ID_A2DP_CHOPPY) {
+ mBqrVsA2dpChoppy.writeToParcel(out, flags);
+ } else if (id == QUALITY_REPORT_ID_SCO_CHOPPY) {
+ mBqrVsScoChoppy.writeToParcel(out, flags);
+ } else if (id == QUALITY_REPORT_ID_CONN_FAIL) {
+ mBqrVsConnectFail.writeToParcel(out, flags);
+ }
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = "BQR: {\n"
+ + " mAddr: " + mAddr
+ + ", mLmpVer: " + String.format("0x%02X", mLmpVer)
+ + ", mLmpSubVer: " + String.format("0x%04X", mLmpSubVer)
+ + ", mManufacturerId: " + String.format("0x%04X", mManufacturerId)
+ + ", mName: " + mName
+ + ", mBluetoothClass: " + String.format("0x%X", mBluetoothClass)
+ + ",\n"
+ + mBqrCommon + "\n"
+ + mBqrVsCommon + "\n";
+
+ int id = mBqrCommon.getQualityReportId();
+ if (id == QUALITY_REPORT_ID_APPROACH_LSTO) {
+ str += mBqrVsLsto + "\n}";
+ } else if (id == QUALITY_REPORT_ID_A2DP_CHOPPY) {
+ str += mBqrVsA2dpChoppy + "\n}";
+ } else if (id == QUALITY_REPORT_ID_SCO_CHOPPY) {
+ str += mBqrVsScoChoppy + "\n}";
+ } else if (id == QUALITY_REPORT_ID_CONN_FAIL) {
+ str += mBqrVsConnectFail + "\n}";
+ } else if (id == QUALITY_REPORT_ID_MONITOR) {
+ str += "}";
+ }
+
+ return str;
+ }
+
+ /**
+ * This class provides the public APIs to access the common part of BQR event.
+ */
+ public class BqrCommon implements Parcelable {
+ private static final String TAG = BluetoothQualityReport.TAG + ".BqrCommon";
+ static final int BQR_COMMON_LEN = 48;
+
+ private int mQualityReportId;
+ private int mPacketType;
+ private int mConnectionHandle;
+ private int mConnectionRole;
+ private int mTxPowerLevel;
+ private int mRssi;
+ private int mSnr;
+ private int mUnusedAfhChannelCount;
+ private int mAfhSelectUnidealChannelCount;
+ private int mLsto;
+ private long mPiconetClock;
+ private long mRetransmissionCount;
+ private long mNoRxCount;
+ private long mNakCount;
+ private long mLastTxAckTimestamp;
+ private long mFlowOffCount;
+ private long mLastFlowOnTimestamp;
+ private long mOverflowCount;
+ private long mUnderflowCount;
+
+ private BqrCommon(byte[] rawData, int offset) {
+ if (rawData == null || rawData.length < offset + BQR_COMMON_LEN) {
+ throw new IllegalArgumentException(TAG + ": BQR raw data length is abnormal.");
+ }
+
+ ByteBuffer bqrBuf = ByteBuffer.wrap(rawData, offset, rawData.length - offset)
+ .asReadOnlyBuffer();
+ bqrBuf.order(ByteOrder.LITTLE_ENDIAN);
+
+ mQualityReportId = bqrBuf.get() & 0xFF;
+ mPacketType = bqrBuf.get() & 0xFF;
+ mConnectionHandle = bqrBuf.getShort() & 0xFFFF;
+ mConnectionRole = bqrBuf.get() & 0xFF;
+ mTxPowerLevel = bqrBuf.get() & 0xFF;
+ mRssi = bqrBuf.get();
+ mSnr = bqrBuf.get();
+ mUnusedAfhChannelCount = bqrBuf.get() & 0xFF;
+ mAfhSelectUnidealChannelCount = bqrBuf.get() & 0xFF;
+ mLsto = bqrBuf.getShort() & 0xFFFF;
+ mPiconetClock = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mRetransmissionCount = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mNoRxCount = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mNakCount = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mLastTxAckTimestamp = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mFlowOffCount = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mLastFlowOnTimestamp = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mOverflowCount = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mUnderflowCount = bqrBuf.getInt() & 0xFFFFFFFFL;
+ }
+
+ private BqrCommon(Parcel in) {
+ mQualityReportId = in.readInt();
+ mPacketType = in.readInt();
+ mConnectionHandle = in.readInt();
+ mConnectionRole = in.readInt();
+ mTxPowerLevel = in.readInt();
+ mRssi = in.readInt();
+ mSnr = in.readInt();
+ mUnusedAfhChannelCount = in.readInt();
+ mAfhSelectUnidealChannelCount = in.readInt();
+ mLsto = in.readInt();
+ mPiconetClock = in.readLong();
+ mRetransmissionCount = in.readLong();
+ mNoRxCount = in.readLong();
+ mNakCount = in.readLong();
+ mLastTxAckTimestamp = in.readLong();
+ mFlowOffCount = in.readLong();
+ mLastFlowOnTimestamp = in.readLong();
+ mOverflowCount = in.readLong();
+ mUnderflowCount = in.readLong();
+ }
+
+ int getQualityReportId() {
+ return mQualityReportId;
+ }
+
+ /**
+ * Get the packet type of the connection.
+ * @return the packet type.
+ */
+ public int getPacketType() {
+ return mPacketType;
+ }
+
+ /**
+ * Get the string of packet type
+ * @return the string of packet type.
+ */
+ public String getPacketTypeStr() {
+ PacketType type = PacketType.fromOrdinal(mPacketType);
+ return type.toString();
+ }
+
+ /**
+ * Get the connecton handle of the connection
+ * @return the connecton handle.
+ */
+ public int getConnectionHandle() {
+ return mConnectionHandle;
+ }
+
+ /**
+ * Get the connecton Role of the connection, "Master" or "Slave".
+ * @return the connecton Role.
+ */
+ public String getConnectionRole() {
+ if (mConnectionRole == 0) {
+ return "Master";
+ } else if (mConnectionRole == 1) {
+ return "Slave";
+ } else {
+ return "INVALID:" + mConnectionRole;
+ }
+ }
+
+ /**
+ * Get the current transmit power level for the connection.
+ * @return the TX power level.
+ */
+ public int getTxPowerLevel() {
+ return mTxPowerLevel;
+ }
+
+ /**
+ * Get the Received Signal Strength Indication (RSSI) value for the connection.
+ * @return the RSSI.
+ */
+ public int getRssi() {
+ return mRssi;
+ }
+
+ /**
+ * get the Signal-to-Noise Ratio (SNR) value for the connection.
+ * @return the SNR.
+ */
+ public int getSnr() {
+ return mSnr;
+ }
+
+ /**
+ * Get the number of unused channels in AFH_channel_map.
+ * @return the number of unused channels.
+ */
+ public int getUnusedAfhChannelCount() {
+ return mUnusedAfhChannelCount;
+ }
+
+ /**
+ * Get the number of the channels which are interfered and quality is
+ * bad but are still selected for AFH.
+ * @return the number of the selected unideal channels.
+ */
+ public int getAfhSelectUnidealChannelCount() {
+ return mAfhSelectUnidealChannelCount;
+ }
+
+ /**
+ * Get the current link supervision timeout setting.
+ * time_ms: N * 0.625 ms (1 slot).
+ * @return link supervision timeout value.
+ */
+ public int getLsto() {
+ return mLsto;
+ }
+
+ /**
+ * Get the piconet clock for the specified Connection_Handle.
+ * time_ms: N * 0.3125 ms (1 Bluetooth Clock).
+ * @return the piconet clock.
+ */
+ public long getPiconetClock() {
+ return mPiconetClock;
+ }
+
+ /**
+ * Get the count of retransmission.
+ * @return the count of retransmission.
+ */
+ public long getRetransmissionCount() {
+ return mRetransmissionCount;
+ }
+
+ /**
+ * Get the count of no RX.
+ * @return the count of no RX.
+ */
+ public long getNoRxCount() {
+ return mNoRxCount;
+ }
+
+ /**
+ * Get the count of NAK(Negative Acknowledge).
+ * @return the count of NAK.
+ */
+ public long getNakCount() {
+ return mNakCount;
+ }
+
+ /**
+ * Get the timestamp of last TX ACK.
+ * time_ms: N * 0.3125 ms (1 Bluetooth Clock).
+ * @return the timestamp of last TX ACK.
+ */
+ public long getLastTxAckTimestamp() {
+ return mLastTxAckTimestamp;
+ }
+
+ /**
+ * Get the count of flow-off.
+ * @return the count of flow-off.
+ */
+ public long getFlowOffCount() {
+ return mFlowOffCount;
+ }
+
+ /**
+ * Get the timestamp of last flow-on.
+ * @return the timestamp of last flow-on.
+ */
+ public long getLastFlowOnTimestamp() {
+ return mLastFlowOnTimestamp;
+ }
+
+ /**
+ * Get the buffer overflow count (how many bytes of TX data are dropped) since the
+ * last event.
+ * @return the buffer overflow count.
+ */
+ public long getOverflowCount() {
+ return mOverflowCount;
+ }
+
+ /**
+ * Get the buffer underflow count (in byte).
+ * @return the buffer underflow count.
+ */
+ public long getUnderflowCount() {
+ return mUnderflowCount;
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mQualityReportId);
+ dest.writeInt(mPacketType);
+ dest.writeInt(mConnectionHandle);
+ dest.writeInt(mConnectionRole);
+ dest.writeInt(mTxPowerLevel);
+ dest.writeInt(mRssi);
+ dest.writeInt(mSnr);
+ dest.writeInt(mUnusedAfhChannelCount);
+ dest.writeInt(mAfhSelectUnidealChannelCount);
+ dest.writeInt(mLsto);
+ dest.writeLong(mPiconetClock);
+ dest.writeLong(mRetransmissionCount);
+ dest.writeLong(mNoRxCount);
+ dest.writeLong(mNakCount);
+ dest.writeLong(mLastTxAckTimestamp);
+ dest.writeLong(mFlowOffCount);
+ dest.writeLong(mLastFlowOnTimestamp);
+ dest.writeLong(mOverflowCount);
+ dest.writeLong(mUnderflowCount);
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = " BqrCommon: {\n"
+ + " mQualityReportId: " + BluetoothQualityReport.this.getQualityReportIdStr()
+ + "(" + String.format("0x%02X", mQualityReportId) + ")"
+ + ", mPacketType: " + getPacketTypeStr()
+ + "(" + String.format("0x%02X", mPacketType) + ")"
+ + ", mConnectionHandle: " + String.format("0x%04X", mConnectionHandle)
+ + ", mConnectionRole: " + getConnectionRole() + "(" + mConnectionRole + ")"
+ + ", mTxPowerLevel: " + mTxPowerLevel
+ + ", mRssi: " + mRssi
+ + ", mSnr: " + mSnr
+ + ", mUnusedAfhChannelCount: " + mUnusedAfhChannelCount
+ + ",\n"
+ + " mAfhSelectUnidealChannelCount: " + mAfhSelectUnidealChannelCount
+ + ", mLsto: " + mLsto
+ + ", mPiconetClock: " + String.format("0x%08X", mPiconetClock)
+ + ", mRetransmissionCount: " + mRetransmissionCount
+ + ", mNoRxCount: " + mNoRxCount
+ + ", mNakCount: " + mNakCount
+ + ", mLastTxAckTimestamp: " + String.format("0x%08X", mLastTxAckTimestamp)
+ + ", mFlowOffCount: " + mFlowOffCount
+ + ",\n"
+ + " mLastFlowOnTimestamp: " + String.format("0x%08X", mLastFlowOnTimestamp)
+ + ", mOverflowCount: " + mOverflowCount
+ + ", mUnderflowCount: " + mUnderflowCount
+ + "\n }";
+
+ return str;
+ }
+
+ }
+
+ /**
+ * This class provides the public APIs to access the vendor specific common part of
+ * BQR event.
+ */
+ public class BqrVsCommon implements Parcelable {
+ private static final String TAG = BluetoothQualityReport.TAG + ".BqrVsCommon";
+ private static final int BQR_VS_COMMON_LEN = 6 + 1;
+
+ private String mAddr;
+ private int mCalFailedItemCount;
+
+ private BqrVsCommon(byte[] rawData, int offset) {
+ if (rawData == null || rawData.length < offset + BQR_VS_COMMON_LEN) {
+ throw new IllegalArgumentException(TAG + ": BQR raw data length is abnormal.");
+ }
+
+ ByteBuffer bqrBuf = ByteBuffer.wrap(rawData, offset, rawData.length - offset)
+ .asReadOnlyBuffer();
+ bqrBuf.order(ByteOrder.LITTLE_ENDIAN);
+
+ mAddr = String.format("%02X:%02X:%02X:%02X:%02X:%02X", bqrBuf.get(offset+5),
+ bqrBuf.get(offset+4), bqrBuf.get(offset+3), bqrBuf.get(offset+2),
+ bqrBuf.get(offset+1), bqrBuf.get(offset+0));
+ bqrBuf.position(offset+6);
+ mCalFailedItemCount = bqrBuf.get() & 0xFF;
+ }
+
+ private BqrVsCommon(Parcel in) {
+ mAddr = in.readString();
+ mCalFailedItemCount = in.readInt();
+ }
+
+ /**
+ * Get the count of calibration failed items.
+ * @return the count of calibration failure.
+ */
+ public int getCalFailedItemCount() {
+ return mCalFailedItemCount;
+ }
+
+ int getLength() {
+ return BQR_VS_COMMON_LEN;
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(mAddr);
+ dest.writeInt(mCalFailedItemCount);
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = " BqrVsCommon: {\n"
+ + " mAddr: " + mAddr
+ + ", mCalFailedItemCount: " + mCalFailedItemCount
+ + "\n }";
+
+ return str;
+ }
+ }
+
+ /**
+ * This class provides the public APIs to access the vendor specific part of
+ * Approaching LSTO event.
+ */
+ public class BqrVsLsto implements Parcelable {
+ private static final String TAG = BluetoothQualityReport.TAG + ".BqrVsLsto";
+
+ private int mConnState;
+ private long mBasebandStats;
+ private long mSlotsUsed;
+ private int mCxmDenials;
+ private int mTxSkipped;
+ private int mRfLoss;
+ private long mNativeClock;
+ private long mLastTxAckTimestamp;
+
+ private BqrVsLsto(byte[] rawData, int offset) {
+ if (rawData == null || rawData.length <= offset) {
+ throw new IllegalArgumentException(TAG + ": BQR raw data length is abnormal.");
+ }
+
+ ByteBuffer bqrBuf = ByteBuffer.wrap(rawData, offset, rawData.length - offset)
+ .asReadOnlyBuffer();
+ bqrBuf.order(ByteOrder.LITTLE_ENDIAN);
+
+ mConnState = bqrBuf.get() & 0xFF;
+ mBasebandStats = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mSlotsUsed = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mCxmDenials = bqrBuf.getShort() & 0xFFFF;
+ mTxSkipped = bqrBuf.getShort() & 0xFFFF;
+ mRfLoss = bqrBuf.getShort() & 0xFFFF;
+ mNativeClock = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mLastTxAckTimestamp = bqrBuf.getInt() & 0xFFFFFFFFL;
+ }
+
+ private BqrVsLsto(Parcel in) {
+ mConnState = in.readInt();
+ mBasebandStats = in.readLong();
+ mSlotsUsed = in.readLong();
+ mCxmDenials = in.readInt();
+ mTxSkipped = in.readInt();
+ mRfLoss = in.readInt();
+ mNativeClock = in.readLong();
+ mLastTxAckTimestamp = in.readLong();
+ }
+
+ /**
+ * Get the conn state of sco.
+ * @return the conn state.
+ */
+ public int getConnState() {
+ return mConnState;
+ }
+
+ /**
+ * Get the string of conn state of sco.
+ * @return the string of conn state.
+ */
+ public String getConnStateStr() {
+ return ConnState.getName(mConnState);
+ }
+
+ /**
+ * Get the baseband statistics.
+ * @return the baseband statistics.
+ */
+ public long getBasebandStats() {
+ return mBasebandStats;
+ }
+
+ /**
+ * Get the count of slots allocated for current connection.
+ * @return the count of slots allocated for current connection.
+ */
+ public long getSlotsUsed() {
+ return mSlotsUsed;
+ }
+
+ /**
+ * Get the count of Coex denials.
+ * @return the count of CXM denials.
+ */
+ public int getCxmDenials() {
+ return mCxmDenials;
+ }
+
+ /**
+ * Get the count of TX skipped when no poll from remote device.
+ * @return the count of TX skipped.
+ */
+ public int getTxSkipped() {
+ return mTxSkipped;
+ }
+
+ /**
+ * Get the count of RF loss.
+ * @return the count of RF loss.
+ */
+ public int getRfLoss() {
+ return mRfLoss;
+ }
+
+ /**
+ * Get the timestamp when issue happened.
+ * time_ms: N * 0.3125 ms (1 Bluetooth Clock).
+ * @return the timestamp when issue happened.
+ */
+ public long getNativeClock() {
+ return mNativeClock;
+ }
+
+ /**
+ * Get the timestamp of last TX ACK.
+ * time_ms: N * 0.3125 ms (1 Bluetooth Clock).
+ * @return the timestamp of last TX ACK.
+ */
+ public long getLastTxAckTimestamp() {
+ return mLastTxAckTimestamp;
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mConnState);
+ dest.writeLong(mBasebandStats);
+ dest.writeLong(mSlotsUsed);
+ dest.writeInt(mCxmDenials);
+ dest.writeInt(mTxSkipped);
+ dest.writeInt(mRfLoss);
+ dest.writeLong(mNativeClock);
+ dest.writeLong(mLastTxAckTimestamp);
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = " BqrVsLsto: {\n"
+ + " mConnState: " + getConnStateStr()
+ + "(" + String.format("0x%02X", mConnState) + ")"
+ + ", mBasebandStats: " + String.format("0x%08X", mBasebandStats)
+ + ", mSlotsUsed: " + mSlotsUsed
+ + ", mCxmDenials: " + mCxmDenials
+ + ", mTxSkipped: " + mTxSkipped
+ + ", mRfLoss: " + mRfLoss
+ + ", mNativeClock: " + String.format("0x%08X", mNativeClock)
+ + ", mLastTxAckTimestamp: " + String.format("0x%08X", mLastTxAckTimestamp)
+ + "\n }";
+
+ return str;
+ }
+ }
+
+ /**
+ * This class provides the public APIs to access the vendor specific part of
+ * A2dp choppy event.
+ */
+ public class BqrVsA2dpChoppy implements Parcelable {
+ private static final String TAG = BluetoothQualityReport.TAG + ".BqrVsA2dpChoppy";
+
+ private long mArrivalTime;
+ private long mScheduleTime;
+ private int mGlitchCount;
+ private int mTxCxmDenials;
+ private int mRxCxmDenials;
+ private int mAclTxQueueLength;
+ private int mLinkQuality;
+
+ private BqrVsA2dpChoppy(byte[] rawData, int offset) {
+ if (rawData == null || rawData.length <= offset) {
+ throw new IllegalArgumentException(TAG + ": BQR raw data length is abnormal.");
+ }
+
+ ByteBuffer bqrBuf = ByteBuffer.wrap(rawData, offset, rawData.length - offset)
+ .asReadOnlyBuffer();
+ bqrBuf.order(ByteOrder.LITTLE_ENDIAN);
+
+ mArrivalTime = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mScheduleTime = bqrBuf.getInt() & 0xFFFFFFFFL;
+ mGlitchCount = bqrBuf.getShort() & 0xFFFF;
+ mTxCxmDenials = bqrBuf.getShort() & 0xFFFF;
+ mRxCxmDenials = bqrBuf.getShort() & 0xFFFF;
+ mAclTxQueueLength = bqrBuf.get() & 0xFF;
+ mLinkQuality = bqrBuf.get() & 0xFF;
+ }
+
+ private BqrVsA2dpChoppy(Parcel in) {
+ mArrivalTime = in.readLong();
+ mScheduleTime = in.readLong();
+ mGlitchCount = in.readInt();
+ mTxCxmDenials = in.readInt();
+ mRxCxmDenials = in.readInt();
+ mAclTxQueueLength = in.readInt();
+ mLinkQuality = in.readInt();
+ }
+
+ /**
+ * Get the timestamp of a2dp packet arrived.
+ * time_ms: N * 0.3125 ms (1 Bluetooth Clock).
+ * @return the timestamp of a2dp packet arrived.
+ */
+ public long getArrivalTime() {
+ return mArrivalTime;
+ }
+
+ /**
+ * Get the timestamp of a2dp packet scheduled.
+ * time_ms: N * 0.3125 ms (1 Bluetooth Clock).
+ * @return the timestamp of a2dp packet scheduled.
+ */
+ public long getScheduleTime() {
+ return mScheduleTime;
+ }
+
+ /**
+ * Get the a2dp glitch count since the last event.
+ * @return the a2dp glitch count.
+ */
+ public int getGlitchCount() {
+ return mGlitchCount;
+ }
+
+ /**
+ * Get the count of Coex TX denials.
+ * @return the count of Coex TX denials.
+ */
+ public int getTxCxmDenials() {
+ return mTxCxmDenials;
+ }
+
+ /**
+ * Get the count of Coex RX denials.
+ * @return the count of Coex RX denials.
+ */
+ public int getRxCxmDenials() {
+ return mRxCxmDenials;
+ }
+
+ /**
+ * Get the ACL queue length which are pending TX in FW.
+ * @return the ACL queue length.
+ */
+ public int getAclTxQueueLength() {
+ return mAclTxQueueLength;
+ }
+
+ /**
+ * Get the link quality for the current connection.
+ * @return the link quality.
+ */
+ public int getLinkQuality() {
+ return mLinkQuality;
+ }
+
+ /**
+ * Get the string of link quality for the current connection.
+ * @return the string of link quality.
+ */
+ public String getLinkQualityStr() {
+ LinkQuality q = LinkQuality.fromOrdinal(mLinkQuality);
+ return q.toString();
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeLong(mArrivalTime);
+ dest.writeLong(mScheduleTime);
+ dest.writeInt(mGlitchCount);
+ dest.writeInt(mTxCxmDenials);
+ dest.writeInt(mRxCxmDenials);
+ dest.writeInt(mAclTxQueueLength);
+ dest.writeInt(mLinkQuality);
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = " BqrVsA2dpChoppy: {\n"
+ + " mArrivalTime: " + String.format("0x%08X", mArrivalTime)
+ + ", mScheduleTime: " + String.format("0x%08X", mScheduleTime)
+ + ", mGlitchCount: " + mGlitchCount
+ + ", mTxCxmDenials: " + mTxCxmDenials
+ + ", mRxCxmDenials: " + mRxCxmDenials
+ + ", mAclTxQueueLength: " + mAclTxQueueLength
+ + ", mLinkQuality: " + getLinkQualityStr()
+ + "(" + String.format("0x%02X", mLinkQuality) + ")"
+ + "\n }";
+
+ return str;
+ }
+
+ }
+
+ /**
+ * This class provides the public APIs to access the vendor specific part of
+ * SCO choppy event.
+ */
+ public class BqrVsScoChoppy implements Parcelable {
+ private static final String TAG = BluetoothQualityReport.TAG + ".BqrVsScoChoppy";
+
+ private int mGlitchCount;
+ private int mIntervalEsco;
+ private int mWindowEsco;
+ private int mAirFormat;
+ private int mInstanceCount;
+ private int mTxCxmDenials;
+ private int mRxCxmDenials;
+ private int mTxAbortCount;
+ private int mLateDispatch;
+ private int mMicIntrMiss;
+ private int mLpaIntrMiss;
+ private int mSprIntrMiss;
+ private int mPlcFillCount;
+ private int mPlcDiscardCount;
+ private int mMissedInstanceCount;
+ private int mTxRetransmitSlotCount;
+ private int mRxRetransmitSlotCount;
+ private int mGoodRxFrameCount;
+
+ private BqrVsScoChoppy(byte[] rawData, int offset) {
+ if (rawData == null || rawData.length <= offset) {
+ throw new IllegalArgumentException(TAG + ": BQR raw data length is abnormal.");
+ }
+
+ ByteBuffer bqrBuf = ByteBuffer.wrap(rawData, offset, rawData.length - offset)
+ .asReadOnlyBuffer();
+ bqrBuf.order(ByteOrder.LITTLE_ENDIAN);
+
+ mGlitchCount = bqrBuf.getShort() & 0xFFFF;
+ mIntervalEsco = bqrBuf.get() & 0xFF;
+ mWindowEsco = bqrBuf.get() & 0xFF;
+ mAirFormat = bqrBuf.get() & 0xFF;
+ mInstanceCount = bqrBuf.getShort() & 0xFFFF;
+ mTxCxmDenials = bqrBuf.getShort() & 0xFFFF;
+ mRxCxmDenials = bqrBuf.getShort() & 0xFFFF;
+ mTxAbortCount = bqrBuf.getShort() & 0xFFFF;
+ mLateDispatch = bqrBuf.getShort() & 0xFFFF;
+ mMicIntrMiss = bqrBuf.getShort() & 0xFFFF;
+ mLpaIntrMiss = bqrBuf.getShort() & 0xFFFF;
+ mSprIntrMiss = bqrBuf.getShort() & 0xFFFF;
+ mPlcFillCount = bqrBuf.getShort() & 0xFFFF;
+ mPlcDiscardCount = bqrBuf.getShort() & 0xFFFF;
+ try {
+ mMissedInstanceCount = bqrBuf.getShort() & 0xFFFF;
+ mTxRetransmitSlotCount = bqrBuf.getShort() & 0xFFFF;
+ mRxRetransmitSlotCount = bqrBuf.getShort() & 0xFFFF;
+ mGoodRxFrameCount = bqrBuf.getShort() & 0xFFFF;
+ } catch (BufferUnderflowException e) {
+ Log.v(TAG, "some fields are not contained");
+ }
+ }
+
+ private BqrVsScoChoppy(Parcel in) {
+ mGlitchCount = in.readInt();
+ mIntervalEsco = in.readInt();
+ mWindowEsco = in.readInt();
+ mAirFormat = in.readInt();
+ mInstanceCount = in.readInt();
+ mTxCxmDenials = in.readInt();
+ mRxCxmDenials = in.readInt();
+ mTxAbortCount = in.readInt();
+ mLateDispatch = in.readInt();
+ mMicIntrMiss = in.readInt();
+ mLpaIntrMiss = in.readInt();
+ mSprIntrMiss = in.readInt();
+ mPlcFillCount = in.readInt();
+ mPlcDiscardCount = in.readInt();
+ mMissedInstanceCount = in.readInt();
+ mTxRetransmitSlotCount = in.readInt();
+ mRxRetransmitSlotCount = in.readInt();
+ mGoodRxFrameCount = in.readInt();
+ }
+
+ /**
+ * Get the sco glitch count since the last event.
+ * @return the sco glitch count.
+ */
+ public int getGlitchCount() {
+ return mGlitchCount;
+ }
+
+ /**
+ * Get ESCO interval in slots. It is the value of Transmission_Interval parameter in
+ * Synchronous Connection Complete event.
+ * @return ESCO interval in slots.
+ */
+ public int getIntervalEsco() {
+ return mIntervalEsco;
+ }
+
+ /**
+ * Get ESCO window in slots. It is the value of Retransmission Window parameter in
+ * Synchronous Connection Complete event.
+ * @return ESCO window in slots.
+ */
+ public int getWindowEsco() {
+ return mWindowEsco;
+ }
+
+ /**
+ * Get the air mode. It is the value of Air Mode parameter in
+ * Synchronous Connection Complete event.
+ * @return the air mode.
+ */
+ public int getAirFormat() {
+ return mAirFormat;
+ }
+
+ /**
+ * Get the string of air mode.
+ * @return the string of air mode.
+ */
+ public String getAirFormatStr() {
+ AirMode m = AirMode.fromOrdinal(mAirFormat);
+ return m.toString();
+ }
+
+ /**
+ * Get the xSCO instance count.
+ * @return the xSCO instance count.
+ */
+ public int getInstanceCount() {
+ return mInstanceCount;
+ }
+
+ /**
+ * Get the count of Coex TX denials.
+ * @return the count of Coex TX denials.
+ */
+ public int getTxCxmDenials() {
+ return mTxCxmDenials;
+ }
+
+ /**
+ * Get the count of Coex RX denials.
+ * @return the count of Coex RX denials.
+ */
+ public int getRxCxmDenials() {
+ return mRxCxmDenials;
+ }
+
+ /**
+ * Get the count of sco packets aborted.
+ * @return the count of sco packets aborted.
+ */
+ public int getTxAbortCount() {
+ return mTxAbortCount;
+ }
+
+ /**
+ * Get the count of sco packets dispatched late.
+ * @return the count of sco packets dispatched late.
+ */
+ public int getLateDispatch() {
+ return mLateDispatch;
+ }
+
+ /**
+ * Get the count of missed Mic interrrupts.
+ * @return the count of missed Mic interrrupts.
+ */
+ public int getMicIntrMiss() {
+ return mMicIntrMiss;
+ }
+
+ /**
+ * Get the count of missed LPA interrrupts.
+ * @return the count of missed LPA interrrupts.
+ */
+ public int getLpaIntrMiss() {
+ return mLpaIntrMiss;
+ }
+
+ /**
+ * Get the count of missed Speaker interrrupts.
+ * @return the count of missed Speaker interrrupts.
+ */
+ public int getSprIntrMiss() {
+ return mSprIntrMiss;
+ }
+
+ /**
+ * Get the count of packet loss concealment filled.
+ * @return the count of packet loss concealment filled.
+ */
+ public int getPlcFillCount() {
+ return mPlcFillCount;
+ }
+
+ /**
+ * Get the count of packet loss concealment discarded.
+ * @return the count of packet loss concealment discarded.
+ */
+ public int getPlcDiscardCount() {
+ return mPlcDiscardCount;
+ }
+
+ /**
+ * Get the count of sco instances missed.
+ * @return the count of sco instances missed.
+ */
+ public int getMissedInstanceCount() {
+ return mMissedInstanceCount;
+ }
+
+ /**
+ * Get the count of slots for Tx retransmission.
+ * @return the count of slots for Tx retransmission.
+ */
+ public int getTxRetransmitSlotCount() {
+ return mTxRetransmitSlotCount;
+ }
+
+ /**
+ * Get the count of slots for Rx retransmission.
+ * @return the count of slots for Rx retransmission.
+ */
+ public int getRxRetransmitSlotCount() {
+ return mRxRetransmitSlotCount;
+ }
+
+ /**
+ * Get the count of Rx good packets
+ * @return the count of Rx good packets.
+ */
+ public int getGoodRxFrameCount() {
+ return mGoodRxFrameCount;
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mGlitchCount);
+ dest.writeInt(mIntervalEsco);
+ dest.writeInt(mWindowEsco);
+ dest.writeInt(mAirFormat);
+ dest.writeInt(mInstanceCount);
+ dest.writeInt(mTxCxmDenials);
+ dest.writeInt(mRxCxmDenials);
+ dest.writeInt(mTxAbortCount);
+ dest.writeInt(mLateDispatch);
+ dest.writeInt(mMicIntrMiss);
+ dest.writeInt(mLpaIntrMiss);
+ dest.writeInt(mSprIntrMiss);
+ dest.writeInt(mPlcFillCount);
+ dest.writeInt(mPlcDiscardCount);
+ dest.writeInt(mMissedInstanceCount);
+ dest.writeInt(mTxRetransmitSlotCount);
+ dest.writeInt(mRxRetransmitSlotCount);
+ dest.writeInt(mGoodRxFrameCount);
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = " BqrVsScoChoppy: {\n"
+ + " mGlitchCount: " + mGlitchCount
+ + ", mIntervalEsco: " + mIntervalEsco
+ + ", mWindowEsco: " + mWindowEsco
+ + ", mAirFormat: " + getAirFormatStr()
+ + "(" + String.format("0x%02X", mAirFormat) + ")"
+ + ", mInstanceCount: " + mInstanceCount
+ + ", mTxCxmDenials: " + mTxCxmDenials
+ + ", mRxCxmDenials: " + mRxCxmDenials
+ + ", mTxAbortCount: " + mTxAbortCount
+ + ",\n"
+ + " mLateDispatch: " + mLateDispatch
+ + ", mMicIntrMiss: " + mMicIntrMiss
+ + ", mLpaIntrMiss: " + mLpaIntrMiss
+ + ", mSprIntrMiss: " + mSprIntrMiss
+ + ", mPlcFillCount: " + mPlcFillCount
+ + ", mPlcDiscardCount: " + mPlcDiscardCount
+ + ", mMissedInstanceCount: " + mMissedInstanceCount
+ + ", mTxRetransmitSlotCount: " + mTxRetransmitSlotCount
+ + ",\n"
+ + " mRxRetransmitSlotCount: " + mRxRetransmitSlotCount
+ + ", mGoodRxFrameCount: " + mGoodRxFrameCount
+ + "\n }";
+
+ return str;
+ }
+
+ }
+
+ /**
+ * This class provides the public APIs to access the vendor specific part of
+ * Connect fail event.
+ */
+ public class BqrVsConnectFail implements Parcelable {
+ private static final String TAG = BluetoothQualityReport.TAG + ".BqrVsConnectFail";
+
+ private int mFailReason;
+
+ private BqrVsConnectFail(byte[] rawData, int offset) {
+ if (rawData == null || rawData.length <= offset) {
+ throw new IllegalArgumentException(TAG + ": BQR raw data length is abnormal.");
+ }
+
+ ByteBuffer bqrBuf = ByteBuffer.wrap(rawData, offset, rawData.length - offset)
+ .asReadOnlyBuffer();
+ bqrBuf.order(ByteOrder.LITTLE_ENDIAN);
+
+ mFailReason = bqrBuf.get() & 0xFF;
+ }
+
+ private BqrVsConnectFail(Parcel in) {
+ mFailReason = in.readInt();
+ }
+
+ /**
+ * Get the fail reason.
+ * @return the fail reason.
+ */
+ public int getFailReason() {
+ return mFailReason;
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mFailReason);
+ }
+
+ @Override
+ public String toString() {
+ String str;
+ str = " BqrVsConnectFail: {\n"
+ + " mFailReason: " + String.format("0x%02X", mFailReason)
+ + "\n }";
+
+ return str;
+ }
+ }
+
+}
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java
index 1655b62bbfec..0d2bd216f19f 100644
--- a/core/java/android/bluetooth/BluetoothSocket.java
+++ b/core/java/android/bluetooth/BluetoothSocket.java
@@ -27,7 +27,6 @@ import android.os.ParcelFileDescriptor;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.util.Log;
-
import java.io.Closeable;
import java.io.FileDescriptor;
import java.io.IOException;
@@ -272,6 +271,7 @@ public final class BluetoothSocket implements Closeable {
as.mSocketOS = as.mSocket.getOutputStream();
as.mAddress = remoteAddr;
as.mDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(remoteAddr);
+ as.mPort = mPort;
return as;
}
@@ -806,5 +806,65 @@ public final class BluetoothSocket implements Closeable {
return ret;
}
+ /**
+ * setSocketOpt for the Buetooth Socket.
+ *
+ * @param optionName socket option name
+ * @param optionVal socket option value
+ * @param optionLen socket option length
+ * @return -1 on immediate error,
+ * 0 otherwise
+ * @hide
+ */
+ @UnsupportedAppUsage
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int setSocketOpt(int optionName, byte [] optionVal, int optionLen) throws IOException {
+ int ret = 0;
+ if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed");
+ IBluetooth bluetoothProxy = BluetoothAdapter.getDefaultAdapter().getBluetoothService(null);
+ if (bluetoothProxy == null) {
+ Log.e(TAG, "setSocketOpt fail, reason: bluetooth is off");
+ return -1;
+ }
+ try {
+ if(VDBG) Log.d(TAG, "setSocketOpt(), mType: " + mType + " mPort: " + mPort);
+ ret = bluetoothProxy.setSocketOpt(mType, mPort, optionName, optionVal, optionLen);
+ } catch (RemoteException e) {
+ Log.e(TAG, Log.getStackTraceString(new Throwable()));
+ return -1;
+ }
+ return ret;
+ }
+
+ /**
+ * getSocketOpt for the Buetooth Socket.
+ *
+ * @param optionName socket option name
+ * @param optionVal socket option value
+ * @return -1 on immediate error,
+ * length of returned socket option otherwise
+ * @hide
+ */
+ @UnsupportedAppUsage
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getSocketOpt(int optionName, byte [] optionVal) throws IOException {
+ int ret = 0;
+ if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed");
+ IBluetooth bluetoothProxy = BluetoothAdapter.getDefaultAdapter().getBluetoothService(null);
+ if (bluetoothProxy == null) {
+ Log.e(TAG, "getSocketOpt fail, reason: bluetooth is off");
+ return -1;
+ }
+ try {
+ if(VDBG) Log.d(TAG, "getSocketOpt(), mType: " + mType + " mPort: " + mPort);
+ ret = bluetoothProxy.getSocketOpt(mType, mPort, optionName, optionVal);
+ } catch (RemoteException e) {
+ Log.e(TAG, Log.getStackTraceString(new Throwable()));
+ return -1;
+ }
+ return ret;
+ }
}
diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java
index bc3754a2fc56..02f9044445a2 100644
--- a/core/java/android/bluetooth/BluetoothUuid.java
+++ b/core/java/android/bluetooth/BluetoothUuid.java
@@ -177,6 +177,41 @@ public final class BluetoothUuid {
public static final ParcelUuid BASE_UUID =
ParcelUuid.fromString("00000000-0000-1000-8000-00805F9B34FB");
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_HEARINGAID_UUID =
+ ParcelUuid.fromString("00006AD2-0000-1000-8000-00805F9B34FB");
+
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_MEDIA_T_UUID =
+ ParcelUuid.fromString("00006AD0-0000-1000-8000-00805F9B34FB");
+
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_MEDIA_P_UUID =
+ ParcelUuid.fromString("00006AD1-0000-1000-8000-00805F9B34FB");
+
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_MEDIA_G_UUID =
+ ParcelUuid.fromString("00006AD3-0000-1000-8000-00805F9B34FB");
+
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_MEDIA_W_UUID =
+ ParcelUuid.fromString("2587db3c-ce70-4fc9-935f-777ab4188fd7");
+
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_VOICE_P_UUID =
+ ParcelUuid.fromString("00006AD4-0000-1000-8000-00805F9B34FB");
+
+ /** @hide */
+ @NonNull
+ public static ParcelUuid ADVANCE_VOICE_T_UUID =
+ ParcelUuid.fromString("00006AD5-0000-1000-8000-00805F9B34FB");
+
/**
* Length of bytes for 16 bit UUID
*
diff --git a/core/java/android/bluetooth/BluetoothVcp.java b/core/java/android/bluetooth/BluetoothVcp.java
new file mode 100644
index 000000000000..1f8498c62fb4
--- /dev/null
+++ b/core/java/android/bluetooth/BluetoothVcp.java
@@ -0,0 +1,420 @@
+/*
+ *Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *Not a contribution
+ */
+
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.bluetooth;
+
+import android.annotation.RequiresPermission;
+import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
+import android.content.AttributionSource;
+import android.content.Context;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class provides the public APIs to control the Bluetooth VCP profile.
+ *
+ * <p>BluetoothVcp is a proxy object for controlling the Bluetooth VolumeControl
+ * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get
+ * the BluetoothVcp proxy object.
+ *
+ * {@hide}
+ */
+public final class BluetoothVcp implements BluetoothProfile {
+ private static final String TAG = "BluetoothVcp";
+ private static final boolean DBG = true;
+ private static final boolean VDBG = true;
+
+ /**
+ * Intent used to broadcast the change in connection state of the VCP
+ * profile.
+ *
+ * <p>This intent will have 3 extras:
+ * <ul>
+ * <li> {@link #EXTRA_STATE} - The current state of the profile. </li>
+ * <li> {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile.</li>
+ * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li>
+ * </ul>
+ *
+ * <p>{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of
+ * {@link #STATE_DISCONNECTED}, {@link #STATE_CONNECTING},
+ * {@link #STATE_CONNECTED}, {@link #STATE_DISCONNECTING}.
+ *
+ * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to
+ * receive.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public static final String ACTION_CONNECTION_STATE_CHANGED =
+ "android.bluetooth.vcp.profile.action.CONNECTION_STATE_CHANGED";
+
+ /**
+ * Intent used to broadcast the volume change of the Volume Renderer device
+ *
+ * <p>This intent will have 1 extras:
+ * <ul>
+ * <li> {@link #EXTRA_VOLUME} - Current volume settings of Renderer device
+ * device. Range: 0 - 255.
+ *
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public static final String ACTION_VOLUME_CHANGED =
+ "android.bluetooth.vcp.profile.action.VOLUME_CHANGED";
+
+ /**
+ * A int extra field in {@link #ACTION_VOLUME_CHANGED}
+ * intents that contains the volume of the Volume Renderer device.
+ */
+ public static final String EXTRA_VOLUME =
+ "android.bluetooth.vcp.profile.extra.VOLUME";
+
+ /**
+ * Intent used to broadcast the mute change of the Volume Renderer device
+ *
+ * <p>This intent will have 1 extras:
+ * <ul>
+ * <li> {@link #EXTRA_MUTE} - Current mute status of Renderer device
+ * device. False: unmute, True: mute.
+ *
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public static final String ACTION_MUTE_CHANGED =
+ "android.bluetooth.vcp.profile.action.MUTE_CHANGED";
+
+ /**
+ * A boolean extra field in {@link #ACTION_MUTE_CHANGED}
+ * intents that contains the mute status of the Volume Renderer device.
+ */
+ public static final String EXTRA_MUTE =
+ "android.bluetooth.vcp.profile.extra.MUTE";
+
+ /**
+ * Intent used to broadcast the connection mode change of the VCP
+ *
+ * <p>This intent will have 1 extras:
+ * <ul>
+ * <li> {@link #EXTRA_MODE} - Current connection mode of VCP
+ * can be any of {@link #MODE_NONE}, {@link #MODE_UNICAST},
+ * {@link #MODE_BROADCAST}, {@link #MODE_UNICAST_BROADCAST},
+ *
+ * @hide
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public static final String ACTION_CONNECTION_MODE_CHANGED =
+ "android.bluetooth.vcp.profile.action.CONNECTION_MODE_CHANGED";
+
+ /**
+ * A int extra field in {@link #ACTION_CONNECTION_MODE_CHANGED}
+ * intents that contains the connection mode of the VCP.
+ */
+ public static final String EXTRA_MODE =
+ "android.bluetooth.vcp.profile.extra.MODE";
+
+ /** None VCP connection */
+ public static final int MODE_NONE = 0x00;
+ /** VCP connection setup with unicast mode */
+ public static final int MODE_UNICAST = 0x01;
+ /** VCP connection setup with broadcast mode */
+ public static final int MODE_BROADCAST = 0x02;
+ /** VCP connection setup with unicast and broadcast mode */
+ public static final int MODE_UNICAST_BROADCAST = 0x03;
+
+ public static final int A2DP = 0x0001;
+ public static final int HFP = 0x0002;
+ public static final int LE_MEDIA = 0x0010;
+ public static final int LE_VOICE = 0x2000;
+
+ public static final int CALL_STREAM = 0;
+ public static final int MEDIA_STREAM = 1;
+
+ private BluetoothAdapter mAdapter;
+ private final AttributionSource mAttributionSource;
+ private final BluetoothProfileConnector<IBluetoothVcp> mProfileConnector =
+ new BluetoothProfileConnector(this, BluetoothProfile.VCP,
+ "BluetoothVcp", IBluetoothVcp.class.getName()) {
+ @Override
+ public IBluetoothVcp getServiceInterface(IBinder service) {
+ return IBluetoothVcp.Stub.asInterface(
+ Binder.allowBlocking(service));
+ }
+ };
+
+ /**
+ * Create a BluetoothVcp proxy object for interacting with the local
+ * Bluetooth VCP service.
+ */
+ /*package*/ BluetoothVcp(Context context, ServiceListener listener) {
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
+ mProfileConnector.connect(context, listener);
+ mAttributionSource = mAdapter.getAttributionSource();
+ }
+
+ /*package*/ void close() {
+ mProfileConnector.disconnect();
+ }
+
+ private IBluetoothVcp getService() {
+ return mProfileConnector.getService();
+ }
+
+ @Override
+ public void finalize() {
+ close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<BluetoothDevice> getConnectedDevices() {
+ if (VDBG) log("getConnectedDevices()");
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
+ if (VDBG) log("getDevicesMatchingStates()");
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getConnectionState(BluetoothDevice device) {
+ if (VDBG) log("getConnectionState(" + device + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ return service.getConnectionState(device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+
+ /**
+ * Get current VCP Connection mode
+ *
+ * @param device: remote device instance
+ * @return current connection mode of VCP:
+ * {@link #BluetoothVcp.MODE_NONE} if none VCP connection
+ * {@link #BluetoothVcp.MODE_UNICAST} if VCP is connected for unicast
+ * {@link #BluetoothVcp.MODE_BROADCAST} if VCP is connected for broadcast
+ * {@link #BluetoothVcp.MODE_UNICAST_BROADCAST} if VCP
+ * is connected for unicast and broadcast
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getConnectionMode(BluetoothDevice device) {
+ if (VDBG) log("getConnectionMode(" + device + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ return service.getConnectionMode(device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return MODE_NONE;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return MODE_NONE;
+ }
+
+ /**
+ * Set absolute volume to remote device via VCP connection
+ *
+ * @param device: remote device instance
+ * @prarm volume: requested volume settings for remote device
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public void setAbsoluteVolume(BluetoothDevice device, int volume) {
+ if (VDBG) log("setAbsoluteVolume(" + device + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ service.setAbsoluteVolume(device, volume, mAttributionSource);
+ return;
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ }
+
+ /**
+ * Get current absolute volume of the remote device
+ *
+ * @param device: remote device instance
+ * @return current absolute volume of the remote device
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getAbsoluteVolume(BluetoothDevice device) {
+ if (VDBG) log("getAbsoluteVolume(" + device + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ return service.getAbsoluteVolume(device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return -1;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return -1;
+ }
+
+ /**
+ * Mute or unmute remote device via VCP connection
+ *
+ * @param device: remote device instance
+ * @prarm enableMute: true if mute, false if unmute
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public void setMute(BluetoothDevice device, boolean enableMute) {
+ if (VDBG) log("setMute(" + device + ")" +" enableMute: " + enableMute);
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ service.setMute(device, enableMute, mAttributionSource);
+ return;
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ }
+
+ /**
+ * Get mute status of remote device
+ *
+ * @param device: remote device instance
+ * @return current mute status of the remote device
+ * true if mute status, false if unmute status
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean isMute(BluetoothDevice device) {
+ if (VDBG) log("isMute(" + device + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ return service.isMute(device, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return false;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return false;
+ }
+
+ /**
+ * set active stream for a DuMo device
+ *
+ * @param device: remote device instance
+ * @param audioType: call/media audio
+ * @param profile: profile that is needed to be active
+ * @return success/failure
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public boolean setActiveProfile(BluetoothDevice device, int audioType, int profile) {
+ if (VDBG) log("setActiveProfile(" + device + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled() && isValidDevice(device)) {
+ try {
+ return service.setActiveProfile(device, audioType, profile, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return false;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return false;
+ }
+
+ /**
+ * set active stream for a DuMo device
+ *
+ * @param audioType: call/media audio
+ * @return ID of current active profile
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public int getActiveProfile(int audioType) {
+ if (VDBG) log("getActiveProfile(" + audioType + ")");
+ final IBluetoothVcp service =
+ getService();
+ if (service != null && isEnabled()) {
+ try {
+ return service.getActiveProfile(audioType, mAttributionSource);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
+ return -1;
+ }
+ }
+ if (service == null) Log.w(TAG, "Proxy not attached to service");
+ return -1;
+ }
+
+ private boolean isEnabled() {
+ return mAdapter.getState() == BluetoothAdapter.STATE_ON;
+ }
+
+ private static boolean isValidDevice(BluetoothDevice device) {
+ return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress());
+ }
+
+ private static void log(String msg) {
+ Log.d(TAG, msg);
+ }
+}
+
diff --git a/core/java/android/bluetooth/DeviceGroup.java b/core/java/android/bluetooth/DeviceGroup.java
new file mode 100644
index 000000000000..0dac87f3d8f6
--- /dev/null
+++ b/core/java/android/bluetooth/DeviceGroup.java
@@ -0,0 +1,177 @@
+/******************************************************************************
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package android.bluetooth;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.ParcelUuid;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * Provides Device Group details.
+ *
+ * {@see BluetoothDeviceGroup}
+ * @hide
+ *
+ */
+
+public final class DeviceGroup implements Parcelable {
+ /** Identifier of the Device Group */
+ private int mGroupId;
+ /** Size of the Device Group. */
+ private int mSize;
+ /** List of all group devices {@link BluetoothDevice} */
+ private CopyOnWriteArrayList <BluetoothDevice> mGroupDevices
+ = new CopyOnWriteArrayList<BluetoothDevice>();
+ /** Primary Service UUID which has included required Device Group service*/
+ private final ParcelUuid mIncludingSrvcUUID;
+ /** Suggests whether exclusive access can be taken for this device group */
+ private final boolean mExclusiveAccessSupport;
+
+ /**
+ * Constructor.
+ * @hide
+ */
+ public DeviceGroup(int groupId, int size, List<BluetoothDevice> groupDevices,
+ ParcelUuid includingSrvcUUID, boolean exclusiveAccessSupport) {
+ mGroupId = groupId;
+ mSize = size;
+ mGroupDevices.addAll(groupDevices);
+ mIncludingSrvcUUID = includingSrvcUUID;
+ mExclusiveAccessSupport = exclusiveAccessSupport;
+ }
+
+ public DeviceGroup(Parcel in) {
+ mGroupId = in.readInt();
+ mSize = in.readInt();
+ in.readList(mGroupDevices, BluetoothDevice.class.getClassLoader());
+ mIncludingSrvcUUID = in.readParcelable(ParcelUuid.class.getClassLoader());
+ mExclusiveAccessSupport = in.readBoolean();
+ }
+
+ /**
+ * Used to retrieve identifier of the Device Group.
+ *
+ * @return Identifier of the Device Group.
+ */
+ public int getDeviceGroupId() {
+ return mGroupId;
+ }
+
+ /**
+ * Used to know total number group devices which are part of this Device Group.
+ *
+ * @return size of the Device Group
+ */
+ public int getDeviceGroupSize() {
+ return mSize;
+ }
+
+ /**
+ * Indicates total number of group devices discovered in Group Discovery procedure.
+ *
+ * @return total group devices discovered in the Device Group.
+ */
+ public int getTotalDiscoveredGroupDevices() {
+ return mGroupDevices.size();
+ }
+
+
+ /**
+ * Used to fetch group devices of the Device Group.
+ *
+ *@return List of group devices {@link BluetoothDevice} in the Device Group.
+ */
+ public List<BluetoothDevice> getDeviceGroupMembers() {
+ return mGroupDevices;
+ }
+
+ /**
+ * Suggests primary GATT service which has included this DeviceGroup Service
+ * for this device group. If remote device is part of multiple Device Groups then
+ * this uuid cant be null. If remote device is part of only one device froup
+ * then this returned parameter can be null.
+ *
+ *@return UUID of the GATT primary Service which has included this device group.
+ */
+ public ParcelUuid getIncludingServiceUUID() {
+ return mIncludingSrvcUUID;
+ }
+
+ /**
+ * Suggests whether exclusive access is supported by this Device Group.
+ *
+ * @return true, if exclusive access operation is supported by this Device Group.
+ * Otherwise, false.
+ */
+ public boolean isExclusiveAccessSupported() {
+ return mExclusiveAccessSupport;
+ }
+
+ /**
+ * Indicates whether all devices of this Device Group are discovered.
+ *
+ * @return true, if all group devices are discovered. Otherwise, false.
+ */
+ public boolean isGroupDiscoveredCompleted() {
+ return (mSize == getTotalDiscoveredGroupDevices());
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mGroupId);
+ dest.writeInt(mSize);
+ dest.writeList(mGroupDevices);
+ dest.writeParcelable(mIncludingSrvcUUID, 0);
+ dest.writeBoolean(mExclusiveAccessSupport);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public static final Parcelable.Creator<DeviceGroup> CREATOR =
+ new Parcelable.Creator<DeviceGroup>() {
+ public DeviceGroup createFromParcel(Parcel in) {
+ return new DeviceGroup(in);
+ }
+
+ public DeviceGroup[] newArray(int size) {
+ return new DeviceGroup[size];
+ }
+ };
+}
diff --git a/core/java/android/bluetooth/le/AdvertiseData.java b/core/java/android/bluetooth/le/AdvertiseData.java
index cec658049ca5..f0075263894f 100644
--- a/core/java/android/bluetooth/le/AdvertiseData.java
+++ b/core/java/android/bluetooth/le/AdvertiseData.java
@@ -51,19 +51,22 @@ public final class AdvertiseData implements Parcelable {
private final Map<ParcelUuid, byte[]> mServiceData;
private final boolean mIncludeTxPowerLevel;
private final boolean mIncludeDeviceName;
+ private final byte[] mTransportDiscoveryData;
private AdvertiseData(List<ParcelUuid> serviceUuids,
List<ParcelUuid> serviceSolicitationUuids,
SparseArray<byte[]> manufacturerData,
Map<ParcelUuid, byte[]> serviceData,
boolean includeTxPowerLevel,
- boolean includeDeviceName) {
+ boolean includeDeviceName,
+ byte[] transportDiscoveryData) {
mServiceUuids = serviceUuids;
mServiceSolicitationUuids = serviceSolicitationUuids;
mManufacturerSpecificData = manufacturerData;
mServiceData = serviceData;
mIncludeTxPowerLevel = includeTxPowerLevel;
mIncludeDeviceName = includeDeviceName;
+ mTransportDiscoveryData = transportDiscoveryData;
}
/**
@@ -112,12 +115,20 @@ public final class AdvertiseData implements Parcelable {
}
/**
+ * Returns an array of Transport Discovery data.
+ * @hide
+ */
+ public byte[] getTransportDiscoveryData() {
+ return mTransportDiscoveryData;
+ }
+
+ /**
* @hide
*/
@Override
public int hashCode() {
return Objects.hash(mServiceUuids, mServiceSolicitationUuids, mManufacturerSpecificData,
- mServiceData, mIncludeDeviceName, mIncludeTxPowerLevel);
+ mServiceData, mIncludeDeviceName, mIncludeTxPowerLevel, mTransportDiscoveryData);
}
/**
@@ -138,7 +149,8 @@ public final class AdvertiseData implements Parcelable {
other.mManufacturerSpecificData)
&& BluetoothLeUtils.equals(mServiceData, other.mServiceData)
&& mIncludeDeviceName == other.mIncludeDeviceName
- && mIncludeTxPowerLevel == other.mIncludeTxPowerLevel;
+ && mIncludeTxPowerLevel == other.mIncludeTxPowerLevel
+ && BluetoothLeUtils.equals(mTransportDiscoveryData, other.mTransportDiscoveryData);
}
@Override
@@ -148,7 +160,8 @@ public final class AdvertiseData implements Parcelable {
+ BluetoothLeUtils.toString(mManufacturerSpecificData) + ", mServiceData="
+ BluetoothLeUtils.toString(mServiceData)
+ ", mIncludeTxPowerLevel=" + mIncludeTxPowerLevel + ", mIncludeDeviceName="
- + mIncludeDeviceName + "]";
+ + mIncludeDeviceName + ", mTransportDiscoveryData="
+ + BluetoothLeUtils.toString(mTransportDiscoveryData)+ "]";
}
@Override
@@ -175,6 +188,10 @@ public final class AdvertiseData implements Parcelable {
}
dest.writeByte((byte) (getIncludeTxPowerLevel() ? 1 : 0));
dest.writeByte((byte) (getIncludeDeviceName() ? 1 : 0));
+ dest.writeInt(mTransportDiscoveryData != null ? mTransportDiscoveryData.length : 0);
+ if (mTransportDiscoveryData != null) {
+ dest.writeByteArray(mTransportDiscoveryData);
+ }
}
public static final @android.annotation.NonNull Parcelable.Creator<AdvertiseData> CREATOR =
@@ -211,6 +228,11 @@ public final class AdvertiseData implements Parcelable {
}
builder.setIncludeTxPowerLevel(in.readByte() == 1);
builder.setIncludeDeviceName(in.readByte() == 1);
+ int transportDiscoveryDataSize = in.readInt();
+ if (transportDiscoveryDataSize > 0) {
+ byte[] transportDiscoveryData = in.createByteArray();
+ builder.addTransportDiscoveryData(transportDiscoveryData);
+ }
return builder.build();
}
};
@@ -227,6 +249,7 @@ public final class AdvertiseData implements Parcelable {
private Map<ParcelUuid, byte[]> mServiceData = new ArrayMap<ParcelUuid, byte[]>();
private boolean mIncludeTxPowerLevel;
private boolean mIncludeDeviceName;
+ private byte[] mTransportDiscoveryData;
/**
* Add a service UUID to advertise data.
@@ -315,12 +338,24 @@ public final class AdvertiseData implements Parcelable {
}
/**
+ * Add Transport Discovery data
+ * @hide
+ */
+ public Builder addTransportDiscoveryData(byte[] transportDiscoveryData) {
+ if ((transportDiscoveryData == null) || (transportDiscoveryData.length == 0)) {
+ throw new IllegalArgumentException("transportDiscoveryData is null");
+ }
+ mTransportDiscoveryData = transportDiscoveryData;
+ return this;
+ }
+
+ /**
* Build the {@link AdvertiseData}.
*/
public AdvertiseData build() {
return new AdvertiseData(mServiceUuids, mServiceSolicitationUuids,
mManufacturerSpecificData, mServiceData, mIncludeTxPowerLevel,
- mIncludeDeviceName);
+ mIncludeDeviceName, mTransportDiscoveryData);
}
}
}
diff --git a/core/java/android/bluetooth/le/AdvertisingSetParameters.java b/core/java/android/bluetooth/le/AdvertisingSetParameters.java
index e39b198ae384..360e8f8815e0 100644
--- a/core/java/android/bluetooth/le/AdvertisingSetParameters.java
+++ b/core/java/android/bluetooth/le/AdvertisingSetParameters.java
@@ -20,6 +20,7 @@ import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.os.Parcel;
import android.os.Parcelable;
+import android.app.ActivityThread;
/**
* The {@link AdvertisingSetParameters} provide a way to adjust advertising
@@ -389,10 +390,20 @@ public final class AdvertisingSetParameters implements Parcelable {
* {@link AdvertisingSetParameters#TX_POWER_MEDIUM},
* or {@link AdvertisingSetParameters#TX_POWER_HIGH}.
* @throws IllegalArgumentException If the {@code txPowerLevel} is invalid.
+ * Allow tx power level to be set more than {@link AdvertisingSetParameters#TX_POWER_HIGH},
+ * if the setTxPowerLevel is invoked from com.android.bluetooth process
*/
public Builder setTxPowerLevel(int txPowerLevel) {
- if (txPowerLevel < TX_POWER_MIN || txPowerLevel > TX_POWER_MAX) {
- throw new IllegalArgumentException("unknown txPowerLevel " + txPowerLevel);
+ String packageName = ActivityThread.currentPackageName();
+ if (packageName.equals("com.android.bluetooth")) {
+ int maxPowerLevel = 20;
+ if (txPowerLevel < TX_POWER_MIN || txPowerLevel > maxPowerLevel) {
+ throw new IllegalArgumentException("invalid txPowerLevel " + txPowerLevel);
+ }
+ } else {
+ if (txPowerLevel < TX_POWER_MIN || txPowerLevel > TX_POWER_MAX) {
+ throw new IllegalArgumentException("unknown txPowerLevel " + txPowerLevel);
+ }
}
mTxPowerLevel = txPowerLevel;
return this;
diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java
index 34aac8bfdb25..2afe24f1439a 100644
--- a/core/java/android/bluetooth/le/BluetoothLeScanner.java
+++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java
@@ -38,6 +38,7 @@ import android.os.RemoteException;
import android.os.WorkSource;
import android.util.Log;
+import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -260,6 +261,13 @@ public final class BluetoothLeScanner {
if (gatt == null) {
return postCallbackErrorOrReturn(callback, ScanCallback.SCAN_FAILED_INTERNAL_ERROR);
}
+
+ if ((settings.getCallbackType() == ScanSettings.CALLBACK_TYPE_SENSOR_ROUTING)
+ && (filters == null || filters.isEmpty())) {
+ ScanFilter filter = (new ScanFilter.Builder()).build();
+ filters = Arrays.asList(filter);
+ }
+
if (!isSettingsConfigAllowedForScan(settings)) {
return postCallbackErrorOrReturn(callback,
ScanCallback.SCAN_FAILED_FEATURE_UNSUPPORTED);
@@ -272,6 +280,10 @@ public final class BluetoothLeScanner {
return postCallbackErrorOrReturn(callback,
ScanCallback.SCAN_FAILED_FEATURE_UNSUPPORTED);
}
+ if (!isRoutingAllowedForScan(settings)) {
+ return postCallbackErrorOrReturn(callback,
+ ScanCallback.SCAN_FAILED_FEATURE_UNSUPPORTED);
+ }
if (callback != null) {
BleScanCallbackWrapper wrapper = new BleScanCallbackWrapper(gatt, filters,
settings, workSource, callback, resultStorages);
@@ -648,4 +660,14 @@ public final class BluetoothLeScanner {
}
return true;
}
+
+ private boolean isRoutingAllowedForScan(ScanSettings settings) {
+ final int callbackType = settings.getCallbackType();
+
+ if (callbackType == ScanSettings.CALLBACK_TYPE_SENSOR_ROUTING
+ && settings.getScanMode() == ScanSettings.SCAN_MODE_OPPORTUNISTIC) {
+ return false;
+ }
+ return true;
+ }
}
diff --git a/core/java/android/bluetooth/le/BluetoothLeUtils.java b/core/java/android/bluetooth/le/BluetoothLeUtils.java
index 6381f557c1b2..f8d1c517540d 100644
--- a/core/java/android/bluetooth/le/BluetoothLeUtils.java
+++ b/core/java/android/bluetooth/le/BluetoothLeUtils.java
@@ -77,6 +77,28 @@ public class BluetoothLeUtils {
}
/**
+ * Returns a string composed from a byte array.
+ */
+ static <T> String toString(byte[] data) {
+ if (data == null) {
+ return "null";
+ }
+ if (data.length == 0) {
+ return "{}";
+ }
+ StringBuilder buffer = new StringBuilder();
+ buffer.append('{');
+ for(int i=0; i < data.length; i++) {
+ buffer.append(data[i]);
+ if ((i+1) < data.length) {
+ buffer.append(", ");
+ }
+ }
+ buffer.append('}');
+ return buffer.toString();
+ }
+
+ /**
* Check whether two {@link SparseArray} equal.
*/
static boolean equals(SparseArray<byte[]> array, SparseArray<byte[]> otherArray) {
@@ -126,6 +148,25 @@ public class BluetoothLeUtils {
}
/**
+ * Check whether two byte arrays are equal.
+ */
+ static <T> boolean equals(byte[] data, byte[] otherData) {
+ if (data == otherData) {
+ return true;
+ }
+ if (data == null || otherData == null) {
+ return false;
+ }
+ if (data.length != otherData.length) {
+ return false;
+ }
+ if (!Objects.deepEquals(data, otherData)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
* Ensure Bluetooth is turned on.
*
* @throws IllegalStateException If {@code adapter} is null or Bluetooth state is not {@link
diff --git a/core/java/android/bluetooth/le/PeriodicAdvertisingCallback.java b/core/java/android/bluetooth/le/PeriodicAdvertisingCallback.java
index 14ac911fcb7f..b3fd484f699f 100644
--- a/core/java/android/bluetooth/le/PeriodicAdvertisingCallback.java
+++ b/core/java/android/bluetooth/le/PeriodicAdvertisingCallback.java
@@ -78,4 +78,13 @@ public abstract class PeriodicAdvertisingCallback {
*/
public void onSyncLost(int syncHandle) {
}
+
+ /**
+ * Callback when periodic sync transfered.
+ *
+ * @param device
+ * @param status
+ */
+ public void onSyncTransfered(BluetoothDevice device, int status) {
+ }
}
diff --git a/core/java/android/bluetooth/le/PeriodicAdvertisingManager.java b/core/java/android/bluetooth/le/PeriodicAdvertisingManager.java
index dea686d18ea2..ff9a41b92f34 100644
--- a/core/java/android/bluetooth/le/PeriodicAdvertisingManager.java
+++ b/core/java/android/bluetooth/le/PeriodicAdvertisingManager.java
@@ -259,6 +259,75 @@ public final class PeriodicAdvertisingManager {
}
});
}
+
+ public void onSyncTransfered(BluetoothDevice device, int status) {
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onSyncTransfered(device, status);
+ // App can still unregister the sync until notified it's lost.
+ // Remove callback after app was notifed.
+ //mCallbackWrappers.remove(callback);
+ }
+ });
+ }
};
}
+
+ public void transferSync(BluetoothDevice bda, int service_data, int sync_handle) {
+ IBluetoothGatt gatt;
+ try {
+ gatt = mBluetoothManager.getBluetoothGatt();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to get Bluetooth gatt - ", e);
+ PeriodicAdvertisingCallback callback = null;
+ for (PeriodicAdvertisingCallback cb : mCallbackWrappers.keySet()) {
+ callback = cb;
+ }
+ if (callback != null) {
+ callback.onSyncTransfered(bda,
+ PeriodicAdvertisingCallback.SYNC_NO_RESOURCES);
+ }
+ return;
+ }
+ try {
+ gatt.transferSync(bda, service_data , sync_handle);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to register sync - ", e);
+ return;
+ }
+ }
+
+ public void transferSetInfo(BluetoothDevice bda, int service_data,
+ int adv_handle, PeriodicAdvertisingCallback callback) {
+ transferSetInfo(bda, service_data, adv_handle, callback, null);
+ }
+
+ public void transferSetInfo (BluetoothDevice bda, int service_data,
+ int adv_handle, PeriodicAdvertisingCallback callback, Handler handler) {
+ if (callback == null) {
+ throw new IllegalArgumentException("callback can't be null");
+ }
+ IBluetoothGatt gatt;
+ try {
+ gatt = mBluetoothManager.getBluetoothGatt();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to get Bluetooth gatt - ", e);
+ return;
+ }
+ if (handler == null) {
+ handler = new Handler(Looper.getMainLooper());
+ }
+ IPeriodicAdvertisingCallback wrapper = wrap(callback, handler);
+ if (wrapper == null) {
+ throw new IllegalArgumentException("callback was not properly registered");
+ }
+ try {
+ gatt.transferSetInfo(bda, service_data , adv_handle, wrapper);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to register sync - ", e);
+ return;
+ }
+
+ }
}
diff --git a/core/java/android/bluetooth/le/ScanFilter.java b/core/java/android/bluetooth/le/ScanFilter.java
index 8ff018121ab0..20ed49850b1d 100644
--- a/core/java/android/bluetooth/le/ScanFilter.java
+++ b/core/java/android/bluetooth/le/ScanFilter.java
@@ -51,6 +51,12 @@ import java.util.UUID;
*/
public final class ScanFilter implements Parcelable {
+ /**
+ * Provide TDS data scan results for WiFi Alliance Org id
+ * @hide
+ */
+ public static final int WIFI_ALLIANCE_ORG_ID = 2;
+
@Nullable
private final String mDeviceName;
@@ -85,6 +91,15 @@ public final class ScanFilter implements Parcelable {
@Nullable
private final byte[] mManufacturerDataMask;
+ private final int mOrgId;
+ private final int mTDSFlags;
+ private final int mTDSFlagsMask;
+ private final byte[] mWifiNANHash;
+
+ private final boolean mGroupBasedFiltering;
+
+ private static final int GROUP_DATA_LEN = 6;
+
/** @hide */
public static final ScanFilter EMPTY = new ScanFilter.Builder().build();
@@ -93,7 +108,9 @@ public final class ScanFilter implements Parcelable {
ParcelUuid solicitationUuidMask, ParcelUuid serviceDataUuid,
byte[] serviceData, byte[] serviceDataMask,
int manufacturerId, byte[] manufacturerData, byte[] manufacturerDataMask,
- @AddressType int addressType, @Nullable byte[] irk) {
+ @AddressType int addressType, @Nullable byte[] irk,
+ int orgId, int TDSFlags, int TDSFlagsMask, byte[] wifiNANHash,
+ boolean groupBasedFiltering) {
mDeviceName = name;
mServiceUuid = uuid;
mServiceUuidMask = uuidMask;
@@ -108,6 +125,11 @@ public final class ScanFilter implements Parcelable {
mManufacturerDataMask = manufacturerDataMask;
mAddressType = addressType;
mIrk = irk;
+ mOrgId = orgId;
+ mTDSFlags = TDSFlags;
+ mTDSFlagsMask = TDSFlagsMask;
+ mWifiNANHash = wifiNANHash;
+ mGroupBasedFiltering = groupBasedFiltering;
}
@Override
@@ -177,6 +199,18 @@ public final class ScanFilter implements Parcelable {
dest.writeByteArray(mIrk);
}
}
+ dest.writeInt(mOrgId);
+ dest.writeInt(mOrgId < 0 ? 0 : 1);
+ if(mOrgId >= 0) {
+ dest.writeInt(mTDSFlags);
+ dest.writeInt(mTDSFlagsMask);
+ dest.writeInt(mWifiNANHash == null ? 0 : 1);
+ if (mWifiNANHash != null) {
+ dest.writeInt(mWifiNANHash.length);
+ dest.writeByteArray(mWifiNANHash);
+ }
+ }
+ dest.writeBoolean(mGroupBasedFiltering);
}
/**
@@ -267,6 +301,25 @@ public final class ScanFilter implements Parcelable {
builder.setDeviceAddress(address, addressType);
}
}
+
+ int orgId = in.readInt();
+ if(in.readInt() == 1) {
+ int tdsFlags = in.readInt();
+ int tdsFlagsMask = in.readInt();
+ if (in.readInt() == 1) {
+ int wifiNANHashLength = in.readInt();
+ byte[] wifiNanHash = new byte[wifiNANHashLength];
+ in.readByteArray(wifiNanHash);
+ builder.setTransportDiscoveryData(orgId, tdsFlags, tdsFlagsMask,
+ wifiNanHash);
+ }
+ else {
+ builder.setTransportDiscoveryData(orgId, tdsFlags, tdsFlagsMask, null);
+ }
+ }
+
+ boolean groupBasedFiltering = in.readBoolean();
+ builder.setGroupBasedFiltering(groupBasedFiltering);
return builder.build();
}
};
@@ -363,6 +416,45 @@ public final class ScanFilter implements Parcelable {
}
/**
+ * @hide
+ * Returns the organization id. -1 if the organization id is not set.
+ */
+ public int getOrgId() {
+ return mOrgId;
+ }
+
+ /**
+ * @hide
+ * Returns the TDS flags. -1 if TDS flags is not set.
+ */
+ public int getTDSFlags() {
+ return mTDSFlags;
+ }
+
+ /**
+ * @hide
+ * Returns the TDS flags mask. -1 if TDS flags mask is not set.
+ */
+ public int getTDSFlagsMask() {
+ return mTDSFlagsMask;
+ }
+
+ /**
+ * @hide
+ */
+ public byte[] getWifiNANHash() {
+ return mWifiNANHash;
+ }
+
+ /**
+ * @hide
+ * Returns true, if Group AD Type based filtering is enabled. Otherwise, false.
+ */
+ public boolean getGroupFilteringValue() {
+ return mGroupBasedFiltering;
+ }
+
+ /**
* Check if the scan filter matches a {@code scanResult}. A scan result is considered as a match
* if it matches all the field filters.
*/
@@ -419,6 +511,26 @@ public final class ScanFilter implements Parcelable {
return false;
}
}
+
+ //Transport Discovery data match
+ if(mOrgId >= 0) {
+ byte[] tdsData = scanRecord.getTDSData();
+ if ((tdsData != null) && (tdsData.length > 0)) {
+ if ((mOrgId != tdsData[0]) ||
+ ((mTDSFlags & mTDSFlagsMask) != (tdsData[1] & mTDSFlagsMask))) {
+ return false;
+ }
+ }
+ }
+
+ // Group AD Type filter match
+ if (mGroupBasedFiltering) {
+ byte [] groupIdData = scanRecord.getGroupIdentifierData();
+ if (groupIdData != null && groupIdData.length != GROUP_DATA_LEN) {
+ return false;
+ }
+ }
+
// All filters match.
return true;
}
@@ -513,7 +625,11 @@ public final class ScanFilter implements Parcelable {
+ Arrays.toString(mServiceData) + ", mServiceDataMask="
+ Arrays.toString(mServiceDataMask) + ", mManufacturerId=" + mManufacturerId
+ ", mManufacturerData=" + Arrays.toString(mManufacturerData)
- + ", mManufacturerDataMask=" + Arrays.toString(mManufacturerDataMask) + "]";
+ + ", mManufacturerDataMask=" + Arrays.toString(mManufacturerDataMask)
+ + ", mOrganizationId=" + mOrgId + ", mTDSFlags=" + mTDSFlags
+ + ", mTDSFlagsMask=" + mTDSFlagsMask
+ + ", mWifiNANHash=" + Arrays.toString(mWifiNANHash) +"]"
+ + ", mGroupBasedFiltering=" + mGroupBasedFiltering;
}
@Override
@@ -525,7 +641,9 @@ public final class ScanFilter implements Parcelable {
Arrays.hashCode(mServiceData),
Arrays.hashCode(mServiceDataMask),
mServiceUuid, mServiceUuidMask,
- mServiceSolicitationUuid, mServiceSolicitationUuidMask);
+ mServiceSolicitationUuid, mServiceSolicitationUuidMask,
+ mOrgId, mTDSFlags, mTDSFlagsMask, Arrays.hashCode(mWifiNANHash),
+ mGroupBasedFiltering);
}
@Override
@@ -549,7 +667,12 @@ public final class ScanFilter implements Parcelable {
&& Objects.equals(mServiceUuidMask, other.mServiceUuidMask)
&& Objects.equals(mServiceSolicitationUuid, other.mServiceSolicitationUuid)
&& Objects.equals(mServiceSolicitationUuidMask,
- other.mServiceSolicitationUuidMask);
+ other.mServiceSolicitationUuidMask)
+ && mOrgId == other.mOrgId
+ && mTDSFlags == other.mTDSFlags
+ && mTDSFlagsMask == other.mTDSFlagsMask
+ && Objects.deepEquals(mWifiNANHash, other.mWifiNANHash)
+ && mGroupBasedFiltering == other.mGroupBasedFiltering;
}
/**
@@ -591,6 +714,13 @@ public final class ScanFilter implements Parcelable {
private byte[] mManufacturerData;
private byte[] mManufacturerDataMask;
+ private int mOrgId = -1;
+ private int mTDSFlags = -1;
+ private int mTDSFlagsMask = -1;
+ private byte[] mWifiNANHash;
+
+ private boolean mGroupBasedFiltering;
+
/**
* Set filter on device name.
*/
@@ -895,6 +1025,38 @@ public final class ScanFilter implements Parcelable {
return this;
}
+
+ /**
+ * @hide
+ * Set filter on transport discovery data.
+ * @throws IllegalArgumentException If the {@code orgId} is invalid or {@code
+ * wifiNANhash} is not null while {@code orgId} is non-Wifi.
+ */
+ public Builder setTransportDiscoveryData(int orgId, int TDSFlags, int TDSFlagsMask,
+ byte[] wifiNANHash) {
+ if (orgId < 0) {
+ throw new IllegalArgumentException("invalid organization id");
+ }
+ if ((orgId != WIFI_ALLIANCE_ORG_ID) && (wifiNANHash != null)) {
+ throw new IllegalArgumentException("Wifi NAN Hash is not null for non-Wifi Org Id");
+ }
+ mOrgId = orgId;
+ mTDSFlags = TDSFlags;
+ mTDSFlagsMask = TDSFlagsMask;
+ mWifiNANHash = wifiNANHash;
+ return this;
+ }
+
+ /**
+ * @hide
+ * Enable filter on Group AD Type.
+ */
+ public @NonNull Builder setGroupBasedFiltering(
+ boolean enable) {
+ mGroupBasedFiltering = enable;
+ return this;
+ }
+
/**
* Build {@link ScanFilter}.
*
@@ -906,7 +1068,9 @@ public final class ScanFilter implements Parcelable {
mServiceSolicitationUuidMask,
mServiceDataUuid, mServiceData, mServiceDataMask,
mManufacturerId, mManufacturerData, mManufacturerDataMask,
- mAddressType, mIrk);
+ mAddressType, mIrk,
+ mOrgId, mTDSFlags, mTDSFlagsMask, mWifiNANHash,
+ mGroupBasedFiltering);
}
}
}
diff --git a/core/java/android/bluetooth/le/ScanRecord.java b/core/java/android/bluetooth/le/ScanRecord.java
index 9b8c2eaf4d19..28dbfbef993f 100644
--- a/core/java/android/bluetooth/le/ScanRecord.java
+++ b/core/java/android/bluetooth/le/ScanRecord.java
@@ -59,6 +59,11 @@ public final class ScanRecord {
private static final int DATA_TYPE_SERVICE_SOLICITATION_UUIDS_32_BIT = 0x1F;
private static final int DATA_TYPE_SERVICE_SOLICITATION_UUIDS_128_BIT = 0x15;
private static final int DATA_TYPE_MANUFACTURER_SPECIFIC_DATA = 0xFF;
+ private static final int DATA_TYPE_TRANSPORT_DISCOVERY_DATA = 0x26;
+ /**
+ * @hide
+ */
+ public static int DATA_TYPE_GROUP_AD_TYPE = 0x00;
// Flags of the advertising data.
private final int mAdvertiseFlags;
@@ -81,6 +86,12 @@ public final class ScanRecord {
// Raw bytes of scan record.
private final byte[] mBytes;
+ // Transport Discovery data.
+ private final byte[] mTDSData;
+
+ // Group Identifier Data
+ private final byte[] mGroupIdentifierData;
+
/**
* Returns the advertising flags indicating the discoverable mode and capability of the device.
* Returns -1 if the flag field is not set.
@@ -165,6 +176,22 @@ public final class ScanRecord {
}
/**
+ * @hide
+ * Returns Transport Discovery data
+ */
+ public byte[] getTDSData() {
+ return mTDSData;
+ }
+
+ /**
+ * @hide
+ * Returns Group Identifier data
+ */
+ public byte[] getGroupIdentifierData() {
+ return mGroupIdentifierData;
+ }
+
+ /**
* Returns raw bytes of scan record.
*/
public byte[] getBytes() {
@@ -197,7 +224,7 @@ public final class ScanRecord {
SparseArray<byte[]> manufacturerData,
Map<ParcelUuid, byte[]> serviceData,
int advertiseFlags, int txPowerLevel,
- String localName, byte[] bytes) {
+ String localName, byte[] tdsData, byte[] groupIdentifierData, byte[] bytes) {
mServiceSolicitationUuids = serviceSolicitationUuids;
mServiceUuids = serviceUuids;
mManufacturerSpecificData = manufacturerData;
@@ -205,6 +232,8 @@ public final class ScanRecord {
mDeviceName = localName;
mAdvertiseFlags = advertiseFlags;
mTxPowerLevel = txPowerLevel;
+ mTDSData = tdsData;
+ mGroupIdentifierData = groupIdentifierData;
mBytes = bytes;
}
@@ -235,6 +264,9 @@ public final class ScanRecord {
SparseArray<byte[]> manufacturerData = new SparseArray<byte[]>();
Map<ParcelUuid, byte[]> serviceData = new ArrayMap<ParcelUuid, byte[]>();
+ byte[] tdsData = null;
+ byte[] groupIdentifierData = null;
+
try {
while (currentPos < scanRecord.length) {
// length is unsigned int.
@@ -312,8 +344,15 @@ public final class ScanRecord {
dataLength - 2);
manufacturerData.put(manufacturerId, manufacturerDataBytes);
break;
+ case DATA_TYPE_TRANSPORT_DISCOVERY_DATA:
+ tdsData = extractBytes(scanRecord, currentPos, dataLength);
+ break;
+
default:
- // Just ignore, we don't handle such data type.
+ if (fieldType == DATA_TYPE_GROUP_AD_TYPE) {
+ Log.d(TAG, "Parsing Group Identifier data");
+ groupIdentifierData = extractBytes(scanRecord, currentPos, dataLength);
+ }
break;
}
currentPos += dataLength;
@@ -323,12 +362,14 @@ public final class ScanRecord {
serviceUuids = null;
}
return new ScanRecord(serviceUuids, serviceSolicitationUuids, manufacturerData,
- serviceData, advertiseFlag, txPowerLevel, localName, scanRecord);
+ serviceData, advertiseFlag, txPowerLevel, localName, tdsData,
+ groupIdentifierData, scanRecord);
} catch (Exception e) {
Log.e(TAG, "unable to parse scan record: " + Arrays.toString(scanRecord));
// As the record is invalid, ignore all the parsed results for this packet
// and return an empty record with raw scanRecord bytes in results
- return new ScanRecord(null, null, null, null, -1, Integer.MIN_VALUE, null, scanRecord);
+ return new ScanRecord(null, null, null, null, -1, Integer.MIN_VALUE, null, null,
+ null, scanRecord);
}
}
@@ -339,7 +380,8 @@ public final class ScanRecord {
+ ", mManufacturerSpecificData=" + BluetoothLeUtils.toString(
mManufacturerSpecificData)
+ ", mServiceData=" + BluetoothLeUtils.toString(mServiceData)
- + ", mTxPowerLevel=" + mTxPowerLevel + ", mDeviceName=" + mDeviceName + "]";
+ + ", mTxPowerLevel=" + mTxPowerLevel + ", mDeviceName=" + mDeviceName +
+ ", mTDSData=" + BluetoothLeUtils.toString(mTDSData) +"]";
}
// Parse service UUIDs.
diff --git a/core/java/android/bluetooth/le/ScanResult.java b/core/java/android/bluetooth/le/ScanResult.java
index 522845628487..40ff3bec817e 100644
--- a/core/java/android/bluetooth/le/ScanResult.java
+++ b/core/java/android/bluetooth/le/ScanResult.java
@@ -93,6 +93,7 @@ public final class ScanResult implements Parcelable, Attributable {
private int mAdvertisingSid;
private int mTxPower;
private int mPeriodicAdvertisingInterval;
+ private int mAddressType;
/**
* Constructs a new ScanResult.
@@ -117,6 +118,7 @@ public final class ScanResult implements Parcelable, Attributable {
mAdvertisingSid = SID_NOT_PRESENT;
mTxPower = 127;
mPeriodicAdvertisingInterval = 0;
+ mAddressType = -1;
}
/**
@@ -146,6 +148,42 @@ public final class ScanResult implements Parcelable, Attributable {
mPeriodicAdvertisingInterval = periodicAdvertisingInterval;
mScanRecord = scanRecord;
mTimestampNanos = timestampNanos;
+ mAddressType = -1;
+ }
+
+ /**
+ * Constructs a new ScanResult.
+ *
+ * @param device Remote Bluetooth device found.
+ * @param addressType addressType for the Scan result
+ * @param eventType Event type.
+ * @param primaryPhy Primary advertising phy.
+ * @param secondaryPhy Secondary advertising phy.
+ * @param advertisingSid Advertising set ID.
+ * @param txPower Transmit power.
+ * @param rssi Received signal strength.
+ * @param periodicAdvertisingInterval Periodic advertising interval.
+ * @param scanRecord Scan record including both advertising data and scan response data.
+ * @param timestampNanos Timestamp at which the scan result was observed.
+ * @param addressType addressType for the Scan result
+ *
+ *@hide
+ */
+ public ScanResult(BluetoothDevice device, int addressType, int eventType, int primaryPhy,
+ int secondaryPhy,
+ int advertisingSid, int txPower, int rssi, int periodicAdvertisingInterval,
+ ScanRecord scanRecord, long timestampNanos) {
+ mDevice = device;
+ mEventType = eventType;
+ mPrimaryPhy = primaryPhy;
+ mSecondaryPhy = secondaryPhy;
+ mAdvertisingSid = advertisingSid;
+ mTxPower = txPower;
+ mRssi = rssi;
+ mPeriodicAdvertisingInterval = periodicAdvertisingInterval;
+ mScanRecord = scanRecord;
+ mTimestampNanos = timestampNanos;
+ mAddressType = addressType;
}
private ScanResult(Parcel in) {
@@ -174,6 +212,7 @@ public final class ScanResult implements Parcelable, Attributable {
dest.writeInt(mAdvertisingSid);
dest.writeInt(mTxPower);
dest.writeInt(mPeriodicAdvertisingInterval);
+ dest.writeInt(mAddressType);
}
private void readFromParcel(Parcel in) {
@@ -191,6 +230,7 @@ public final class ScanResult implements Parcelable, Attributable {
mAdvertisingSid = in.readInt();
mTxPower = in.readInt();
mPeriodicAdvertisingInterval = in.readInt();
+ mAddressType = in.readInt();
}
@Override
@@ -308,6 +348,14 @@ public final class ScanResult implements Parcelable, Attributable {
return mPeriodicAdvertisingInterval;
}
+ /**
+ *
+ *@hide
+ */
+ public int getAddressType() {
+ return mAddressType;
+ }
+
@Override
public int hashCode() {
return Objects.hash(mDevice, mRssi, mScanRecord, mTimestampNanos,
@@ -333,7 +381,8 @@ public final class ScanResult implements Parcelable, Attributable {
&& mSecondaryPhy == other.mSecondaryPhy
&& mAdvertisingSid == other.mAdvertisingSid
&& mTxPower == other.mTxPower
- && mPeriodicAdvertisingInterval == other.mPeriodicAdvertisingInterval;
+ && mPeriodicAdvertisingInterval == other.mPeriodicAdvertisingInterval
+ && mAddressType == other.mAddressType;
}
@Override
diff --git a/core/java/android/bluetooth/le/ScanSettings.java b/core/java/android/bluetooth/le/ScanSettings.java
index 1aa7cb5111ce..f946cadc7311 100644
--- a/core/java/android/bluetooth/le/ScanSettings.java
+++ b/core/java/android/bluetooth/le/ScanSettings.java
@@ -79,6 +79,12 @@ public final class ScanSettings implements Parcelable {
*/
public static final int CALLBACK_TYPE_MATCH_LOST = 4;
+ /**
+ * Provide results to sensor router instead of the apps processor
+ * @hide
+ */
+ public static final int CALLBACK_TYPE_SENSOR_ROUTING = 8;
+
/**
* Determines how many advertisements to match per filter, as this is scarce hw resource
@@ -319,7 +325,8 @@ public final class ScanSettings implements Parcelable {
private boolean isValidCallbackType(int callbackType) {
if (callbackType == CALLBACK_TYPE_ALL_MATCHES
|| callbackType == CALLBACK_TYPE_FIRST_MATCH
- || callbackType == CALLBACK_TYPE_MATCH_LOST) {
+ || callbackType == CALLBACK_TYPE_MATCH_LOST
+ || callbackType == CALLBACK_TYPE_SENSOR_ROUTING) {
return true;
}
return callbackType == (CALLBACK_TYPE_FIRST_MATCH | CALLBACK_TYPE_MATCH_LOST);
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index 265ff331ffa0..4956e3780000 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -1104,6 +1104,7 @@ public abstract class ContentResolver implements ContentInterface {
public final @Nullable Cursor query(@RequiresPermission.Read @NonNull Uri uri,
@Nullable String[] projection, @Nullable String selection,
@Nullable String[] selectionArgs, @Nullable String sortOrder) {
+ android.util.SeempLog.record_uri(13, uri);
return query(uri, projection, selection, selectionArgs, sortOrder, null);
}
@@ -1190,6 +1191,7 @@ public abstract class ContentResolver implements ContentInterface {
public final @Nullable Cursor query(final @RequiresPermission.Read @NonNull Uri uri,
@Nullable String[] projection, @Nullable Bundle queryArgs,
@Nullable CancellationSignal cancellationSignal) {
+ android.util.SeempLog.record_uri(13, uri);
Objects.requireNonNull(uri, "uri");
try {
@@ -2176,6 +2178,7 @@ public abstract class ContentResolver implements ContentInterface {
@Override
public final @Nullable Uri insert(@RequiresPermission.Write @NonNull Uri url,
@Nullable ContentValues values, @Nullable Bundle extras) {
+ android.util.SeempLog.record_uri(37, url);
Objects.requireNonNull(url, "url");
try {
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 35794d79b49d..75d2634ca2f9 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2900,6 +2900,18 @@ public class Intent implements Parcelable, Cloneable {
public static final String ACTION_PACKAGE_NEEDS_VERIFICATION = "android.intent.action.PACKAGE_NEEDS_VERIFICATION";
/**
+ * Broadcast Action: Sent to the optional package verifier when a package
+ * needs to be verified. The data contains the package URI.
+ * <p class="note">
+ * This is a protected intent.
+ * </p>
+ *
+ * @hide
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_PACKAGE_NEEDS_OPTIONAL_VERIFICATION = "com.qualcomm.qti.intent.action.PACKAGE_NEEDS_OPTIONAL_VERIFICATION";
+
+ /**
* Broadcast Action: Sent to the system package verifier when a package is
* verified. The data contains the package URI.
* <p class="note">
@@ -11408,6 +11420,7 @@ public class Intent implements Parcelable, Cloneable {
case ACTION_MEDIA_SCANNER_SCAN_FILE:
case ACTION_PACKAGE_NEEDS_VERIFICATION:
case ACTION_PACKAGE_NEEDS_INTEGRITY_VERIFICATION:
+ case ACTION_PACKAGE_NEEDS_OPTIONAL_VERIFICATION:
case ACTION_PACKAGE_VERIFIED:
case ACTION_PACKAGE_ENABLE_ROLLBACK:
// Ignore legacy actions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 2c4ff5889263..9934823abd47 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -29,6 +29,8 @@ import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Environment;
+import android.os.SystemProperties;
+import android.util.DisplayMetrics;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.UserHandle;
@@ -61,58 +63,58 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
private static ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class);
/**
- * Default task affinity of all activities in this application. See
- * {@link ActivityInfo#taskAffinity} for more information. This comes
- * from the "taskAffinity" attribute.
+ * Default task affinity of all activities in this application. See
+ * {@link ActivityInfo#taskAffinity} for more information. This comes
+ * from the "taskAffinity" attribute.
*/
public String taskAffinity;
-
+
/**
* Optional name of a permission required to be able to access this
* application's components. From the "permission" attribute.
*/
public String permission;
-
+
/**
* The name of the process this application should run in. From the
* "process" attribute or, if not set, the same as
* <var>packageName</var>.
*/
public String processName;
-
+
/**
* Class implementing the Application object. From the "class"
* attribute.
*/
public String className;
-
+
/**
* A style resource identifier (in the package's resources) of the
* description of an application. From the "description" attribute
* or, if not set, 0.
*/
- public int descriptionRes;
-
+ public int descriptionRes;
+
/**
* A style resource identifier (in the package's resources) of the
* default visual theme of the application. From the "theme" attribute
* or, if not set, 0.
*/
public int theme;
-
+
/**
* Class implementing the Application's manage space
* functionality. From the "manageSpaceActivity"
* attribute. This is an optional attribute and will be null if
* applications don't specify it in their manifest
*/
- public String manageSpaceActivityName;
-
+ public String manageSpaceActivityName;
+
/**
* Class implementing the Application's backup functionality. From
* the "backupAgent" attribute. This is an optional attribute and
* will be null if the application does not specify it in its manifest.
- *
+ *
* <p>If android:allowBackup is set to false, this attribute is ignored.
*/
public String backupAgentName;
@@ -173,7 +175,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* {@code signatureOrSystem}.
*/
public static final int FLAG_SYSTEM = 1<<0;
-
+
/**
* Value for {@link #flags}: set to true if this application would like to
* allow debugging of its
@@ -182,7 +184,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:debuggable} of the &lt;application&gt; tag.
*/
public static final int FLAG_DEBUGGABLE = 1<<1;
-
+
/**
* Value for {@link #flags}: set to true if this application has code
* associated with it. Comes
@@ -190,7 +192,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:hasCode} of the &lt;application&gt; tag.
*/
public static final int FLAG_HAS_CODE = 1<<2;
-
+
/**
* Value for {@link #flags}: set to true if this application is persistent.
* Comes from {@link android.R.styleable#AndroidManifestApplication_persistent
@@ -211,20 +213,20 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:allowTaskReparenting} of the &lt;application&gt; tag.
*/
public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5;
-
+
/**
* Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
* Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData
* android:allowClearUserData} of the &lt;application&gt; tag.
*/
public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6;
-
+
/**
* Value for {@link #flags}: this is set if this application has been
* installed as an update to a built-in system application.
*/
public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7;
-
+
/**
* Value for {@link #flags}: this is set if the application has specified
* {@link android.R.styleable#AndroidManifestApplication_testOnly
@@ -239,15 +241,15 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:smallScreens}.
*/
public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9;
-
+
/**
* Value for {@link #flags}: true when the application's window can be
* displayed on normal screens. Corresponds to
* {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens
* android:normalScreens}.
*/
- public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10;
-
+ public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10;
+
/**
* Value for {@link #flags}: true when the application's window can be
* increased in size for larger screens. Corresponds to
@@ -255,7 +257,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:largeScreens}.
*/
public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11;
-
+
/**
* Value for {@link #flags}: true when the application knows how to adjust
* its UI for different screen sizes. Corresponds to
@@ -263,7 +265,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:resizeable}.
*/
public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12;
-
+
/**
* Value for {@link #flags}: true when the application knows how to
* accommodate different screen densities. Corresponds to
@@ -275,7 +277,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
*/
@Deprecated
public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13;
-
+
/**
* Value for {@link #flags}: set to true if this application would like to
* request the VM to operate under the safe mode. Comes from
@@ -287,7 +289,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
/**
* Value for {@link #flags}: set to <code>false</code> if the application does not wish
* to permit any OS-driven backups of its data; <code>true</code> otherwise.
- *
+ *
* <p>Comes from the
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
* attribute of the &lt;application&gt; tag.
@@ -350,7 +352,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* android:xlargeScreens}.
*/
public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
-
+
/**
* Value for {@link #flags}: true when the application has requested a
* large heap for its processes. Corresponds to
@@ -845,6 +847,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public static final String METADATA_PRELOADED_FONTS = "preloaded_fonts";
/**
+ * Boolean indicating whether the resolution of the SurfaceView associated
+ * with this appplication can be overriden.
+ * {@hide}
+ */
+ public int overrideRes = 0;
+
+ /**
+ * In case, app needs different density than device density, set this value.
+ * {@hide}
+ */
+ public int overrideDensity = 0;
+
+ /**
* The required smallest screen width the application can run on. If 0,
* nothing has been specified. Comes from
* {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp
@@ -1113,7 +1128,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
* the same uid).
*/
public int uid;
-
+
/**
* The minimum SDK version this application can run on. It will not run
* on earlier versions.
@@ -1785,7 +1800,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
if (sb == null) {
sb = ab.packageName;
}
-
+
return sCollator.compare(sa.toString(), sb.toString());
}
@@ -1797,7 +1812,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public ApplicationInfo() {
}
-
+
public ApplicationInfo(ApplicationInfo orig) {
super(orig);
taskAffinity = orig.taskAffinity;
@@ -1808,6 +1823,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
flags = orig.flags;
privateFlags = orig.privateFlags;
privateFlagsExt = orig.privateFlagsExt;
+ overrideRes = orig.overrideRes;
+ overrideDensity = orig.overrideDensity;
requiresSmallestWidthDp = orig.requiresSmallestWidthDp;
compatibleWidthLimitDp = orig.compatibleWidthLimitDp;
largestWidthLimitDp = orig.largestWidthLimitDp;
@@ -1893,6 +1910,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
dest.writeInt(flags);
dest.writeInt(privateFlags);
dest.writeInt(privateFlagsExt);
+ dest.writeInt(overrideRes);
+ dest.writeInt(overrideDensity);
dest.writeInt(requiresSmallestWidthDp);
dest.writeInt(compatibleWidthLimitDp);
dest.writeInt(largestWidthLimitDp);
@@ -1983,6 +2002,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
flags = source.readInt();
privateFlags = source.readInt();
privateFlagsExt = source.readInt();
+ overrideRes = source.readInt();
+ overrideDensity = source.readInt();
requiresSmallestWidthDp = source.readInt();
compatibleWidthLimitDp = source.readInt();
largestWidthLimitDp = source.readInt();
@@ -2069,7 +2090,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
/**
* Disable compatibility mode
- *
+ *
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
@@ -2290,7 +2311,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
}
return pm.getDefaultActivityIcon();
}
-
+
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private boolean isPackageUnavailable(PackageManager pm) {
try {
@@ -2511,6 +2532,11 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
return output.toArray(new String[output.size()]);
}
+ /** @hide */
+ public int getOverrideDensity() {
+ return overrideDensity;
+ }
+
/** {@hide} */ public void setCodePath(String codePath) { scanSourceDir = codePath; }
/** {@hide} */ public void setBaseCodePath(String baseCodePath) { sourceDir = baseCodePath; }
/** {@hide} */ public void setSplitCodePaths(String[] splitCodePaths) { splitSourceDirs = splitCodePaths; }
@@ -2526,6 +2552,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public void setRequestRawExternalStorageAccess(@Nullable Boolean value) {
requestRawExternalStorageAccess = value;
}
+ /** {@hide} */ public void setOverrideRes(int overrideResolution) { overrideRes = overrideResolution; }
/** {@hide} */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@@ -2548,7 +2575,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public int getMemtagMode() {
return memtagMode;
}
-
/**
* Returns whether the application has requested automatic zero-initialization of native heap
* memory allocations to be enabled or disabled.
@@ -2557,4 +2583,5 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
public int getNativeHeapZeroInitialized() {
return nativeHeapZeroInitialized;
}
+ /** {@hide} */ public int canOverrideRes() { return overrideRes; }
}
diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java
index 439c6396f1d0..8f0d50d94d18 100644
--- a/core/java/android/content/res/CompatibilityInfo.java
+++ b/core/java/android/content/res/CompatibilityInfo.java
@@ -34,6 +34,7 @@ import android.view.InsetsState;
import android.view.MotionEvent;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
+import android.util.Log;
/**
* CompatibilityInfo class keeps the information about the screen compatibility mode that the
@@ -47,6 +48,8 @@ public class CompatibilityInfo implements Parcelable {
public static final CompatibilityInfo DEFAULT_COMPATIBILITY_INFO = new CompatibilityInfo() {
};
+ static final String TAG = "CompatibilityInfo";
+
/**
* This is the number of pixels we would like to have along the
* short axis of an app that needs to run on a normal size screen.
@@ -163,11 +166,18 @@ public class CompatibilityInfo implements Parcelable {
// Let the user decide.
compatFlags |= NEEDS_SCREEN_COMPAT;
}
-
- // Modern apps always support densities.
- applicationDensity = DisplayMetrics.DENSITY_DEVICE;
- applicationScale = 1.0f;
- applicationInvertedScale = 1.0f;
+ int density = appInfo.getOverrideDensity();
+ if(density != 0) {
+ applicationDensity = density;
+ applicationScale = DisplayMetrics.DENSITY_DEVICE / (float) applicationDensity;
+ applicationInvertedScale = 1.0f / applicationScale;
+ compatFlags |= SCALING_REQUIRED;
+ } else {
+ // Modern apps always support densities.
+ applicationDensity = DisplayMetrics.DENSITY_DEVICE;
+ applicationScale = 1.0f;
+ applicationInvertedScale = 1.0f;
+ }
} else {
/**
@@ -254,26 +264,31 @@ public class CompatibilityInfo implements Parcelable {
compatFlags |= NEVER_NEEDS_COMPAT;
}
- if (overrideScale != 1.0f) {
+ int density = appInfo.getOverrideDensity();
+ if ((appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) == 0) {
+ applicationDensity = DisplayMetrics.DENSITY_DEFAULT;
+ applicationScale = DisplayMetrics.DENSITY_DEVICE
+ / (float) DisplayMetrics.DENSITY_DEFAULT;
+ applicationInvertedScale = 1.0f / applicationScale;
+ compatFlags |= SCALING_REQUIRED;
+ } else if((density != 0) || (overrideScale != 1.0f)) {
applicationScale = overrideScale;
applicationInvertedScale = 1.0f / overrideScale;
applicationDensity = (int) ((DisplayMetrics.DENSITY_DEVICE_STABLE
* applicationInvertedScale) + .5f);
compatFlags |= HAS_OVERRIDE_SCALING;
- } else if ((appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES) != 0) {
+ } else {
applicationDensity = DisplayMetrics.DENSITY_DEVICE;
applicationScale = 1.0f;
applicationInvertedScale = 1.0f;
- } else {
- applicationDensity = DisplayMetrics.DENSITY_DEFAULT;
- applicationScale = DisplayMetrics.DENSITY_DEVICE
- / (float) DisplayMetrics.DENSITY_DEFAULT;
- applicationInvertedScale = 1.0f / applicationScale;
- compatFlags |= SCALING_REQUIRED;
}
}
mCompatibilityFlags = compatFlags;
+
+ Log.d(TAG, "mCompatibilityFlags - " + Integer.toHexString(mCompatibilityFlags));
+ Log.d(TAG, "applicationDensity - " + applicationDensity);
+ Log.d(TAG, "applicationScale - " + applicationScale);
}
private CompatibilityInfo(int compFlags,
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 3bdd39f5d7d7..0e6f46a79fe6 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -45,6 +45,7 @@ import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.SystemProperties;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RSIllegalArgumentException;
@@ -54,6 +55,7 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
+import android.os.SystemProperties;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IAppOpsCallback;
@@ -171,6 +173,10 @@ public class Camera {
private static final int CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x200;
private static final int CAMERA_MSG_PREVIEW_METADATA = 0x400;
private static final int CAMERA_MSG_FOCUS_MOVE = 0x800;
+ /* ### QC ADD-ONS: START */
+ private static final int CAMERA_MSG_STATS_DATA = 0x1000;
+ private static final int CAMERA_MSG_META_DATA = 0x2000;
+ /* ### QC ADD-ONS: END */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private long mNativeContext; // accessed by native methods
@@ -202,6 +208,17 @@ public class Camera {
private boolean mShutterSoundEnabledFromApp = true;
private static final int NO_ERROR = 0;
+ private static final int EACCESS = -13;
+ private static final int ENODEV = -19;
+ private static final int EBUSY = -16;
+ private static final int EINVAL = -22;
+ private static final int ENOSYS = -38;
+ private static final int EUSERS = -87;
+ private static final int EOPNOTSUPP = -95;
+ /* ### QC ADD-ONS: START */
+ private CameraDataCallback mCameraDataCallback;
+ private CameraMetaDataCallback mCameraMetaDataCallback;
+ /* ### QC ADD-ONS: END */
/**
* Broadcast Action: A new picture is taken by the camera, and the entry of
@@ -279,7 +296,35 @@ public class Camera {
* @return total number of accessible camera devices, or 0 if there are no
* cameras or an error was encountered enumerating them.
*/
- public native static int getNumberOfCameras();
+ public static int getNumberOfCameras() {
+ boolean exposeAuxCamera = false;
+ String packageName = ActivityThread.currentOpPackageName();
+ /* Force to expose only two cameras
+ * if the package name does not falls in this bucket
+ */
+ String packageList = SystemProperties.get("vendor.camera.aux.packagelist");
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ exposeAuxCamera = true;
+ break;
+ }
+ }
+ }
+ int numberOfCameras = _getNumberOfCameras();
+ if (exposeAuxCamera == false && (numberOfCameras > 2)) {
+ numberOfCameras = 2;
+ }
+ return numberOfCameras;
+ }
+
+ /**
+ * Returns the number of physical cameras available on this device.
+ */
+ /** @hide */
+ public native static int _getNumberOfCameras();
/**
* Returns the information about a particular camera.
@@ -290,6 +335,9 @@ public class Camera {
* low-level failure).
*/
public static void getCameraInfo(int cameraId, CameraInfo cameraInfo) {
+ if(cameraId >= getNumberOfCameras()){
+ throw new RuntimeException("Unknown camera ID");
+ }
_getCameraInfo(cameraId, cameraInfo);
IBinder b = ServiceManager.getService(Context.AUDIO_SERVICE);
IAudioService audioService = IAudioService.Stub.asInterface(b);
@@ -323,6 +371,17 @@ public class Camera {
*/
public static final int CAMERA_FACING_FRONT = 1;
+ /* ### QC ADD-ONS: START TBD*/
+ /** @hide
+ * camera is in ZSL mode.
+ */
+ public static final int CAMERA_SUPPORT_MODE_ZSL = 2;
+
+ /** @hide
+ * camera is in non-ZSL mode.
+ */
+ public static final int CAMERA_SUPPORT_MODE_NONZSL = 3;
+ /* ### QC ADD-ONS: END */
/**
* The direction that the camera faces. It should be
* CAMERA_FACING_BACK or CAMERA_FACING_FRONT.
@@ -474,6 +533,10 @@ public class Camera {
mPostviewCallback = null;
mUsingPreviewAllocation = false;
mZoomListener = null;
+ /* ### QC ADD-ONS: START */
+ mCameraDataCallback = null;
+ mCameraMetaDataCallback = null;
+ /* ### QC ADD-ONS: END */
Looper looper;
if ((looper = Looper.myLooper()) != null) {
@@ -490,6 +553,9 @@ public class Camera {
/** used by Camera#open, Camera#open(int) */
Camera(int cameraId) {
+ if(cameraId >= getNumberOfCameras()){
+ throw new RuntimeException("Unknown camera ID");
+ }
int err = cameraInit(cameraId);
if (checkInitErrors(err)) {
if (err == -EACCES) {
@@ -814,6 +880,7 @@ public class Camera {
* @see android.media.MediaActionSound
*/
public final void setPreviewCallback(PreviewCallback cb) {
+ android.util.SeempLog.record(66);
mPreviewCallback = cb;
mOneShot = false;
mWithBuffer = false;
@@ -842,6 +909,7 @@ public class Camera {
* @see android.media.MediaActionSound
*/
public final void setOneShotPreviewCallback(PreviewCallback cb) {
+ android.util.SeempLog.record(68);
mPreviewCallback = cb;
mOneShot = true;
mWithBuffer = false;
@@ -882,6 +950,7 @@ public class Camera {
* @see android.media.MediaActionSound
*/
public final void setPreviewCallbackWithBuffer(PreviewCallback cb) {
+ android.util.SeempLog.record(67);
mPreviewCallback = cb;
mOneShot = false;
mWithBuffer = true;
@@ -1213,7 +1282,23 @@ public class Camera {
mAutoFocusMoveCallback.onAutoFocusMoving(msg.arg1 == 0 ? false : true, mCamera);
}
return;
+ /* ### QC ADD-ONS: START */
+ case CAMERA_MSG_STATS_DATA:
+ int statsdata[] = new int[257];
+ for(int i =0; i<257; i++ ) {
+ statsdata[i] = byteToInt( (byte[])msg.obj, i*4);
+ }
+ if (mCameraDataCallback != null) {
+ mCameraDataCallback.onCameraData(statsdata, mCamera);
+ }
+ return;
+ case CAMERA_MSG_META_DATA:
+ if (mCameraMetaDataCallback != null) {
+ mCameraMetaDataCallback.onCameraMetaData((byte[])msg.obj, mCamera);
+ }
+ return;
+ /* ### QC ADD-ONS: END */
default:
Log.e(TAG, "Unknown message type " + msg.what);
return;
@@ -1447,6 +1532,7 @@ public class Camera {
*/
public final void takePicture(ShutterCallback shutter, PictureCallback raw,
PictureCallback jpeg) {
+ android.util.SeempLog.record(65);
takePicture(shutter, raw, null, jpeg);
}
private native final void native_takePicture(int msgType);
@@ -1485,6 +1571,7 @@ public class Camera {
*/
public final void takePicture(ShutterCallback shutter, PictureCallback raw,
PictureCallback postview, PictureCallback jpeg) {
+ android.util.SeempLog.record(65);
mShutterCallback = shutter;
mRawImageCallback = raw;
mPostviewCallback = postview;
@@ -1954,6 +2041,23 @@ public class Camera {
* as a set. Either they are all valid, or none of them are.
*/
public Point mouth = null;
+
+ /**
+ * {@hide}
+ */
+ public int smileDegree = 0;
+ /**
+ * {@hide}
+ */
+ public int smileScore = 0;
+ /**
+ * {@hide}
+ */
+ public int blinkDetected = 0;
+ /**
+ * {@hide}
+ */
+ public int faceRecognised = 0;
}
/**
@@ -2078,6 +2182,27 @@ public class Camera {
return p;
}
+ /** @hide
+ * Returns the current cct value of white balance.
+ *
+ * If it's in AWB mode, cct is determined by stats/awb module.
+ *
+ * If it's in Manual WB mode, it actually returns cct value
+ * set by user via {@link #setParameters(Camera.Parameters)}.
+ */
+ public int getWBCurrentCCT() {
+ Parameters p = new Parameters();
+ String s = native_getParameters();
+ p.unflatten(s);
+
+ int cct = 0;
+ if (p.getWBCurrentCCT() != null) {
+ cct = Integer.parseInt(p.getWBCurrentCCT());
+ }
+
+ return cct;
+ }
+
/**
* Returns an empty {@link Parameters} for testing purpose.
*
@@ -2091,6 +2216,157 @@ public class Camera {
return camera.new Parameters();
}
+ /* ### QC ADD-ONS: START */
+ private static int byteToInt(byte[] b, int offset) {
+ int value = 0;
+ for (int i = 0; i < 4; i++) {
+ int shift = (4 - 1 - i) * 8;
+ value += (b[(3-i) + offset] & 0x000000FF) << shift;
+ }
+ return value;
+ }
+ /** @hide
+ * Handles the callback for when Camera Data is available.
+ * data is read from the camera.
+ */
+ public interface CameraDataCallback {
+ /**
+ * Callback for when camera data is available.
+ *
+ * @param data a int array of the camera data
+ * @param camera the Camera service object
+ */
+ void onCameraData(int[] data, Camera camera);
+ };
+
+ /** @hide
+ * Set camera histogram mode and registers a callback function to run.
+ * Only valid after startPreview() has been called.
+ *
+ * @param cb the callback to run
+ */
+ public final void setHistogramMode(CameraDataCallback cb)
+ {
+ mCameraDataCallback = cb;
+ native_setHistogramMode(cb!=null);
+ }
+ private native final void native_setHistogramMode(boolean mode);
+
+ /** @hide
+ * Set camera histogram command to send data.
+ *
+ */
+ public final void sendHistogramData()
+ {
+ native_sendHistogramData();
+ }
+ private native final void native_sendHistogramData();
+
+ /** @hide
+ * Handles the callback for when Camera Meta Data is available.
+ * Meta data is read from the camera.
+ */
+ public interface CameraMetaDataCallback {
+ /**
+ * Callback for when camera meta data is available.
+ *
+ * @param data a byte array of the camera meta data
+ * @param camera the Camera service object
+ */
+ void onCameraMetaData(byte[] data, Camera camera);
+ };
+
+ /** @hide
+ * Set camera meta data and registers a callback function to run.
+ * Only valid after startPreview() has been called.
+ *
+ * @param cb the callback to run
+ */
+ public final void setMetadataCb(CameraMetaDataCallback cb)
+ {
+ mCameraMetaDataCallback = cb;
+ native_setMetadataCb(cb!=null);
+ }
+ private native final void native_setMetadataCb(boolean mode);
+
+ /** @hide
+ * Set camera face detection command to send meta data.
+ */
+ public final void sendMetaData()
+ {
+ native_sendMetaData();
+ }
+ private native final void native_sendMetaData();
+
+ /** @hide
+ * Configure longshot mode. Available only in ZSL.
+ *
+ * @param enable enable/disable this mode
+ */
+ public final void setLongshot(boolean enable)
+ {
+ native_setLongshot(enable);
+ }
+ private native final void native_setLongshot(boolean enable);
+
+ /** @hide
+ * Handles the Touch Co-ordinate.
+ */
+ public class Coordinate {
+ /**
+ * Sets the x,y co-ordinates for a touch event
+ *
+ * @param x the x co-ordinate (pixels)
+ * @param y the y co-ordinate (pixels)
+ */
+ public Coordinate(int x, int y) {
+ xCoordinate = x;
+ yCoordinate = y;
+ }
+ /**
+ * Compares {@code obj} to this co-ordinate.
+ *
+ * @param obj the object to compare this co-ordinate with.
+ * @return {@code true} if the xCoordinate and yCoordinate of {@code obj} is the
+ * same as those of this coordinate. {@code false} otherwise.
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof Coordinate)) {
+ return false;
+ }
+ Coordinate c = (Coordinate) obj;
+ return xCoordinate == c.xCoordinate && yCoordinate == c.yCoordinate;
+ }
+
+ /** x co-ordinate for the touch event*/
+ public int xCoordinate;
+
+ /** y co-ordinate for the touch event */
+ public int yCoordinate;
+ };
+
+ /** @hide
+ * Returns the current focus position.
+ *
+ * If it's in AF mode, it's the lens position after af is done.
+ *
+ * If it's in Manual Focus mode, it actually returns the value
+ * set by user via {@link #setParameters(Camera.Parameters)}.
+ */
+ public int getCurrentFocusPosition() {
+ Parameters p = new Parameters();
+ String s = native_getParameters();
+ p.unflatten(s);
+
+ int focus_pos = -1;
+ if (p.getCurrentFocusPosition() != null) {
+ focus_pos = Integer.parseInt(p.getCurrentFocusPosition());
+ }
+ return focus_pos;
+ }
+
+ /* ### QC ADD-ONS: END */
/**
* Returns a copied {@link Parameters}; for shim use only.
*
@@ -2352,6 +2628,10 @@ public class Camera {
public static final String WHITE_BALANCE_CLOUDY_DAYLIGHT = "cloudy-daylight";
public static final String WHITE_BALANCE_TWILIGHT = "twilight";
public static final String WHITE_BALANCE_SHADE = "shade";
+ /** @hide
+ * wb manual cct mode.
+ */
+ public static final String WHITE_BALANCE_MANUAL_CCT = "manual-cct";
// Values for color effect settings.
public static final String EFFECT_NONE = "none";
@@ -2399,6 +2679,11 @@ public class Camera {
*/
public static final String FLASH_MODE_TORCH = "torch";
+ /** @hide
+ * Scene mode is off.
+ */
+ public static final String SCENE_MODE_ASD = "asd";
+
/**
* Scene mode is off.
*/
@@ -2475,6 +2760,14 @@ public class Camera {
* Capture the naturally warm color of scenes lit by candles.
*/
public static final String SCENE_MODE_CANDLELIGHT = "candlelight";
+ /** @hide
+ * SCENE_MODE_BACKLIGHT
+ **/
+ public static final String SCENE_MODE_BACKLIGHT = "backlight";
+ /** @hide
+ * SCENE_MODE_FLOWERS
+ **/
+ public static final String SCENE_MODE_FLOWERS = "flowers";
/**
* Applications are looking for a barcode. Camera driver will be
@@ -2517,6 +2810,13 @@ public class Camera {
*/
public static final String FOCUS_MODE_FIXED = "fixed";
+ /** @hide
+ * Normal focus mode. Applications should call
+ * {@link #autoFocus(AutoFocusCallback)} to start the focus in this
+ * mode.
+ */
+ public static final String FOCUS_MODE_NORMAL = "normal";
+
/**
* Extended depth of field (EDOF). Focusing is done digitally and
* continuously. Applications should not call {@link
@@ -2569,6 +2869,11 @@ public class Camera {
*/
public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture";
+ /** @hide
+ * manual focus mode
+ */
+ public static final String FOCUS_MODE_MANUAL_POSITION = "manual";
+
// Indices for focus distance array.
/**
* The array index of near focus distance for use with
@@ -2605,11 +2910,15 @@ public class Camera {
// Formats for setPreviewFormat and setPictureFormat.
private static final String PIXEL_FORMAT_YUV422SP = "yuv422sp";
private static final String PIXEL_FORMAT_YUV420SP = "yuv420sp";
+ private static final String PIXEL_FORMAT_YUV420SP_ADRENO = "yuv420sp-adreno";
private static final String PIXEL_FORMAT_YUV422I = "yuv422i-yuyv";
private static final String PIXEL_FORMAT_YUV420P = "yuv420p";
private static final String PIXEL_FORMAT_RGB565 = "rgb565";
private static final String PIXEL_FORMAT_JPEG = "jpeg";
private static final String PIXEL_FORMAT_BAYER_RGGB = "bayer-rggb";
+ private static final String PIXEL_FORMAT_RAW = "raw";
+ private static final String PIXEL_FORMAT_YV12 = "yv12";
+ private static final String PIXEL_FORMAT_NV12 = "nv12";
/**
* Order matters: Keys that are {@link #set(String, String) set} later
@@ -3429,8 +3738,11 @@ public class Camera {
* parameters.
*/
public void removeGpsData() {
+ remove(KEY_QC_GPS_LATITUDE_REF);
remove(KEY_GPS_LATITUDE);
+ remove(KEY_QC_GPS_LONGITUDE_REF);
remove(KEY_GPS_LONGITUDE);
+ remove(KEY_QC_GPS_ALTITUDE_REF);
remove(KEY_GPS_ALTITUDE);
remove(KEY_GPS_TIMESTAMP);
remove(KEY_GPS_PROCESSING_METHOD);
@@ -4454,5 +4766,1231 @@ public class Camera {
if (s1 != null && s1.equals(s2)) return true;
return false;
}
+ /* ### QC ADD-ONS: START */
+
+ /* ### QC ADDED PARAMETER KEYS*/
+ private static final String KEY_QC_HFR_SIZE = "hfr-size";
+ private static final String KEY_QC_PREVIEW_FRAME_RATE_MODE = "preview-frame-rate-mode";
+ private static final String KEY_QC_PREVIEW_FRAME_RATE_AUTO_MODE = "frame-rate-auto";
+ private static final String KEY_QC_PREVIEW_FRAME_RATE_FIXED_MODE = "frame-rate-fixed";
+ private static final String KEY_QC_GPS_LATITUDE_REF = "gps-latitude-ref";
+ private static final String KEY_QC_GPS_LONGITUDE_REF = "gps-longitude-ref";
+ private static final String KEY_QC_GPS_ALTITUDE_REF = "gps-altitude-ref";
+ private static final String KEY_QC_GPS_STATUS = "gps-status";
+ private static final String KEY_QC_EXIF_DATETIME = "exif-datetime";
+ private static final String KEY_QC_TOUCH_AF_AEC = "touch-af-aec";
+ private static final String KEY_QC_TOUCH_INDEX_AEC = "touch-index-aec";
+ private static final String KEY_QC_TOUCH_INDEX_AF = "touch-index-af";
+ private static final String KEY_QC_MANUAL_FOCUS_POSITION = "manual-focus-position";
+ private static final String KEY_QC_MANUAL_FOCUS_POS_TYPE = "manual-focus-pos-type";
+ private static final String KEY_QC_SCENE_DETECT = "scene-detect";
+ private static final String KEY_QC_ISO_MODE = "iso";
+ private static final String KEY_QC_EXPOSURE_TIME = "exposure-time";
+ private static final String KEY_QC_MIN_EXPOSURE_TIME = "min-exposure-time";
+ private static final String KEY_QC_MAX_EXPOSURE_TIME = "max-exposure-time";
+ private static final String KEY_QC_LENSSHADE = "lensshade";
+ private static final String KEY_QC_HISTOGRAM = "histogram";
+ private static final String KEY_QC_SKIN_TONE_ENHANCEMENT = "skinToneEnhancement";
+ private static final String KEY_QC_AUTO_EXPOSURE = "auto-exposure";
+ private static final String KEY_QC_SHARPNESS = "sharpness";
+ private static final String KEY_QC_MAX_SHARPNESS = "max-sharpness";
+ private static final String KEY_QC_CONTRAST = "contrast";
+ private static final String KEY_QC_MAX_CONTRAST = "max-contrast";
+ private static final String KEY_QC_SATURATION = "saturation";
+ private static final String KEY_QC_MAX_SATURATION = "max-saturation";
+ private static final String KEY_QC_DENOISE = "denoise";
+ private static final String KEY_QC_CONTINUOUS_AF = "continuous-af";
+ private static final String KEY_QC_SELECTABLE_ZONE_AF = "selectable-zone-af";
+ private static final String KEY_QC_FACE_DETECTION = "face-detection";
+ private static final String KEY_QC_MEMORY_COLOR_ENHANCEMENT = "mce";
+ private static final String KEY_QC_REDEYE_REDUCTION = "redeye-reduction";
+ private static final String KEY_QC_ZSL = "zsl";
+ private static final String KEY_QC_CAMERA_MODE = "camera-mode";
+ private static final String KEY_QC_VIDEO_HIGH_FRAME_RATE = "video-hfr";
+ private static final String KEY_QC_VIDEO_HDR = "video-hdr";
+ private static final String KEY_QC_POWER_MODE = "power-mode";
+ private static final String KEY_QC_POWER_MODE_SUPPORTED = "power-mode-supported";
+ private static final String KEY_QC_WB_MANUAL_CCT = "wb-manual-cct";
+ private static final String KEY_QC_MIN_WB_CCT = "min-wb-cct";
+ private static final String KEY_QC_MAX_WB_CCT = "max-wb-cct";
+ private static final String KEY_QC_AUTO_HDR_ENABLE = "auto-hdr-enable";
+ private static final String KEY_QC_VIDEO_ROTATION = "video-rotation";
+
+ /** @hide
+ * KEY_QC_AE_BRACKET_HDR
+ **/
+ public static final String KEY_QC_AE_BRACKET_HDR = "ae-bracket-hdr";
+
+ /* ### QC ADDED PARAMETER VALUES*/
+
+ // Values for touch af/aec settings.
+ /** @hide
+ * TOUCH_AF_AEC_OFF
+ **/
+ public static final String TOUCH_AF_AEC_OFF = "touch-off";
+ /** @hide
+ * TOUCH_AF_AEC_ON
+ **/
+ public static final String TOUCH_AF_AEC_ON = "touch-on";
+
+ // Values for auto exposure settings.
+ /** @hide
+ * Auto exposure frame-avg
+ **/
+ public static final String AUTO_EXPOSURE_FRAME_AVG = "frame-average";
+ /** @hide
+ * Auto exposure center weighted
+ **/
+ public static final String AUTO_EXPOSURE_CENTER_WEIGHTED = "center-weighted";
+ /** @hide
+ * Auto exposure spot metering
+ **/
+ public static final String AUTO_EXPOSURE_SPOT_METERING = "spot-metering";
+
+ //Values for ISO settings
+ /** @hide
+ * ISO_AUTO
+ **/
+ public static final String ISO_AUTO = "auto";
+ /** @hide
+ * ISO_HJR
+ **/
+ public static final String ISO_HJR = "ISO_HJR";
+ /** @hide
+ * ISO_100
+ **/
+ public static final String ISO_100 = "ISO100";
+ /** @hide
+ * ISO_200
+ **/
+ public static final String ISO_200 = "ISO200";
+ /** @hide
+ * ISO_400
+ **/
+ public static final String ISO_400 = "ISO400";
+ /** @hide
+ * ISO_800
+ **/
+ public static final String ISO_800 = "ISO800";
+ /** @hide
+ * ISO_1600
+ **/
+ public static final String ISO_1600 = "ISO1600";
+
+ /** @hide
+ * ISO_3200
+ **/
+ public static final String ISO_3200 = "ISO3200";
+
+ //Values for Lens Shading
+ /** @hide
+ * LENSSHADE_ENABLE
+ **/
+ public static final String LENSSHADE_ENABLE = "enable";
+ /** @hide
+ * LENSSHADE_DISABLE
+ **/
+ public static final String LENSSHADE_DISABLE= "disable";
+
+ //Values for Histogram
+ /** @hide
+ * Histogram enable
+ **/
+ public static final String HISTOGRAM_ENABLE = "enable";
+ /** @hide
+ * Histogram disable
+ **/
+ public static final String HISTOGRAM_DISABLE= "disable";
+
+ //Values for Skin Tone Enhancement
+ /** @hide
+ * SKIN_TONE_ENHANCEMENT_ENABLE
+ **/
+ public static final String SKIN_TONE_ENHANCEMENT_ENABLE = "enable";
+ /** @hide
+ * SKIN_TONE_ENHANCEMENT_DISABLE
+ **/
+ public static final String SKIN_TONE_ENHANCEMENT_DISABLE= "disable";
+
+ // Values for MCE settings.
+ /** @hide
+ * MCE_ENaBLE
+ **/
+ public static final String MCE_ENABLE = "enable";
+ /** @hide
+ * MCE_DISABLE
+ **/
+ public static final String MCE_DISABLE = "disable";
+
+ // Values for ZSL settings.
+ /** @hide
+ * ZSL_ON
+ **/
+ public static final String ZSL_ON = "on";
+ /** @hide
+ * ZSL_OFF
+ **/
+ public static final String ZSL_OFF = "off";
+
+ // Values for HDR Bracketing settings.
+
+ /** @hide
+ * AEC bracketing off
+ **/
+ public static final String AE_BRACKET_HDR_OFF = "Off";
+ /** @hide
+ * AEC bracketing hdr
+ **/
+ public static final String AE_BRACKET_HDR = "HDR";
+ /** @hide
+ * AEC bracketing aec-bracket
+ **/
+ public static final String AE_BRACKET = "AE-Bracket";
+
+ // Values for Power mode.
+ /** @hide
+ * LOW_POWER
+ **/
+ public static final String LOW_POWER = "Low_Power";
+ /** @hide
+ * NORMAL_POWER
+ **/
+ public static final String NORMAL_POWER = "Normal_Power";
+
+ // Values for HFR settings.
+ /** @hide
+ * VIDEO_HFR_OFF
+ **/
+ public static final String VIDEO_HFR_OFF = "off";
+ /** @hide
+ * VIDEO_HFR_2X
+ **/
+ public static final String VIDEO_HFR_2X = "60";
+ /** @hide
+ * VIDEO_HFR_3X
+ **/
+ public static final String VIDEO_HFR_3X = "90";
+ /** @hide
+ * VIDEO_HFR_4X
+ **/
+ public static final String VIDEO_HFR_4X = "120";
+
+ // Values for auto scene detection settings.
+ /** @hide
+ * SCENE_DETECT_OFF
+ **/
+ public static final String SCENE_DETECT_OFF = "off";
+ /** @hide
+ * SCENE_DETECT_ON
+ **/
+ public static final String SCENE_DETECT_ON = "on";
+
+ //Values for Continuous AF
+
+ /** @hide
+ * CAF off
+ **/
+ public static final String CONTINUOUS_AF_OFF = "caf-off";
+ /** @hide
+ * CAF on
+ **/
+ public static final String CONTINUOUS_AF_ON = "caf-on";
+ /** @hide
+ * Denoise off
+ **/
+ public static final String DENOISE_OFF = "denoise-off";
+ /** @hide
+ * Denoise on
+ **/
+ public static final String DENOISE_ON = "denoise-on";
+
+ // Values for Redeye Reduction settings.
+ /** @hide
+ * REDEYE_REDUCTION_ENABLE
+ **/
+ public static final String REDEYE_REDUCTION_ENABLE = "enable";
+ /** @hide
+ * REDEYE_REDUCTION_DISABLE
+ **/
+ public static final String REDEYE_REDUCTION_DISABLE = "disable";
+
+ // Values for selectable zone af settings.
+ /** @hide
+ * SELECTABLE_ZONE_AF_AUTO
+ **/
+ public static final String SELECTABLE_ZONE_AF_AUTO = "auto";
+ /** @hide
+ * SELECTABLE_ZONE_AF_SPOTMETERING
+ **/
+ public static final String SELECTABLE_ZONE_AF_SPOTMETERING = "spot-metering";
+ /** @hide
+ * SELECTABLE_ZONE_AF_CENTER_WEIGHTED
+ **/
+ public static final String SELECTABLE_ZONE_AF_CENTER_WEIGHTED = "center-weighted";
+ /** @hide
+ * SELECTABLE_ZONE_AF_FRAME_AVERAGE
+ **/
+ public static final String SELECTABLE_ZONE_AF_FRAME_AVERAGE = "frame-average";
+
+ // Values for Face Detection settings.
+ /** @hide
+ * Face Detection off
+ **/
+ public static final String FACE_DETECTION_OFF = "off";
+ /** @hide
+ * Face Detction on
+ **/
+ public static final String FACE_DETECTION_ON = "on";
+
+ // Values for video rotation settings.
+
+ /** @hide
+ * VIDEO_ROTATION_0
+ **/
+ public static final String VIDEO_ROTATION_0 = "0";
+ /** @hide
+ * VIDEO_ROTATION_90
+ **/
+ public static final String VIDEO_ROTATION_90 = "90";
+ /** @hide
+ * VIDEO_ROTATION_180
+ **/
+ public static final String VIDEO_ROTATION_180 = "180";
+ /** @hide
+ * VIDEO_ROTATION_270
+ **/
+ public static final String VIDEO_ROTATION_270 = "270";
+
+ /* ### QC ADDED PARAMETER APIS*/
+ /** @hide
+ * Gets the supported preview sizes in high frame rate recording mode.
+ *
+ * @return a list of Size object. This method will always return a list
+ * with at least one element.
+ */
+ public List<Size> getSupportedHfrSizes() {
+ String str = get(KEY_QC_HFR_SIZE + SUPPORTED_VALUES_SUFFIX);
+ return splitSize(str);
+ }
+
+ /** @hide
+ * Gets the supported Touch AF/AEC setting.
+ *
+ * @return a List of TOUCH_AF_AEC_XXX string constants. null if TOUCH AF/AEC
+ * setting is not supported.
+ *
+ */
+ public List<String> getSupportedTouchAfAec() {
+ String str = get(KEY_QC_TOUCH_AF_AEC + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /**
+ * Gets the supported Touch AF/AEC setting.
+ *
+ * @return a List of TOUCH_AF_AEC_XXX string constants. null if TOUCH AF/AEC
+ * setting is not supported.
+ *
+ */
+
+ /** @hide
+ * Gets the supported frame rate modes.
+ *
+ * @return a List of FRAME_RATE_XXX_MODE string constant. null if this
+ * setting is not supported.
+ */
+ public List<String> getSupportedPreviewFrameRateModes() {
+ String str = get(KEY_QC_PREVIEW_FRAME_RATE_MODE + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported auto scene detection modes.
+ *
+ * @return a List of SCENE_DETECT_XXX string constant. null if scene detection
+ * setting is not supported.
+ *
+ */
+ public List<String> getSupportedSceneDetectModes() {
+ String str = get(KEY_QC_SCENE_DETECT + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported ISO values.
+ *
+ * @return a List of FLASH_MODE_XXX string constants. null if flash mode
+ * setting is not supported.
+ */
+ public List<String> getSupportedIsoValues() {
+ String str = get(KEY_QC_ISO_MODE + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported Lensshade modes.
+ *
+ * @return a List of LENS_MODE_XXX string constants. null if lens mode
+ * setting is not supported.
+ */
+ public List<String> getSupportedLensShadeModes() {
+ String str = get(KEY_QC_LENSSHADE + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported Histogram modes.
+ *
+ * @return a List of HISTOGRAM_XXX string constants. null if histogram mode
+ * setting is not supported.
+ */
+ public List<String> getSupportedHistogramModes() {
+ String str = get(KEY_QC_HISTOGRAM + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported Skin Tone Enhancement modes.
+ *
+ * @return a List of SKIN_TONE_ENHANCEMENT_XXX string constants. null if skin tone enhancement
+ * setting is not supported.
+ */
+ public List<String> getSupportedSkinToneEnhancementModes() {
+ String str = get(KEY_QC_SKIN_TONE_ENHANCEMENT + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported auto exposure setting.
+ *
+ * @return a List of AUTO_EXPOSURE_XXX string constants. null if auto exposure
+ * setting is not supported.
+ */
+ public List<String> getSupportedAutoexposure() {
+ String str = get(KEY_QC_AUTO_EXPOSURE + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported MCE modes.
+ *
+ * @return a List of MCE_ENABLE/DISABLE string constants. null if MCE mode
+ * setting is not supported.
+ */
+ public List<String> getSupportedMemColorEnhanceModes() {
+ String str = get(KEY_QC_MEMORY_COLOR_ENHANCEMENT + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported ZSL modes.
+ *
+ * @return a List of ZSL_OFF/OFF string constants. null if ZSL mode
+ * setting is not supported.
+ */
+ public List<String> getSupportedZSLModes() {
+ String str = get(KEY_QC_ZSL + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported Video HDR modes.
+ *
+ * @return a List of Video HDR_OFF/OFF string constants. null if
+ * Video HDR mode setting is not supported.
+ */
+ public List<String> getSupportedVideoHDRModes() {
+ String str = get(KEY_QC_VIDEO_HDR + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported HFR modes.
+ *
+ * @return a List of VIDEO_HFR_XXX string constants. null if hfr mode
+ * setting is not supported.
+ */
+ public List<String> getSupportedVideoHighFrameRateModes() {
+ String str = get(KEY_QC_VIDEO_HIGH_FRAME_RATE + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported Continuous AF modes.
+ *
+ * @return a List of CONTINUOUS_AF_XXX string constant. null if continuous AF
+ * setting is not supported.
+ *
+ */
+ public List<String> getSupportedContinuousAfModes() {
+ String str = get(KEY_QC_CONTINUOUS_AF + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported DENOISE modes.
+ *
+ * @return a List of DENOISE_XXX string constant. null if DENOISE
+ * setting is not supported.
+ *
+ */
+ public List<String> getSupportedDenoiseModes() {
+ String str = get(KEY_QC_DENOISE + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported selectable zone af setting.
+ *
+ * @return a List of SELECTABLE_ZONE_AF_XXX string constants. null if selectable zone af
+ * setting is not supported.
+ */
+ public List<String> getSupportedSelectableZoneAf() {
+ String str = get(KEY_QC_SELECTABLE_ZONE_AF + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported face detection modes.
+ *
+ * @return a List of FACE_DETECTION_XXX string constant. null if face detection
+ * setting is not supported.
+ *
+ */
+ public List<String> getSupportedFaceDetectionModes() {
+ String str = get(KEY_QC_FACE_DETECTION + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Gets the supported redeye reduction modes.
+ *
+ * @return a List of REDEYE_REDUCTION_XXX string constant. null if redeye reduction
+ * setting is not supported.
+ *
+ */
+ public List<String> getSupportedRedeyeReductionModes() {
+ String str = get(KEY_QC_REDEYE_REDUCTION + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ /** @hide
+ * Sets GPS altitude reference. This will be stored in JPEG EXIF header.
+ * @param altRef reference GPS altitude in meters.
+ */
+ public void setGpsAltitudeRef(double altRef) {
+ set(KEY_QC_GPS_ALTITUDE_REF, Double.toString(altRef));
+ }
+
+ /** @hide
+ * Sets GPS Status. This will be stored in JPEG EXIF header.
+ *
+ * @param status GPS status (UTC in seconds since January 1,
+ * 1970).
+ */
+ public void setGpsStatus(double status) {
+ set(KEY_QC_GPS_STATUS, Double.toString(status));
+ }
+
+ /** @hide
+ * Sets the touch co-ordinate for Touch AEC.
+ *
+ * @param x the x co-ordinate of the touch event
+ * @param y the y co-ordinate of the touch event
+ *
+ */
+ public void setTouchIndexAec(int x, int y) {
+ String v = Integer.toString(x) + "x" + Integer.toString(y);
+ set(KEY_QC_TOUCH_INDEX_AEC, v);
+ }
+
+ /** @hide
+ * Returns the touch co-ordinates of the touch event.
+ *
+ * @return a Index object with the x and y co-ordinated
+ * for the touch event
+ *
+ */
+ public Coordinate getTouchIndexAec() {
+ String pair = get(KEY_QC_TOUCH_INDEX_AEC);
+ return strToCoordinate(pair);
+ }
+
+ /** @hide
+ * Sets the touch co-ordinate for Touch AF.
+ *
+ * @param x the x co-ordinate of the touch event
+ * @param y the y co-ordinate of the touch event
+ *
+ */
+ public void setTouchIndexAf(int x, int y) {
+ String v = Integer.toString(x) + "x" + Integer.toString(y);
+ set(KEY_QC_TOUCH_INDEX_AF, v);
+ }
+
+ /** @hide
+ * Returns the touch co-ordinates of the touch event.
+ *
+ * @return a Index object with the x and y co-ordinated
+ * for the touch event
+ *
+ */
+ public Coordinate getTouchIndexAf() {
+ String pair = get(KEY_QC_TOUCH_INDEX_AF);
+ return strToCoordinate(pair);
+ }
+ /** @hide
+ * Set Sharpness Level
+ *
+ * @param sharpness level
+ */
+ public void setSharpness(int sharpness){
+ if((sharpness < 0) || (sharpness > getMaxSharpness()) )
+ throw new IllegalArgumentException(
+ "Invalid Sharpness " + sharpness);
+
+ set(KEY_QC_SHARPNESS, String.valueOf(sharpness));
+ }
+
+ /** @hide
+ * Set Contrast Level
+ *
+ * @param contrast level
+ */
+ public void setContrast(int contrast){
+ if((contrast < 0 ) || (contrast > getMaxContrast()))
+ throw new IllegalArgumentException(
+ "Invalid Contrast " + contrast);
+
+ set(KEY_QC_CONTRAST, String.valueOf(contrast));
+ }
+
+ /** @hide
+ * Set Saturation Level
+ *
+ * @param saturation level
+ */
+ public void setSaturation(int saturation){
+ if((saturation < 0 ) || (saturation > getMaxSaturation()))
+ throw new IllegalArgumentException(
+ "Invalid Saturation " + saturation);
+
+ set(KEY_QC_SATURATION, String.valueOf(saturation));
+ }
+
+ /** @hide
+ * @return true if full size video snapshot is supported.
+ */
+ public boolean isPowerModeSupported() {
+ String str = get(KEY_QC_POWER_MODE_SUPPORTED);
+ return TRUE.equals(str);
+ }
+
+ /** @hide
+ * Get Sharpness level
+ *
+ * @return sharpness level
+ */
+ public int getSharpness(){
+ return getInt(KEY_QC_SHARPNESS);
+ }
+
+ /** @hide
+ * Get Max Sharpness Level
+ *
+ * @return max sharpness level
+ */
+ public int getMaxSharpness(){
+ return getInt(KEY_QC_MAX_SHARPNESS);
+ }
+
+ /** @hide
+ * Get Contrast level
+ *
+ * @return contrast level
+ */
+ public int getContrast(){
+ return getInt(KEY_QC_CONTRAST);
+ }
+
+ /** @hide
+ * Get Max Contrast Level
+ *
+ * @return max contrast level
+ */
+ public int getMaxContrast(){
+ return getInt(KEY_QC_MAX_CONTRAST);
+ }
+
+ /** @hide
+ * Get Saturation level
+ *
+ * @return saturation level
+ */
+ public int getSaturation(){
+ return getInt(KEY_QC_SATURATION);
+ }
+
+ /** @hide
+ * Get Max Saturation Level
+ *
+ * @return max contrast level
+ */
+ public int getMaxSaturation(){
+ return getInt(KEY_QC_MAX_SATURATION);
+ }
+
+ /** @hide
+ * Sets GPS latitude reference coordinate. This will be stored in JPEG EXIF
+ * header.
+ * @param latRef GPS latitude reference coordinate.
+ */
+ public void setGpsLatitudeRef(String latRef) {
+ set(KEY_QC_GPS_LATITUDE_REF, latRef);
+ }
+
+ /** @hide
+ * Sets GPS longitude reference coordinate. This will be stored in JPEG EXIF
+ * header.
+ * @param lonRef GPS longitude reference coordinate.
+ */
+ public void setGpsLongitudeRef(String lonRef) {
+ set(KEY_QC_GPS_LONGITUDE_REF, lonRef);
+ }
+
+ /** @hide
+ * Sets system timestamp. This will be stored in JPEG EXIF header.
+ *
+ * @param dateTime current timestamp (UTC in seconds since January 1,
+ * 1970).
+ */
+ public void setExifDateTime(String dateTime) {
+ set(KEY_QC_EXIF_DATETIME, dateTime);
+ }
+
+ /** @hide
+ * Gets the current Touch AF/AEC setting.
+ *
+ * @return one of TOUCH_AF_AEC_XXX string constant. null if Touch AF/AEC
+ * setting is not supported.
+ *
+ */
+ public String getTouchAfAec() {
+ return get(KEY_QC_TOUCH_AF_AEC);
+ }
+
+ /** @hide
+ * Sets the current TOUCH AF/AEC setting.
+ *
+ * @param value TOUCH_AF_AEC_XXX string constants.
+ *
+ */
+ public void setTouchAfAec(String value) {
+ set(KEY_QC_TOUCH_AF_AEC, value);
+ }
+
+ /** @hide
+ * Gets the current redeye reduction setting.
+ *
+ * @return one of REDEYE_REDUCTION_XXX string constant. null if redeye reduction
+ * setting is not supported.
+ *
+ */
+ public String getRedeyeReductionMode() {
+ return get(KEY_QC_REDEYE_REDUCTION);
+ }
+
+ /** @hide
+ * Sets the redeye reduction. Other parameters may be changed after changing
+ * redeye reduction. After setting redeye reduction,
+ * applications should call getParameters to know if some parameters are
+ * changed.
+ *
+ * @param value REDEYE_REDUCTION_XXX string constants.
+ *
+ */
+ public void setRedeyeReductionMode(String value) {
+ set(KEY_QC_REDEYE_REDUCTION, value);
+ }
+
+ /** @hide
+ * Gets the frame rate mode setting.
+ *
+ * @return one of FRAME_RATE_XXX_MODE string constant. null if this
+ * setting is not supported.
+ */
+ public String getPreviewFrameRateMode() {
+ return get(KEY_QC_PREVIEW_FRAME_RATE_MODE);
+ }
+
+ /** @hide
+ * Sets the frame rate mode.
+ *
+ * @param value FRAME_RATE_XXX_MODE string constants.
+ */
+ public void setPreviewFrameRateMode(String value) {
+ set(KEY_QC_PREVIEW_FRAME_RATE_MODE, value);
+ }
+
+ /** @hide
+ * Gets the current auto scene detection setting.
+ *
+ * @return one of SCENE_DETECT_XXX string constant. null if auto scene detection
+ * setting is not supported.
+ *
+ */
+ public String getSceneDetectMode() {
+ return get(KEY_QC_SCENE_DETECT);
+ }
+
+ /** @hide
+ * Sets the auto scene detect. Other parameters may be changed after changing
+ * scene detect. After setting auto scene detection,
+ * applications should call getParameters to know if some parameters are
+ * changed.
+ *
+ * @param value SCENE_DETECT_XXX string constants.
+ *
+ */
+ public void setSceneDetectMode(String value) {
+ set(KEY_QC_SCENE_DETECT, value);
+ }
+
+ /** @hide
+ * Gets the current hdr bracketing mode setting.
+ *
+ * @return current hdr bracketing mode.
+ * @see #KEY_AE_BRACKET_OFF
+ * @see #KEY_AE_BRACKET_HDR
+ * @see #KEY_AE_BRACKET_BRACKATING
+ */
+ public String getAEBracket() {
+ return get(KEY_QC_AE_BRACKET_HDR);
+ }
+
+ /** @hide
+ * Sets the Power mode.
+ *
+ * @param value Power mode.
+ * @see #getPowerMode()
+ */
+ public void setPowerMode(String value) {
+ set(KEY_QC_POWER_MODE, value);
+ }
+
+ /** @hide
+ * Gets the current power mode setting.
+ *
+ * @return current power mode. null if power mode setting is not
+ * supported.
+ * @see #POWER_MODE_LOW
+ * @see #POWER_MODE_NORMAL
+ */
+ public String getPowerMode() {
+ return get(KEY_QC_POWER_MODE);
+ }
+
+ /** @hide
+ * Set HDR-Bracketing Level
+ *
+ * @param value HDR-Bracketing
+ */
+ public void setAEBracket(String value){
+ set(KEY_QC_AE_BRACKET_HDR, value);
+ }
+
+ /** @hide
+ * Gets the current ISO setting.
+ *
+ * @return one of ISO_XXX string constant. null if ISO
+ * setting is not supported.
+ */
+ public String getISOValue() {
+ return get(KEY_QC_ISO_MODE);
+ }
+
+ /** @hide
+ * Sets the ISO.
+ *
+ * @param iso ISO_XXX string constant.
+ */
+ public void setISOValue(String iso) {
+ set(KEY_QC_ISO_MODE, iso);
+ }
+
+ /** @hide
+ * Sets the exposure time.
+ *
+ * @param value exposure time.
+ */
+ public void setExposureTime(int value) {
+ set(KEY_QC_EXPOSURE_TIME, Integer.toString(value));
+ }
+
+ /** @hide
+ * Gets the current exposure time.
+ *
+ * @return exposure time.
+ */
+ public String getExposureTime() {
+ return get(KEY_QC_EXPOSURE_TIME);
+ }
+
+ /** @hide
+ * Gets the min supported exposure time.
+ *
+ * @return min supported exposure time.
+ */
+ public String getMinExposureTime() {
+ return get(KEY_QC_MIN_EXPOSURE_TIME);
+ }
+
+ /** @hide
+ * Gets the max supported exposure time.
+ *
+ * @return max supported exposure time.
+ */
+ public String getMaxExposureTime() {
+ return get(KEY_QC_MAX_EXPOSURE_TIME);
+ }
+
+ /** @hide
+ * Gets the current LensShade Mode.
+ *
+ * @return LensShade Mode
+ */
+ public String getLensShade() {
+ return get(KEY_QC_LENSSHADE);
+ }
+
+ /** @hide
+ * Sets the current LensShade Mode.
+ *
+ * @return LensShade Mode
+ */
+ public void setLensShade(String lensshade) {
+ set(KEY_QC_LENSSHADE, lensshade);
+ }
+
+ /** @hide
+ * Gets the current auto exposure setting.
+ *
+ * @return one of AUTO_EXPOSURE_XXX string constant. null if auto exposure
+ * setting is not supported.
+ */
+ public String getAutoExposure() {
+ return get(KEY_QC_AUTO_EXPOSURE);
+ }
+
+ /** @hide
+ * Sets the current auto exposure setting.
+ *
+ * @param value AUTO_EXPOSURE_XXX string constants.
+ */
+ public void setAutoExposure(String value) {
+ set(KEY_QC_AUTO_EXPOSURE, value);
+ }
+
+ /** @hide
+ * Gets the current MCE Mode.
+ *
+ * @return MCE value
+ */
+ public String getMemColorEnhance() {
+ return get(KEY_QC_MEMORY_COLOR_ENHANCEMENT);
+ }
+
+ /** @hide
+ * Sets the current MCE Mode.
+ *
+ * @return MCE Mode
+ */
+ public void setMemColorEnhance(String mce) {
+ set(KEY_QC_MEMORY_COLOR_ENHANCEMENT, mce);
+ }
+
+ /** @hide
+ * Set white balance manual cct value.
+ *
+ * @param cct user CCT setting.
+ */
+ public void setWBManualCCT(int cct) {
+ set(KEY_QC_WB_MANUAL_CCT, Integer.toString(cct));
+ }
+
+ /** @hide
+ * Gets the WB min supported CCT.
+ *
+ * @return min cct value.
+ */
+ public String getWBMinCCT() {
+ return get(KEY_QC_MIN_WB_CCT);
+ }
+
+ /** @hide
+ * Gets the WB max supported CCT.
+ *
+ * @return max cct value.
+ */
+ public String getMaxWBCCT() {
+ return get(KEY_QC_MAX_WB_CCT);
+ }
+
+ /** @hide
+ * Gets the current WB CCT.
+ *
+ * @return CCT value
+ */
+ public String getWBCurrentCCT() {
+ return get(KEY_QC_WB_MANUAL_CCT);
+ }
+
+ /** @hide
+ * Gets the current ZSL Mode.
+ *
+ * @return ZSL mode value
+ */
+ public String getZSLMode() {
+ return get(KEY_QC_ZSL);
+ }
+
+ /** @hide
+ * Sets the current ZSL Mode. ZSL mode is set as a 0th bit in KEY_CAMERA_MODE.
+ *
+ * @return null
+ */
+ public void setZSLMode(String zsl) {
+ set(KEY_QC_ZSL, zsl);
+ }
+
+ /** @hide
+ * Sets the current Auto HDR Mode.
+ * @ auto_hdr auto hdr string for enable/disable
+ * @return null
+ */
+ public void setAutoHDRMode(String auto_hdr){
+ set(KEY_QC_AUTO_HDR_ENABLE,auto_hdr);
+ }
+
+ /** @hide
+ * Gets the current Camera Mode Flag. Camera mode includes a
+ * flag(byte) which indicates different camera modes.
+ * For now support for ZSL added at bit0
+ *
+ * @return Camera Mode.
+ */
+ public String getCameraMode() {
+ return get(KEY_QC_CAMERA_MODE);
+ }
+
+ /** @hide
+ * Sets the current Camera Mode.
+ *
+ * @return null
+ */
+ public void setCameraMode(int cameraMode) {
+ set(KEY_QC_CAMERA_MODE, cameraMode);
+ }
+
+ private static final int MANUAL_FOCUS_POS_TYPE_INDEX = 0;
+ private static final int MANUAL_FOCUS_POS_TYPE_DAC = 1;
+ /** @hide
+ * Set focus position.
+ *
+ * @param pos user setting of focus position.
+ */
+ public void setFocusPosition(int type, int pos) {
+ set(KEY_QC_MANUAL_FOCUS_POS_TYPE, Integer.toString(type));
+ set(KEY_QC_MANUAL_FOCUS_POSITION, Integer.toString(pos));
+ }
+
+ /** @hide
+ * Gets the current focus position.
+ *
+ * @return current focus position
+ */
+ public String getCurrentFocusPosition() {
+ return get(KEY_QC_MANUAL_FOCUS_POSITION);
+ }
+
+
+ /** @hide
+ * Gets the current HFR Mode.
+ *
+ * @return VIDEO_HFR_XXX string constants
+ */
+ public String getVideoHighFrameRate() {
+ return get(KEY_QC_VIDEO_HIGH_FRAME_RATE);
+ }
+
+ /** @hide
+ * Sets the current HFR Mode.
+ *
+ * @param hfr VIDEO_HFR_XXX string constants
+ */
+ public void setVideoHighFrameRate(String hfr) {
+ set(KEY_QC_VIDEO_HIGH_FRAME_RATE, hfr);
+ }
+
+ /** @hide
+ * Gets the current Video HDR Mode.
+ *
+ * @return Video HDR mode value
+ */
+ public String getVideoHDRMode() {
+ return get(KEY_QC_VIDEO_HDR);
+ }
+
+ /** @hide
+ * Sets the current Video HDR Mode.
+ *
+ * @return null
+ */
+ public void setVideoHDRMode(String videohdr) {
+ set(KEY_QC_VIDEO_HDR, videohdr);
+ }
+
+ /** @hide
+ * Gets the current DENOISE setting.
+ *
+ * @return one of DENOISE_XXX string constant. null if Denoise
+ * setting is not supported.
+ *
+ */
+ public String getDenoise() {
+ return get(KEY_QC_DENOISE);
+ }
+
+ /** @hide
+ * Gets the current Continuous AF setting.
+ *
+ * @return one of CONTINUOUS_AF_XXX string constant. null if continuous AF
+ * setting is not supported.
+ *
+ */
+ public String getContinuousAf() {
+ return get(KEY_QC_CONTINUOUS_AF);
+ }
+
+ /** @hide
+ * Sets the current Denoise mode.
+ * @param value DENOISE_XXX string constants.
+ *
+ */
+
+ public void setDenoise(String value) {
+ set(KEY_QC_DENOISE, value);
+ }
+
+ /** @hide
+ * Sets the current Continuous AF mode.
+ * @param value CONTINUOUS_AF_XXX string constants.
+ *
+ */
+ public void setContinuousAf(String value) {
+ set(KEY_QC_CONTINUOUS_AF, value);
+ }
+
+ /** @hide
+ * Gets the current selectable zone af setting.
+ *
+ * @return one of SELECTABLE_ZONE_AF_XXX string constant. null if selectable zone af
+ * setting is not supported.
+ */
+ public String getSelectableZoneAf() {
+ return get(KEY_QC_SELECTABLE_ZONE_AF);
+ }
+
+ /** @hide
+ * Sets the current selectable zone af setting.
+ *
+ * @param value SELECTABLE_ZONE_AF_XXX string constants.
+ */
+ public void setSelectableZoneAf(String value) {
+ set(KEY_QC_SELECTABLE_ZONE_AF, value);
+ }
+
+ /** @hide
+ * Gets the current face detection setting.
+ *
+ * @return one of FACE_DETECTION_XXX string constant. null if face detection
+ * setting is not supported.
+ *
+ */
+ public String getFaceDetectionMode() {
+ return get(KEY_QC_FACE_DETECTION);
+ }
+
+ /** @hide
+ * Sets the auto scene detect. Other settings like Touch AF/AEC might be
+ * changed after setting face detection.
+ *
+ * @param value FACE_DETECTION_XXX string constants.
+ *
+ */
+ public void setFaceDetectionMode(String value) {
+ set(KEY_QC_FACE_DETECTION, value);
+ }
+
+ /** @hide
+ * Gets the current video rotation setting.
+ *
+ * @return one of VIDEO_QC_ROTATION_XXX string constant. null if video rotation
+ * setting is not supported.
+ */
+ public String getVideoRotation() {
+ return get(KEY_QC_VIDEO_ROTATION);
+ }
+
+ /** @hide
+ * Sets the current video rotation setting.
+ *
+ * @param value VIDEO_QC_ROTATION_XXX string constants.
+ */
+ public void setVideoRotation(String value) {
+ set(KEY_QC_VIDEO_ROTATION, value);
+ }
+ /** @hide
+ * Gets the supported video rotation modes.
+ *
+ * @return a List of VIDEO_QC_ROTATION_XXX string constant. null if this
+ * setting is not supported.
+ */
+ public List<String> getSupportedVideoRotationValues() {
+ String str = get(KEY_QC_VIDEO_ROTATION + SUPPORTED_VALUES_SUFFIX);
+ return split(str);
+ }
+
+ // Splits a comma delimited string to an ArrayList of Coordinate.
+ // Return null if the passing string is null or the Coordinate is 0.
+ private ArrayList<Coordinate> splitCoordinate(String str) {
+ if (str == null) return null;
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(str);
+ ArrayList<Coordinate> coordinateList = new ArrayList<Coordinate>();
+ for (String s : splitter) {
+ Coordinate coordinate = strToCoordinate(s);
+ if (coordinate != null) coordinateList.add(coordinate);
+ }
+ if (coordinateList.size() == 0) return null;
+ return coordinateList;
+ }
+
+ // Parses a string (ex: "500x500") to Coordinate object.
+ // Return null if the passing string is null.
+ private Coordinate strToCoordinate(String str) {
+ if (str == null) return null;
+
+ int pos = str.indexOf('x');
+ if (pos != -1) {
+ String x = str.substring(0, pos);
+ String y = str.substring(pos + 1);
+ return new Coordinate(Integer.parseInt(x),
+ Integer.parseInt(y));
+ }
+ Log.e(TAG, "Invalid Coordinate parameter string=" + str);
+ return null;
+ }
+ /* ### QC ADD-ONS: END */
};
}
diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java
index fe8dc46aff4d..0ae131a45537 100644
--- a/core/java/android/hardware/SystemSensorManager.java
+++ b/core/java/android/hardware/SystemSensorManager.java
@@ -174,6 +174,7 @@ public class SystemSensorManager extends SensorManager {
@Override
protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor,
int delayUs, Handler handler, int maxBatchReportLatencyUs, int reservedFlags) {
+ android.util.SeempLog.record_sensor_rate(381, sensor, delayUs);
if (listener == null || sensor == null) {
Log.e(TAG, "sensor or listener is null");
return false;
@@ -221,6 +222,7 @@ public class SystemSensorManager extends SensorManager {
/** @hide */
@Override
protected void unregisterListenerImpl(SensorEventListener listener, Sensor sensor) {
+ android.util.SeempLog.record_sensor(382, sensor);
// Trigger Sensors should use the cancelTriggerSensor call.
if (sensor != null && sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) {
return;
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java
index 3c1ec3e629a9..564c13ecdc8a 100644
--- a/core/java/android/hardware/camera2/CameraDevice.java
+++ b/core/java/android/hardware/camera2/CameraDevice.java
@@ -244,6 +244,10 @@ public abstract class CameraDevice implements AutoCloseable {
@NonNull CameraCaptureSession.StateCallback callback, @Nullable Handler handler)
throws CameraAccessException;
+ /** @hide */
+ public abstract void setVendorStreamConfigMode(int index)
+ throws CameraAccessException;
+
/**
* <p>Create a new camera capture session by providing the target output set of Surfaces and
* its corresponding surface configuration to the camera device.</p>
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java
index b7c5644df107..0fca32196518 100644
--- a/core/java/android/hardware/camera2/CameraManager.java
+++ b/core/java/android/hardware/camera2/CameraManager.java
@@ -23,6 +23,7 @@ import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
+import android.app.ActivityThread;
import android.content.Context;
import android.hardware.CameraStatus;
import android.hardware.ICameraService;
@@ -47,6 +48,8 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
import android.os.SystemProperties;
+import android.text.TextUtils;
+import android.util.Log;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
@@ -1520,8 +1523,22 @@ public final class CameraManager {
private String[] extractCameraIdListLocked() {
String[] cameraIds = null;
+ boolean exposeAuxCamera = false;
+ String packageName = ActivityThread.currentOpPackageName();
+ String packageList = SystemProperties.get("vendor.camera.aux.packagelist");
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ exposeAuxCamera = true;
+ break;
+ }
+ }
+ }
int idCount = 0;
for (int i = 0; i < mDeviceStatus.size(); i++) {
+ if(!exposeAuxCamera && (i == 2)) break;
int status = mDeviceStatus.valueAt(i);
if (status == ICameraServiceListener.STATUS_NOT_PRESENT
|| status == ICameraServiceListener.STATUS_ENUMERATING) continue;
@@ -1530,6 +1547,7 @@ public final class CameraManager {
cameraIds = new String[idCount];
idCount = 0;
for (int i = 0; i < mDeviceStatus.size(); i++) {
+ if(!exposeAuxCamera && (i == 2)) break;
int status = mDeviceStatus.valueAt(i);
if (status == ICameraServiceListener.STATUS_NOT_PRESENT
|| status == ICameraServiceListener.STATUS_ENUMERATING) continue;
@@ -1790,6 +1808,26 @@ public final class CameraManager {
throw new IllegalArgumentException("cameraId was null");
}
+ /* Force to expose only two cameras
+ * if the package name does not falls in this bucket
+ */
+ boolean exposeAuxCamera = false;
+ String packageName = ActivityThread.currentOpPackageName();
+ String packageList = SystemProperties.get("vendor.camera.aux.packagelist");
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ exposeAuxCamera = true;
+ break;
+ }
+ }
+ }
+ if (exposeAuxCamera == false && (Integer.parseInt(cameraId) >= 2)) {
+ throw new IllegalArgumentException("invalid cameraId");
+ }
+
ICameraService cameraService = getCameraService();
if (cameraService == null) {
throw new CameraAccessException(CameraAccessException.CAMERA_DISCONNECTED,
@@ -1988,6 +2026,30 @@ public final class CameraManager {
}
private void onStatusChangedLocked(int status, String id) {
+ /* Force to ignore the last mono/aux camera status update
+ * if the package name does not falls in this bucket
+ */
+ boolean exposeMonoCamera = false;
+ String packageName = ActivityThread.currentOpPackageName();
+ String packageList = SystemProperties.get("vendor.camera.aux.packagelist");
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ exposeMonoCamera = true;
+ break;
+ }
+ }
+ }
+
+ if (exposeMonoCamera == false) {
+ if (Integer.parseInt(id) >= 2) {
+ Log.w(TAG, "[soar.cts] ignore the status update of camera: " + id);
+ return;
+ }
+ }
+
if (DEBUG) {
Log.v(TAG,
String.format("Camera id %s has status changed to 0x%x", id, status));
@@ -2119,6 +2181,31 @@ public final class CameraManager {
String.format("Camera id %s has torch status changed to 0x%x", id, status));
}
+ /* Force to ignore the aux or composite camera torch status update
+ * if the package name does not falls in this bucket
+ */
+ boolean exposeMonoCamera = false;
+ String packageName = ActivityThread.currentOpPackageName();
+ String packageList = SystemProperties.get("vendor.camera.aux.packagelist");
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ exposeMonoCamera = true;
+ break;
+ }
+ }
+ }
+
+ if (exposeMonoCamera == false) {
+ if (Integer.parseInt(id) >= 2) {
+ Log.w(TAG, "ignore the torch status update of camera: " + id);
+ return;
+ }
+ }
+
+
if (!validTorchStatus(status)) {
Log.e(TAG, String.format("Ignoring invalid device %s torch status 0x%x", id,
status));
diff --git a/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
index 9a9163c724ff..b2f118bce794 100644
--- a/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraCaptureSessionImpl.java
@@ -222,7 +222,8 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession
} else if (request.isReprocess() && !isReprocessable()) {
throw new IllegalArgumentException("this capture session cannot handle reprocess " +
"requests");
- } else if (request.isReprocess() && request.getReprocessableSessionId() != mId) {
+ } else if (!mDeviceImpl.isPrivilegedApp() &&
+ request.isReprocess() && request.getReprocessableSessionId() != mId) {
throw new IllegalArgumentException("capture request was created for another session");
}
}
diff --git a/core/java/android/hardware/camera2/impl/CameraConstrainedHighSpeedCaptureSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraConstrainedHighSpeedCaptureSessionImpl.java
index 2920e670f15b..9ac415b465ba 100644
--- a/core/java/android/hardware/camera2/impl/CameraConstrainedHighSpeedCaptureSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraConstrainedHighSpeedCaptureSessionImpl.java
@@ -26,10 +26,12 @@ import android.hardware.camera2.CameraOfflineSession.CameraOfflineSessionCallbac
import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.params.OutputConfiguration;
import android.hardware.camera2.params.StreamConfigurationMap;
+import android.hardware.camera2.params.HighSpeedVideoConfiguration;
import android.hardware.camera2.utils.SurfaceUtils;
import android.os.Handler;
import android.os.ConditionVariable;
import android.util.Range;
+import android.util.Size;
import android.view.Surface;
import java.util.ArrayList;
@@ -95,10 +97,7 @@ public class CameraConstrainedHighSpeedCaptureSessionImpl
StreamConfigurationMap config = mCharacteristics.get(ck);
SurfaceUtils.checkConstrainedHighSpeedSurfaces(outputSurfaces, fpsRange, config);
- // Request list size: to limit the preview to 30fps, need use maxFps/30; to maximize
- // the preview frame rate, should use maxBatch size for that high speed stream
- // configuration. We choose the former for now.
- int requestListSize = fpsRange.getUpper() / 30;
+ int requestListSize = getHighSpeedRequestListSize(fpsRange, outputSurfaces);
List<CaptureRequest> requestList = new ArrayList<CaptureRequest>();
// Prepare the Request builders: need carry over the request controls.
@@ -177,6 +176,34 @@ public class CameraConstrainedHighSpeedCaptureSessionImpl
return true;
}
+ private int getHighSpeedRequestListSize(Range<Integer> fpsRange, Collection<Surface> surfaces) {
+ int requestListSize = 0;
+
+ for (Surface surface : surfaces) {
+
+ if (SurfaceUtils.isSurfaceForHwVideoEncoder(surface)) {
+ Size surfaceSize = SurfaceUtils.getSurfaceSize(surface);
+ HighSpeedVideoConfiguration[] highSpeedVideoConfigurations =
+ mCharacteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS);
+
+ // Get the batchsize for matching FPS & video size
+ for (HighSpeedVideoConfiguration config : highSpeedVideoConfigurations) {
+ if (config.getSize().equals(surfaceSize) && config.getFpsRange().equals(fpsRange)) {
+ requestListSize = config.getBatchSizeMax();
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ if (requestListSize == 0) {
+ // If cant' find the matching batch size, limit the preview to 30fps.
+ requestListSize = fpsRange.getUpper() / 30;
+ }
+ return requestListSize;
+ }
+
@Override
public CameraDevice getDevice() {
return mSessionImpl.getDevice();
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
index 9b19fc4d3ef2..cabb14122e00 100644
--- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
@@ -16,12 +16,15 @@
package android.hardware.camera2.impl;
+import static android.hardware.camera2.CameraAccessException.CAMERA_IN_USE;
import static com.android.internal.util.function.pooled.PooledLambda.obtainRunnable;
import android.annotation.NonNull;
import android.content.Context;
import android.graphics.ImageFormat;
import android.hardware.ICameraService;
+import android.app.ActivityThread;
+import android.graphics.ImageFormat;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCharacteristics;
@@ -53,6 +56,8 @@ import android.os.Looper;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.os.SystemClock;
+import android.os.SystemProperties;
+import android.text.TextUtils;
import android.util.Log;
import android.util.Range;
import android.util.Size;
@@ -84,7 +89,7 @@ public class CameraDeviceImpl extends CameraDevice
private final boolean DEBUG = false;
private static final int REQUEST_ID_NONE = -1;
-
+ private int customOpMode = 0;
// TODO: guard every function with if (!mRemoteDevice) check (if it was closed)
private ICameraDeviceUserWrapper mRemoteDevice;
@@ -151,6 +156,7 @@ public class CameraDeviceImpl extends CameraDevice
private int mNextSessionId = 0;
private final int mAppTargetSdkVersion;
+ private boolean mIsPrivilegedApp = false;
private ExecutorService mOfflineSwitchService;
private CameraOfflineSessionImpl mOfflineSessionImpl;
@@ -301,6 +307,7 @@ public class CameraDeviceImpl extends CameraDevice
} else {
mTotalPartialCount = partialCount;
}
+ mIsPrivilegedApp = checkPrivilegedAppList();
}
public CameraDeviceCallbacks getCallbacks() {
@@ -389,6 +396,10 @@ public class CameraDeviceImpl extends CameraDevice
}
}
+ public void setVendorStreamConfigMode(int fpsrange) {
+ customOpMode = fpsrange;
+ }
+
@Override
public String getId() {
return mCameraId;
@@ -507,6 +518,7 @@ public class CameraDeviceImpl extends CameraDevice
mConfiguredOutputs.put(streamId, outConfig);
}
}
+ operatingMode = (operatingMode | (customOpMode << 16));
int offlineStreamIds[];
if (sessionParams != null) {
@@ -1503,6 +1515,27 @@ public class CameraDeviceImpl extends CameraDevice
return false;
}
+ private boolean checkPrivilegedAppList() {
+ String packageName = ActivityThread.currentOpPackageName();
+ String packageList = SystemProperties.get("persist.vendor.camera.privapp.list");
+
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public boolean isPrivilegedApp() {
+ return mIsPrivilegedApp;
+ }
+
private void checkInputConfiguration(InputConfiguration inputConfig) {
if (inputConfig == null) {
return;
@@ -1540,6 +1573,14 @@ public class CameraDeviceImpl extends CameraDevice
inputConfig.getWidth() + "x" + inputConfig.getHeight() + " is not valid");
}
} else {
+ /*
+ * don't check input format and size,
+ * if the package name is in the white list
+ */
+ if (isPrivilegedApp()) {
+ Log.w(TAG, "ignore input format/size check for white listed app");
+ return;
+ }
if (!checkInputConfigurationWithStreamConfigurations(inputConfig, /*maxRes*/false) &&
!checkInputConfigurationWithStreamConfigurations(inputConfig, /*maxRes*/true)) {
throw new IllegalArgumentException("Input config with format " +
diff --git a/core/java/android/hardware/camera2/utils/SurfaceUtils.java b/core/java/android/hardware/camera2/utils/SurfaceUtils.java
index fd1a33161740..d2d33c2de63e 100644
--- a/core/java/android/hardware/camera2/utils/SurfaceUtils.java
+++ b/core/java/android/hardware/camera2/utils/SurfaceUtils.java
@@ -34,6 +34,11 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import android.app.ActivityThread;
+import android.os.SystemProperties;
+import android.text.TextUtils;
+
+
/**
* Various Surface utilities.
*/
@@ -78,8 +83,8 @@ public class SurfaceUtils {
public static boolean isSurfaceForHwVideoEncoder(Surface surface) {
checkNotNull(surface);
long usageFlags = nativeDetectSurfaceUsageFlags(surface);
- long disallowedFlags = HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE | USAGE_HW_COMPOSER
- | USAGE_RENDERSCRIPT | HardwareBuffer.USAGE_CPU_READ_OFTEN;
+ long disallowedFlags = USAGE_HW_COMPOSER | USAGE_RENDERSCRIPT |
+ HardwareBuffer.USAGE_CPU_READ_OFTEN;
long allowedFlags = HardwareBuffer.USAGE_VIDEO_ENCODE;
boolean videoEncoderConsumer = ((usageFlags & disallowedFlags) == 0
&& (usageFlags & allowedFlags) != 0);
@@ -241,7 +246,13 @@ public class SurfaceUtils {
+ " the size must be 1 or 2");
}
+ if (isPrivilegedApp()) {
+ //skip checks for privileged apps
+ return;
+ }
+
List<Size> highSpeedSizes = null;
+
if (fpsRange == null) {
highSpeedSizes = Arrays.asList(config.getHighSpeedVideoSizes());
} else {
@@ -303,4 +314,21 @@ public class SurfaceUtils {
/*out*/int[/*2*/] dimens);
private static native long nativeGetSurfaceId(Surface surface);
+
+ private static boolean isPrivilegedApp() {
+ String packageName = ActivityThread.currentOpPackageName();
+ String packageList = SystemProperties.get("persist.camera.privapp.list");
+
+ if (packageList.length() > 0) {
+ TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(',');
+ splitter.setString(packageList);
+ for (String str : splitter) {
+ if (packageName.equals(str)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
}
diff --git a/core/java/android/net/NetworkStats.java b/core/java/android/net/NetworkStats.java
index 288b06ee52c8..6630463002cb 100644
--- a/core/java/android/net/NetworkStats.java
+++ b/core/java/android/net/NetworkStats.java
@@ -930,6 +930,7 @@ public final class NetworkStats implements Parcelable {
entry.operations += operations[i];
}
}
+
return entry;
}
diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java
index f41306301d42..865503502325 100644
--- a/core/java/android/net/NetworkStatsHistory.java
+++ b/core/java/android/net/NetworkStatsHistory.java
@@ -256,6 +256,34 @@ public class NetworkStatsHistory implements Parcelable {
}
/**
+ * Safely multiple a value by a rational.
+ * <p>
+ * Internally it uses integer-based math whenever possible, but switches
+ * over to double-based math if values would overflow.
+ */
+ public static long multiplySafe(long value, long num, long den) {
+ if (den == 0) den = 1;
+ long x = value;
+ long y = num;
+
+ // Logic shamelessly borrowed from Math.multiplyExact()
+ long r = x * y;
+ long ax = Math.abs(x);
+ long ay = Math.abs(y);
+ if (((ax | ay) >>> 31 != 0)) {
+ // Some bits greater than 2^31 that might cause overflow
+ // Check the result using the divide operator
+ // and check for the special case of Long.MIN_VALUE * -1
+ if (((y != 0) && (r / y != x)) ||
+ (x == Long.MIN_VALUE && y == -1)) {
+ // Use double math to avoid overflowing
+ return (long) (((double) num / den) * value);
+ }
+ }
+ return r / den;
+ }
+
+ /**
* Return index of bucket that contains or is immediately before the
* requested time.
*/
diff --git a/core/java/android/nfc/INfcAdapter.aidl b/core/java/android/nfc/INfcAdapter.aidl
index cb9a3e43db81..37ba09b381ea 100644
--- a/core/java/android/nfc/INfcAdapter.aidl
+++ b/core/java/android/nfc/INfcAdapter.aidl
@@ -1,4 +1,7 @@
/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,6 +35,7 @@ import android.nfc.INfcUnlockHandler;
import android.nfc.ITagRemovedCallback;
import android.nfc.INfcDta;
import android.os.Bundle;
+import android.os.IBinder;
/**
* @hide
@@ -43,6 +47,8 @@ interface INfcAdapter
INfcFCardEmulation getNfcFCardEmulationInterface();
INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg);
INfcDta getNfcDtaInterface(in String pkg);
+ IBinder getNfcAdapterVendorInterface(in String vendor);
+
int getState();
boolean disable(boolean saveState);
boolean enable();
diff --git a/core/java/android/nfc/cardemulation/AidGroup.java b/core/java/android/nfc/cardemulation/AidGroup.java
index 2436e57b74bc..d4c966be04b8 100644
--- a/core/java/android/nfc/cardemulation/AidGroup.java
+++ b/core/java/android/nfc/cardemulation/AidGroup.java
@@ -1,4 +1,7 @@
/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,7 +42,7 @@ import java.util.List;
*
* @hide
*/
-public final class AidGroup implements Parcelable {
+public class AidGroup implements Parcelable {
/**
* The maximum number of AIDs that can be present in any one group.
*/
@@ -48,11 +51,11 @@ public final class AidGroup implements Parcelable {
static final String TAG = "AidGroup";
@UnsupportedAppUsage
- final List<String> aids;
+ protected List<String> aids;
@UnsupportedAppUsage
- final String category;
+ protected String category;
@UnsupportedAppUsage
- final String description;
+ protected String description;
/**
* Creates a new AidGroup object.
diff --git a/core/java/android/nfc/cardemulation/ApduServiceInfo.java b/core/java/android/nfc/cardemulation/ApduServiceInfo.java
index 0af322e885b1..3de6f43bc7ea 100644
--- a/core/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/core/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -1,4 +1,7 @@
/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,24 +52,24 @@ import java.util.Map;
/**
* @hide
*/
-public final class ApduServiceInfo implements Parcelable {
+public class ApduServiceInfo implements Parcelable {
static final String TAG = "ApduServiceInfo";
/**
* The service that implements this
*/
@UnsupportedAppUsage
- final ResolveInfo mService;
+ protected ResolveInfo mService;
/**
* Description of the service
*/
- final String mDescription;
+ protected String mDescription;
/**
* Whether this service represents AIDs running on the host CPU
*/
- final boolean mOnHost;
+ protected boolean mOnHost;
/**
* Offhost reader name.
@@ -84,18 +87,18 @@ public final class ApduServiceInfo implements Parcelable {
* Mapping from category to static AID group
*/
@UnsupportedAppUsage
- final HashMap<String, AidGroup> mStaticAidGroups;
+ protected HashMap<String, AidGroup> mStaticAidGroups;
/**
* Mapping from category to dynamic AID group
*/
@UnsupportedAppUsage
- final HashMap<String, AidGroup> mDynamicAidGroups;
+ protected HashMap<String, AidGroup> mDynamicAidGroups;
/**
* Whether this service should only be started when the device is unlocked.
*/
- final boolean mRequiresDeviceUnlock;
+ protected boolean mRequiresDeviceUnlock;
/**
* Whether this service should only be started when the device is screen on.
@@ -105,17 +108,17 @@ public final class ApduServiceInfo implements Parcelable {
/**
* The id of the service banner specified in XML.
*/
- final int mBannerResourceId;
+ protected int mBannerResourceId;
/**
* The uid of the package the service belongs to
*/
- final int mUid;
+ protected int mUid;
/**
* Settings Activity for this service
*/
- final String mSettingsActivityName;
+ protected String mSettingsActivityName;
/**
* @hide
diff --git a/core/java/android/nfc/tech/MifareClassic.java b/core/java/android/nfc/tech/MifareClassic.java
index 080e058737b6..9cae043c4bdd 100644
--- a/core/java/android/nfc/tech/MifareClassic.java
+++ b/core/java/android/nfc/tech/MifareClassic.java
@@ -1,4 +1,6 @@
/*
+ * Copyright (C) 2018 NXP Semiconductors
+ * The original Work has been changed by NXP Semiconductors.
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -173,6 +175,10 @@ public final class MifareClassic extends BasicTagTechnology {
mType = TYPE_CLASSIC;
mSize = SIZE_4K;
break;
+ case 0x19:
+ mType = TYPE_CLASSIC;
+ mSize = SIZE_2K;
+ break;
case 0x28:
mType = TYPE_CLASSIC;
mSize = SIZE_1K;
diff --git a/core/java/android/nfc/tech/NfcA.java b/core/java/android/nfc/tech/NfcA.java
index 88730f9af3df..819e9e31b6e6 100644
--- a/core/java/android/nfc/tech/NfcA.java
+++ b/core/java/android/nfc/tech/NfcA.java
@@ -1,4 +1,6 @@
/*
+ * Copyright (C) 2018 NXP Semiconductors
+ * The original Work has been changed by NXP Semiconductors.
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,8 +68,15 @@ public final class NfcA extends BasicTagTechnology {
/** @hide */
public NfcA(Tag tag) throws RemoteException {
super(tag, TagTechnology.NFC_A);
- Bundle extras = tag.getTechExtras(TagTechnology.NFC_A);
- mSak = extras.getShort(EXTRA_SAK);
+ Bundle extras;
+ mSak = 0;
+ if(tag.hasTech(TagTechnology.MIFARE_CLASSIC))
+ {
+ extras = tag.getTechExtras(TagTechnology.MIFARE_CLASSIC);
+ mSak = extras.getShort(EXTRA_SAK);
+ }
+ extras = tag.getTechExtras(TagTechnology.NFC_A);
+ mSak |= extras.getShort(EXTRA_SAK);
mAtqa = extras.getByteArray(EXTRA_ATQA);
}
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 9f37c4877199..1945a54128b6 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -964,6 +964,31 @@ public class Process {
throws IllegalArgumentException, SecurityException;
/**
+ * Sets the scheduling group for processes in the same cgroup.procs of uid and pid
+ * @hide
+ * @param uid The user identifier of the process to change.
+ * @param pid The identifier of the process to change.
+ * @param group The target group for this process from THREAD_GROUP_*.
+ * @param dex2oat_only is the cgroup apply for all or for dex2oat only.
+ *
+ * @throws IllegalArgumentException Throws IllegalArgumentException if
+ * <var>tid</var> does not exist.
+ * @throws SecurityException Throws SecurityException if your process does
+ * not have permission to modify the given thread, or to use the given
+ * priority.
+ *
+ * group == THREAD_GROUP_DEFAULT means to move all non-background priority
+ * threads to the foreground scheduling group, but to leave background
+ * priority threads alone. group == THREAD_GROUP_BG_NONINTERACTIVE moves all
+ * threads, regardless of priority, to the background scheduling group.
+ * group == THREAD_GROUP_FOREGROUND is not allowed.
+ *
+ * Always sets cpusets.
+ */
+ public static final native void setCgroupProcsProcessGroup(int uid, int pid, int group, boolean dex2oat_only)
+ throws IllegalArgumentException, SecurityException;
+
+ /**
* Freeze or unfreeze the specified process.
*
* @param pid Identifier of the process to freeze or unfreeze.
diff --git a/core/java/android/os/storage/DiskInfo.java b/core/java/android/os/storage/DiskInfo.java
index d32928cbeb38..b751e821c78d 100644
--- a/core/java/android/os/storage/DiskInfo.java
+++ b/core/java/android/os/storage/DiskInfo.java
@@ -50,6 +50,8 @@ public class DiskInfo implements Parcelable {
public static final int FLAG_DEFAULT_PRIMARY = 1 << 1;
public static final int FLAG_SD = 1 << 2;
public static final int FLAG_USB = 1 << 3;
+ public static final int FLAG_EMMC = 1 << 4;
+ public static final int FLAG_UFS_CARD = 1 << 5;
/** The FLAG_STUB_VISIBLE is set from vold, which gets the flag from outside (e.g., ChromeOS) */
public static final int FLAG_STUB_VISIBLE = 1 << 6;
diff --git a/core/java/android/provider/Browser.java b/core/java/android/provider/Browser.java
index afa7b80f58a0..472c0fb110f9 100644
--- a/core/java/android/provider/Browser.java
+++ b/core/java/android/provider/Browser.java
@@ -242,6 +242,7 @@ public class Browser {
*/
public static final Cursor getAllBookmarks(ContentResolver cr) throws
IllegalStateException {
+ android.util.SeempLog.record(32);
return new MatrixCursor(new String[]{Bookmarks.URL}, 0);
}
@@ -254,6 +255,7 @@ public class Browser {
*/
public static final Cursor getAllVisitedUrls(ContentResolver cr) throws
IllegalStateException {
+ android.util.SeempLog.record(33);
return new MatrixCursor(new String[]{Combined.URL}, 0);
}
@@ -262,6 +264,7 @@ public class Browser {
}
private static final Cursor getVisitedLike(ContentResolver cr, String url) {
+ android.util.SeempLog.record(34);
boolean secure = false;
String compareString = url;
if (compareString.startsWith("http://")) {
@@ -323,6 +326,7 @@ public class Browser {
@Deprecated
@UnsupportedAppUsage
public static final String[] getVisitedHistory(ContentResolver cr) {
+ android.util.SeempLog.record(35);
return new String[0];
}
@@ -358,6 +362,7 @@ public class Browser {
* @removed
*/
public static final void clearHistory(ContentResolver cr) {
+ android.util.SeempLog.record(37);
}
@@ -419,6 +424,7 @@ public class Browser {
*/
public static final void requestAllIcons(ContentResolver cr, String where,
WebIconDatabase.IconListener listener) {
+ android.util.SeempLog.record(36);
// Do nothing: this is no longer used.
}
diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java
index 92a18836653a..1b1e30c71374 100644
--- a/core/java/android/provider/CalendarContract.java
+++ b/core/java/android/provider/CalendarContract.java
@@ -984,6 +984,7 @@ public final class CalendarContract {
* @return A Cursor containing all attendees for the event
*/
public static final Cursor query(ContentResolver cr, long eventId, String[] projection) {
+ android.util.SeempLog.record(54);
String[] attArgs = {Long.toString(eventId)};
return cr.query(CONTENT_URI, projection, ATTENDEES_WHERE, attArgs /* selection args */,
null /* sort order */);
@@ -1916,6 +1917,7 @@ public final class CalendarContract {
*/
public static final Cursor query(ContentResolver cr, String[] projection,
long begin, long end) {
+ android.util.SeempLog.record(54);
Uri.Builder builder = CONTENT_URI.buildUpon();
ContentUris.appendId(builder, begin);
ContentUris.appendId(builder, end);
@@ -1945,6 +1947,7 @@ public final class CalendarContract {
*/
public static final Cursor query(ContentResolver cr, String[] projection,
long begin, long end, String searchQuery) {
+ android.util.SeempLog.record(54);
Uri.Builder builder = CONTENT_SEARCH_URI.buildUpon();
ContentUris.appendId(builder, begin);
ContentUris.appendId(builder, end);
@@ -2255,6 +2258,7 @@ public final class CalendarContract {
*/
public static final Cursor query(ContentResolver cr, int startDay, int numDays,
String[] projection) {
+ android.util.SeempLog.record(54);
if (numDays < 1) {
return null;
}
@@ -2338,6 +2342,7 @@ public final class CalendarContract {
* @return A Cursor containing all reminders for the event
*/
public static final Cursor query(ContentResolver cr, long eventId, String[] projection) {
+ android.util.SeempLog.record(54);
String[] remArgs = {Long.toString(eventId)};
return cr.query(CONTENT_URI, projection, REMINDERS_WHERE, remArgs /*selection args*/,
null /* sort order */);
@@ -2488,6 +2493,7 @@ public final class CalendarContract {
*/
public static final Uri insert(ContentResolver cr, long eventId,
long begin, long end, long alarmTime, int minutes) {
+ android.util.SeempLog.record(51);
ContentValues values = new ContentValues();
values.put(CalendarAlerts.EVENT_ID, eventId);
values.put(CalendarAlerts.BEGIN, begin);
@@ -2516,6 +2522,7 @@ public final class CalendarContract {
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public static final long findNextAlarmTime(ContentResolver cr, long millis) {
+ android.util.SeempLog.record(53);
String selection = ALARM_TIME + ">=" + millis;
// TODO: construct an explicit SQL query so that we can add
// "LIMIT 1" to the end and get just one result.
@@ -2647,6 +2654,7 @@ public final class CalendarContract {
*/
public static final boolean alarmExists(ContentResolver cr, long eventId,
long begin, long alarmTime) {
+ android.util.SeempLog.record(52);
// TODO: construct an explicit SQL query so that we can add
// "LIMIT 1" to the end and get just one result.
String[] projection = new String[] { ALARM_TIME };
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 376d9421e8d3..87bb32ce8afa 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -1638,6 +1638,7 @@ public final class ContactsContract {
* {@link #CONTENT_LOOKUP_URI} to attempt refreshing.
*/
public static Uri getLookupUri(ContentResolver resolver, Uri contactUri) {
+ android.util.SeempLog.record(86);
final Cursor c = resolver.query(contactUri, new String[] {
Contacts.LOOKUP_KEY, Contacts._ID
}, null, null, null);
@@ -1665,6 +1666,7 @@ public final class ContactsContract {
* provided parameters.
*/
public static Uri getLookupUri(long contactId, String lookupKey) {
+ android.util.SeempLog.record(86);
if (TextUtils.isEmpty(lookupKey)) {
return null;
}
@@ -1678,6 +1680,7 @@ public final class ContactsContract {
* Returns null if the contact cannot be found.
*/
public static Uri lookupContact(ContentResolver resolver, Uri lookupUri) {
+ android.util.SeempLog.record(87);
if (lookupUri == null) {
return null;
}
@@ -2170,6 +2173,7 @@ public final class ContactsContract {
*/
public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri contactUri,
boolean preferHighres) {
+ android.util.SeempLog.record(88);
if (preferHighres) {
final Uri displayPhotoUri = Uri.withAppendedPath(contactUri,
Contacts.Photo.DISPLAY_PHOTO);
@@ -2218,6 +2222,7 @@ public final class ContactsContract {
* of the thumbnail the high-res picture is preferred
*/
public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri contactUri) {
+ android.util.SeempLog.record(88);
return openContactPhotoInputStream(cr, contactUri, false);
}
@@ -2920,6 +2925,7 @@ public final class ContactsContract {
* entry of the given {@link RawContacts} entry.
*/
public static Uri getContactLookupUri(ContentResolver resolver, Uri rawContactUri) {
+ android.util.SeempLog.record(89);
// TODO: use a lighter query by joining rawcontacts with contacts in provider
final Uri dataUri = Uri.withAppendedPath(rawContactUri, Data.CONTENT_DIRECTORY);
final Cursor cursor = resolver.query(dataUri, new String[] {
@@ -4978,6 +4984,7 @@ public final class ContactsContract {
* </p>
*/
public static Uri getContactLookupUri(ContentResolver resolver, Uri dataUri) {
+ android.util.SeempLog.record(89);
final Cursor cursor = resolver.query(dataUri, new String[] {
RawContacts.CONTACT_ID, Contacts.LOOKUP_KEY
}, null, null, null);
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index a1b4deae0989..9b51ab9e30a7 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3504,6 +3504,7 @@ public final class Settings {
@UnsupportedAppUsage
public static String getStringForUser(ContentResolver resolver, String name,
int userHandle) {
+ android.util.SeempLog.record(android.util.SeempLog.getSeempGetApiIdFromValue(name));
if (MOVED_TO_SECURE.contains(name)) {
Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
+ " to android.provider.Settings.Secure, returning read-only value.");
@@ -3559,6 +3560,7 @@ public final class Settings {
private static boolean putStringForUser(ContentResolver resolver, String name, String value,
int userHandle, boolean overrideableByRestore) {
+ android.util.SeempLog.record(android.util.SeempLog.getSeempPutApiIdFromValue(name));
if (MOVED_TO_SECURE.contains(name)) {
Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
+ " to android.provider.Settings.Secure, value is unchanged.");
@@ -4290,6 +4292,13 @@ public final class Settings {
"display_color_mode_vendor_hint";
/**
+ * Whether to play tone while outgoing call is accepted.
+ * The value 1 - vibrate, 0 - not
+ * @hide
+ */
+ public static final String CALL_CONNECTED_TONE_ENABLED = "call_connected_tone_enabled";
+
+ /**
* The user selected min refresh rate in frames per second.
*
* If this isn't set, 0 will be used.
@@ -5326,6 +5335,7 @@ public final class Settings {
PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT);
+ PRIVATE_SETTINGS.add(CALL_CONNECTED_TONE_ENABLED);
}
/**
@@ -5731,6 +5741,7 @@ public final class Settings {
MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
+ MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER_2);
MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
@@ -11240,6 +11251,15 @@ public final class Settings {
public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
/**
+ * Whether to allow modem to intelligently switch DDS without user direction
+ *
+ * (0 = disabled, 1 = enabled)
+ * @hide
+ */
+ @Readable
+ public static final String SMART_DDS_SWITCH = "smart_dds_switch";
+
+ /**
* Whether the wifi data connection should remain active even when higher
* priority networks like Ethernet are active, to keep both networks.
* In the case where higher priority networks are connected, wifi will be
@@ -11392,12 +11412,15 @@ public final class Settings {
@Readable
public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
- /** Preferred NTP server. {@hide} */
- @Readable
- public static final String NTP_SERVER = "ntp_server";
- /** Timeout in milliseconds to wait for NTP server. {@hide} */
- @Readable
- public static final String NTP_TIMEOUT = "ntp_timeout";
+ /** Preferred NTP server. {@hide} */
+ @Readable
+ public static final String NTP_SERVER = "ntp_server";
+ /** Timeout in milliseconds to wait for NTP server. {@hide} */
+ @Readable
+ public static final String NTP_TIMEOUT = "ntp_timeout";
+ /** Secondary NTP server. {@hide} */
+ @Readable
+ public static final String NTP_SERVER_2 = "ntp_server_2";
/** {@hide} */
@Readable
@@ -15720,6 +15743,14 @@ public final class Settings {
public static final String CELL_ON = "cell_on";
/**
+ * Whether to vibrate while outgoing call is accepted
+ * The value 1 - vibrate, 0 - not
+ * @hide
+ */
+ public static final String VIBRATING_FOR_OUTGOING_CALL_ACCEPTED =
+ "vibrating_for_outgoing_call_accepted";
+
+ /**
* Global settings which can be accessed by instant apps.
* @hide
*/
diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java
index 9f3a847e12eb..3baecf0acc7f 100644
--- a/core/java/android/provider/Telephony.java
+++ b/core/java/android/provider/Telephony.java
@@ -282,6 +282,13 @@ public final class Telephony {
* <p>Type: TEXT</p>
*/
public static final String CREATOR = "creator";
+
+ /**
+ * The priority of the message.
+ * <P>Type: INTEGER</P>
+ * @hide
+ */
+ public static final String PRIORITY = "priority";
}
/**
@@ -390,6 +397,7 @@ public final class Telephony {
* @hide
*/
public static Cursor query(ContentResolver cr, String[] projection) {
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection, null, null, DEFAULT_SORT_ORDER);
}
@@ -400,6 +408,7 @@ public final class Telephony {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public static Cursor query(ContentResolver cr, String[] projection,
String where, String orderBy) {
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection, where,
null, orderBy == null ? DEFAULT_SORT_ORDER : orderBy);
}
@@ -503,6 +512,31 @@ public final class Telephony {
public static Uri addMessageToUri(int subId, ContentResolver resolver,
Uri uri, String address, String body, String subject,
Long date, boolean read, boolean deliveryReport, long threadId) {
+ return addMessageToUri(subId, resolver, uri, address, body, subject,
+ date, read, deliveryReport, threadId, -1);
+ }
+
+ /**
+ * Add an SMS to the given URI with thread_id specified.
+ *
+ * @param resolver the content resolver to use
+ * @param uri the URI to add the message to
+ * @param address the address of the sender
+ * @param body the body of the message
+ * @param subject the psuedo-subject of the message
+ * @param date the timestamp for the message
+ * @param read true if the message has been read, false if not
+ * @param deliveryReport true if a delivery report was requested, false if not
+ * @param threadId the thread_id of the message
+ * @param subId the subscription which the message belongs to
+ * @param priority the priority of the message
+ * @return the URI for the new message
+ * @hide
+ */
+ public static Uri addMessageToUri(int subId, ContentResolver resolver,
+ Uri uri, String address, String body, String subject,
+ Long date, boolean read, boolean deliveryReport,
+ long threadId, int priority) {
ContentValues values = new ContentValues(8);
Rlog.v(TAG,"Telephony addMessageToUri sub id: " + subId);
@@ -514,6 +548,7 @@ public final class Telephony {
values.put(READ, read ? Integer.valueOf(1) : Integer.valueOf(0));
values.put(SUBJECT, subject);
values.put(BODY, body);
+ values.put(PRIORITY, priority);
if (deliveryReport) {
values.put(STATUS, STATUS_PENDING);
}
@@ -2127,6 +2162,20 @@ public final class Telephony {
* <P>Type: INTEGER (boolean)</P>
*/
public static final String ARCHIVED = "archived";
+
+ /**
+ * Indicates the last mms type in the thread.
+ * <P>Type: TEXT</P>
+ * @hide
+ */
+ public static final String ATTACHMENT_INFO = "attachment_info";
+
+ /**
+ * Indicates whether this thread is a notification thread.
+ * <P>Type: INTEGER</P>
+ * @hide
+ */
+ public static final String NOTIFICATION = "notification";
}
/**
@@ -2927,6 +2976,7 @@ public final class Telephony {
*/
public static Cursor query(
ContentResolver cr, String[] projection) {
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection, null, null, DEFAULT_SORT_ORDER);
}
@@ -2937,6 +2987,7 @@ public final class Telephony {
public static Cursor query(
ContentResolver cr, String[] projection,
String where, String orderBy) {
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection,
where, null, orderBy == null ? DEFAULT_SORT_ORDER : orderBy);
}
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index b68717a9b457..8a2b15de6757 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -2250,7 +2250,7 @@ public abstract class WallpaperService extends Service {
return;
}
case MSG_UPDATE_SURFACE:
- mEngine.updateSurface(true, false, false);
+ mEngine.updateSurface(true, false, true/*false*/);
break;
case MSG_ZOOM:
mEngine.setZoom(Float.intBitsToFloat(message.arg1));
diff --git a/core/java/android/speech/SpeechRecognizer.java b/core/java/android/speech/SpeechRecognizer.java
index 3cdd8b8d8436..b907596427d8 100644
--- a/core/java/android/speech/SpeechRecognizer.java
+++ b/core/java/android/speech/SpeechRecognizer.java
@@ -401,6 +401,7 @@ public class SpeechRecognizer {
*/
@MainThread
public void startListening(final Intent recognizerIntent) {
+ android.util.SeempLog.record(72);
if (recognizerIntent == null) {
throw new IllegalArgumentException("intent must not be null");
}
diff --git a/core/java/android/util/BoostFramework.java b/core/java/android/util/BoostFramework.java
new file mode 100644
index 000000000000..ba73942a98a7
--- /dev/null
+++ b/core/java/android/util/BoostFramework.java
@@ -0,0 +1,794 @@
+/*
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package android.util;
+
+import android.content.Context;
+import android.graphics.BLASTBufferQueue;
+import android.os.SystemProperties;
+import android.util.Log;
+
+import dalvik.system.PathClassLoader;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/** @hide */
+public class BoostFramework {
+
+ private static final String TAG = "BoostFramework";
+ private static final String PERFORMANCE_JAR = "/system/framework/QPerformance.jar";
+ private static final String PERFORMANCE_CLASS = "com.qualcomm.qti.Performance";
+
+ private static final String UXPERFORMANCE_JAR = "/system/framework/UxPerformance.jar";
+ private static final String UXPERFORMANCE_CLASS = "com.qualcomm.qti.UxPerformance";
+ public static final float PERF_HAL_V22 = 2.2f;
+ public static final float PERF_HAL_V23 = 2.3f;
+
+/** @hide */
+ private static boolean sIsLoaded = false;
+ private static Class<?> sPerfClass = null;
+ private static Method sAcquireFunc = null;
+ private static Method sPerfHintFunc = null;
+ private static Method sReleaseFunc = null;
+ private static Method sReleaseHandlerFunc = null;
+ private static Method sFeedbackFunc = null;
+ private static Method sFeedbackFuncExtn = null;
+ private static Method sPerfGetPropFunc = null;
+ private static Method sAcqAndReleaseFunc = null;
+ private static Method sperfHintAcqRelFunc = null;
+ private static Method sperfHintRenewFunc = null;
+ private static Method sPerfEventFunc = null;
+ private static Method sPerfGetPerfHalVerFunc = null;
+
+ private static Method sIOPStart = null;
+ private static Method sIOPStop = null;
+ private static Method sUXEngineEvents = null;
+ private static Method sUXEngineTrigger = null;
+
+ private static boolean sUxIsLoaded = false;
+ private static Class<?> sUxPerfClass = null;
+ private static Method sUxIOPStart = null;
+
+/** @hide */
+ private Object mPerf = null;
+ private Object mUxPerf = null;
+
+ //perf hints
+ public static final int VENDOR_HINT_SCROLL_BOOST = 0x00001080;
+ public static final int VENDOR_HINT_FIRST_LAUNCH_BOOST = 0x00001081;
+ public static final int VENDOR_HINT_SUBSEQ_LAUNCH_BOOST = 0x00001082;
+ public static final int VENDOR_HINT_ANIM_BOOST = 0x00001083;
+ public static final int VENDOR_HINT_ACTIVITY_BOOST = 0x00001084;
+ public static final int VENDOR_HINT_TOUCH_BOOST = 0x00001085;
+ public static final int VENDOR_HINT_MTP_BOOST = 0x00001086;
+ public static final int VENDOR_HINT_DRAG_BOOST = 0x00001087;
+ public static final int VENDOR_HINT_PACKAGE_INSTALL_BOOST = 0x00001088;
+ public static final int VENDOR_HINT_ROTATION_LATENCY_BOOST = 0x00001089;
+ public static final int VENDOR_HINT_ROTATION_ANIM_BOOST = 0x00001090;
+ public static final int VENDOR_HINT_PERFORMANCE_MODE = 0x00001091;
+ public static final int VENDOR_HINT_APP_UPDATE = 0x00001092;
+ public static final int VENDOR_HINT_KILL = 0x00001093;
+ public static final int VENDOR_HINT_BOOST_RENDERTHREAD = 0x00001096;
+ //perf events
+ public static final int VENDOR_HINT_FIRST_DRAW = 0x00001042;
+ public static final int VENDOR_HINT_TAP_EVENT = 0x00001043;
+ public static final int VENDOR_HINT_DRAG_START = 0x00001051;
+ public static final int VENDOR_HINT_DRAG_END = 0x00001052;
+ //Ime Launch Boost Hint
+ public static final int VENDOR_HINT_IME_LAUNCH_EVENT = 0x0000109F;
+
+ //feedback hints
+ public static final int VENDOR_FEEDBACK_WORKLOAD_TYPE = 0x00001601;
+ public static final int VENDOR_FEEDBACK_LAUNCH_END_POINT = 0x00001602;
+
+ //UXE Events and Triggers
+ public static final int UXE_TRIGGER = 1;
+ public static final int UXE_EVENT_BINDAPP = 2;
+ public static final int UXE_EVENT_DISPLAYED_ACT = 3;
+ public static final int UXE_EVENT_KILL = 4;
+ public static final int UXE_EVENT_GAME = 5;
+ public static final int UXE_EVENT_SUB_LAUNCH = 6;
+ public static final int UXE_EVENT_PKG_UNINSTALL = 7;
+ public static final int UXE_EVENT_PKG_INSTALL = 8;
+
+ //perf opcodes
+ public static final int MPCTLV3_GPU_IS_APP_FG = 0X42820000;
+ public static final int MPCTLV3_GPU_IS_APP_BG = 0X42824000;
+
+ public class Scroll {
+ public static final int VERTICAL = 1;
+ public static final int HORIZONTAL = 2;
+ public static final int PANEL_VIEW = 3;
+ public static final int PREFILING = 4;
+ };
+
+ public class Launch {
+ public static final int BOOST_V1 = 1;
+ public static final int BOOST_V2 = 2;
+ public static final int BOOST_V3 = 3;
+ public static final int BOOST_GAME = 4;
+ public static final int RESERVED_1 = 5;
+ public static final int RESERVED_2 = 6;
+ public static final int RESERVED_3 = 7;
+ public static final int RESERVED_4 = 8;
+ public static final int RESERVED_5 = 9;
+ public static final int ACTIVITY_LAUNCH_BOOST = 10;
+ public static final int TYPE_SERVICE_START = 100;
+ public static final int TYPE_START_PROC = 101;
+ public static final int TYPE_START_APP_FROM_BG = 102;
+ public static final int TYPE_ATTACH_APPLICATION = 103;
+ };
+
+ public class Draw {
+ public static final int EVENT_TYPE_V1 = 1;
+ };
+
+ public class WorkloadType {
+ public static final int NOT_KNOWN = 0;
+ public static final int APP = 1;
+ public static final int GAME = 2;
+ public static final int BROWSER = 3;
+ public static final int PREPROAPP = 4;
+ };
+
+/** @hide */
+ public BoostFramework() {
+ initFunctions();
+
+ try {
+ if (sPerfClass != null) {
+ mPerf = sPerfClass.newInstance();
+ }
+ if (sUxPerfClass != null) {
+ mUxPerf = sUxPerfClass.newInstance();
+ }
+ }
+ catch(Exception e) {
+ Log.e(TAG,"BoostFramework() : Exception_2 = " + e);
+ }
+ }
+
+/** @hide */
+ public BoostFramework(Context context) {
+ this(context, false);
+ }
+
+/** @hide */
+ public BoostFramework(Context context, boolean isTrusted) {
+ initFunctions();
+
+ try {
+ if (sPerfClass != null) {
+ Constructor cons = sPerfClass.getConstructor(Context.class);
+ if (cons != null)
+ mPerf = cons.newInstance(context);
+ }
+ if (sUxPerfClass != null) {
+ if (isTrusted) {
+ Constructor cons = sUxPerfClass.getConstructor(Context.class);
+ if (cons != null)
+ mUxPerf = cons.newInstance(context);
+ } else {
+ mUxPerf = sUxPerfClass.newInstance();
+ }
+ }
+ }
+ catch(Exception e) {
+ Log.e(TAG,"BoostFramework() : Exception_3 = " + e);
+ }
+ }
+
+/** @hide */
+ public BoostFramework(boolean isUntrustedDomain) {
+ initFunctions();
+
+ try {
+ if (sPerfClass != null) {
+ Constructor cons = sPerfClass.getConstructor(boolean.class);
+ if (cons != null)
+ mPerf = cons.newInstance(isUntrustedDomain);
+ }
+ if (sUxPerfClass != null) {
+ mUxPerf = sUxPerfClass.newInstance();
+ }
+ }
+ catch(Exception e) {
+ Log.e(TAG,"BoostFramework() : Exception_5 = " + e);
+ }
+ }
+
+ private void initFunctions () {
+ synchronized(BoostFramework.class) {
+ if (sIsLoaded == false) {
+ try {
+ sPerfClass = Class.forName(PERFORMANCE_CLASS);
+
+ Class[] argClasses = new Class[] {int.class, int[].class};
+ sAcquireFunc = sPerfClass.getMethod("perfLockAcquire", argClasses);
+
+ argClasses = new Class[] {int.class, String.class, int.class, int.class};
+ sPerfHintFunc = sPerfClass.getMethod("perfHint", argClasses);
+
+ argClasses = new Class[] {};
+ sReleaseFunc = sPerfClass.getMethod("perfLockRelease", argClasses);
+
+ argClasses = new Class[] {int.class};
+ sReleaseHandlerFunc = sPerfClass.getDeclaredMethod("perfLockReleaseHandler", argClasses);
+
+ argClasses = new Class[] {int.class, String.class};
+ sFeedbackFunc = sPerfClass.getMethod("perfGetFeedback", argClasses);
+
+ argClasses = new Class[] {int.class, String.class, int.class, int[].class};
+ sFeedbackFuncExtn = sPerfClass.getMethod("perfGetFeedbackExtn", argClasses);
+
+ argClasses = new Class[] {int.class, String.class, String.class};
+ sIOPStart = sPerfClass.getDeclaredMethod("perfIOPrefetchStart", argClasses);
+
+ argClasses = new Class[] {};
+ sIOPStop = sPerfClass.getDeclaredMethod("perfIOPrefetchStop", argClasses);
+
+ argClasses = new Class[] {String.class, String.class};
+ sPerfGetPropFunc = sPerfClass.getMethod("perfGetProp", argClasses);
+
+ argClasses = new Class[] {int.class, int.class, int.class, int.class, int[].class};
+ sAcqAndReleaseFunc = sPerfClass.getMethod("perfLockAcqAndRelease", argClasses);
+
+ argClasses = new Class[] {int.class, String.class, int.class, int[].class};
+ sPerfEventFunc = sPerfClass.getMethod("perfEvent", argClasses);
+
+ argClasses = new Class[] {int.class, int.class, String.class, int.class,
+ int.class, int.class, int[].class};
+ sperfHintAcqRelFunc = sPerfClass.getMethod("perfHintAcqRel", argClasses);
+
+ argClasses = new Class[] {int.class, int.class, String.class, int.class,
+ int.class, int.class, int[].class};
+ sperfHintRenewFunc = sPerfClass.getMethod("perfHintRenew", argClasses);
+
+ try {
+ argClasses = new Class[] {};
+ sPerfGetPerfHalVerFunc = sPerfClass.getMethod("perfGetHalVer", argClasses);
+
+ } catch (Exception e) {
+ Log.i(TAG, "BoostFramework() : Exception_1 = perfGetHalVer not supported");
+ sPerfGetPerfHalVerFunc = null;
+ }
+
+ try {
+ argClasses = new Class[] {int.class, int.class, String.class, int.class, String.class};
+ sUXEngineEvents = sPerfClass.getDeclaredMethod("perfUXEngine_events",
+ argClasses);
+
+ argClasses = new Class[] {int.class};
+ sUXEngineTrigger = sPerfClass.getDeclaredMethod("perfUXEngine_trigger",
+ argClasses);
+ } catch (Exception e) {
+ Log.i(TAG, "BoostFramework() : Exception_4 = PreferredApps not supported");
+ }
+
+ sIsLoaded = true;
+ }
+ catch(Exception e) {
+ Log.e(TAG,"BoostFramework() : Exception_1 = " + e);
+ }
+ // Load UXE Class now Adding new try/catch block to avoid
+ // any interference with Qperformance
+ try {
+ sUxPerfClass = Class.forName(UXPERFORMANCE_CLASS);
+
+ Class[] argUxClasses = new Class[] {int.class, String.class, String.class};
+ sUxIOPStart = sUxPerfClass.getDeclaredMethod("perfIOPrefetchStart", argUxClasses);
+
+ sUxIsLoaded = true;
+ }
+ catch(Exception e) {
+ Log.e(TAG,"BoostFramework() Ux Perf: Exception = " + e);
+ }
+ }
+ }
+ }
+
+/** @hide */
+ public int perfLockAcquire(int duration, int... list) {
+ int ret = -1;
+ try {
+ if (sAcquireFunc != null) {
+ Object retVal = sAcquireFunc.invoke(mPerf, duration, list);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfLockRelease() {
+ int ret = -1;
+ try {
+ if (sReleaseFunc != null) {
+ Object retVal = sReleaseFunc.invoke(mPerf);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfLockReleaseHandler(int handle) {
+ int ret = -1;
+ try {
+ if (sReleaseHandlerFunc != null) {
+ Object retVal = sReleaseHandlerFunc.invoke(mPerf, handle);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfHint(int hint, String userDataStr) {
+ return perfHint(hint, userDataStr, -1, -1);
+ }
+
+/** @hide */
+ public int perfHint(int hint, String userDataStr, int userData) {
+ return perfHint(hint, userDataStr, userData, -1);
+ }
+
+/** @hide */
+ public int perfHint(int hint, String userDataStr, int userData1, int userData2) {
+ int ret = -1;
+ try {
+ if (sPerfHintFunc != null) {
+ Object retVal = sPerfHintFunc.invoke(mPerf, hint, userDataStr, userData1, userData2);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public double getPerfHalVersion() {
+ double retVal = PERF_HAL_V22;
+ try {
+ if (sPerfGetPerfHalVerFunc != null) {
+ Object ret = sPerfGetPerfHalVerFunc.invoke(mPerf);
+ retVal = (double)ret;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return retVal;
+ }
+
+/** @hide */
+ public int perfGetFeedback(int req, String pkg_name) {
+ int ret = -1;
+ try {
+ if (sFeedbackFunc != null) {
+ Object retVal = sFeedbackFunc.invoke(mPerf, req, pkg_name);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfGetFeedbackExtn(int req, String pkg_name, int numArgs, int... list) {
+ int ret = -1;
+ try {
+ if (sFeedbackFuncExtn != null) {
+ Object retVal = sFeedbackFuncExtn.invoke(mPerf, req, pkg_name, numArgs, list);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfIOPrefetchStart(int pid, String pkgName, String codePath) {
+ int ret = -1;
+ try {
+ Object retVal = sIOPStart.invoke(mPerf, pid, pkgName, codePath);
+ ret = (int) retVal;
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e);
+ }
+ try {
+ Object retVal = sUxIOPStart.invoke(mUxPerf, pid, pkgName, codePath);
+ ret = (int) retVal;
+ } catch (Exception e) {
+ Log.e(TAG, "Ux Perf Exception " + e);
+ }
+
+ return ret;
+ }
+
+/** @hide */
+ public int perfIOPrefetchStop() {
+ int ret = -1;
+ try {
+ Object retVal = sIOPStop.invoke(mPerf);
+ ret = (int) retVal;
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfUXEngine_events(int opcode, int pid, String pkgName, int lat) {
+ return perfUXEngine_events(opcode, pid, pkgName, lat, null);
+ }
+
+/** @hide */
+ public int perfUXEngine_events(int opcode, int pid, String pkgName, int lat, String codePath) {
+ int ret = -1;
+ try {
+ if (sUXEngineEvents == null) {
+ return ret;
+ }
+
+ Object retVal = sUXEngineEvents.invoke(mPerf, opcode, pid, pkgName, lat,codePath);
+ ret = (int) retVal;
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e);
+ }
+ return ret;
+ }
+
+
+/** @hide */
+ public String perfUXEngine_trigger(int opcode) {
+ String ret = null;
+ try {
+ if (sUXEngineTrigger == null) {
+ return ret;
+ }
+ Object retVal = sUXEngineTrigger.invoke(mPerf, opcode);
+ ret = (String) retVal;
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e);
+ }
+ return ret;
+ }
+
+
+/** @hide */
+ public String perfGetProp(String prop_name, String def_val) {
+ String ret = "";
+ try {
+ if (sPerfGetPropFunc != null) {
+ Object retVal = sPerfGetPropFunc.invoke(mPerf, prop_name, def_val);
+ ret = (String)retVal;
+ }else {
+ ret = def_val;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfLockAcqAndRelease(int handle, int duration, int numArgs,int reserveNumArgs, int... list) {
+ int ret = -1;
+ try {
+ if (sAcqAndReleaseFunc != null) {
+ Object retVal = sAcqAndReleaseFunc.invoke(mPerf, handle, duration, numArgs, reserveNumArgs, list);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public void perfEvent(int eventId, String pkg_name) {
+ perfEvent(eventId, pkg_name, 0);
+ }
+
+/** @hide */
+ public void perfEvent(int eventId, String pkg_name, int numArgs, int... list) {
+ try {
+ if (sPerfEventFunc != null) {
+ sPerfEventFunc.invoke(mPerf, eventId, pkg_name, numArgs, list);
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ }
+
+/** @hide */
+ public int perfHintAcqRel(int handle, int hint, String pkg_name) {
+ return perfHintAcqRel(handle, hint, pkg_name, -1, -1, 0);
+ }
+
+/** @hide */
+ public int perfHintAcqRel(int handle, int hint, String pkg_name, int duration) {
+ return perfHintAcqRel(handle, hint, pkg_name, duration, -1, 0);
+ }
+
+/** @hide */
+ public int perfHintAcqRel(int handle, int hint, String pkg_name, int duration, int hintType) {
+ return perfHintAcqRel(handle, hint, pkg_name, duration, hintType, 0);
+ }
+
+/** @hide */
+ public int perfHintAcqRel(int handle, int hint, String pkg_name, int duration,
+ int hintType, int numArgs, int... list) {
+ int ret = -1;
+ try {
+ if (sperfHintAcqRelFunc != null) {
+ Object retVal = sperfHintAcqRelFunc.invoke(mPerf,handle, hint, pkg_name,
+ duration, hintType, numArgs, list);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+/** @hide */
+ public int perfHintRenew(int handle, int hint, String pkg_name) {
+ return perfHintRenew(handle, hint, pkg_name, -1, -1, 0);
+ }
+
+/** @hide */
+ public int perfHintRenew(int handle, int hint, String pkg_name, int duration) {
+ return perfHintRenew(handle, hint, pkg_name, duration, -1, 0);
+ }
+
+/** @hide */
+ public int perfHintRenew(int handle, int hint, String pkg_name, int duration, int hintType) {
+ return perfHintRenew(handle, hint, pkg_name, duration, hintType, 0);
+ }
+
+/** @hide */
+ public int perfHintRenew(int handle, int hint, String pkg_name, int duration,
+ int hintType, int numArgs, int... list) {
+ int ret = -1;
+ try {
+ if (sperfHintRenewFunc != null) {
+ Object retVal = sperfHintRenewFunc.invoke(mPerf,handle, hint, pkg_name,
+ duration, hintType, numArgs, list);
+ ret = (int)retVal;
+ }
+ } catch(Exception e) {
+ Log.e(TAG,"Exception " + e);
+ }
+ return ret;
+ }
+
+ /** @hide */
+ public static class ScrollOptimizer {
+ /** @hide */
+ public static final int FLING_START = 1;
+ /** @hide */
+ public static final int FLING_END = 0;
+ private static final String SCROLL_OPT_PROP = "ro.vendor.perf.scroll_opt";
+ private static final String QXPERFORMANCE_JAR =
+ "/system/framework/QXPerformance.jar";
+ private static final String SCROLL_OPT_CLASS =
+ "com.qualcomm.qti.QXPerformance.ScrollOptimizer";
+ private static boolean sScrollOptProp = false;
+ private static boolean sScrollOptEnable = false;
+ private static boolean sQXIsLoaded = false;
+ private static Class<?> sQXPerfClass = null;
+ private static Method sSetFrameInterval = null;
+ private static Method sSetBLASTBufferQueue = null;
+ private static Method sSetMotionType = null;
+ private static Method sSetVsyncTime = null;
+ private static Method sSetUITaskStatus = null;
+ private static Method sSetFlingFlag = null;
+ private static Method sShouldUseVsync = null;
+ private static Method sGetFrameDelay = null;
+ private static Method sGetAdjustedAnimationClock = null;
+
+ private static void initQXPerfFuncs() {
+ if (sQXIsLoaded) return;
+
+ try {
+ sScrollOptProp = SystemProperties.getBoolean(SCROLL_OPT_PROP, false);
+ if (!sScrollOptProp) {
+ sScrollOptEnable = false;
+ sQXIsLoaded = true;
+ return;
+ }
+
+ PathClassLoader qXPerfClassLoader = new PathClassLoader(
+ QXPERFORMANCE_JAR, ClassLoader.getSystemClassLoader());
+ sQXPerfClass = qXPerfClassLoader.loadClass(SCROLL_OPT_CLASS);
+ Class[] argClasses = new Class[]{long.class};
+ sSetFrameInterval = sQXPerfClass.getMethod(
+ "setFrameInterval", argClasses);
+
+ argClasses = new Class[]{BLASTBufferQueue.class};
+ sSetBLASTBufferQueue = sQXPerfClass.getMethod("setBLASTBufferQueue", argClasses);
+
+ argClasses = new Class[]{int.class};
+ sSetMotionType = sQXPerfClass.getMethod("setMotionType", argClasses);
+
+ argClasses = new Class[]{long.class};
+ sSetVsyncTime = sQXPerfClass.getMethod("setVsyncTime", argClasses);
+
+ argClasses = new Class[]{boolean.class};
+ sSetUITaskStatus = sQXPerfClass.getMethod("setUITaskStatus", argClasses);
+
+ argClasses = new Class[]{int.class};
+ sSetFlingFlag = sQXPerfClass.getMethod("setFlingFlag", argClasses);
+
+ sShouldUseVsync = sQXPerfClass.getMethod("shouldUseVsync");
+
+ argClasses = new Class[]{long.class};
+ sGetFrameDelay = sQXPerfClass.getMethod("getFrameDelay", argClasses);
+
+ argClasses = new Class[]{long.class};
+ sGetAdjustedAnimationClock = sQXPerfClass.getMethod(
+ "getAdjustedAnimationClock", argClasses);
+
+ sQXIsLoaded = true;
+ } catch (Exception e) {
+ Log.e(TAG, "initQXPerfFuncs failed");
+ e.printStackTrace();
+ }
+ }
+
+ /** @hide */
+ public static void setFrameInterval(long frameIntervalNanos) {
+ Thread initThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ initQXPerfFuncs();
+ if (sScrollOptProp && sSetFrameInterval != null) {
+ sSetFrameInterval.invoke(null, frameIntervalNanos);
+ sScrollOptEnable = true;
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "Failed to run initThread.");
+ e.printStackTrace();
+ }
+ }
+ });
+ initThread.start();
+ }
+
+ /** @hide */
+ public static void setBLASTBufferQueue(BLASTBufferQueue blastBufferQueue) {
+ if (sScrollOptEnable && sSetBLASTBufferQueue != null) {
+ try {
+ sSetBLASTBufferQueue.invoke(null, blastBufferQueue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /** @hide */
+ public static void setMotionType(int eventType) {
+ if (sScrollOptEnable && sSetMotionType != null) {
+ try {
+ sSetMotionType.invoke(null, eventType);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /** @hide */
+ public static void setVsyncTime(long vsyncTimeNanos) {
+ if (sScrollOptEnable && sSetVsyncTime != null) {
+ try {
+ sSetVsyncTime.invoke(null, vsyncTimeNanos);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /** @hide */
+ public static void setUITaskStatus(boolean running) {
+ if (sScrollOptEnable && sSetUITaskStatus != null) {
+ try {
+ sSetUITaskStatus.invoke(null, running);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /** @hide */
+ public static void setFlingFlag(int flag) {
+ if (sScrollOptEnable && sSetFlingFlag != null) {
+ try {
+ sSetFlingFlag.invoke(null, flag);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /** @hide */
+ public static boolean shouldUseVsync(boolean defaultVsyncFlag) {
+ boolean useVsync = defaultVsyncFlag;
+ if (sScrollOptEnable && sShouldUseVsync != null) {
+ try {
+ Object retVal = sShouldUseVsync.invoke(null);
+ useVsync = (boolean)retVal;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return useVsync;
+ }
+
+ /** @hide */
+ public static long getFrameDelay(long defaultDelay, long lastFrameTimeNanos) {
+ long frameDelay = defaultDelay;
+ if (sScrollOptEnable && sGetFrameDelay != null) {
+ try {
+ Object retVal = sGetFrameDelay.invoke(null, lastFrameTimeNanos);
+ frameDelay = (long)retVal;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return frameDelay;
+ }
+
+ /** @hide */
+ public static long getAdjustedAnimationClock(long frameTimeNanos) {
+ long newFrameTimeNanos = frameTimeNanos;
+ if (sScrollOptEnable && sGetAdjustedAnimationClock != null) {
+ try {
+ Object retVal = sGetAdjustedAnimationClock.invoke(null,
+ frameTimeNanos);
+ newFrameTimeNanos = (long)retVal;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return newFrameTimeNanos;
+ }
+ }
+};
diff --git a/core/java/android/util/FeatureFlagUtils.java b/core/java/android/util/FeatureFlagUtils.java
index e08b913fe248..871fd51b5968 100644
--- a/core/java/android/util/FeatureFlagUtils.java
+++ b/core/java/android/util/FeatureFlagUtils.java
@@ -76,7 +76,7 @@ public class FeatureFlagUtils {
DEFAULT_FLAGS.put("settings_tether_all_in_one", "false");
DEFAULT_FLAGS.put("settings_contextual_home", "false");
- DEFAULT_FLAGS.put(SETTINGS_PROVIDER_MODEL, "true");
+ DEFAULT_FLAGS.put(SETTINGS_PROVIDER_MODEL, "false");
DEFAULT_FLAGS.put(SETTINGS_USE_NEW_BACKUP_ELIGIBILITY_RULES, "true");
DEFAULT_FLAGS.put(SETTINGS_ENABLE_SECURITY_HUB, "true");
DEFAULT_FLAGS.put(SETTINGS_SUPPORT_LARGE_SCREEN, "true");
@@ -98,6 +98,11 @@ public class FeatureFlagUtils {
* @return true if the flag is enabled (either by default in system, or override by user)
*/
public static boolean isEnabled(Context context, String feature) {
+ // Hide feature in SC Developer Preview
+ if (SETTINGS_PROVIDER_MODEL.equals(feature)) {
+ return false;
+ }
+
// Override precedence:
// Settings.Global -> sys.fflag.override.* -> static list
diff --git a/core/java/android/util/NtpTrustedTime.java b/core/java/android/util/NtpTrustedTime.java
index 4ac3178ecb4c..519fd2b9a171 100644
--- a/core/java/android/util/NtpTrustedTime.java
+++ b/core/java/android/util/NtpTrustedTime.java
@@ -28,6 +28,7 @@ import android.net.NetworkInfo;
import android.net.SntpClient;
import android.os.Build;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
@@ -126,6 +127,12 @@ public class NtpTrustedTime implements TrustedTime {
// forceRefresh().
private volatile TimeResult mTimeResult;
+ private boolean mBackupmode = false;
+ private static String mBackupServer = "";
+ private static int mNtpRetries = 0;
+ private static int mNtpRetriesMax = 0;
+ private static final String BACKUP_SERVER = "persist.backup.ntpServer";
+
private NtpTrustedTime(Context context) {
mContext = Objects.requireNonNull(context);
}
@@ -133,14 +140,39 @@ public class NtpTrustedTime implements TrustedTime {
@UnsupportedAppUsage
public static synchronized NtpTrustedTime getInstance(Context context) {
if (sSingleton == null) {
+ final Resources res = context.getResources();
+ final ContentResolver resolver = context.getContentResolver();
+
Context appContext = context.getApplicationContext();
sSingleton = new NtpTrustedTime(appContext);
+
+ final String sserver_prop = Settings.Global.getString(
+ resolver, Settings.Global.NTP_SERVER_2);
+
+ final String secondServer_prop = ((null != sserver_prop)
+ && (0 < sserver_prop.length()))
+ ? sserver_prop : BACKUP_SERVER;
+
+ final String backupServer = SystemProperties.get(secondServer_prop);
+
+ if ((null != backupServer) && (0 < backupServer.length())) {
+ int retryMax = res.getInteger(com.android.internal.R.integer.config_ntpRetry);
+ if (0 < retryMax) {
+ sSingleton.mNtpRetriesMax = retryMax;
+ sSingleton.mBackupServer = (backupServer.trim()).replace("\"", "");
+ }
+ }
}
return sSingleton;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public boolean forceRefresh() {
+ return hasCache() ? forceSync() : false;
+ }
+
+ @Override
+ public boolean forceSync() {
synchronized (this) {
NtpConnectionInfo connectionInfo = getNtpConnectionInfo();
if (connectionInfo == null) {
@@ -163,14 +195,21 @@ public class NtpTrustedTime implements TrustedTime {
if (LOGD) Log.d(TAG, "forceRefresh() from cache miss");
final SntpClient client = new SntpClient();
- final String serverName = connectionInfo.getServer();
+ String serverName = connectionInfo.getServer();
final int timeoutMillis = connectionInfo.getTimeoutMillis();
+
+ if (getBackupmode()) {
+ setBackupmode(false);
+ serverName = mBackupServer;
+ }
+ if (LOGD) Log.d(TAG, "Ntp Server to access at:" + serverName);
if (client.requestTime(serverName, timeoutMillis, network)) {
long ntpCertainty = client.getRoundTripTime() / 2;
mTimeResult = new TimeResult(
client.getNtpTime(), client.getNtpTimeReference(), ntpCertainty);
return true;
} else {
+ countInBackupmode();
return false;
}
}
@@ -294,4 +333,32 @@ public class NtpTrustedTime implements TrustedTime {
final String server = secureServer != null ? secureServer : defaultServer;
return TextUtils.isEmpty(server) ? null : new NtpConnectionInfo(server, timeoutMillis);
}
+
+ public void setBackupmode(boolean mode) {
+ if (isBackupSupported()) {
+ mBackupmode = mode;
+ }
+ if (LOGD) Log.d(TAG, "setBackupmode() set the backup mode to be:" + mBackupmode);
+ }
+
+ private boolean getBackupmode() {
+ return mBackupmode;
+ }
+
+ private boolean isBackupSupported() {
+ return ((0 < mNtpRetriesMax) &&
+ (null != mBackupServer) &&
+ (0 != mBackupServer.length()));
+ }
+
+ private void countInBackupmode() {
+ if (isBackupSupported()) {
+ mNtpRetries++;
+ if (mNtpRetries >= mNtpRetriesMax) {
+ mNtpRetries = 0;
+ setBackupmode(true);
+ }
+ }
+ if (LOGD) Log.d(TAG, "countInBackupmode() func");
+ }
}
diff --git a/core/java/android/util/SeempLog.java b/core/java/android/util/SeempLog.java
new file mode 100644
index 000000000000..3764882644d8
--- /dev/null
+++ b/core/java/android/util/SeempLog.java
@@ -0,0 +1,754 @@
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package android.util;
+
+import com.android.internal.os.RuntimeInit;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.UnknownHostException;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.List;
+import java.util.Iterator;
+import android.util.Log;
+import android.provider.Settings;
+
+/**
+ * SeempLog
+ *
+ * @hide
+ */
+public final class SeempLog {
+ private SeempLog() {
+ }
+
+ /**
+ * Send a log message to the seemp log.
+ * @param api The api triggering this message.
+ */
+ public static int record(int api) {
+ return seemp_println_native(api, "");
+ }
+
+ /**
+ * Send a log message to the seemp log.
+ * @param api The api triggering this message.
+ * @param msg The message you would like logged.
+ */
+ public static int record_str(int api, String msg) {
+ if ( msg != null ) {
+ return seemp_println_native(api, msg);
+ }
+ else {
+ return seemp_println_native(api, "");
+ }
+ }
+
+ public static int record_sensor(int api,
+ android.hardware.Sensor sensor) {
+ if ( sensor != null ) {
+ return seemp_println_native(api, "sensor="+sensor.getType());
+ }
+ else {
+ return seemp_println_native(api, "sensor=-1");
+ }
+ }
+
+ public static int record_sensor_rate(int api,
+ android.hardware.Sensor sensor, int rate) {
+ if ( sensor != null ) {
+ return seemp_println_native(api,
+ "sensor="+sensor.getType() + ",rate="+rate);
+ }
+ else {
+ return seemp_println_native(api, "sensor=-1,rate=" + rate);
+ }
+ }
+
+ public static int record_uri(int api, android.net.Uri uri) {
+ if ( uri != null ) {
+ return seemp_println_native(api, "uri, " + uri.toString());
+ }
+ else {
+ return seemp_println_native(api, "uri, null" );
+ }
+ }
+
+ public static int record_vg_layout(int api,
+ android.view.ViewGroup.LayoutParams params) {
+ try {
+ android.view.WindowManager.LayoutParams p =
+ (android.view.WindowManager.LayoutParams) params;
+ if ( p != null ) {
+ return seemp_println_native(api,
+ "window_type=" + p.type + ",window_flag=" + p.flags);
+ }
+ else {
+ return seemp_println_native(api, "");
+ }
+ } catch (ClassCastException cce) {
+ return seemp_println_native(api, "");
+ }
+ }
+
+ /** @hide */ public static native int seemp_println_native(int api, String msg);
+
+ public static final int SEEMP_API_android_provider_Settings__get_ANDROID_ID_ = 7;
+ public static final int SEEMP_API_android_provider_Settings__get_ACCELEROMETER_ROTATION_ = 96;
+ public static final int SEEMP_API_android_provider_Settings__get_USER_ROTATION_ = 97;
+ public static final int SEEMP_API_android_provider_Settings__get_ADB_ENABLED_ = 98;
+ public static final int SEEMP_API_android_provider_Settings__get_DEBUG_APP_ = 99;
+ public static final int SEEMP_API_android_provider_Settings__get_WAIT_FOR_DEBUGGER_ = 100;
+ public static final int SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_ON_ = 101;
+ public static final int SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_RADIOS_ = 102;
+ public static final int SEEMP_API_android_provider_Settings__get_ALARM_ALERT_ = 103;
+ public static final int SEEMP_API_android_provider_Settings__get_NEXT_ALARM_FORMATTED_ = 104;
+ public static final int SEEMP_API_android_provider_Settings__get_ALWAYS_FINISH_ACTIVITIES_ = 105;
+ public static final int SEEMP_API_android_provider_Settings__get_LOGGING_ID_ = 106;
+ public static final int SEEMP_API_android_provider_Settings__get_ANIMATOR_DURATION_SCALE_ = 107;
+ public static final int SEEMP_API_android_provider_Settings__get_WINDOW_ANIMATION_SCALE_ = 108;
+ public static final int SEEMP_API_android_provider_Settings__get_FONT_SCALE_ = 109;
+ public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_ = 110;
+ public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_ = 111;
+ public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_AUTOMATIC_ = 112;
+ public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_MANUAL_ = 113;
+ public static final int SEEMP_API_android_provider_Settings__get_SCREEN_OFF_TIMEOUT_ = 114;
+ public static final int SEEMP_API_android_provider_Settings__get_DIM_SCREEN_ = 115;
+ public static final int SEEMP_API_android_provider_Settings__get_TRANSITION_ANIMATION_SCALE_ = 116;
+ public static final int SEEMP_API_android_provider_Settings__get_STAY_ON_WHILE_PLUGGED_IN_ = 117;
+ public static final int SEEMP_API_android_provider_Settings__get_WALLPAPER_ACTIVITY_ = 118;
+ public static final int SEEMP_API_android_provider_Settings__get_SHOW_PROCESSES_ = 119;
+ public static final int SEEMP_API_android_provider_Settings__get_SHOW_WEB_SUGGESTIONS_ = 120;
+ public static final int SEEMP_API_android_provider_Settings__get_SHOW_GTALK_SERVICE_STATUS_ = 121;
+ public static final int SEEMP_API_android_provider_Settings__get_USE_GOOGLE_MAIL_ = 122;
+ public static final int SEEMP_API_android_provider_Settings__get_AUTO_TIME_ = 123;
+ public static final int SEEMP_API_android_provider_Settings__get_AUTO_TIME_ZONE_ = 124;
+ public static final int SEEMP_API_android_provider_Settings__get_DATE_FORMAT_ = 125;
+ public static final int SEEMP_API_android_provider_Settings__get_TIME_12_24_ = 126;
+ public static final int SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_ = 127;
+ public static final int SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_TIMEOUT_ = 128;
+ public static final int SEEMP_API_android_provider_Settings__get_BLUETOOTH_ON_ = 129;
+ public static final int SEEMP_API_android_provider_Settings__get_DEVICE_PROVISIONED_ = 130;
+ public static final int SEEMP_API_android_provider_Settings__get_SETUP_WIZARD_HAS_RUN_ = 131;
+ public static final int SEEMP_API_android_provider_Settings__get_DTMF_TONE_WHEN_DIALING_ = 132;
+ public static final int SEEMP_API_android_provider_Settings__get_END_BUTTON_BEHAVIOR_ = 133;
+ public static final int SEEMP_API_android_provider_Settings__get_RINGTONE_ = 134;
+ public static final int SEEMP_API_android_provider_Settings__get_MODE_RINGER_ = 135;
+ public static final int SEEMP_API_android_provider_Settings__get_INSTALL_NON_MARKET_APPS_ = 136;
+ public static final int SEEMP_API_android_provider_Settings__get_LOCATION_PROVIDERS_ALLOWED_ = 137;
+ public static final int SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_ENABLED_ = 138;
+ public static final int SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_ = 139;
+ public static final int SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_VISIBLE_ = 140;
+ public static final int SEEMP_API_android_provider_Settings__get_NETWORK_PREFERENCE_ = 141;
+ public static final int SEEMP_API_android_provider_Settings__get_DATA_ROAMING_ = 142;
+ public static final int SEEMP_API_android_provider_Settings__get_HTTP_PROXY_ = 143;
+ public static final int SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_ENABLED_ = 144;
+ public static final int SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_LAST_UPDATE_ = 145;
+ public static final int SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_REDIRECT_URL_ = 146;
+ public static final int SEEMP_API_android_provider_Settings__get_RADIO_BLUETOOTH_ = 147;
+ public static final int SEEMP_API_android_provider_Settings__get_RADIO_CELL_ = 148;
+ public static final int SEEMP_API_android_provider_Settings__get_RADIO_NFC_ = 149;
+ public static final int SEEMP_API_android_provider_Settings__get_RADIO_WIFI_ = 150;
+ public static final int SEEMP_API_android_provider_Settings__get_SYS_PROP_SETTING_VERSION_ = 151;
+ public static final int SEEMP_API_android_provider_Settings__get_SETTINGS_CLASSNAME_ = 152;
+ public static final int SEEMP_API_android_provider_Settings__get_TEXT_AUTO_CAPS_ = 153;
+ public static final int SEEMP_API_android_provider_Settings__get_TEXT_AUTO_PUNCTUATE_ = 154;
+ public static final int SEEMP_API_android_provider_Settings__get_TEXT_AUTO_REPLACE_ = 155;
+ public static final int SEEMP_API_android_provider_Settings__get_TEXT_SHOW_PASSWORD_ = 156;
+ public static final int SEEMP_API_android_provider_Settings__get_USB_MASS_STORAGE_ENABLED_ = 157;
+ public static final int SEEMP_API_android_provider_Settings__get_VIBRATE_ON_ = 158;
+ public static final int SEEMP_API_android_provider_Settings__get_HAPTIC_FEEDBACK_ENABLED_ = 159;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_ALARM_ = 160;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_BLUETOOTH_SCO_ = 161;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_MUSIC_ = 162;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_NOTIFICATION_ = 163;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_RING_ = 164;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_SYSTEM_ = 165;
+ public static final int SEEMP_API_android_provider_Settings__get_VOLUME_VOICE_ = 166;
+ public static final int SEEMP_API_android_provider_Settings__get_SOUND_EFFECTS_ENABLED_ = 167;
+ public static final int SEEMP_API_android_provider_Settings__get_MODE_RINGER_STREAMS_AFFECTED_ = 168;
+ public static final int SEEMP_API_android_provider_Settings__get_MUTE_STREAMS_AFFECTED_ = 169;
+ public static final int SEEMP_API_android_provider_Settings__get_NOTIFICATION_SOUND_ = 170;
+ public static final int SEEMP_API_android_provider_Settings__get_APPEND_FOR_LAST_AUDIBLE_ = 171;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_MAX_DHCP_RETRY_COUNT_ = 172;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_ = 173;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_ = 174;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_ = 175;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_NUM_OPEN_NETWORKS_KEPT_ = 176;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_ON_ = 177;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_ = 178;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_DEFAULT_ = 179;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_NEVER_ = 180;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED_ = 181;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS1_ = 182;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS2_ = 183;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_GATEWAY_ = 184;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_IP_ = 185;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_NETMASK_ = 186;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_USE_STATIC_IP_ = 187;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_ = 188;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_AP_COUNT_ = 189;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_ = 190;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_ = 191;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_ = 192;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_ = 193;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_MAX_AP_CHECKS_ = 194;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ON_ = 195;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_COUNT_ = 196;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_DELAY_MS_ = 197;
+ public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_TIMEOUT_MS_ = 198;
+ public static final int SEEMP_API_android_provider_Settings__put_ACCELEROMETER_ROTATION_ = 199;
+ public static final int SEEMP_API_android_provider_Settings__put_USER_ROTATION_ = 200;
+ public static final int SEEMP_API_android_provider_Settings__put_ADB_ENABLED_ = 201;
+ public static final int SEEMP_API_android_provider_Settings__put_DEBUG_APP_ = 202;
+ public static final int SEEMP_API_android_provider_Settings__put_WAIT_FOR_DEBUGGER_ = 203;
+ public static final int SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_ON_ = 204;
+ public static final int SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_RADIOS_ = 205;
+ public static final int SEEMP_API_android_provider_Settings__put_ALARM_ALERT_ = 206;
+ public static final int SEEMP_API_android_provider_Settings__put_NEXT_ALARM_FORMATTED_ = 207;
+ public static final int SEEMP_API_android_provider_Settings__put_ALWAYS_FINISH_ACTIVITIES_ = 208;
+ public static final int SEEMP_API_android_provider_Settings__put_ANDROID_ID_ = 209;
+ public static final int SEEMP_API_android_provider_Settings__put_LOGGING_ID_ = 210;
+ public static final int SEEMP_API_android_provider_Settings__put_ANIMATOR_DURATION_SCALE_ = 211;
+ public static final int SEEMP_API_android_provider_Settings__put_WINDOW_ANIMATION_SCALE_ = 212;
+ public static final int SEEMP_API_android_provider_Settings__put_FONT_SCALE_ = 213;
+ public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_ = 214;
+ public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_ = 215;
+ public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_AUTOMATIC_ = 216;
+ public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_MANUAL_ = 217;
+ public static final int SEEMP_API_android_provider_Settings__put_SCREEN_OFF_TIMEOUT_ = 218;
+ public static final int SEEMP_API_android_provider_Settings__put_DIM_SCREEN_ = 219;
+ public static final int SEEMP_API_android_provider_Settings__put_TRANSITION_ANIMATION_SCALE_ = 220;
+ public static final int SEEMP_API_android_provider_Settings__put_STAY_ON_WHILE_PLUGGED_IN_ = 221;
+ public static final int SEEMP_API_android_provider_Settings__put_WALLPAPER_ACTIVITY_ = 222;
+ public static final int SEEMP_API_android_provider_Settings__put_SHOW_PROCESSES_ = 223;
+ public static final int SEEMP_API_android_provider_Settings__put_SHOW_WEB_SUGGESTIONS_ = 224;
+ public static final int SEEMP_API_android_provider_Settings__put_SHOW_GTALK_SERVICE_STATUS_ = 225;
+ public static final int SEEMP_API_android_provider_Settings__put_USE_GOOGLE_MAIL_ = 226;
+ public static final int SEEMP_API_android_provider_Settings__put_AUTO_TIME_ = 227;
+ public static final int SEEMP_API_android_provider_Settings__put_AUTO_TIME_ZONE_ = 228;
+ public static final int SEEMP_API_android_provider_Settings__put_DATE_FORMAT_ = 229;
+ public static final int SEEMP_API_android_provider_Settings__put_TIME_12_24_ = 230;
+ public static final int SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_ = 231;
+ public static final int SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_TIMEOUT_ = 232;
+ public static final int SEEMP_API_android_provider_Settings__put_BLUETOOTH_ON_ = 233;
+ public static final int SEEMP_API_android_provider_Settings__put_DEVICE_PROVISIONED_ = 234;
+ public static final int SEEMP_API_android_provider_Settings__put_SETUP_WIZARD_HAS_RUN_ = 235;
+ public static final int SEEMP_API_android_provider_Settings__put_DTMF_TONE_WHEN_DIALING_ = 236;
+ public static final int SEEMP_API_android_provider_Settings__put_END_BUTTON_BEHAVIOR_ = 237;
+ public static final int SEEMP_API_android_provider_Settings__put_RINGTONE_ = 238;
+ public static final int SEEMP_API_android_provider_Settings__put_MODE_RINGER_ = 239;
+ public static final int SEEMP_API_android_provider_Settings__put_INSTALL_NON_MARKET_APPS_ = 240;
+ public static final int SEEMP_API_android_provider_Settings__put_LOCATION_PROVIDERS_ALLOWED_ = 241;
+ public static final int SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_ENABLED_ = 242;
+ public static final int SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_ = 243;
+ public static final int SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_VISIBLE_ = 244;
+ public static final int SEEMP_API_android_provider_Settings__put_NETWORK_PREFERENCE_ = 245;
+ public static final int SEEMP_API_android_provider_Settings__put_DATA_ROAMING_ = 246;
+ public static final int SEEMP_API_android_provider_Settings__put_HTTP_PROXY_ = 247;
+ public static final int SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_ENABLED_ = 248;
+ public static final int SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_LAST_UPDATE_ = 249;
+ public static final int SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_REDIRECT_URL_ = 250;
+ public static final int SEEMP_API_android_provider_Settings__put_RADIO_BLUETOOTH_ = 251;
+ public static final int SEEMP_API_android_provider_Settings__put_RADIO_CELL_ = 252;
+ public static final int SEEMP_API_android_provider_Settings__put_RADIO_NFC_ = 253;
+ public static final int SEEMP_API_android_provider_Settings__put_RADIO_WIFI_ = 254;
+ public static final int SEEMP_API_android_provider_Settings__put_SYS_PROP_SETTING_VERSION_ = 255;
+ public static final int SEEMP_API_android_provider_Settings__put_SETTINGS_CLASSNAME_ = 256;
+ public static final int SEEMP_API_android_provider_Settings__put_TEXT_AUTO_CAPS_ = 257;
+ public static final int SEEMP_API_android_provider_Settings__put_TEXT_AUTO_PUNCTUATE_ = 258;
+ public static final int SEEMP_API_android_provider_Settings__put_TEXT_AUTO_REPLACE_ = 259;
+ public static final int SEEMP_API_android_provider_Settings__put_TEXT_SHOW_PASSWORD_ = 260;
+ public static final int SEEMP_API_android_provider_Settings__put_USB_MASS_STORAGE_ENABLED_ = 261;
+ public static final int SEEMP_API_android_provider_Settings__put_VIBRATE_ON_ = 262;
+ public static final int SEEMP_API_android_provider_Settings__put_HAPTIC_FEEDBACK_ENABLED_ = 263;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_ALARM_ = 264;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_BLUETOOTH_SCO_ = 265;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_MUSIC_ = 266;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_NOTIFICATION_ = 267;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_RING_ = 268;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_SYSTEM_ = 269;
+ public static final int SEEMP_API_android_provider_Settings__put_VOLUME_VOICE_ = 270;
+ public static final int SEEMP_API_android_provider_Settings__put_SOUND_EFFECTS_ENABLED_ = 271;
+ public static final int SEEMP_API_android_provider_Settings__put_MODE_RINGER_STREAMS_AFFECTED_ = 272;
+ public static final int SEEMP_API_android_provider_Settings__put_MUTE_STREAMS_AFFECTED_ = 273;
+ public static final int SEEMP_API_android_provider_Settings__put_NOTIFICATION_SOUND_ = 274;
+ public static final int SEEMP_API_android_provider_Settings__put_APPEND_FOR_LAST_AUDIBLE_ = 275;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_MAX_DHCP_RETRY_COUNT_ = 276;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_ = 277;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_ = 278;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_ = 279;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_NUM_OPEN_NETWORKS_KEPT_ = 280;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_ON_ = 281;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_ = 282;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_DEFAULT_ = 283;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_NEVER_ = 284;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED_ = 285;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS1_ = 286;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS2_ = 287;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_GATEWAY_ = 288;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_IP_ = 289;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_NETMASK_ = 290;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_USE_STATIC_IP_ = 291;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_ = 292;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_AP_COUNT_ = 293;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_ = 294;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_ = 295;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_ = 296;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_ = 297;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_MAX_AP_CHECKS_ = 298;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ON_ = 299;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_COUNT_ = 300;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_DELAY_MS_ = 301;
+ public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_TIMEOUT_MS_ = 302;
+
+ private final static java.util.Map<String,Integer> value_to_get_map;
+ static {
+ value_to_get_map = new java.util.HashMap<String,Integer>( 198 );
+ value_to_get_map.put(Settings.System.NOTIFICATION_SOUND,
+ SEEMP_API_android_provider_Settings__get_NOTIFICATION_SOUND_);
+ value_to_get_map.put(Settings.System.DTMF_TONE_WHEN_DIALING,
+ SEEMP_API_android_provider_Settings__get_DTMF_TONE_WHEN_DIALING_);
+ value_to_get_map.put(Settings.System.LOCK_PATTERN_ENABLED,
+ SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_ENABLED_);
+ value_to_get_map.put(Settings.System.WIFI_MAX_DHCP_RETRY_COUNT,
+ SEEMP_API_android_provider_Settings__get_WIFI_MAX_DHCP_RETRY_COUNT_);
+ value_to_get_map.put(Settings.System.AUTO_TIME,
+ SEEMP_API_android_provider_Settings__get_AUTO_TIME_);
+ value_to_get_map.put(Settings.System.SETUP_WIZARD_HAS_RUN,
+ SEEMP_API_android_provider_Settings__get_SETUP_WIZARD_HAS_RUN_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_);
+ value_to_get_map.put(Settings.System.LOCATION_PROVIDERS_ALLOWED,
+ SEEMP_API_android_provider_Settings__get_LOCATION_PROVIDERS_ALLOWED_);
+ value_to_get_map.put(Settings.System.ALARM_ALERT,
+ SEEMP_API_android_provider_Settings__get_ALARM_ALERT_);
+ value_to_get_map.put(Settings.System.VIBRATE_ON,
+ SEEMP_API_android_provider_Settings__get_VIBRATE_ON_);
+ value_to_get_map.put(Settings.System.USB_MASS_STORAGE_ENABLED,
+ SEEMP_API_android_provider_Settings__get_USB_MASS_STORAGE_ENABLED_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_PING_DELAY_MS,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_DELAY_MS_);
+ value_to_get_map.put(Settings.System.FONT_SCALE,
+ SEEMP_API_android_provider_Settings__get_FONT_SCALE_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_AP_COUNT,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_AP_COUNT_);
+ value_to_get_map.put(Settings.System.ALWAYS_FINISH_ACTIVITIES,
+ SEEMP_API_android_provider_Settings__get_ALWAYS_FINISH_ACTIVITIES_);
+ value_to_get_map.put(Settings.System.ACCELEROMETER_ROTATION,
+ SEEMP_API_android_provider_Settings__get_ACCELEROMETER_ROTATION_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_PING_TIMEOUT_MS,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_TIMEOUT_MS_);
+ value_to_get_map.put(Settings.System.VOLUME_NOTIFICATION,
+ SEEMP_API_android_provider_Settings__get_VOLUME_NOTIFICATION_);
+ value_to_get_map.put(Settings.System.AIRPLANE_MODE_ON,
+ SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_ON_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_);
+ value_to_get_map.put(Settings.System.WIFI_STATIC_IP,
+ SEEMP_API_android_provider_Settings__get_WIFI_STATIC_IP_);
+ value_to_get_map.put(Settings.System.RADIO_BLUETOOTH,
+ SEEMP_API_android_provider_Settings__get_RADIO_BLUETOOTH_);
+ value_to_get_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY_TIMEOUT,
+ SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_TIMEOUT_);
+ value_to_get_map.put(Settings.System.VOLUME_RING,
+ SEEMP_API_android_provider_Settings__get_VOLUME_RING_);
+ value_to_get_map.put(Settings.System.MODE_RINGER_STREAMS_AFFECTED,
+ SEEMP_API_android_provider_Settings__get_MODE_RINGER_STREAMS_AFFECTED_);
+ value_to_get_map.put(Settings.System.VOLUME_SYSTEM,
+ SEEMP_API_android_provider_Settings__get_VOLUME_SYSTEM_);
+ value_to_get_map.put(Settings.System.SCREEN_OFF_TIMEOUT,
+ SEEMP_API_android_provider_Settings__get_SCREEN_OFF_TIMEOUT_);
+ value_to_get_map.put(Settings.System.RADIO_WIFI,
+ SEEMP_API_android_provider_Settings__get_RADIO_WIFI_);
+ value_to_get_map.put(Settings.System.AUTO_TIME_ZONE,
+ SEEMP_API_android_provider_Settings__get_AUTO_TIME_ZONE_);
+ value_to_get_map.put(Settings.System.TEXT_AUTO_CAPS,
+ SEEMP_API_android_provider_Settings__get_TEXT_AUTO_CAPS_);
+ value_to_get_map.put(Settings.System.WALLPAPER_ACTIVITY,
+ SEEMP_API_android_provider_Settings__get_WALLPAPER_ACTIVITY_);
+ value_to_get_map.put(Settings.System.ANIMATOR_DURATION_SCALE,
+ SEEMP_API_android_provider_Settings__get_ANIMATOR_DURATION_SCALE_);
+ value_to_get_map.put(Settings.System.WIFI_NUM_OPEN_NETWORKS_KEPT,
+ SEEMP_API_android_provider_Settings__get_WIFI_NUM_OPEN_NETWORKS_KEPT_);
+ value_to_get_map.put(Settings.System.LOCK_PATTERN_VISIBLE,
+ SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_VISIBLE_);
+ value_to_get_map.put(Settings.System.VOLUME_VOICE,
+ SEEMP_API_android_provider_Settings__get_VOLUME_VOICE_);
+ value_to_get_map.put(Settings.System.DEBUG_APP,
+ SEEMP_API_android_provider_Settings__get_DEBUG_APP_);
+ value_to_get_map.put(Settings.System.WIFI_ON,
+ SEEMP_API_android_provider_Settings__get_WIFI_ON_);
+ value_to_get_map.put(Settings.System.TEXT_SHOW_PASSWORD,
+ SEEMP_API_android_provider_Settings__get_TEXT_SHOW_PASSWORD_);
+ value_to_get_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
+ SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_);
+ value_to_get_map.put(Settings.System.WIFI_SLEEP_POLICY,
+ SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_);
+ value_to_get_map.put(Settings.System.VOLUME_MUSIC,
+ SEEMP_API_android_provider_Settings__get_VOLUME_MUSIC_);
+ value_to_get_map.put(Settings.System.PARENTAL_CONTROL_LAST_UPDATE,
+ SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_LAST_UPDATE_);
+ value_to_get_map.put(Settings.System.DEVICE_PROVISIONED,
+ SEEMP_API_android_provider_Settings__get_DEVICE_PROVISIONED_);
+ value_to_get_map.put(Settings.System.HTTP_PROXY,
+ SEEMP_API_android_provider_Settings__get_HTTP_PROXY_);
+ value_to_get_map.put(Settings.System.ANDROID_ID,
+ SEEMP_API_android_provider_Settings__get_ANDROID_ID_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_MAX_AP_CHECKS,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_MAX_AP_CHECKS_);
+ value_to_get_map.put(Settings.System.END_BUTTON_BEHAVIOR,
+ SEEMP_API_android_provider_Settings__get_END_BUTTON_BEHAVIOR_);
+ value_to_get_map.put(Settings.System.NEXT_ALARM_FORMATTED,
+ SEEMP_API_android_provider_Settings__get_NEXT_ALARM_FORMATTED_);
+ value_to_get_map.put(Settings.System.RADIO_CELL,
+ SEEMP_API_android_provider_Settings__get_RADIO_CELL_);
+ value_to_get_map.put(Settings.System.PARENTAL_CONTROL_ENABLED,
+ SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_ENABLED_);
+ value_to_get_map.put(Settings.System.BLUETOOTH_ON,
+ SEEMP_API_android_provider_Settings__get_BLUETOOTH_ON_);
+ value_to_get_map.put(Settings.System.WINDOW_ANIMATION_SCALE,
+ SEEMP_API_android_provider_Settings__get_WINDOW_ANIMATION_SCALE_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_);
+ value_to_get_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY,
+ SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_);
+ value_to_get_map.put(Settings.System.WIFI_STATIC_DNS1,
+ SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS1_);
+ value_to_get_map.put(Settings.System.WIFI_STATIC_DNS2,
+ SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS2_);
+ value_to_get_map.put(Settings.System.HAPTIC_FEEDBACK_ENABLED,
+ SEEMP_API_android_provider_Settings__get_HAPTIC_FEEDBACK_ENABLED_);
+ value_to_get_map.put(Settings.System.SHOW_WEB_SUGGESTIONS,
+ SEEMP_API_android_provider_Settings__get_SHOW_WEB_SUGGESTIONS_);
+ value_to_get_map.put(Settings.System.PARENTAL_CONTROL_REDIRECT_URL,
+ SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_REDIRECT_URL_);
+ value_to_get_map.put(Settings.System.DATE_FORMAT,
+ SEEMP_API_android_provider_Settings__get_DATE_FORMAT_);
+ value_to_get_map.put(Settings.System.RADIO_NFC,
+ SEEMP_API_android_provider_Settings__get_RADIO_NFC_);
+ value_to_get_map.put(Settings.System.AIRPLANE_MODE_RADIOS,
+ SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_RADIOS_);
+ value_to_get_map.put(Settings.System.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED,
+ SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_);
+ value_to_get_map.put(Settings.System.TIME_12_24,
+ SEEMP_API_android_provider_Settings__get_TIME_12_24_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_);
+ value_to_get_map.put(Settings.System.VOLUME_BLUETOOTH_SCO,
+ SEEMP_API_android_provider_Settings__get_VOLUME_BLUETOOTH_SCO_);
+ value_to_get_map.put(Settings.System.USER_ROTATION,
+ SEEMP_API_android_provider_Settings__get_USER_ROTATION_);
+ value_to_get_map.put(Settings.System.WIFI_STATIC_GATEWAY,
+ SEEMP_API_android_provider_Settings__get_WIFI_STATIC_GATEWAY_);
+ value_to_get_map.put(Settings.System.STAY_ON_WHILE_PLUGGED_IN,
+ SEEMP_API_android_provider_Settings__get_STAY_ON_WHILE_PLUGGED_IN_);
+ value_to_get_map.put(Settings.System.SOUND_EFFECTS_ENABLED,
+ SEEMP_API_android_provider_Settings__get_SOUND_EFFECTS_ENABLED_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_PING_COUNT,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_COUNT_);
+ value_to_get_map.put(Settings.System.DATA_ROAMING,
+ SEEMP_API_android_provider_Settings__get_DATA_ROAMING_);
+ value_to_get_map.put(Settings.System.SETTINGS_CLASSNAME,
+ SEEMP_API_android_provider_Settings__get_SETTINGS_CLASSNAME_);
+ value_to_get_map.put(Settings.System.TRANSITION_ANIMATION_SCALE,
+ SEEMP_API_android_provider_Settings__get_TRANSITION_ANIMATION_SCALE_);
+ value_to_get_map.put(Settings.System.WAIT_FOR_DEBUGGER,
+ SEEMP_API_android_provider_Settings__get_WAIT_FOR_DEBUGGER_);
+ value_to_get_map.put(Settings.System.INSTALL_NON_MARKET_APPS,
+ SEEMP_API_android_provider_Settings__get_INSTALL_NON_MARKET_APPS_);
+ value_to_get_map.put(Settings.System.ADB_ENABLED,
+ SEEMP_API_android_provider_Settings__get_ADB_ENABLED_);
+ value_to_get_map.put(Settings.System.WIFI_USE_STATIC_IP,
+ SEEMP_API_android_provider_Settings__get_WIFI_USE_STATIC_IP_);
+ value_to_get_map.put(Settings.System.DIM_SCREEN,
+ SEEMP_API_android_provider_Settings__get_DIM_SCREEN_);
+ value_to_get_map.put(Settings.System.VOLUME_ALARM,
+ SEEMP_API_android_provider_Settings__get_VOLUME_ALARM_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_ON,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ON_);
+ value_to_get_map.put(Settings.System.WIFI_STATIC_NETMASK,
+ SEEMP_API_android_provider_Settings__get_WIFI_STATIC_NETMASK_);
+ value_to_get_map.put(Settings.System.NETWORK_PREFERENCE,
+ SEEMP_API_android_provider_Settings__get_NETWORK_PREFERENCE_);
+ value_to_get_map.put(Settings.System.SHOW_PROCESSES,
+ SEEMP_API_android_provider_Settings__get_SHOW_PROCESSES_);
+ value_to_get_map.put(Settings.System.TEXT_AUTO_REPLACE,
+ SEEMP_API_android_provider_Settings__get_TEXT_AUTO_REPLACE_);
+ value_to_get_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+ SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_);
+ value_to_get_map.put(Settings.System.APPEND_FOR_LAST_AUDIBLE,
+ SEEMP_API_android_provider_Settings__get_APPEND_FOR_LAST_AUDIBLE_);
+ value_to_get_map.put(Settings.System.SHOW_GTALK_SERVICE_STATUS,
+ SEEMP_API_android_provider_Settings__get_SHOW_GTALK_SERVICE_STATUS_);
+ value_to_get_map.put(Settings.System.SCREEN_BRIGHTNESS,
+ SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_);
+ value_to_get_map.put(Settings.System.USE_GOOGLE_MAIL,
+ SEEMP_API_android_provider_Settings__get_USE_GOOGLE_MAIL_);
+ value_to_get_map.put(Settings.System.RINGTONE,
+ SEEMP_API_android_provider_Settings__get_RINGTONE_);
+ value_to_get_map.put(Settings.System.LOGGING_ID,
+ SEEMP_API_android_provider_Settings__get_LOGGING_ID_);
+ value_to_get_map.put(Settings.System.MODE_RINGER,
+ SEEMP_API_android_provider_Settings__get_MODE_RINGER_);
+ value_to_get_map.put(Settings.System.MUTE_STREAMS_AFFECTED,
+ SEEMP_API_android_provider_Settings__get_MUTE_STREAMS_AFFECTED_);
+ value_to_get_map.put(Settings.System.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE,
+ SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_);
+ value_to_get_map.put(Settings.System.TEXT_AUTO_PUNCTUATE,
+ SEEMP_API_android_provider_Settings__get_TEXT_AUTO_PUNCTUATE_);
+ value_to_get_map.put(Settings.System.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS,
+ SEEMP_API_android_provider_Settings__get_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_);
+ value_to_get_map.put(Settings.System.SCREEN_BRIGHTNESS_MODE,
+ SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_);
+ }
+
+ public static int getSeempGetApiIdFromValue( String v )
+ {
+ Integer result = value_to_get_map.get( v );
+ if (result == null)
+ {
+ result = -1;
+ }
+ return result;
+ }
+
+ private final static java.util.Map<String,Integer> value_to_put_map;
+ static {
+ value_to_put_map = new java.util.HashMap<String,Integer>( 198 );
+ value_to_put_map.put(Settings.System.NOTIFICATION_SOUND,
+ SEEMP_API_android_provider_Settings__put_NOTIFICATION_SOUND_);
+ value_to_put_map.put(Settings.System.DTMF_TONE_WHEN_DIALING,
+ SEEMP_API_android_provider_Settings__put_DTMF_TONE_WHEN_DIALING_);
+ value_to_put_map.put(Settings.System.LOCK_PATTERN_ENABLED,
+ SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_ENABLED_);
+ value_to_put_map.put(Settings.System.WIFI_MAX_DHCP_RETRY_COUNT,
+ SEEMP_API_android_provider_Settings__put_WIFI_MAX_DHCP_RETRY_COUNT_);
+ value_to_put_map.put(Settings.System.AUTO_TIME,
+ SEEMP_API_android_provider_Settings__put_AUTO_TIME_);
+ value_to_put_map.put(Settings.System.SETUP_WIZARD_HAS_RUN,
+ SEEMP_API_android_provider_Settings__put_SETUP_WIZARD_HAS_RUN_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_);
+ value_to_put_map.put(Settings.System.LOCATION_PROVIDERS_ALLOWED,
+ SEEMP_API_android_provider_Settings__put_LOCATION_PROVIDERS_ALLOWED_);
+ value_to_put_map.put(Settings.System.ALARM_ALERT,
+ SEEMP_API_android_provider_Settings__put_ALARM_ALERT_);
+ value_to_put_map.put(Settings.System.VIBRATE_ON,
+ SEEMP_API_android_provider_Settings__put_VIBRATE_ON_);
+ value_to_put_map.put(Settings.System.USB_MASS_STORAGE_ENABLED,
+ SEEMP_API_android_provider_Settings__put_USB_MASS_STORAGE_ENABLED_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_PING_DELAY_MS,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_DELAY_MS_);
+ value_to_put_map.put(Settings.System.FONT_SCALE,
+ SEEMP_API_android_provider_Settings__put_FONT_SCALE_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_AP_COUNT,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_AP_COUNT_);
+ value_to_put_map.put(Settings.System.ALWAYS_FINISH_ACTIVITIES,
+ SEEMP_API_android_provider_Settings__put_ALWAYS_FINISH_ACTIVITIES_);
+ value_to_put_map.put(Settings.System.ACCELEROMETER_ROTATION,
+ SEEMP_API_android_provider_Settings__put_ACCELEROMETER_ROTATION_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_PING_TIMEOUT_MS,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_TIMEOUT_MS_);
+ value_to_put_map.put(Settings.System.VOLUME_NOTIFICATION,
+ SEEMP_API_android_provider_Settings__put_VOLUME_NOTIFICATION_);
+ value_to_put_map.put(Settings.System.AIRPLANE_MODE_ON,
+ SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_ON_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_);
+ value_to_put_map.put(Settings.System.WIFI_STATIC_IP,
+ SEEMP_API_android_provider_Settings__put_WIFI_STATIC_IP_);
+ value_to_put_map.put(Settings.System.RADIO_BLUETOOTH,
+ SEEMP_API_android_provider_Settings__put_RADIO_BLUETOOTH_);
+ value_to_put_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY_TIMEOUT,
+ SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_TIMEOUT_);
+ value_to_put_map.put(Settings.System.VOLUME_RING,
+ SEEMP_API_android_provider_Settings__put_VOLUME_RING_);
+ value_to_put_map.put(Settings.System.MODE_RINGER_STREAMS_AFFECTED,
+ SEEMP_API_android_provider_Settings__put_MODE_RINGER_STREAMS_AFFECTED_);
+ value_to_put_map.put(Settings.System.VOLUME_SYSTEM,
+ SEEMP_API_android_provider_Settings__put_VOLUME_SYSTEM_);
+ value_to_put_map.put(Settings.System.SCREEN_OFF_TIMEOUT,
+ SEEMP_API_android_provider_Settings__put_SCREEN_OFF_TIMEOUT_);
+ value_to_put_map.put(Settings.System.RADIO_WIFI,
+ SEEMP_API_android_provider_Settings__put_RADIO_WIFI_);
+ value_to_put_map.put(Settings.System.AUTO_TIME_ZONE,
+ SEEMP_API_android_provider_Settings__put_AUTO_TIME_ZONE_);
+ value_to_put_map.put(Settings.System.TEXT_AUTO_CAPS,
+ SEEMP_API_android_provider_Settings__put_TEXT_AUTO_CAPS_);
+ value_to_put_map.put(Settings.System.WALLPAPER_ACTIVITY,
+ SEEMP_API_android_provider_Settings__put_WALLPAPER_ACTIVITY_);
+ value_to_put_map.put(Settings.System.ANIMATOR_DURATION_SCALE,
+ SEEMP_API_android_provider_Settings__put_ANIMATOR_DURATION_SCALE_);
+ value_to_put_map.put(Settings.System.WIFI_NUM_OPEN_NETWORKS_KEPT,
+ SEEMP_API_android_provider_Settings__put_WIFI_NUM_OPEN_NETWORKS_KEPT_);
+ value_to_put_map.put(Settings.System.LOCK_PATTERN_VISIBLE,
+ SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_VISIBLE_);
+ value_to_put_map.put(Settings.System.VOLUME_VOICE,
+ SEEMP_API_android_provider_Settings__put_VOLUME_VOICE_);
+ value_to_put_map.put(Settings.System.DEBUG_APP,
+ SEEMP_API_android_provider_Settings__put_DEBUG_APP_);
+ value_to_put_map.put(Settings.System.WIFI_ON,
+ SEEMP_API_android_provider_Settings__put_WIFI_ON_);
+ value_to_put_map.put(Settings.System.TEXT_SHOW_PASSWORD,
+ SEEMP_API_android_provider_Settings__put_TEXT_SHOW_PASSWORD_);
+ value_to_put_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
+ SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_);
+ value_to_put_map.put(Settings.System.WIFI_SLEEP_POLICY,
+ SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_);
+ value_to_put_map.put(Settings.System.VOLUME_MUSIC,
+ SEEMP_API_android_provider_Settings__put_VOLUME_MUSIC_);
+ value_to_put_map.put(Settings.System.PARENTAL_CONTROL_LAST_UPDATE,
+ SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_LAST_UPDATE_);
+ value_to_put_map.put(Settings.System.DEVICE_PROVISIONED,
+ SEEMP_API_android_provider_Settings__put_DEVICE_PROVISIONED_);
+ value_to_put_map.put(Settings.System.HTTP_PROXY,
+ SEEMP_API_android_provider_Settings__put_HTTP_PROXY_);
+ value_to_put_map.put(Settings.System.ANDROID_ID,
+ SEEMP_API_android_provider_Settings__put_ANDROID_ID_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_MAX_AP_CHECKS,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_MAX_AP_CHECKS_);
+ value_to_put_map.put(Settings.System.END_BUTTON_BEHAVIOR,
+ SEEMP_API_android_provider_Settings__put_END_BUTTON_BEHAVIOR_);
+ value_to_put_map.put(Settings.System.NEXT_ALARM_FORMATTED,
+ SEEMP_API_android_provider_Settings__put_NEXT_ALARM_FORMATTED_);
+ value_to_put_map.put(Settings.System.RADIO_CELL,
+ SEEMP_API_android_provider_Settings__put_RADIO_CELL_);
+ value_to_put_map.put(Settings.System.PARENTAL_CONTROL_ENABLED,
+ SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_ENABLED_);
+ value_to_put_map.put(Settings.System.BLUETOOTH_ON,
+ SEEMP_API_android_provider_Settings__put_BLUETOOTH_ON_);
+ value_to_put_map.put(Settings.System.WINDOW_ANIMATION_SCALE,
+ SEEMP_API_android_provider_Settings__put_WINDOW_ANIMATION_SCALE_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_);
+ value_to_put_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY,
+ SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_);
+ value_to_put_map.put(Settings.System.WIFI_STATIC_DNS1,
+ SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS1_);
+ value_to_put_map.put(Settings.System.WIFI_STATIC_DNS2,
+ SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS2_);
+ value_to_put_map.put(Settings.System.HAPTIC_FEEDBACK_ENABLED,
+ SEEMP_API_android_provider_Settings__put_HAPTIC_FEEDBACK_ENABLED_);
+ value_to_put_map.put(Settings.System.SHOW_WEB_SUGGESTIONS,
+ SEEMP_API_android_provider_Settings__put_SHOW_WEB_SUGGESTIONS_);
+ value_to_put_map.put(Settings.System.PARENTAL_CONTROL_REDIRECT_URL,
+ SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_REDIRECT_URL_);
+ value_to_put_map.put(Settings.System.DATE_FORMAT,
+ SEEMP_API_android_provider_Settings__put_DATE_FORMAT_);
+ value_to_put_map.put(Settings.System.RADIO_NFC,
+ SEEMP_API_android_provider_Settings__put_RADIO_NFC_);
+ value_to_put_map.put(Settings.System.AIRPLANE_MODE_RADIOS,
+ SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_RADIOS_);
+ value_to_put_map.put(Settings.System.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED,
+ SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_);
+ value_to_put_map.put(Settings.System.TIME_12_24,
+ SEEMP_API_android_provider_Settings__put_TIME_12_24_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_);
+ value_to_put_map.put(Settings.System.VOLUME_BLUETOOTH_SCO,
+ SEEMP_API_android_provider_Settings__put_VOLUME_BLUETOOTH_SCO_);
+ value_to_put_map.put(Settings.System.USER_ROTATION,
+ SEEMP_API_android_provider_Settings__put_USER_ROTATION_);
+ value_to_put_map.put(Settings.System.WIFI_STATIC_GATEWAY,
+ SEEMP_API_android_provider_Settings__put_WIFI_STATIC_GATEWAY_);
+ value_to_put_map.put(Settings.System.STAY_ON_WHILE_PLUGGED_IN,
+ SEEMP_API_android_provider_Settings__put_STAY_ON_WHILE_PLUGGED_IN_);
+ value_to_put_map.put(Settings.System.SOUND_EFFECTS_ENABLED,
+ SEEMP_API_android_provider_Settings__put_SOUND_EFFECTS_ENABLED_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_PING_COUNT,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_COUNT_);
+ value_to_put_map.put(Settings.System.DATA_ROAMING,
+ SEEMP_API_android_provider_Settings__put_DATA_ROAMING_);
+ value_to_put_map.put(Settings.System.SETTINGS_CLASSNAME,
+ SEEMP_API_android_provider_Settings__put_SETTINGS_CLASSNAME_);
+ value_to_put_map.put(Settings.System.TRANSITION_ANIMATION_SCALE,
+ SEEMP_API_android_provider_Settings__put_TRANSITION_ANIMATION_SCALE_);
+ value_to_put_map.put(Settings.System.WAIT_FOR_DEBUGGER,
+ SEEMP_API_android_provider_Settings__put_WAIT_FOR_DEBUGGER_);
+ value_to_put_map.put(Settings.System.INSTALL_NON_MARKET_APPS,
+ SEEMP_API_android_provider_Settings__put_INSTALL_NON_MARKET_APPS_);
+ value_to_put_map.put(Settings.System.ADB_ENABLED,
+ SEEMP_API_android_provider_Settings__put_ADB_ENABLED_);
+ value_to_put_map.put(Settings.System.WIFI_USE_STATIC_IP,
+ SEEMP_API_android_provider_Settings__put_WIFI_USE_STATIC_IP_);
+ value_to_put_map.put(Settings.System.DIM_SCREEN,
+ SEEMP_API_android_provider_Settings__put_DIM_SCREEN_);
+ value_to_put_map.put(Settings.System.VOLUME_ALARM,
+ SEEMP_API_android_provider_Settings__put_VOLUME_ALARM_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_ON,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ON_);
+ value_to_put_map.put(Settings.System.WIFI_STATIC_NETMASK,
+ SEEMP_API_android_provider_Settings__put_WIFI_STATIC_NETMASK_);
+ value_to_put_map.put(Settings.System.NETWORK_PREFERENCE,
+ SEEMP_API_android_provider_Settings__put_NETWORK_PREFERENCE_);
+ value_to_put_map.put(Settings.System.SHOW_PROCESSES,
+ SEEMP_API_android_provider_Settings__put_SHOW_PROCESSES_);
+ value_to_put_map.put(Settings.System.TEXT_AUTO_REPLACE,
+ SEEMP_API_android_provider_Settings__put_TEXT_AUTO_REPLACE_);
+ value_to_put_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+ SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_);
+ value_to_put_map.put(Settings.System.APPEND_FOR_LAST_AUDIBLE,
+ SEEMP_API_android_provider_Settings__put_APPEND_FOR_LAST_AUDIBLE_);
+ value_to_put_map.put(Settings.System.SHOW_GTALK_SERVICE_STATUS,
+ SEEMP_API_android_provider_Settings__put_SHOW_GTALK_SERVICE_STATUS_);
+ value_to_put_map.put(Settings.System.SCREEN_BRIGHTNESS,
+ SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_);
+ value_to_put_map.put(Settings.System.USE_GOOGLE_MAIL,
+ SEEMP_API_android_provider_Settings__put_USE_GOOGLE_MAIL_);
+ value_to_put_map.put(Settings.System.RINGTONE,
+ SEEMP_API_android_provider_Settings__put_RINGTONE_);
+ value_to_put_map.put(Settings.System.LOGGING_ID,
+ SEEMP_API_android_provider_Settings__put_LOGGING_ID_);
+ value_to_put_map.put(Settings.System.MODE_RINGER,
+ SEEMP_API_android_provider_Settings__put_MODE_RINGER_);
+ value_to_put_map.put(Settings.System.MUTE_STREAMS_AFFECTED,
+ SEEMP_API_android_provider_Settings__put_MUTE_STREAMS_AFFECTED_);
+ value_to_put_map.put(Settings.System.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE,
+ SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_);
+ value_to_put_map.put(Settings.System.TEXT_AUTO_PUNCTUATE,
+ SEEMP_API_android_provider_Settings__put_TEXT_AUTO_PUNCTUATE_);
+ value_to_put_map.put(Settings.System.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS,
+ SEEMP_API_android_provider_Settings__put_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_);
+ value_to_put_map.put(Settings.System.SCREEN_BRIGHTNESS_MODE,
+ SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_);
+ }
+
+ public static int getSeempPutApiIdFromValue( String v )
+ {
+ Integer result = value_to_put_map.get( v );
+ if (result == null)
+ {
+ result = -1;
+ }
+ return result;
+ }
+}
diff --git a/core/java/android/util/SparseArrayMap.java b/core/java/android/util/SparseArrayMap.java
index 3287c279c87f..17a4c3aa865c 100644
--- a/core/java/android/util/SparseArrayMap.java
+++ b/core/java/android/util/SparseArrayMap.java
@@ -18,6 +18,7 @@ package android.util;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.annotation.TestApi;
import java.util.function.Consumer;
@@ -78,6 +79,7 @@ public class SparseArrayMap<K, V> {
/**
* Get the value associated with the int-K pair.
*/
+ @SuppressLint("KotlinOperator")
@Nullable
public V get(int key, @NonNull K mapKey) {
ArrayMap<K, V> data = mData.get(key);
diff --git a/core/java/android/util/TrustedTime.java b/core/java/android/util/TrustedTime.java
index f279bdb79420..ca236ed7e42f 100644
--- a/core/java/android/util/TrustedTime.java
+++ b/core/java/android/util/TrustedTime.java
@@ -30,6 +30,12 @@ public interface TrustedTime {
/**
* Force update with an external trusted time source, returning {@code true}
* when successful.
+ */
+ public boolean forceSync();
+
+ /**
+ * Force update the cached time with an external trusted time source,
+ * returning {@code true} when successful.
*
* @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
*/
diff --git a/core/java/android/util/apk/ApkSignatureVerifier.java b/core/java/android/util/apk/ApkSignatureVerifier.java
index 73f7543ba819..36d97af6fb0d 100644
--- a/core/java/android/util/apk/ApkSignatureVerifier.java
+++ b/core/java/android/util/apk/ApkSignatureVerifier.java
@@ -30,7 +30,10 @@ import android.content.pm.Signature;
import android.content.pm.parsing.ParsingPackageUtils;
import android.os.Build;
import android.os.Trace;
+import android.util.ArrayMap;
+import android.util.Slog;
import android.util.jar.StrictJarFile;
+import android.util.BoostFramework;
import com.android.internal.util.ArrayUtils;
@@ -49,6 +52,9 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.zip.ZipEntry;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.LinkedBlockingQueue;
/**
* Facade class that takes care of the details of APK verification on
@@ -60,6 +66,12 @@ public class ApkSignatureVerifier {
private static final AtomicReference<byte[]> sBuffer = new AtomicReference<>();
+ private static final String TAG = "ApkSignatureVerifier";
+ // multithread verification
+ private static final int NUMBER_OF_CORES =
+ Runtime.getRuntime().availableProcessors() >= 4 ? 4 : Runtime.getRuntime().availableProcessors() ;
+ private static BoostFramework sPerfBoost = null;
+ private static boolean sIsPerfLockAcquired = false;
/**
* Verifies the provided APK and returns the certificates associated with each signer.
*
@@ -354,31 +366,44 @@ public class ApkSignatureVerifier {
*/
private static SigningDetailsWithDigests verifyV1Signature(String apkPath, boolean verifyFull)
throws PackageParserException {
- StrictJarFile jarFile = null;
-
+ int objectNumber = verifyFull ? NUMBER_OF_CORES : 1;
+ StrictJarFile[] jarFile = new StrictJarFile[objectNumber];
+ final ArrayMap<String, StrictJarFile> strictJarFiles = new ArrayMap<String, StrictJarFile>();
try {
final Certificate[][] lastCerts;
final Signature[] lastSigs;
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "strictJarFileCtor");
+ if (sPerfBoost == null) {
+ sPerfBoost = new BoostFramework();
+ }
+ if (sPerfBoost != null && !sIsPerfLockAcquired && verifyFull) {
+ //Use big enough number here to hold the perflock for entire PackageInstall session
+ sPerfBoost.perfHint(BoostFramework.VENDOR_HINT_PACKAGE_INSTALL_BOOST,
+ null, Integer.MAX_VALUE, -1);
+ Slog.d(TAG, "Perflock acquired for PackageInstall ");
+ sIsPerfLockAcquired = true;
+ }
// we still pass verify = true to ctor to collect certs, even though we're not checking
// the whole jar.
- jarFile = new StrictJarFile(
- apkPath,
- true, // collect certs
- verifyFull); // whether to reject APK with stripped v2 signatures (b/27887819)
+ for (int i = 0; i < objectNumber; i++) {
+ jarFile[i] = new StrictJarFile(
+ apkPath,
+ true, // collect certs
+ verifyFull); // whether to reject APK with stripped v2 signatures (b/27887819)
+ }
final List<ZipEntry> toVerify = new ArrayList<>();
// Gather certs from AndroidManifest.xml, which every APK must have, as an optimization
// to not need to verify the whole APK when verifyFUll == false.
- final ZipEntry manifestEntry = jarFile.findEntry(
+ final ZipEntry manifestEntry = jarFile[0].findEntry(
ParsingPackageUtils.ANDROID_MANIFEST_FILENAME);
if (manifestEntry == null) {
throw new PackageParserException(INSTALL_PARSE_FAILED_BAD_MANIFEST,
"Package " + apkPath + " has no manifest");
}
- lastCerts = loadCertificates(jarFile, manifestEntry);
+ lastCerts = loadCertificates(jarFile[0], manifestEntry);
if (ArrayUtils.isEmpty(lastCerts)) {
throw new PackageParserException(INSTALL_PARSE_FAILED_NO_CERTIFICATES, "Package "
+ apkPath + " has no certificates at entry "
@@ -388,7 +413,7 @@ public class ApkSignatureVerifier {
// fully verify all contents, except for AndroidManifest.xml and the META-INF/ files.
if (verifyFull) {
- final Iterator<ZipEntry> i = jarFile.iterator();
+ final Iterator<ZipEntry> i = jarFile[0].iterator();
while (i.hasNext()) {
final ZipEntry entry = i.next();
if (entry.isDirectory()) continue;
@@ -399,24 +424,93 @@ public class ApkSignatureVerifier {
toVerify.add(entry);
}
-
+ class VerificationData {
+ public Exception exception;
+ public int exceptionFlag;
+ public boolean wait;
+ public int index;
+ public Object objWaitAll;
+ public boolean shutDown;
+ }
+ VerificationData vData = new VerificationData();
+ vData.objWaitAll = new Object();
+ final ThreadPoolExecutor verificationExecutor = new ThreadPoolExecutor(
+ NUMBER_OF_CORES,
+ NUMBER_OF_CORES,
+ 1,/*keep alive time*/
+ TimeUnit.SECONDS,
+ new LinkedBlockingQueue<Runnable>());
for (ZipEntry entry : toVerify) {
- final Certificate[][] entryCerts = loadCertificates(jarFile, entry);
- if (ArrayUtils.isEmpty(entryCerts)) {
- throw new PackageParserException(INSTALL_PARSE_FAILED_NO_CERTIFICATES,
- "Package " + apkPath + " has no certificates at entry "
- + entry.getName());
+ Runnable verifyTask = new Runnable(){
+ public void run() {
+ try {
+ if (vData.exceptionFlag != 0 ) {
+ Slog.w(TAG, "VerifyV1 exit with exception " + vData.exceptionFlag);
+ return;
+ }
+ String tid = Long.toString(Thread.currentThread().getId());
+ StrictJarFile tempJarFile;
+ synchronized (strictJarFiles) {
+ tempJarFile = strictJarFiles.get(tid);
+ if (tempJarFile == null) {
+ if (vData.index >= NUMBER_OF_CORES) {
+ vData.index = 0;
+ }
+ tempJarFile = jarFile[vData.index++];
+ strictJarFiles.put(tid, tempJarFile);
+ }
+ }
+ final Certificate[][] entryCerts = loadCertificates(tempJarFile, entry);
+ if (ArrayUtils.isEmpty(entryCerts)) {
+ throw new PackageParserException(INSTALL_PARSE_FAILED_NO_CERTIFICATES,
+ "Package " + apkPath + " has no certificates at entry "
+ + entry.getName());
+ }
+
+ // make sure all entries use the same signing certs
+ final Signature[] entrySigs = convertToSignatures(entryCerts);
+ if (!Signature.areExactMatch(lastSigs, entrySigs)) {
+ throw new PackageParserException(
+ INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES,
+ "Package " + apkPath + " has mismatched certificates at entry "
+ + entry.getName());
+ }
+ } catch (GeneralSecurityException e) {
+ synchronized (vData.objWaitAll) {
+ vData.exceptionFlag = INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING;
+ vData.exception = e;
+ }
+ } catch (PackageParserException e) {
+ synchronized (vData.objWaitAll) {
+ vData.exceptionFlag = INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION;
+ vData.exception = e;
+ }
+ }
+ }};
+ synchronized (vData.objWaitAll) {
+ if (vData.exceptionFlag == 0) {
+ verificationExecutor.execute(verifyTask);
+ }
}
-
- // make sure all entries use the same signing certs
- final Signature[] entrySigs = convertToSignatures(entryCerts);
- if (!Signature.areExactMatch(lastSigs, entrySigs)) {
- throw new PackageParserException(
- INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES,
- "Package " + apkPath + " has mismatched certificates at entry "
- + entry.getName());
+ }
+ vData.wait = true;
+ verificationExecutor.shutdown();
+ while (vData.wait) {
+ try {
+ if (vData.exceptionFlag != 0 && !vData.shutDown) {
+ Slog.w(TAG, "verifyV1 Exception " + vData.exceptionFlag);
+ verificationExecutor.shutdownNow();
+ vData.shutDown = true;
+ }
+ vData.wait = !verificationExecutor.awaitTermination(50,
+ TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ Slog.w(TAG,"VerifyV1 interrupted while awaiting all threads done...");
}
}
+ if (vData.exceptionFlag != 0)
+ throw new PackageParserException(vData.exceptionFlag,
+ "Failed to collect certificates from " + apkPath, vData.exception);
}
return new SigningDetailsWithDigests(
new PackageParser.SigningDetails(lastSigs, SignatureSchemeVersion.JAR), null);
@@ -427,8 +521,16 @@ public class ApkSignatureVerifier {
throw new PackageParserException(INSTALL_PARSE_FAILED_NO_CERTIFICATES,
"Failed to collect certificates from " + apkPath, e);
} finally {
+ if (sIsPerfLockAcquired && sPerfBoost != null) {
+ sPerfBoost.perfLockRelease();
+ sIsPerfLockAcquired = false;
+ Slog.d(TAG, "Perflock released for PackageInstall ");
+ }
+ strictJarFiles.clear();
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
- closeQuietly(jarFile);
+ for (int i = 0; i < objectNumber ; i++) {
+ closeQuietly(jarFile[i]);
+ }
}
}
diff --git a/core/java/android/view/Choreographer.java b/core/java/android/view/Choreographer.java
index be172f748b55..39beeeae11de 100644
--- a/core/java/android/view/Choreographer.java
+++ b/core/java/android/view/Choreographer.java
@@ -31,6 +31,7 @@ import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
+import android.util.BoostFramework.ScrollOptimizer;
import android.util.Log;
import android.util.TimeUtils;
import android.view.animation.AnimationUtils;
@@ -84,6 +85,7 @@ public final class Choreographer {
// Prints debug messages about jank which was detected (low volume).
private static final boolean DEBUG_JANK = false;
+ private static final boolean OPTS_INPUT = true;
// Prints debug messages about every frame and callback registered (high volume).
private static final boolean DEBUG_FRAMES = false;
@@ -151,6 +153,11 @@ public final class Choreographer {
private static final int MSG_DO_SCHEDULE_VSYNC = 1;
private static final int MSG_DO_SCHEDULE_CALLBACK = 2;
+ private static final int MOTION_EVENT_ACTION_DOWN = 0;
+ private static final int MOTION_EVENT_ACTION_UP = 1;
+ private static final int MOTION_EVENT_ACTION_MOVE = 2;
+ private static final int MOTION_EVENT_ACTION_CANCEL = 3;
+
// All frame callbacks posted by applications have this token.
private static final Object FRAME_CALLBACK_TOKEN = new Object() {
public String toString() { return "FRAME_CALLBACK_TOKEN"; }
@@ -189,6 +196,13 @@ public final class Choreographer {
private int mFPSDivisor = 1;
private DisplayEventReceiver.VsyncEventData mLastVsyncEventData =
new DisplayEventReceiver.VsyncEventData();
+ private int mTouchMoveNum = -1;
+ private int mMotionEventType = -1;
+ private boolean mConsumedMove = false;
+ private boolean mConsumedDown = false;
+ private boolean mIsVsyncScheduled = false;
+ private long mLastTouchOptTimeNanos = 0;
+ private boolean mIsDoFrameProcessing = false;
/**
* Contains information about the current frame for jank-tracking,
@@ -270,6 +284,7 @@ public final class Choreographer {
mLastFrameTimeNanos = Long.MIN_VALUE;
mFrameIntervalNanos = (long)(1000000000 / getRefreshRate());
+ ScrollOptimizer.setFrameInterval(mFrameIntervalNanos);
mCallbackQueues = new CallbackQueue[CALLBACK_LAST + 1];
for (int i = 0; i <= CALLBACK_LAST; i++) {
@@ -305,6 +320,17 @@ public final class Choreographer {
}
/**
+ * {@hide}
+ */
+ public void setMotionEventInfo(int motionEventType, int touchMoveNum) {
+ synchronized(this) {
+ mTouchMoveNum = touchMoveNum;
+ mMotionEventType = motionEventType;
+ ScrollOptimizer.setMotionType(mMotionEventType);
+ }
+ }
+
+ /**
* @return The Choreographer of the main thread, if it exists, or {@code null} otherwise.
* @hide
*/
@@ -636,7 +662,55 @@ public final class Choreographer {
private void scheduleFrameLocked(long now) {
if (!mFrameScheduled) {
mFrameScheduled = true;
- if (USE_VSYNC) {
+ if (OPTS_INPUT) {
+ if (!mIsVsyncScheduled) {
+ long curr = System.nanoTime();
+ boolean skipFlag = curr - mLastTouchOptTimeNanos < mFrameIntervalNanos;
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, "scheduleFrameLocked-mMotionEventType:"
+ + mMotionEventType + " mTouchMoveNum:"+ mTouchMoveNum
+ + " mConsumedDown:" + mConsumedDown
+ + " mConsumedMove:" + mConsumedMove
+ + " mIsDoFrameProcessing:" + mIsDoFrameProcessing
+ + " skip:" + skipFlag
+ + " diff:" + (curr - mLastTouchOptTimeNanos));
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
+ synchronized(this) {
+ switch(mMotionEventType) {
+ case MOTION_EVENT_ACTION_DOWN:
+ mConsumedMove = false;
+ if (!mConsumedDown && !skipFlag && !mIsDoFrameProcessing) {
+ Message msg = mHandler.obtainMessage(MSG_DO_FRAME);
+ msg.setAsynchronous(true);
+ mHandler.sendMessageAtFrontOfQueue(msg);
+ mLastTouchOptTimeNanos = System.nanoTime();
+ mConsumedDown = true;
+ return;
+ }
+ break;
+ case MOTION_EVENT_ACTION_MOVE:
+ mConsumedDown = false;
+ //if ((mTouchMoveNum == 1) && !mConsumedMove && !skipFlag) {
+ if (!mConsumedMove && !skipFlag && !mIsDoFrameProcessing) {
+ Message msg = mHandler.obtainMessage(MSG_DO_FRAME);
+ msg.setAsynchronous(true);
+ mHandler.sendMessageAtFrontOfQueue(msg);
+ mLastTouchOptTimeNanos = System.nanoTime();
+ mConsumedMove = true;
+ return;
+ }
+ break;
+ case MOTION_EVENT_ACTION_UP:
+ case MOTION_EVENT_ACTION_CANCEL:
+ mConsumedMove = false;
+ mConsumedDown = false;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ if (ScrollOptimizer.shouldUseVsync(USE_VSYNC)) {
if (DEBUG_FRAMES) {
Log.d(TAG, "Scheduling next frame on vsync.");
}
@@ -652,6 +726,8 @@ public final class Choreographer {
mHandler.sendMessageAtFrontOfQueue(msg);
}
} else {
+ sFrameDelay = ScrollOptimizer.getFrameDelay(sFrameDelay,
+ mLastFrameTimeNanos);
final long nextFrameTime = Math.max(
mLastFrameTimeNanos / TimeUtils.NANOS_PER_MS + sFrameDelay, now);
if (DEBUG_FRAMES) {
@@ -703,11 +779,13 @@ public final class Choreographer {
final long startNanos;
final long frameIntervalNanos = vsyncEventData.frameInterval;
try {
+ mIsDoFrameProcessing = true;
if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
Trace.traceBegin(Trace.TRACE_TAG_VIEW,
"Choreographer#doFrame " + vsyncEventData.id);
}
synchronized (mLock) {
+ mIsVsyncScheduled = false;
if (!mFrameScheduled) {
traceMessage("Frame not scheduled");
return; // no work to do
@@ -766,6 +844,7 @@ public final class Choreographer {
mLastVsyncEventData = vsyncEventData;
}
+ ScrollOptimizer.setUITaskStatus(true);
AnimationUtils.lockAnimationClock(frameTimeNanos / TimeUtils.NANOS_PER_MS);
mFrameInfo.markInputHandlingStart();
@@ -780,6 +859,7 @@ public final class Choreographer {
doCallbacks(Choreographer.CALLBACK_TRAVERSAL, frameTimeNanos, frameIntervalNanos);
doCallbacks(Choreographer.CALLBACK_COMMIT, frameTimeNanos, frameIntervalNanos);
+ ScrollOptimizer.setUITaskStatus(false);
} finally {
AnimationUtils.unlockAnimationClock();
Trace.traceEnd(Trace.TRACE_TAG_VIEW);
@@ -791,6 +871,7 @@ public final class Choreographer {
+ (endNanos - startNanos) * 0.000001f + " ms, latency "
+ (startNanos - frameTimeNanos) * 0.000001f + " ms.");
}
+ mIsDoFrameProcessing = false;
}
void doCallbacks(int callbackType, long frameTimeNanos, long frameIntervalNanos) {
@@ -881,6 +962,7 @@ public final class Choreographer {
try {
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "Choreographer#scheduleVsyncLocked");
mDisplayEventReceiver.scheduleVsync();
+ mIsVsyncScheduled = true;
} finally {
Trace.traceEnd(Trace.TRACE_TAG_VIEW);
}
@@ -1008,6 +1090,7 @@ public final class Choreographer {
mTimestampNanos = timestampNanos;
mFrame = frame;
mLastVsyncEventData = vsyncEventData;
+ ScrollOptimizer.setVsyncTime(mTimestampNanos);
Message msg = Message.obtain(mHandler, this);
msg.setAsynchronous(true);
mHandler.sendMessageAtTime(msg, timestampNanos / TimeUtils.NANOS_PER_MS);
diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java
index c1a5636b7b34..0632dbc6b691 100644
--- a/core/java/android/view/DisplayCutout.java
+++ b/core/java/android/view/DisplayCutout.java
@@ -38,6 +38,7 @@ import android.graphics.Path;
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.SystemProperties;
import android.text.TextUtils;
import android.util.DisplayUtils;
import android.util.Pair;
@@ -1038,7 +1039,11 @@ public final class DisplayCutout {
if (TextUtils.isEmpty(spec) && waterfallInsets.equals(Insets.NONE)) {
return NULL_PAIR;
}
-
+ int disableRoundedCorner =
+ SystemProperties.getInt("vendor.display.disable_rounded_corner", 0);
+ if (disableRoundedCorner == 1) {
+ return NULL_PAIR;
+ }
synchronized (CACHE_LOCK) {
if (spec.equals(sCachedSpec) && sCachedDisplayWidth == displayWidth
&& sCachedDisplayHeight == displayHeight
diff --git a/core/java/android/view/InputEventReceiver.java b/core/java/android/view/InputEventReceiver.java
index 25dda5b2e0bb..f28242aa8215 100644
--- a/core/java/android/view/InputEventReceiver.java
+++ b/core/java/android/view/InputEventReceiver.java
@@ -49,6 +49,7 @@ public abstract class InputEventReceiver {
// Map from InputEvent sequence numbers to dispatcher sequence numbers.
private final SparseIntArray mSeqMap = new SparseIntArray();
+ Choreographer mChoreographer;
private static native long nativeInit(WeakReference<InputEventReceiver> receiver,
InputChannel inputChannel, MessageQueue messageQueue);
@@ -259,6 +260,19 @@ public abstract class InputEventReceiver {
onInputEvent(event);
}
+ // Called from native code.
+ @SuppressWarnings("unused")
+ private void dispatchMotionEventInfo(int motionEventType, int touchMoveNum) {
+ try {
+ if (mChoreographer == null)
+ mChoreographer = Choreographer.getInstance();
+
+ if (mChoreographer != null)
+ mChoreographer.setMotionEventInfo(motionEventType, touchMoveNum);
+ } catch (Exception e) {
+ Log.e(TAG, "cannot invoke setMotionEventInfo.");
+ }
+ }
/**
* Dump the state of this InputEventReceiver to the writer.
* @param prefix the prefix (typically whitespace padding) to append in front of each line
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 0e49cc967656..49a55a43b7ab 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -859,6 +859,26 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
}
}
+ /**
+ * Control whether the surface view's content should flow through
+ * protected hardware path to display disallowing access from non-secure
+ * execution environments.
+ *
+ * <p>Note that this must be set before the surface view's containing
+ * window is attached to the window manager.
+ *
+ * @param isProtected True if the surface view is protected.
+ *
+ * @hide
+ */
+ public void setProtected(boolean isProtected) {
+ if (isProtected) {
+ mSurfaceFlags |= SurfaceControl.PROTECTED_APP;
+ } else {
+ mSurfaceFlags &= ~SurfaceControl.PROTECTED_APP;
+ }
+ }
+
private void updateOpaqueFlag() {
if (!PixelFormat.formatHasAlpha(mRequestedFormat)) {
mSurfaceFlags |= SurfaceControl.OPAQUE;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index f4386099a550..79e52995ade3 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -14580,6 +14580,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
final int actionMasked = event.getActionMasked();
if (actionMasked == MotionEvent.ACTION_DOWN) {
+ android.util.SeempLog.record(3);
// Defensive cleanup for new gesture
stopNestedScroll();
}
@@ -15260,6 +15261,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @param event the KeyEvent object that defines the button action
*/
public boolean onKeyDown(int keyCode, KeyEvent event) {
+ android.util.SeempLog.record(4);
if (KeyEvent.isConfirmKey(keyCode)) {
if ((mViewFlags & ENABLED_MASK) == DISABLED) {
return true;
@@ -15317,6 +15319,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @param event The KeyEvent object that defines the button action.
*/
public boolean onKeyUp(int keyCode, KeyEvent event) {
+ android.util.SeempLog.record(5);
if (KeyEvent.isConfirmKey(keyCode)) {
if ((mViewFlags & ENABLED_MASK) == DISABLED) {
return true;
@@ -15961,6 +15964,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @return True if the event was handled, false otherwise.
*/
public boolean onTouchEvent(MotionEvent event) {
+ android.util.SeempLog.record(3);
final float x = event.getX();
final float y = event.getY();
final int viewFlags = mViewFlags;
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 0b19f4f44653..6584c66950d5 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -141,6 +141,7 @@ import android.os.UserHandle;
import android.sysprop.DisplayProperties;
import android.util.AndroidRuntimeException;
import android.util.ArraySet;
+import android.util.BoostFramework.ScrollOptimizer;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.IndentingPrintWriter;
@@ -791,6 +792,7 @@ public final class ViewRootImpl implements ViewParent,
private int mSurfaceSequenceId = 0;
private String mTag = TAG;
+ boolean mHaveMoveEvent = false;
public ViewRootImpl(Context context, Display display) {
this(context, display, WindowManagerGlobal.getWindowSession(),
@@ -2026,6 +2028,7 @@ public final class ViewRootImpl implements ViewParent,
mSurfaceSize.x, mSurfaceSize.y,
mWindowAttributes.format);
}
+ ScrollOptimizer.setBLASTBufferQueue(mBlastBufferQueue);
return ret;
}
@@ -6450,6 +6453,12 @@ public final class ViewRootImpl implements ViewParent,
mAttachInfo.mUnbufferedDispatchRequested = false;
mAttachInfo.mHandlingPointerEvent = true;
boolean handled = mView.dispatchPointerEvent(event);
+ int action = event.getActionMasked();
+ if (action == MotionEvent.ACTION_MOVE) {
+ mHaveMoveEvent = true;
+ } else if (action == MotionEvent.ACTION_UP) {
+ mHaveMoveEvent = false;
+ }
maybeUpdatePointerIcon(event);
maybeUpdateTooltip(event);
mAttachInfo.mHandlingPointerEvent = false;
@@ -8635,6 +8644,7 @@ public final class ViewRootImpl implements ViewParent,
}
void doProcessInputEvents() {
+ ScrollOptimizer.setBLASTBufferQueue(mBlastBufferQueue);
// Deliver all pending input events in the queue.
while (mPendingInputEventHead != null) {
QueuedInputEvent q = mPendingInputEventHead;
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index a2d3e3447354..3ad4e353f0cb 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -134,6 +134,7 @@ public final class WindowManagerImpl implements WindowManager {
@Override
public void addView(@NonNull View view, @NonNull ViewGroup.LayoutParams params) {
+ android.util.SeempLog.record_vg_layout(383,params);
applyTokens(params);
mGlobal.addView(view, params, mContext.getDisplayNoVerify(), mParentWindow,
mContext.getUserId());
@@ -141,6 +142,7 @@ public final class WindowManagerImpl implements WindowManager {
@Override
public void updateViewLayout(@NonNull View view, @NonNull ViewGroup.LayoutParams params) {
+ android.util.SeempLog.record_vg_layout(384,params);
applyTokens(params);
mGlobal.updateViewLayout(view, params);
}
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index e6f103e6d53b..fede0dfa94db 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -67,6 +67,7 @@ import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.text.style.SuggestionSpan;
+import android.util.BoostFramework;
import android.util.Log;
import android.util.Pools.Pool;
import android.util.Pools.SimplePool;
@@ -270,6 +271,11 @@ public final class InputMethodManager {
*/
private static final String SUBTYPE_MODE_VOICE = "voice";
+ //Perf
+ static BoostFramework mPerfBoost = null;
+ static boolean IME_BOOST_ENABLED = false;
+ static boolean isImeBoostPropertyRead = false;
+
/**
* Ensures that {@link #sInstance} becomes non-{@code null} for application that have directly
* or indirectly relied on {@link #sInstance} via reflection or something like that.
@@ -586,6 +592,20 @@ public final class InputMethodManager {
ImeTracing.getInstance().triggerClientDump(
"InputMethodManager.DelegateImpl#startInput", InputMethodManager.this,
null /* icProto */);
+
+ if (isImeBoostPropertyRead == false) {
+ mPerfBoost = new BoostFramework();
+
+ if (mPerfBoost != null) {
+ IME_BOOST_ENABLED = Boolean.parseBoolean(mPerfBoost.perfGetProp("ro.vendor.qti.sys.fw.use_ime_boost", "false"));
+ }
+ isImeBoostPropertyRead = true;
+ }
+
+ if (IME_BOOST_ENABLED == true && mPerfBoost != null) {
+ mPerfBoost.perfEvent(BoostFramework.VENDOR_HINT_IME_LAUNCH_EVENT, null);
+ }
+
synchronized (mH) {
mCurrentTextBoxAttribute = null;
mCompletions = null;
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index 4a6551176198..5a5709d65c8f 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -402,7 +402,9 @@ public class WebChromeClient {
* origin.
*/
public void onGeolocationPermissionsShowPrompt(String origin,
- GeolocationPermissions.Callback callback) {}
+ GeolocationPermissions.Callback callback) {
+ android.util.SeempLog.record(54);
+ }
/**
* Notify the host application that a request for Geolocation permissions,
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 1244d750e164..ac21d952765d 100644..100755
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -36,6 +36,7 @@ import android.os.Handler;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.StrictMode;
+import android.os.SystemProperties;
import android.os.Trace;
import android.text.Editable;
import android.text.InputType;
@@ -116,6 +117,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
@SuppressWarnings("UnusedDeclaration")
private static final String TAG = "AbsListView";
+ private static final boolean OPTS_INPUT = true;
+ private static final double MOVE_TOUCH_SLOP = 0.6;
+ private static final double TOUCH_SLOP_MIN = 0.6;
+ private static final double TOUCH_SLOP_MAX = 1.0;
/**
* Disables the transcript mode.
@@ -785,6 +790,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
*/
private boolean mIsDetaching;
+ private boolean mIsFirstTouchMoveEvent = false;
+ private int mMoveAcceleration;
+ private int mNumTouchMoveEvent = 0;
+
/**
* Interface definition for a callback to be invoked when the list or grid
* has been scrolled.
@@ -932,6 +941,20 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final ViewConfiguration configuration = ViewConfiguration.get(mContext);
mTouchSlop = configuration.getScaledTouchSlop();
mVerticalScrollFactor = configuration.getScaledVerticalScrollFactor();
+ if (OPTS_INPUT) {
+ double touchslopprop = MOVE_TOUCH_SLOP;
+ if (touchslopprop > 0) {
+ if (touchslopprop < TOUCH_SLOP_MIN) {
+ mMoveAcceleration = (int)(mTouchSlop * TOUCH_SLOP_MIN);
+ } else if ((touchslopprop >= TOUCH_SLOP_MIN) && (touchslopprop < TOUCH_SLOP_MAX)){
+ mMoveAcceleration = (int)(mTouchSlop * touchslopprop);
+ } else {
+ mMoveAcceleration = mTouchSlop;
+ }
+ } else {
+ mMoveAcceleration = mTouchSlop;
+ }
+ }
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mOverscrollDistance = configuration.getScaledOverscrollDistance();
@@ -3541,7 +3564,18 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int deltaY = y - mMotionY;
final int distance = Math.abs(deltaY);
final boolean overscroll = mScrollY != 0;
- if ((overscroll || distance > mTouchSlop) &&
+ boolean isFarEnough = false;
+ if (OPTS_INPUT) {
+ if (mIsFirstTouchMoveEvent) {
+ isFarEnough = distance > mMoveAcceleration;
+ } else {
+ isFarEnough = distance > mTouchSlop;
+ }
+ } else {
+ isFarEnough = distance > mTouchSlop;
+ }
+
+ if ((overscroll || isFarEnough) &&
(getNestedScrollAxes() & SCROLL_AXIS_VERTICAL) == 0) {
createScrollingCache();
if (overscroll) {
@@ -3549,7 +3583,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mMotionCorrection = 0;
} else {
mTouchMode = TOUCH_MODE_SCROLL;
- mMotionCorrection = deltaY > 0 ? mTouchSlop : -mTouchSlop;
+ if (mIsFirstTouchMoveEvent) {
+ mMotionCorrection = deltaY > 0 ? mMoveAcceleration : -mMoveAcceleration;
+ } else {
+ mMotionCorrection = deltaY > 0 ? mTouchSlop : -mTouchSlop;
+ }
}
removeCallbacks(mPendingCheckForLongPress);
setPressed(false);
@@ -3897,21 +3935,38 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
switch (actionMasked) {
case MotionEvent.ACTION_DOWN: {
onTouchDown(ev);
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
break;
}
case MotionEvent.ACTION_MOVE: {
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent++;
+ if (mNumTouchMoveEvent == 1) {
+ mIsFirstTouchMoveEvent = true;
+ } else {
+ mIsFirstTouchMoveEvent = false;
+ }
+ }
onTouchMove(ev, vtev);
break;
}
case MotionEvent.ACTION_UP: {
onTouchUp(ev);
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
break;
}
case MotionEvent.ACTION_CANCEL: {
onTouchCancel();
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
break;
}
@@ -3927,6 +3982,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mMotionPosition = motionPosition;
}
mLastY = y;
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
break;
}
@@ -3948,6 +4006,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mMotionPosition = motionPosition;
}
mLastY = y;
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
break;
}
}
@@ -4552,6 +4613,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
switch (actionMasked) {
case MotionEvent.ACTION_DOWN: {
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
int touchMode = mTouchMode;
if (touchMode == TOUCH_MODE_OVERFLING || touchMode == TOUCH_MODE_OVERSCROLL) {
mMotionCorrection = 0;
@@ -4589,6 +4653,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
case MotionEvent.ACTION_MOVE: {
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent++;
+ if (mNumTouchMoveEvent == 1) {
+ mIsFirstTouchMoveEvent = true;
+ } else {
+ mIsFirstTouchMoveEvent = false;
+ }
+ }
switch (mTouchMode) {
case TOUCH_MODE_DOWN:
int pointerIndex = ev.findPointerIndex(mActivePointerId);
@@ -4609,6 +4681,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP: {
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
mTouchMode = TOUCH_MODE_REST;
mActivePointerId = INVALID_POINTER;
recycleVelocityTracker();
@@ -4618,6 +4693,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
case MotionEvent.ACTION_POINTER_UP: {
+ if (OPTS_INPUT) {
+ mNumTouchMoveEvent = 0;
+ }
onSecondaryPointerUp(ev);
break;
}
diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java
index 1683878cd8b2..bf4c73ca4740 100644
--- a/core/java/android/widget/OverScroller.java
+++ b/core/java/android/widget/OverScroller.java
@@ -20,10 +20,12 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.hardware.SensorManager;
import android.os.Build;
+import android.util.BoostFramework.ScrollOptimizer;
import android.util.Log;
import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
+import android.os.SystemProperties;
/**
* This class encapsulates scrolling with the ability to overshoot the bounds
@@ -162,6 +164,9 @@ public class OverScroller {
*/
public final void forceFinished(boolean finished) {
mScrollerX.mFinished = mScrollerY.mFinished = finished;
+ if (finished && mMode == FLING_MODE) {
+ ScrollOptimizer.setFlingFlag(ScrollOptimizer.FLING_END);
+ }
}
/**
@@ -286,6 +291,9 @@ public class OverScroller {
*/
public boolean computeScrollOffset() {
if (isFinished()) {
+ if (mMode == FLING_MODE) {
+ ScrollOptimizer.setFlingFlag(ScrollOptimizer.FLING_END);
+ }
return false;
}
@@ -323,6 +331,9 @@ public class OverScroller {
}
}
+ if (isFinished()) {
+ ScrollOptimizer.setFlingFlag(ScrollOptimizer.FLING_END);
+ }
break;
}
@@ -432,6 +443,8 @@ public class OverScroller {
}
}
+ ScrollOptimizer.setFlingFlag(ScrollOptimizer.FLING_START);
+
mMode = FLING_MODE;
mScrollerX.fling(startX, velocityX, minX, maxX, overX);
mScrollerY.fling(startY, velocityY, minY, maxY, overY);
@@ -499,6 +512,9 @@ public class OverScroller {
* @see #forceFinished(boolean)
*/
public void abortAnimation() {
+ if (mMode == FLING_MODE) {
+ ScrollOptimizer.setFlingFlag(ScrollOptimizer.FLING_END);
+ }
mScrollerX.finish();
mScrollerY.finish();
}
@@ -529,6 +545,7 @@ public class OverScroller {
static class SplineOverScroller {
// Initial position
+ private Context mContext;
private int mStart;
// Current position
@@ -630,6 +647,7 @@ public class OverScroller {
}
SplineOverScroller(Context context) {
+ mContext = context;
mFinished = true;
final float ppi = context.getResources().getDisplayMetrics().density * 160.0f;
mPhysicalCoeff = SensorManager.GRAVITY_EARTH // g (m/s^2)
@@ -832,7 +850,7 @@ public class OverScroller {
}
void notifyEdgeReached(int start, int end, int over) {
- // mState is used to detect successive notifications
+ // mState is used to detect successive notifications
if (mState == SPLINE) {
mOver = over;
mStartTime = AnimationUtils.currentAnimationTimeMillis();
@@ -897,9 +915,10 @@ public class OverScroller {
*/
boolean update() {
final long time = AnimationUtils.currentAnimationTimeMillis();
- final long currentTime = time - mStartTime;
+ final long adjustedTime = ScrollOptimizer.getAdjustedAnimationClock(time);
+ final long currentTime = adjustedTime - mStartTime;
- if (currentTime == 0) {
+ if (currentTime <= 0) {
// Skip work but report that we're still going if we have a nonzero duration.
return mDuration > 0;
}
@@ -939,8 +958,8 @@ public class OverScroller {
final float t = (float) (currentTime) / mDuration;
final float t2 = t * t;
final float sign = Math.signum(mVelocity);
- distance = sign * mOver * (3.0f * t2 - 2.0f * t * t2);
- mCurrVelocity = sign * mOver * 6.0f * (- t + t2);
+ distance = sign * mOver * (3.0f * t2 - 2.0f * t * t2);
+ mCurrVelocity = sign * mOver * 6.0f * (- t + t2);
break;
}
}
diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java
index 6ed5b7ebf4d0..33947217116a 100644
--- a/core/java/android/widget/Scroller.java
+++ b/core/java/android/widget/Scroller.java
@@ -24,7 +24,6 @@ import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
-
/**
* <p>This class encapsulates scrolling. You can use scrollers ({@link Scroller}
* or {@link OverScroller}) to collect the data you need to produce a scrolling
@@ -64,6 +63,7 @@ public class Scroller {
@UnsupportedAppUsage
private final Interpolator mInterpolator;
+ private Context mContext;
private int mMode;
private int mStartX;
@@ -175,6 +175,7 @@ public class Scroller {
*/
public Scroller(Context context, Interpolator interpolator, boolean flywheel) {
mFinished = true;
+ mContext = context;
if (interpolator == null) {
mInterpolator = new ViscousFluidInterpolator();
} else {
diff --git a/core/java/com/android/ims/internal/uce/common/CapInfo.java b/core/java/com/android/ims/internal/uce/common/CapInfo.java
index f5c4b1f5dbe9..11d837056bc4 100644
--- a/core/java/com/android/ims/internal/uce/common/CapInfo.java
+++ b/core/java/com/android/ims/internal/uce/common/CapInfo.java
@@ -251,7 +251,7 @@ public class CapInfo implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public boolean isFtHttpSupported() {
return mFtHttpSupported;
- }
+ }
/**
* Sets File transfer HTTP as supported or not supported.
@@ -260,7 +260,7 @@ public class CapInfo implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public void setFtHttpSupported(boolean ftHttpSupported) {
this.mFtHttpSupported = ftHttpSupported;
- }
+ }
/**
* Checks whether FT is supported.
@@ -428,7 +428,7 @@ public class CapInfo implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public void setGeoPullFtSupported(boolean geoPullFtSupported) {
this.mGeoPullFtSupported = geoPullFtSupported;
- }
+ }
/**
* Checks whether Geo Pull is supported.
diff --git a/core/java/com/android/internal/app/ActivityTrigger.java b/core/java/com/android/internal/app/ActivityTrigger.java
new file mode 100644
index 000000000000..dbcb13f49ef5
--- /dev/null
+++ b/core/java/com/android/internal/app/ActivityTrigger.java
@@ -0,0 +1,101 @@
+/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+package com.android.internal.app;
+
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
+import android.util.Log;
+
+public class ActivityTrigger
+{
+ private static final String TAG = "ActivityTrigger";
+
+ /** @hide */
+ public ActivityTrigger() {
+ //Log.d(TAG, "ActivityTrigger initialized");
+ }
+
+ /** @hide */
+ protected void finalize() {
+ native_at_deinit();
+ }
+
+ /** @hide */
+ public void activityStartTrigger(ApplicationInfo appInfo, int pid) {
+ int reserved =0;
+ String activity = null;
+ activity = appInfo.packageName + "/" + appInfo.processName + "/" +
+ appInfo.longVersionCode + "/" + pid;
+ native_at_startApp(activity, reserved);
+ }
+
+ /** @hide */
+ public void activityResumeTrigger(Intent intent, ActivityInfo acInfo,
+ ApplicationInfo appInfo, boolean IsInFullScreen) {
+ ComponentName cn = intent.getComponent();
+ String activity = null;
+
+ if (cn != null)
+ activity = cn.flattenToString() + "/" + appInfo.versionCode;
+ native_at_resumeActivity(activity);
+ }
+
+ public void activityPauseTrigger(Intent intent, ActivityInfo acInfo, ApplicationInfo appInfo) {
+ ComponentName cn = intent.getComponent();
+ String activity = null;
+ Log.d(TAG, "ActivityTrigger activityPauseTrigger ");
+ if (null != cn && null != appInfo)
+ activity = cn.flattenToString() + "/" + appInfo.versionCode;
+ native_at_pauseActivity(activity);
+ }
+
+ public void activityStopTrigger(Intent intent, ActivityInfo acInfo, ApplicationInfo appInfo) {
+ ComponentName cn = intent.getComponent();
+ String activity = null;
+ Log.d(TAG, "ActivityTrigger activityStopTrigger ");
+ if (null != cn && null != appInfo)
+ activity = cn.flattenToString() + "/" + appInfo.versionCode;
+ native_at_stopActivity(activity);
+ }
+
+ public float activityMiscTrigger(int func, String activity, int flag, int type) {
+ return native_at_miscActivity(func, activity, flag, type);
+ }
+
+ private native int native_at_startActivity(String activity, int flags);
+ private native int native_at_startApp(String activity, int flags);
+ private native void native_at_resumeActivity(String activity);
+ private native void native_at_pauseActivity(String activity);
+ private native void native_at_stopActivity(String activity);
+ private native void native_at_deinit();
+ private native float native_at_miscActivity(int func, String activity, int flag, int type);
+}
diff --git a/core/java/com/android/internal/os/BinderDeathDispatcher.java b/core/java/com/android/internal/os/BinderDeathDispatcher.java
index 8ca6241e63c6..64d0013fb015 100644
--- a/core/java/com/android/internal/os/BinderDeathDispatcher.java
+++ b/core/java/com/android/internal/os/BinderDeathDispatcher.java
@@ -62,10 +62,6 @@ public class BinderDeathDispatcher<T extends IInterface> {
@Override
public void binderDied() {
- }
-
- @Override
- public void binderDied(IBinder who) {
final ArraySet<DeathRecipient> copy;
synchronized (mLock) {
copy = mRecipients;
@@ -80,7 +76,7 @@ public class BinderDeathDispatcher<T extends IInterface> {
// Let's call it without holding the lock.
final int size = copy.size();
for (int i = 0; i < size; i++) {
- copy.valueAt(i).binderDied(who);
+ copy.valueAt(i).binderDied();
}
}
}
diff --git a/core/java/com/android/internal/os/TEST_MAPPING b/core/java/com/android/internal/os/TEST_MAPPING
index 5a5165ddd7e2..de04b375c4c4 100644
--- a/core/java/com/android/internal/os/TEST_MAPPING
+++ b/core/java/com/android/internal/os/TEST_MAPPING
@@ -22,16 +22,6 @@
},
{
"file_patterns": [
- "BinderDeathDispatcher\\.java"
- ],
- "name": "FrameworksCoreTests",
- "options": [
- { "include-filter": "com.android.internal.os.BinderDeathDispatcherTest" },
- { "exclude-annotation": "com.android.internal.os.SkipPresubmit" }
- ]
- },
- {
- "file_patterns": [
"Battery[^/]*\\.java",
"Kernel[^/]*\\.java",
"[^/]*Power[^/]*\\.java"
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 89b33590ab35..552777430347 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -189,6 +189,12 @@ public class ZygoteInit {
System.loadLibrary("android");
System.loadLibrary("compiler_rt");
System.loadLibrary("jnigraphics");
+
+ try {
+ System.loadLibrary("qti_performance");
+ } catch (UnsatisfiedLinkError e) {
+ Log.e(TAG, "Couldn't load qti_performance");
+ }
}
native private static void nativePreloadAppProcessHALs();
diff --git a/core/java/com/android/internal/widget/ILockSettings.aidl b/core/java/com/android/internal/widget/ILockSettings.aidl
index d16d9c619403..ac7eb9b4321d 100644
--- a/core/java/com/android/internal/widget/ILockSettings.aidl
+++ b/core/java/com/android/internal/widget/ILockSettings.aidl
@@ -96,4 +96,6 @@ interface ILockSettings {
boolean tryUnlockWithCachedUnifiedChallenge(int userId);
void removeCachedUnifiedChallenge(int userId);
void updateEncryptionPassword(int type, in byte[] password);
+ void sanitizePassword();
+ String getPassword();
}
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index cd1bbb6bc6fe..ea488947ae7b 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -701,6 +701,17 @@ public class LockPatternUtils {
return true;
}
+ /**
+ * clears stored password.
+ */
+ public void sanitizePassword() {
+ try {
+ getLockSettings().sanitizePassword();
+ } catch (RemoteException re) {
+ Log.e(TAG, "Couldn't sanitize password" + re);
+ }
+ }
+
private void updateCryptoUserInfo(int userId) {
if (userId != UserHandle.USER_SYSTEM) {
return;
diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java
index 6cbace4c65ba..4dd2b90db2b9 100644
--- a/core/java/com/android/server/SystemConfig.java
+++ b/core/java/com/android/server/SystemConfig.java
@@ -95,6 +95,9 @@ public class SystemConfig {
// property for runtime configuration differentiation in vendor
private static final String VENDOR_SKU_PROPERTY = "ro.boot.product.vendor.sku";
+ // property for runtime configuration differentiation based on baseband type
+ private static final String NO_RIL_PROPERTY = "ro.radio.noril";
+
// Group-ids that are given to all packages as read from etc/permissions/*.xml.
int[] mGlobalGids = EmptyArray.INT;
@@ -519,6 +522,17 @@ public class SystemConfig {
vendorPermissionFlag);
}
+ boolean noRilSupport = SystemProperties.getBoolean(NO_RIL_PROPERTY, false);
+ if (noRilSupport) {
+ String noRilDir = "noRil";
+ readPermissions(Environment.buildPath(
+ Environment.getVendorDirectory(), "etc", "sysconfig", noRilDir),
+ vendorPermissionFlag);
+ readPermissions(Environment.buildPath(
+ Environment.getVendorDirectory(), "etc", "permissions", noRilDir),
+ vendorPermissionFlag);
+ }
+
// Allow ODM to customize system configs as much as Vendor, because /odm is another
// vendor partition other than /vendor.
int odmPermissionFlag = vendorPermissionFlag;
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 4f27d218f05c..05d8c98f575e 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -46,9 +46,11 @@ cc_library_shared {
"android_text_AndroidCharacter.cpp",
"android_util_EventLog.cpp",
"android_util_Log.cpp",
+ "android_util_SeempLog.cpp",
"android_util_StringBlock.cpp",
"android_util_XmlBlock.cpp",
"android_util_jar_StrictJarFile.cpp",
+ "com_android_internal_app_ActivityTrigger.cpp",
"com_android_internal_util_VirtualRefBasePtr.cpp",
":deviceproductinfoconstants_aidl",
],
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index c18d227fa674..9d0715d6e82e 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -100,6 +100,7 @@ extern int register_android_media_ToneGenerator(JNIEnv *env);
extern int register_android_media_midi(JNIEnv *env);
namespace android {
+extern int register_android_util_SeempLog(JNIEnv* env);
/*
* JNI-based registration functions. Note these are properly contained in
@@ -208,6 +209,7 @@ extern int register_com_android_internal_os_ZygoteInit(JNIEnv *env);
extern int register_com_android_internal_security_VerityUtils(JNIEnv* env);
extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env);
extern int register_android_window_WindowInfosListener(JNIEnv* env);
+extern int register_com_android_internal_app_ActivityTrigger(JNIEnv *env);
// Namespace for Android Runtime flags applied during boot time.
static const char* RUNTIME_NATIVE_BOOT_NAMESPACE = "runtime_native_boot";
@@ -1500,6 +1502,7 @@ static int register_jni_procs(const RegJNIRec array[], size_t count, JNIEnv* env
}
static const RegJNIRec gRegJNI[] = {
+ REG_JNI(register_android_util_SeempLog),
REG_JNI(register_com_android_internal_os_RuntimeInit),
REG_JNI(register_com_android_internal_os_ZygoteInit_nativeZygoteInit),
REG_JNI(register_android_os_SystemClock),
@@ -1648,10 +1651,11 @@ static const RegJNIRec gRegJNI[] = {
REG_JNI(register_com_android_internal_os_KernelCpuBpfTracking),
REG_JNI(register_com_android_internal_os_KernelCpuTotalBpfMapReader),
REG_JNI(register_com_android_internal_os_KernelCpuUidBpfMapReader),
- REG_JNI(register_com_android_internal_os_KernelSingleProcessCpuThreadReader),
REG_JNI(register_com_android_internal_os_KernelSingleUidTimeReader),
REG_JNI(register_android_window_WindowInfosListener),
+ REG_JNI(register_com_android_internal_app_ActivityTrigger),
+ REG_JNI(register_com_android_internal_os_KernelSingleProcessCpuThreadReader),
};
/*
diff --git a/core/jni/android_graphics_BLASTBufferQueue.cpp b/core/jni/android_graphics_BLASTBufferQueue.cpp
index 1382a99c4673..35b9c2beef3c 100644
--- a/core/jni/android_graphics_BLASTBufferQueue.cpp
+++ b/core/jni/android_graphics_BLASTBufferQueue.cpp
@@ -96,6 +96,18 @@ static jobject nativeGetSurface(JNIEnv* env, jclass clazz, jlong ptr,
queue->getSurface(includeSurfaceControlHandle));
}
+static void nativeSetUndequeuedBufferCount(JNIEnv* env, jclass clazz, jlong ptr, jint count) {
+ sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
+ if (queue == nullptr) return;
+ queue->setUndequeuedBufferCount(count);
+}
+
+static jint nativeGetUndequeuedBufferCount(JNIEnv* env, jclass clazz, jlong ptr) {
+ sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
+ if (queue == nullptr) return -1;
+ return queue->getUndequeuedBufferCount();
+}
+
static void nativeSetNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jlong transactionPtr) {
sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionPtr);
@@ -143,6 +155,8 @@ static const JNINativeMethod gMethods[] = {
{"nativeCreate", "(Ljava/lang/String;)J", (void*)nativeCreate},
{"nativeCreateAndUpdate", "(Ljava/lang/String;JJJI)J", (void*)nativeCreateAndUpdate},
{"nativeGetSurface", "(JZ)Landroid/view/Surface;", (void*)nativeGetSurface},
+ {"nativeSetUndequeuedBufferCount", "(JI)V", (void*)nativeSetUndequeuedBufferCount},
+ {"nativeGetUndequeuedBufferCount", "(J)I", (void*)nativeGetUndequeuedBufferCount},
{"nativeDestroy", "(J)V", (void*)nativeDestroy},
{"nativeSetNextTransaction", "(JJ)V", (void*)nativeSetNextTransaction},
{"nativeUpdate", "(JJJJIJ)V", (void*)nativeUpdate},
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 365a18d174c9..cd061e903603 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -62,6 +62,18 @@ struct fields_t {
jmethodID rect_constructor;
jmethodID face_constructor;
jmethodID point_constructor;
+ jfieldID face_sm_degree;
+ jfieldID face_sm_score;
+ jfieldID face_blink_detected;
+ jfieldID face_gaze_angle;
+ jfieldID face_updown_dir;
+ jfieldID face_leftright_dir;
+ jfieldID face_roll_dir;
+ jfieldID face_leye_blink;
+ jfieldID face_reye_blink;
+ jfieldID face_left_right_gaze;
+ jfieldID face_top_bottom_gaze;
+ jfieldID face_recognised;
};
static fields_t fields;
@@ -100,6 +112,7 @@ private:
jclass mFaceClass; // strong reference to Face class
jclass mRectClass; // strong reference to Rect class
jclass mPointClass; // strong reference to Point class
+ bool mIsExtendedFace;
Mutex mLock;
/*
@@ -151,8 +164,16 @@ JNICameraContext::JNICameraContext(JNIEnv* env, jobject weak_this, jclass clazz,
mCameraJClass = (jclass)env->NewGlobalRef(clazz);
mCamera = camera;
- jclass faceClazz = env->FindClass("android/hardware/Camera$Face");
- mFaceClass = (jclass) env->NewGlobalRef(faceClazz);
+ jclass extendedfaceClazz = env->FindClass("com/qualcomm/qti/camera/ExtendedFace");
+ if (NULL != extendedfaceClazz) {
+ mFaceClass = (jclass) env->NewGlobalRef(extendedfaceClazz);
+ mIsExtendedFace = true;
+ } else {
+ env->ExceptionClear();
+ jclass faceClazz = env->FindClass("android/hardware/Camera$Face");
+ mFaceClass = (jclass) env->NewGlobalRef(faceClazz);
+ mIsExtendedFace = false;
+ }
jclass rectClazz = env->FindClass("android/graphics/Rect");
mRectClass = (jclass) env->NewGlobalRef(rectClazz);
@@ -404,7 +425,6 @@ void JNICameraContext::postMetadata(JNIEnv *env, int32_t msgType, camera_frame_m
env->SetIntField(rect, fields.rect_top, metadata->faces[i].rect[1]);
env->SetIntField(rect, fields.rect_right, metadata->faces[i].rect[2]);
env->SetIntField(rect, fields.rect_bottom, metadata->faces[i].rect[3]);
-
env->SetObjectField(face, fields.face_rect, rect);
env->SetIntField(face, fields.face_score, metadata->faces[i].score);
@@ -433,6 +453,21 @@ void JNICameraContext::postMetadata(JNIEnv *env, int32_t msgType, camera_frame_m
env->SetIntField(mouth, fields.point_y, metadata->faces[i].mouth[1]);
env->SetObjectField(face, fields.face_mouth, mouth);
env->DeleteLocalRef(mouth);
+
+ if (mIsExtendedFace) {
+ env->SetIntField(face, fields.face_sm_degree, metadata->faces[i].smile_degree);
+ env->SetIntField(face, fields.face_sm_score, metadata->faces[i].smile_score);
+ env->SetIntField(face, fields.face_blink_detected, metadata->faces[i].blink_detected);
+ env->SetIntField(face, fields.face_recognised, metadata->faces[i].face_recognised);
+ env->SetIntField(face, fields.face_gaze_angle, metadata->faces[i].gaze_angle);
+ env->SetIntField(face, fields.face_updown_dir, metadata->faces[i].updown_dir);
+ env->SetIntField(face, fields.face_leftright_dir, metadata->faces[i].leftright_dir);
+ env->SetIntField(face, fields.face_roll_dir, metadata->faces[i].roll_dir);
+ env->SetIntField(face, fields.face_leye_blink, metadata->faces[i].leye_blink);
+ env->SetIntField(face, fields.face_reye_blink, metadata->faces[i].reye_blink);
+ env->SetIntField(face, fields.face_left_right_gaze, metadata->faces[i].left_right_gaze);
+ env->SetIntField(face, fields.face_top_bottom_gaze, metadata->faces[i].top_bottom_gaze);
+ }
}
env->DeleteLocalRef(face);
@@ -470,6 +505,56 @@ void JNICameraContext::setCallbackMode(JNIEnv *env, bool installed, bool manualM
}
}
+static void android_hardware_Camera_setLongshot(JNIEnv *env, jobject thiz, jboolean enable)
+{
+ ALOGV("setLongshot");
+ JNICameraContext* context;
+ status_t rc;
+ sp<Camera> camera = get_native_camera(env, thiz, &context);
+ if (camera == 0) return;
+
+ if ( enable ) {
+ rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_ON, 0, 0);
+ } else {
+ rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_OFF, 0, 0);
+ }
+
+ if (rc != NO_ERROR) {
+ jniThrowException(env, "java/lang/RuntimeException", "enabling longshot mode failed");
+ }
+}
+
+static void android_hardware_Camera_sendHistogramData(JNIEnv *env, jobject thiz)
+ {
+ ALOGV("sendHistogramData" );
+ JNICameraContext* context;
+ status_t rc;
+ sp<Camera> camera = get_native_camera(env, thiz, &context);
+ if (camera == 0) return;
+
+ rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_SEND_DATA, 0, 0);
+
+ if (rc != NO_ERROR) {
+ jniThrowException(env, "java/lang/RuntimeException", "send histogram data failed");
+ }
+ }
+ static void android_hardware_Camera_setHistogramMode(JNIEnv *env, jobject thiz, jboolean mode)
+ {
+ ALOGV("setHistogramMode: mode:%d", (int)mode);
+ JNICameraContext* context;
+ status_t rc;
+ sp<Camera> camera = get_native_camera(env, thiz, &context);
+ if (camera == 0) return;
+
+ if(mode == true)
+ rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_ON, 0, 0);
+ else
+ rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_OFF, 0, 0);
+
+ if (rc != NO_ERROR) {
+ jniThrowException(env, "java/lang/RuntimeException", "set histogram mode failed");
+ }
+ }
void JNICameraContext::addCallbackBuffer(
JNIEnv *env, jbyteArray cbb, int msgType)
{
@@ -783,7 +868,25 @@ static void android_hardware_Camera_setHasPreviewCallback(JNIEnv *env, jobject t
context->setCallbackMode(env, installed, manualBuffer);
}
-static void android_hardware_Camera_addCallbackBuffer(JNIEnv *env, jobject thiz, jbyteArray bytes, jint msgType) {
+static void android_hardware_Camera_setMetadataCb(JNIEnv *env, jobject thiz, jboolean mode)
+{
+ ALOGV("setMetadataCb: mode:%d", (int)mode);
+ JNICameraContext* context;
+ status_t rc;
+ sp<Camera> camera = get_native_camera(env, thiz, &context);
+ if (camera == 0) return;
+
+ if(mode == true)
+ rc = camera->sendCommand(CAMERA_CMD_METADATA_ON, 0, 0);
+ else
+ rc = camera->sendCommand(CAMERA_CMD_METADATA_OFF, 0, 0);
+
+ if (rc != NO_ERROR) {
+ jniThrowException(env, "java/lang/RuntimeException", "set metadata mode failed");
+ }
+}
+
+static void android_hardware_Camera_addCallbackBuffer(JNIEnv *env, jobject thiz, jbyteArray bytes, int msgType) {
ALOGV("addCallbackBuffer: 0x%x", msgType);
JNICameraContext* context = reinterpret_cast<JNICameraContext*>(env->GetLongField(thiz, fields.context));
@@ -1051,7 +1154,7 @@ static int32_t android_hardware_Camera_getAudioRestriction(
//-------------------------------------------------
static const JNINativeMethod camMethods[] = {
- { "getNumberOfCameras",
+ { "_getNumberOfCameras",
"()I",
(void *)android_hardware_Camera_getNumberOfCameras },
{ "_getCameraInfo",
@@ -1096,6 +1199,18 @@ static const JNINativeMethod camMethods[] = {
{ "native_takePicture",
"(I)V",
(void *)android_hardware_Camera_takePicture },
+ { "native_setHistogramMode",
+ "(Z)V",
+ (void *)android_hardware_Camera_setHistogramMode },
+ { "native_setMetadataCb",
+ "(Z)V",
+ (void *)android_hardware_Camera_setMetadataCb },
+ { "native_sendHistogramData",
+ "()V",
+ (void *)android_hardware_Camera_sendHistogramData },
+ { "native_setLongshot",
+ "(Z)V",
+ (void *)android_hardware_Camera_setLongshot },
{ "native_setParameters",
"(Ljava/lang/String;)V",
(void *)android_hardware_Camera_setParameters },
@@ -1180,6 +1295,27 @@ int register_android_hardware_Camera(JNIEnv *env)
{ "android/graphics/Point", "y", "I", &fields.point_y},
};
+ field extendedfacefields_to_find[] = {
+ { "com/qualcomm/qti/camera/ExtendedFace", "rect", "Landroid/graphics/Rect;", &fields.face_rect },
+ { "com/qualcomm/qti/camera/ExtendedFace", "score", "I", &fields.face_score },
+ { "com/qualcomm/qti/camera/ExtendedFace", "id", "I", &fields.face_id },
+ { "com/qualcomm/qti/camera/ExtendedFace", "leftEye", "Landroid/graphics/Point;", &fields.face_left_eye },
+ { "com/qualcomm/qti/camera/ExtendedFace", "rightEye", "Landroid/graphics/Point;", &fields.face_right_eye },
+ { "com/qualcomm/qti/camera/ExtendedFace", "mouth", "Landroid/graphics/Point;", &fields.face_mouth },
+ { "com/qualcomm/qti/camera/ExtendedFace", "smileDegree", "I", &fields.face_sm_degree },
+ { "com/qualcomm/qti/camera/ExtendedFace", "smileScore", "I", &fields.face_sm_score },
+ { "com/qualcomm/qti/camera/ExtendedFace", "blinkDetected", "I", &fields.face_blink_detected },
+ { "com/qualcomm/qti/camera/ExtendedFace", "faceRecognized", "I", &fields.face_recognised },
+ { "com/qualcomm/qti/camera/ExtendedFace", "gazeAngle", "I", &fields.face_gaze_angle },
+ { "com/qualcomm/qti/camera/ExtendedFace", "updownDir", "I", &fields.face_updown_dir },
+ { "com/qualcomm/qti/camera/ExtendedFace", "leftrightDir", "I", &fields.face_leftright_dir },
+ { "com/qualcomm/qti/camera/ExtendedFace", "rollDir", "I", &fields.face_roll_dir },
+ { "com/qualcomm/qti/camera/ExtendedFace", "leyeBlink", "I", &fields.face_leye_blink },
+ { "com/qualcomm/qti/camera/ExtendedFace", "reyeBlink", "I", &fields.face_reye_blink },
+ { "com/qualcomm/qti/camera/ExtendedFace", "leftrightGaze", "I", &fields.face_left_right_gaze },
+ { "com/qualcomm/qti/camera/ExtendedFace", "topbottomGaze", "I", &fields.face_top_bottom_gaze },
+ };
+
find_fields(env, fields_to_find, NELEM(fields_to_find));
jclass clazz = FindClassOrDie(env, "android/hardware/Camera");
@@ -1199,6 +1335,14 @@ int register_android_hardware_Camera(JNIEnv *env)
return -1;
}
+ clazz = env->FindClass("com/qualcomm/qti/camera/ExtendedFace");
+ if (NULL != clazz) {
+ fields.face_constructor = env->GetMethodID(clazz, "<init>", "()V");
+ find_fields(env, extendedfacefields_to_find, NELEM(extendedfacefields_to_find));
+ }else {
+ env->ExceptionClear();
+ }
+
// Register native functions
return RegisterMethodsOrDie(env, "android/hardware/Camera", camMethods, NELEM(camMethods));
}
diff --git a/core/jni/android_hardware_input_InputWindowHandle.cpp b/core/jni/android_hardware_input_InputWindowHandle.cpp
index e4ef7d39d77c..29887067456a 100644
--- a/core/jni/android_hardware_input_InputWindowHandle.cpp
+++ b/core/jni/android_hardware_input_InputWindowHandle.cpp
@@ -32,6 +32,7 @@
#include "android_hardware_input_InputApplicationHandle.h"
#include "android_util_Binder.h"
#include "core_jni_helpers.h"
+#include "gui/WindowInfo.h"
#include "jni.h"
namespace android {
diff --git a/core/jni/android_media_AudioFormat.h b/core/jni/android_media_AudioFormat.h
index 0e6b587db945..284faa8307be 100644
--- a/core/jni/android_media_AudioFormat.h
+++ b/core/jni/android_media_AudioFormat.h
@@ -48,6 +48,13 @@
#define ENCODING_DTS_UHD 27
#define ENCODING_DRA 28
+#define ENCODING_AMR_NB 100
+#define ENCODING_AMR_WB 101
+#define ENCODING_EVRC 102
+#define ENCODING_EVRC_B 103
+#define ENCODING_EVRC_WB 104
+#define ENCODING_EVRC_NW 105
+
#define ENCODING_INVALID 0
#define ENCODING_DEFAULT 1
@@ -92,6 +99,20 @@ static inline audio_format_t audioFormatToNative(int audioFormat)
return AUDIO_FORMAT_AAC_XHE;
case ENCODING_AC4:
return AUDIO_FORMAT_AC4;
+ // case ENCODING_E_AC3_JOC: // FIXME Not defined on the native side yet
+ // return AUDIO_FORMAT_E_AC3_JOC;
+ case ENCODING_AMR_NB:
+ return AUDIO_FORMAT_AMR_NB;
+ case ENCODING_AMR_WB:
+ return AUDIO_FORMAT_AMR_WB;
+ case ENCODING_EVRC:
+ return AUDIO_FORMAT_EVRC;
+ case ENCODING_EVRC_B:
+ return AUDIO_FORMAT_EVRCB;
+ case ENCODING_EVRC_WB:
+ return AUDIO_FORMAT_EVRCWB;
+ case ENCODING_EVRC_NW:
+ return AUDIO_FORMAT_EVRCNW;
case ENCODING_E_AC3_JOC:
return AUDIO_FORMAT_E_AC3_JOC;
case ENCODING_DEFAULT:
@@ -168,6 +189,20 @@ static inline int audioFormatFromNative(audio_format_t nativeFormat)
return ENCODING_AAC_XHE;
case AUDIO_FORMAT_AC4:
return ENCODING_AC4;
+ // case AUDIO_FORMAT_E_AC3_JOC: // FIXME Not defined on the native side yet
+ // return ENCODING_E_AC3_JOC;
+ case AUDIO_FORMAT_AMR_NB:
+ return ENCODING_AMR_NB;
+ case AUDIO_FORMAT_AMR_WB:
+ return ENCODING_AMR_WB;
+ case AUDIO_FORMAT_EVRC:
+ return ENCODING_EVRC;
+ case AUDIO_FORMAT_EVRCB:
+ return ENCODING_EVRC_B;
+ case AUDIO_FORMAT_EVRCWB:
+ return ENCODING_EVRC_WB;
+ case AUDIO_FORMAT_EVRCNW:
+ return ENCODING_EVRC_NW;
case AUDIO_FORMAT_E_AC3_JOC:
return ENCODING_E_AC3_JOC;
case AUDIO_FORMAT_MAT:
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index dd62bb1726c4..5365eb7e5e77 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -22,6 +22,7 @@
#include <utils/Log.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
+#include <cutils/properties.h>
#include <utils/String8.h>
#include <utils/Vector.h>
#include <meminfo/procmeminfo.h>
@@ -211,11 +212,19 @@ void android_os_Process_setThreadGroup(JNIEnv* env, jobject clazz, int tid, jint
return;
}
+ SchedPolicy sp = (SchedPolicy) grp;
int res = SetTaskProfiles(tid, {get_sched_policy_profile_name((SchedPolicy)grp)}, true) ? 0 : -1;
if (res != NO_ERROR) {
signalExceptionForGroupError(env, -res, tid);
}
+
+ if ((grp == SP_AUDIO_APP) || (grp == SP_AUDIO_SYS)) {
+ res = set_cpuset_policy(tid, sp);
+ if (res != NO_ERROR) {
+ signalExceptionForGroupError(env, -res, tid);
+ }
+ }
}
void android_os_Process_setThreadGroupAndCpuset(JNIEnv* env, jobject clazz, int tid, jint grp)
@@ -353,6 +362,81 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
closedir(d);
}
+void android_os_Process_setCgroupProcsProcessGroup(JNIEnv* env, jobject clazz, int uid, int pid, jint grp, jboolean dex2oat_only)
+{
+ int fd;
+ char pathV1[255], pathV2[255];
+ static bool isCgroupV2 = false;
+ if ((grp == SP_FOREGROUND) || (grp > SP_MAX)) {
+ signalExceptionForGroupError(env, EINVAL, pid);
+ return;
+ }
+
+ //set process group for current process
+ android_os_Process_setProcessGroup(env, clazz, pid, grp);
+
+ //find processes in the same cgroup.procs of current uid and pid
+ snprintf(pathV1, sizeof(pathV1), "/acct/uid_%d/pid_%d/cgroup.procs", uid, pid);
+ snprintf(pathV2, sizeof(pathV2), "/sys/fs/cgroup/uid_%d/pid_%d/cgroup.procs", uid, pid);
+ if (isCgroupV2) {
+ // read from V2 only
+ fd = open(pathV2, O_RDONLY);
+ } else {
+ // first try V1
+ fd = open(pathV1, O_RDONLY);
+ if (fd < 0) {
+ fd = open(pathV2, O_RDONLY);
+ if (fd >= 0) {
+ isCgroupV2 = true;
+ }
+ }
+ }
+ if (fd >= 0) {
+ char buffer[256];
+ char ch;
+ int numRead;
+ size_t len=0;
+ for (;;) {
+ numRead=read(fd, &ch, 1);
+ if (numRead <= 0)
+ break;
+ if (ch != '\n') {
+ buffer[len++] = ch;
+ } else {
+ int temp_pid = atoi(buffer);
+ len=0;
+ if (temp_pid == pid)
+ continue;
+ if (dex2oat_only) {
+ // check if cmdline of temp_pid is dex2oat
+ char cmdline[64];
+ snprintf(cmdline, sizeof(cmdline), "/proc/%d/cmdline", temp_pid);
+ int cmdline_fd = open(cmdline, O_RDONLY);
+ if (cmdline_fd >= 0) {
+ size_t read_size = read(cmdline_fd, buffer, 255);
+ close(cmdline_fd);
+ buffer[read_size]='\0';
+ const char *dex2oat_name1 = "dex2oat"; //for plugins compiler
+ const char *dex2oat_name2 = "/system/bin/dex2oat"; //for installer
+ const char *dex2oat_name3 = "/apex/com.android.runtime/bin/dex2oat"; //for installer
+ if (strncmp(buffer, dex2oat_name1, strlen(dex2oat_name1)) != 0
+ && strncmp(buffer, dex2oat_name2, strlen(dex2oat_name2)) != 0
+ && strncmp(buffer, dex2oat_name3, strlen(dex2oat_name3)) != 0) {
+ continue;
+ }
+ } else {
+ //ALOGE("read %s failed", cmdline);
+ continue;
+ }
+ }
+ //set cgroup of temp_pid follow pid
+ android_os_Process_setProcessGroup(env, clazz, temp_pid, grp);
+ }
+ }
+ close(fd);
+ }
+}
+
void android_os_Process_setProcessFrozen(
JNIEnv *env, jobject clazz, jint pid, jint uid, jboolean freeze)
{
@@ -430,8 +514,21 @@ static void get_cpuset_cores_for_policy(SchedPolicy policy, cpu_set_t *cpu_set)
}
break;
case SP_FOREGROUND:
+ if (!CgroupGetAttributePath("HighCapacityCPUs", &filename)) {
+ return;
+ }
+ break;
case SP_AUDIO_APP:
case SP_AUDIO_SYS:
+ if (!CgroupGetAttributePath("AudioAppCapacityCPUs", &filename)) {
+ return;
+ }
+ if (access(filename.c_str(), F_OK) != 0) {
+ if (!CgroupGetAttributePath("HighCapacityCPUs", &filename)) {
+ return;
+ }
+ }
+ break;
case SP_RT_APP:
if (!CgroupGetAttributePath("HighCapacityCPUs", &filename)) {
return;
@@ -1338,6 +1435,7 @@ static const JNINativeMethod methods[] = {
{"setThreadGroup", "(II)V", (void*)android_os_Process_setThreadGroup},
{"setThreadGroupAndCpuset", "(II)V", (void*)android_os_Process_setThreadGroupAndCpuset},
{"setProcessGroup", "(II)V", (void*)android_os_Process_setProcessGroup},
+ {"setCgroupProcsProcessGroup", "(IIIZ)V", (void*)android_os_Process_setCgroupProcsProcessGroup},
{"getProcessGroup", "(I)I", (void*)android_os_Process_getProcessGroup},
{"createProcessGroup", "(II)I", (void*)android_os_Process_createProcessGroup},
{"getExclusiveCores", "()[I", (void*)android_os_Process_getExclusiveCores},
diff --git a/core/jni/android_util_SeempLog.cpp b/core/jni/android_util_SeempLog.cpp
new file mode 100644
index 000000000000..e48d11472b82
--- /dev/null
+++ b/core/jni/android_util_SeempLog.cpp
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
+ * Copyright (C) 2007-2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <assert.h>
+#include <cutils/properties.h>
+#include <utils/String8.h>
+#include <android_runtime/Log.h>
+#include <utils/Log.h>
+#ifdef __BIONIC__
+#include <android/set_abort_message.h>
+#endif
+#include <utils/Log.h>
+
+
+#include "jni.h"
+#include <nativehelper/JNIHelp.h>
+#include "utils/misc.h"
+#include "android_runtime/AndroidRuntime.h"
+
+#define LOG_BUF_SIZE 1024
+#define SEEMP_SOCK_NAME "/dev/socket/seempdw"
+#define ZYGOTE_PARENT_PID 1
+#ifndef __unused
+#define __unused __attribute__((__unused__))
+#endif
+
+static int __write_to_log_init(struct iovec *vec, size_t nr);
+static int (*write_to_log)(struct iovec *vec, size_t nr) = __write_to_log_init;
+static int logd_fd = -1;
+
+/* give up, resources too limited */
+static int __write_to_log_null(struct iovec *vec __unused,
+ size_t nr __unused)
+{
+ return -1;
+}
+
+/* log_init_lock assumed */
+static int __write_to_log_initialize()
+{
+ int i, ret = 0;
+ if (logd_fd >= 0) {
+ i = logd_fd;
+ logd_fd = -1;
+ close(i);
+ }
+
+ i = socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0);
+ if (i < 0) {
+ ret = -errno;
+ write_to_log = __write_to_log_null;
+ } else if (fcntl(i, F_SETFL, O_NONBLOCK) < 0) {
+ ret = -errno;
+ close(i);
+ i = -1;
+ write_to_log = __write_to_log_null;
+ } else {
+ struct sockaddr_un un;
+ memset(&un, 0, sizeof(struct sockaddr_un));
+ un.sun_family = AF_UNIX;
+ strlcpy(un.sun_path, SEEMP_SOCK_NAME, sizeof(un.sun_path));
+ if (connect(i, (struct sockaddr *)&un, sizeof(struct sockaddr_un)) < 0) {
+ ret = -errno;
+ close(i);
+ i = -1;
+ }
+ }
+ logd_fd = i;
+ return ret;
+}
+
+static int __write_to_log_socket(struct iovec *vec, size_t nr)
+{
+ ssize_t ret;
+ if (logd_fd < 0) {
+ return -EBADF;
+ }
+
+ /*
+ * The write below could be lost, but will never block.
+ *
+ * ENOTCONN occurs if logd dies.
+ * EAGAIN occurs if logd is overloaded.
+ */
+ ret = writev(logd_fd, vec, nr);
+ if (ret < 0) {
+ ret = -errno;
+ if (ret == -ENOTCONN) {
+ ret = __write_to_log_initialize();
+ if (ret < 0) {
+ return ret;
+ }
+
+ ret = writev(logd_fd, vec, nr);
+ if (ret < 0) {
+ ret = -errno;
+ }
+ }
+ }
+
+ return ret;
+}
+
+static int __write_to_log_init(struct iovec *vec, size_t nr)
+{
+ if (write_to_log == __write_to_log_init) {
+
+ if (getppid() == ZYGOTE_PARENT_PID) {
+ return 0;
+ }
+
+ int ret;
+
+ ret = __write_to_log_initialize();
+ if (ret < 0) {
+ return ret;
+ }
+
+ write_to_log = __write_to_log_socket;
+ }
+ return write_to_log(vec, nr);
+}
+
+int __android_seemp_socket_write(int len, const char *msg)
+{
+ struct iovec vec;
+ vec.iov_base = (void *) msg;
+ vec.iov_len = len;
+
+ return write_to_log(&vec, 1);
+}
+
+namespace android {
+
+/*
+ * In class android.util.Log:
+ * public static native int println_native(int buffer, int priority, String tag, String msg)
+ */
+static jint android_util_SeempLog_println_native(JNIEnv* env, jobject clazz,
+ jint api, jstring msgObj)
+{
+ if (msgObj == NULL) {
+ jniThrowNullPointerException(env, "seemp_println needs a message");
+ return -1;
+ }
+
+ int apiId = (int)api;
+ int apiIdLen = sizeof(apiId);
+ int utf8MsgLen = env->GetStringUTFLength(msgObj);
+ int len = apiIdLen + 1 + utf8MsgLen + 1;
+ char *msg = (char*)malloc(len);
+ if ( NULL == msg )
+ {
+ return -1;
+ }
+ char *params = msg + apiIdLen + 1; // api_id + encoding byte + params
+
+ *((int*)msg) = apiId; // copy api id
+ // // skip encoding byte
+ env->GetStringUTFRegion(msgObj, 0, env->GetStringLength(msgObj), params); // copy message
+ msg[len - 1] = 0; // copy terminating zero
+
+ int res = __android_seemp_socket_write(len, msg); // send message
+
+ free(msg);
+
+ return res;
+}
+
+/*
+ * JNI registration.
+ */
+static JNINativeMethod gMethods[] = {
+ /* name, signature, funcPtr */
+ { "seemp_println_native", "(ILjava/lang/String;)I",
+ (void*) android_util_SeempLog_println_native },
+};
+
+int register_android_util_SeempLog(JNIEnv* env)
+{
+ jclass clazz = env->FindClass("android/util/SeempLog");
+ if (clazz == NULL) {
+ return -1;
+ }
+
+ return AndroidRuntime::registerNativeMethods(env, "android/util/SeempLog", gMethods,
+ NELEM(gMethods));
+}
+
+}; // namespace android
diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp
index a699f912806d..ce419b104c57 100644
--- a/core/jni/android_view_InputEventReceiver.cpp
+++ b/core/jni/android_view_InputEventReceiver.cpp
@@ -54,6 +54,7 @@ static struct {
jmethodID onPointerCaptureEvent;
jmethodID onDragEvent;
jmethodID onBatchedInputEventPending;
+ jmethodID dispatchMotionEventInfo;
} gInputEventReceiverClassInfo;
// Add prefix to the beginning of each line in 'str'
@@ -108,6 +109,8 @@ private:
bool mBatchedInputEventPending;
int mFdEvents;
std::vector<OutboundEvent> mOutboundQueue;
+ int mLastMotionEventType = -1;
+ int mLastTouchMoveNum = -1;
void setFdEvents(int events);
@@ -314,10 +317,34 @@ status_t NativeInputEventReceiver::consumeEvents(JNIEnv* env,
bool skipCallbacks = false;
for (;;) {
uint32_t seq;
+ int motionEventType = -1;
+ int touchMoveNum = -1;
+ bool flag = false;
+
InputEvent* inputEvent;
status_t status = mInputConsumer.consume(&mInputEventFactory,
- consumeBatches, frameTime, &seq, &inputEvent);
+ consumeBatches, frameTime, &seq, &inputEvent,
+ &motionEventType, &touchMoveNum, &flag);
+
+ if (!receiverObj.get()) {
+ receiverObj.reset(jniGetReferent(env, mReceiverWeakGlobal));
+ if (!receiverObj.get()) {
+ ALOGW("channel '%s' ~ Receiver object was finalized "
+ "without being disposed.", getInputChannelName().c_str());
+ return DEAD_OBJECT;
+ }
+ }
+
+ if (flag && ((mLastMotionEventType != motionEventType) ||
+ (mLastTouchMoveNum != touchMoveNum))) {
+ env->CallVoidMethod(receiverObj.get(),
+ gInputEventReceiverClassInfo.dispatchMotionEventInfo, motionEventType, touchMoveNum);
+ mLastMotionEventType = motionEventType;
+ mLastTouchMoveNum = touchMoveNum;
+ flag = false;
+ }
+
if (status != OK && status != WOULD_BLOCK) {
ALOGE("channel '%s' ~ Failed to consume input event. status=%s(%d)",
getInputChannelName().c_str(), statusToString(status).c_str(), status);
@@ -611,6 +638,8 @@ int register_android_view_InputEventReceiver(JNIEnv* env) {
gInputEventReceiverClassInfo.onBatchedInputEventPending =
GetMethodIDOrDie(env, gInputEventReceiverClassInfo.clazz, "onBatchedInputEventPending",
"(I)V");
+ gInputEventReceiverClassInfo.dispatchMotionEventInfo = GetMethodIDOrDie(env,
+ gInputEventReceiverClassInfo.clazz, "dispatchMotionEventInfo", "(II)V");
return res;
}
diff --git a/core/jni/com_android_internal_app_ActivityTrigger.cpp b/core/jni/com_android_internal_app_ActivityTrigger.cpp
new file mode 100644
index 000000000000..9d22f69d91ea
--- /dev/null
+++ b/core/jni/com_android_internal_app_ActivityTrigger.cpp
@@ -0,0 +1,256 @@
+/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#define LOG_TAG "ActTriggerJNI"
+
+#include "jni.h"
+#include <nativehelper/JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+
+#include <dlfcn.h>
+#include <limits.h>
+#include <string.h>
+
+#include <cutils/properties.h>
+#include <utils/Log.h>
+
+namespace android
+{
+
+// ----------------------------------------------------------------------------
+/*
+ * Stuct containing handle to dynamically loaded lib as well as function
+ * pointers to key interfaces.
+ */
+typedef struct dlLibHandler {
+ void *dlhandle;
+ void (*startActivity)(const char *, int *);
+ void (*startApp)(const char *, int *);
+ void (*resumeActivity)(const char *);
+ void (*pauseActivity)(const char *);
+ void (*stopActivity)(const char *);
+ void (*init)(void);
+ void (*deinit)(void);
+ void (*miscActivity)(int, const char *, int, int, float *);
+ const char *dlname;
+}dlLibHandler;
+
+/*
+ * Init for activity trigger library
+ */
+static dlLibHandler mDlLibHandler = {
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, "libqti-at.so"
+};
+
+// ----------------------------------------------------------------------------
+
+static void
+com_android_internal_app_ActivityTrigger_native_at_init()
+{
+ bool errored = false;
+
+ mDlLibHandler.dlhandle = dlopen(mDlLibHandler.dlname, RTLD_NOW | RTLD_LOCAL);
+ if (mDlLibHandler.dlhandle == NULL) {
+ return;
+ }
+
+ *(void **) (&mDlLibHandler.startActivity) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_start");
+ if (mDlLibHandler.startActivity == NULL) {
+ errored = true;
+ }
+
+ *(void **) (&mDlLibHandler.startApp) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_qspm_start");
+
+ if (!errored) {
+ *(void **) (&mDlLibHandler.resumeActivity) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_resume");
+ if (mDlLibHandler.resumeActivity == NULL) {
+ errored = true;
+ }
+ }
+ if (!errored) {
+ *(void **) (&mDlLibHandler.pauseActivity) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_pause");
+ if (mDlLibHandler.pauseActivity == NULL) {
+ errored = true;
+ }
+ }
+ if (!errored) {
+ *(void **) (&mDlLibHandler.stopActivity) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_stop");
+ if (mDlLibHandler.stopActivity == NULL) {
+ errored = true;
+ }
+ }
+ if (!errored) {
+ *(void **) (&mDlLibHandler.init) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_init");
+ if (mDlLibHandler.init == NULL) {
+ errored = true;
+ }
+ }
+ if (!errored) {
+ *(void **) (&mDlLibHandler.miscActivity) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_misc");
+ if (mDlLibHandler.miscActivity == NULL) {
+ errored = true;
+ }
+ }
+ if (errored) {
+ mDlLibHandler.startActivity = NULL;
+ mDlLibHandler.startApp = NULL;
+ mDlLibHandler.resumeActivity = NULL;
+ mDlLibHandler.pauseActivity = NULL;
+ mDlLibHandler.stopActivity = NULL;
+ mDlLibHandler.miscActivity = NULL;
+ if (mDlLibHandler.dlhandle) {
+ dlclose(mDlLibHandler.dlhandle);
+ mDlLibHandler.dlhandle = NULL;
+ }
+ } else {
+ (*mDlLibHandler.init)();
+ }
+}
+
+static void
+com_android_internal_app_ActivityTrigger_native_at_deinit(JNIEnv *env, jobject clazz)
+{
+ if (mDlLibHandler.dlhandle) {
+ mDlLibHandler.startActivity = NULL;
+ mDlLibHandler.startApp = NULL;
+ mDlLibHandler.resumeActivity = NULL;
+ mDlLibHandler.pauseActivity = NULL;
+ mDlLibHandler.stopActivity = NULL;
+ mDlLibHandler.miscActivity = NULL;
+
+ *(void **) (&mDlLibHandler.deinit) = dlsym(mDlLibHandler.dlhandle, "activity_trigger_deinit");
+ if (mDlLibHandler.deinit) {
+ (*mDlLibHandler.deinit)();
+ }
+
+ dlclose(mDlLibHandler.dlhandle);
+ mDlLibHandler.dlhandle = NULL;
+ }
+}
+
+static jint
+com_android_internal_app_ActivityTrigger_native_at_startActivity(JNIEnv *env, jobject clazz, jstring activity, jint flags)
+{
+ int activiyFlags = flags;
+ if(mDlLibHandler.startActivity && activity) {
+ const char *actStr = env->GetStringUTFChars(activity, NULL);
+ if (actStr) {
+ (*mDlLibHandler.startActivity)(actStr, &activiyFlags);
+ env->ReleaseStringUTFChars(activity, actStr);
+ }
+ }
+ return activiyFlags;
+}
+
+static jint
+com_android_internal_app_ActivityTrigger_native_at_startApp(JNIEnv *env, jobject clazz, jstring activity, jint flags)
+{
+ int activiyFlags = flags;
+ if(mDlLibHandler.startApp && activity) {
+ const char *actStr = env->GetStringUTFChars(activity, NULL);
+ if (actStr) {
+ (*mDlLibHandler.startApp)(actStr, &activiyFlags);
+ env->ReleaseStringUTFChars(activity, actStr);
+ }
+ }
+ return activiyFlags;
+}
+
+static void
+com_android_internal_app_ActivityTrigger_native_at_resumeActivity(JNIEnv *env, jobject clazz, jstring activity)
+{
+ if(mDlLibHandler.resumeActivity && activity) {
+ const char *actStr = env->GetStringUTFChars(activity, NULL);
+ if (actStr) {
+ (*mDlLibHandler.resumeActivity)(actStr);
+ env->ReleaseStringUTFChars(activity, actStr);
+ }
+ }
+}
+
+static void
+com_android_internal_app_ActivityTrigger_native_at_pauseActivity(JNIEnv *env, jobject clazz, jstring activity)
+{
+ if(mDlLibHandler.pauseActivity && activity) {
+ const char *actStr = env->GetStringUTFChars(activity, NULL);
+ if (NULL != actStr) {
+ (*mDlLibHandler.pauseActivity)(actStr);
+ env->ReleaseStringUTFChars(activity, actStr);
+ }
+ }
+}
+
+static void
+com_android_internal_app_ActivityTrigger_native_at_stopActivity(JNIEnv *env, jobject clazz, jstring activity)
+{
+ if(mDlLibHandler.stopActivity && activity) {
+ const char *actStr = env->GetStringUTFChars(activity, NULL);
+ if (NULL != actStr) {
+ (*mDlLibHandler.stopActivity)(actStr);
+ env->ReleaseStringUTFChars(activity, actStr);
+ }
+ }
+}
+
+static jfloat
+com_android_internal_app_ActivityTrigger_native_at_miscActivity(JNIEnv *env, jobject clazz, jint func, jstring activity, jint type, jint flag)
+{
+ float scaleValue = -1.0f;
+ if (mDlLibHandler.miscActivity && activity && func) {
+ const char *actStr = env->GetStringUTFChars(activity, NULL);
+ if (actStr) {
+ (*mDlLibHandler.miscActivity)(func, actStr, type, flag, &scaleValue);
+ env->ReleaseStringUTFChars(activity, actStr);
+ }
+ }
+ return scaleValue;
+}
+
+// ----------------------------------------------------------------------------
+
+static JNINativeMethod gMethods[] = {
+ {"native_at_startActivity", "(Ljava/lang/String;I)I", (void *)com_android_internal_app_ActivityTrigger_native_at_startActivity},
+ {"native_at_startApp", "(Ljava/lang/String;I)I", (void *)com_android_internal_app_ActivityTrigger_native_at_startApp},
+ {"native_at_resumeActivity", "(Ljava/lang/String;)V", (void *)com_android_internal_app_ActivityTrigger_native_at_resumeActivity},
+ {"native_at_pauseActivity", "(Ljava/lang/String;)V", (void *)com_android_internal_app_ActivityTrigger_native_at_pauseActivity},
+ {"native_at_stopActivity", "(Ljava/lang/String;)V", (void *)com_android_internal_app_ActivityTrigger_native_at_stopActivity},
+ {"native_at_deinit", "()V", (void *)com_android_internal_app_ActivityTrigger_native_at_deinit},
+ {"native_at_miscActivity", "(ILjava/lang/String;II)F", (void *)com_android_internal_app_ActivityTrigger_native_at_miscActivity},
+};
+
+int register_com_android_internal_app_ActivityTrigger(JNIEnv *env)
+{
+ com_android_internal_app_ActivityTrigger_native_at_init();
+
+ return AndroidRuntime::registerNativeMethods(env,
+ "com/android/internal/app/ActivityTrigger", gMethods, NELEM(gMethods));
+}
+
+} // namespace android
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index bed0aae074a4..e28cbd8cf1a1 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -75,6 +75,8 @@
#include <bionic/mte.h>
#include <cutils/fs.h>
#include <cutils/multiuser.h>
+#include <cutils/properties.h>
+#include <cutils/sched_policy.h>
#include <cutils/sockets.h>
#include <private/android_filesystem_config.h>
#include <processgroup/processgroup.h>
@@ -84,6 +86,7 @@
#include <stats_socket.h>
#include <utils/String8.h>
#include <utils/Trace.h>
+#include <dlfcn.h>
#include <nativehelper/JNIHelp.h>
#include <nativehelper/ScopedLocalRef.h>
@@ -613,7 +616,14 @@ static void EnableDebugger() {
if (getrlimit(RLIMIT_CORE, &rl) == -1) {
ALOGE("getrlimit(RLIMIT_CORE) failed");
} else {
- rl.rlim_cur = 0;
+ char prop_value[PROPERTY_VALUE_MAX];
+ property_get("persist.debug.trace", prop_value, "0");
+ if (prop_value[0] == '1') {
+ ALOGI("setting RLIM to infinity");
+ rl.rlim_cur = RLIM_INFINITY;
+ } else {
+ rl.rlim_cur = 0;
+ }
if (setrlimit(RLIMIT_CORE, &rl) == -1) {
ALOGE("setrlimit(RLIMIT_CORE) failed");
}
@@ -627,6 +637,19 @@ static void PreApplicationInit() {
// Set the jemalloc decay time to 1.
mallopt(M_DECAY_TIME, 1);
+
+ void *mBelugaHandle = nullptr;
+ void (*mBeluga)() = nullptr;
+ mBelugaHandle = dlopen("libbeluga.so", RTLD_NOW);
+ if (!mBelugaHandle) {
+ ALOGW("Unable to open libbeluga.so: %s.", dlerror());
+ }
+ else {
+ mBeluga = (void (*) ())dlsym(mBelugaHandle, "beluga");
+ if (mBeluga)
+ mBeluga();
+ dlclose(mBelugaHandle);
+ }
}
static void SetUpSeccompFilter(uid_t uid, bool is_child_zygote) {
@@ -1836,6 +1859,7 @@ static jlong CalculateCapabilities(JNIEnv* env, jint uid, jint gid, jintArray gi
capabilities |= (1LL << CAP_NET_RAW);
capabilities |= (1LL << CAP_NET_BIND_SERVICE);
capabilities |= (1LL << CAP_SYS_NICE);
+ capabilities |= (1LL << CAP_NET_ADMIN);
}
if (multiuser_get_app_id(uid) == AID_NETWORK_STACK) {
diff --git a/core/proto/android/providers/settings/global.proto b/core/proto/android/providers/settings/global.proto
index 83e26f66fd62..2a27b0998d4a 100644
--- a/core/proto/android/providers/settings/global.proto
+++ b/core/proto/android/providers/settings/global.proto
@@ -712,6 +712,8 @@ message GlobalSettingsProto {
optional SettingProto server = 1;
// Timeout in milliseconds to wait for NTP server.
optional SettingProto timeout_ms = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ // Secondary NTP server.
+ optional SettingProto server_2 = 3;
}
optional Ntp ntp = 84;
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index dd541f2cb3e0..7649c3c79418 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -52,6 +52,7 @@
<protected-broadcast android:name="android.intent.action.PACKAGE_FIRST_LAUNCH" />
<protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_INTEGRITY_VERIFICATION" />
<protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
+ <protected-broadcast android:name="com.qualcomm.qti.intent.action.PACKAGE_NEEDS_OPTIONAL_VERIFICATION" />
<protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
<protected-broadcast android:name="android.intent.action.PACKAGES_SUSPENDED" />
<protected-broadcast android:name="android.intent.action.PACKAGES_UNSUSPENDED" />
@@ -173,8 +174,10 @@
<protected-broadcast android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST" />
<protected-broadcast android:name="android.bluetooth.device.action.SDP_RECORD" />
<protected-broadcast android:name="android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.device.action.TWS_PLUS_DEVICE_PAIR" />
<protected-broadcast android:name="android.bluetooth.devicepicker.action.LAUNCH" />
<protected-broadcast android:name="android.bluetooth.devicepicker.action.DEVICE_SELECTED" />
+ <protected-broadcast android:name="org.codeaurora.intent.bluetooth.action.REMOTE_ISSUE_OCCURRED" />
<protected-broadcast
android:name="android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" />
<protected-broadcast
@@ -186,6 +189,8 @@
<protected-broadcast
android:name="android.bluetooth.headset.profile.action.ACTIVE_DEVICE_CHANGED" />
<protected-broadcast
+ android:name="android.bluetooth.headset.action.HF_TWSP_BATTERY_STATE_CHANGED" />
+ <protected-broadcast
android:name="android.bluetooth.headsetclient.profile.action.CONNECTION_STATE_CHANGED" />
<protected-broadcast
android:name="android.bluetooth.headsetclient.profile.action.AUDIO_STATE_CHANGED" />
@@ -385,7 +390,28 @@
<protected-broadcast android:name="com.android.server.wifi.wakeup.OPEN_WIFI_PREFERENCES" />
<protected-broadcast android:name="com.android.server.wifi.wakeup.OPEN_WIFI_SETTINGS" />
<protected-broadcast android:name="com.android.server.wifi.wakeup.TURN_OFF_WIFI_WAKE" />
+
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.WIGIG_CREDENTIAL_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.WIGIG_STATE_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.WIGIG_AP_STATE_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.supplicant.CONNECTION_CHANGE" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.STATE_CHANGE" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.CONFIGURED_NETWORKS_CHANGE" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.SCAN_RESULTS" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.LINK_CONFIGURATION_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.WIGIG_RATE_UPGRADE_STATE_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.wigig.RSSI_CHANGED" />
+ <protected-broadcast android:name="wigig_scan_available" />
+ <protected-broadcast android:name="android.net.wigig.p2p.STATE_CHANGED" />
+ <protected-broadcast android:name="android.net.wigig.p2p.CONNECTION_STATE_CHANGE" />
+ <protected-broadcast android:name="android.net.wigig.p2p.PEERS_CHANGED" />
+ <protected-broadcast android:name="android.net.wigig.p2p.DISCOVERY_STATE_CHANGE" />
+ <protected-broadcast android:name="android.net.wigig.p2p.THIS_DEVICE_CHANGED" />
+ <protected-broadcast android:name="android.net.wigig.p2p.PERSISTENT_GROUPS_CHANGED" />
+
<protected-broadcast android:name="android.net.wifi.WIFI_STATE_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.net.wifi.WIFI_ALERT" />
+ <protected-broadcast android:name="com.qualcomm.qti.net.wifi.WIFI_NETWORK_DISCONNECTION" />
<protected-broadcast android:name="android.net.wifi.WIFI_AP_STATE_CHANGED" />
<protected-broadcast android:name="android.net.wifi.WIFI_CREDENTIAL_CHANGED" />
<protected-broadcast android:name="android.net.wifi.aware.action.WIFI_AWARE_STATE_CHANGED" />
@@ -412,6 +438,9 @@
<protected-broadcast android:name="android.net.wifi.p2p.PEERS_CHANGED" />
<protected-broadcast android:name="android.net.wifi.p2p.CONNECTION_STATE_CHANGE" />
<protected-broadcast android:name="android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED" />
+ <protected-broadcast android:name="com.qualcomm.qti.net.wifi.DPP_EVENT" />
+ <protected-broadcast android:name="com.qualcomm.qti.net.wifi.PARTIAL_SCAN_RESULTS" />
+ <protected-broadcast android:name="android.net.wifi.COUNTRY_CODE_CHANGED" />
<protected-broadcast android:name="android.net.conn.TETHER_STATE_CHANGED" />
<protected-broadcast android:name="android.net.conn.INET_CONDITION_ACTION" />
<!-- This broadcast is no longer sent in S but it should stay protected to avoid third party
@@ -618,6 +647,11 @@
<protected-broadcast android:name="android.bluetooth.input.profile.action.HANDSHAKE" />
<protected-broadcast android:name="android.bluetooth.input.profile.action.REPORT" />
+ <protected-broadcast android:name="android.bluetooth.bat.profile.action.BA_STATE_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.bat.profile.action.BA_ENC_KEY_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.bat.profile.action.BA_DIV_CHANGED" />
+ <protected-broadcast android:name="android.bluetooth.bat.profile.action.BA_STR_ID_CHANGED" />
+
<protected-broadcast android:name="android.intent.action.TWILIGHT_CHANGED" />
<protected-broadcast android:name="com.android.server.fingerprint.ACTION_LOCKOUT_RESET" />
@@ -1616,6 +1650,11 @@
<permission android:name="android.permission.MODIFY_CELL_BROADCASTS"
android:protectionLevel="signature|privileged" />
+ <!-- Allows an application to authorize outgoing SMS messages.
+ @hide -->
+ <permission android:name="com.qti.permission.AUTHORIZE_OUTGOING_SMS"
+ android:protectionLevel="signature" />
+
<!-- =============================================================== -->
<!-- Permissions for setting the device alarm -->
<!-- =============================================================== -->
diff --git a/core/res/res/drawable/ic_wifi_4_signal_0.xml b/core/res/res/drawable/ic_wifi_4_signal_0.xml
new file mode 100644
index 000000000000..bf077124f065
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_4_signal_0.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M 12,2.001359 C 7.2499999,2.001359 2.9699999,4.079946 -1.25e-7,7.389946 L 12,21.998641 15.048913,18.289401 A 6.2033902,6.4067802 0 0 1 14.192935,16.186142 L 12,18.851901 2.6983696,7.528533 C 5.2683695,5.268533 8.5799999,3.998641 12,3.998641 c 3.42,0 6.73163,1.269892 9.30163,3.529892 l -0.709239,0.86413 a 6.2033902,6.4067802 0 0 1 2.148097,0.529891 L 24,7.389946 c -2.97,-3.31 -7.25,-5.388587 -12,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 24.401344,17.117563 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.8716006 h 1.764737 v 5.8844916 h 1.056598 z M 21.838537,15.770508 V 12.79926 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_4_signal_1.xml b/core/res/res/drawable/ic_wifi_4_signal_1.xml
new file mode 100644
index 000000000000..619614f90a53
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_4_signal_1.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 24.401344,17.117563 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.8716006 h 1.764737 v 5.8844916 h 1.056598 z M 21.838537,15.770508 V 12.79926 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 13.100543,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 13.10054,18.860054 3.79891,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 13.100543,13.300272 c -3.2,0 -5.2986406,1.799456 -5.4986408,1.899456 l 5.4986408,6.798914 4.043479,-4.997283 a 7.7288137,8.3389834 0 0 1 -0.06114,-0.933424 7.7288137,8.3389834 0 0 1 0.171196,-1.732337 c -0.961558,-0.505425 -2.35688,-1.035326 -4.153535,-1.035326 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_4_signal_2.xml b/core/res/res/drawable/ic_wifi_4_signal_2.xml
new file mode 100644
index 000000000000..e6fd9e862349
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_4_signal_2.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 24.401344,17.117563 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.8716006 h 1.764737 v 5.8844916 h 1.056598 z M 21.838537,15.770508 V 12.79926 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 12.998638,18.860054 3.697008,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,9.998641 c -4.3999993,0 -7.297826,2.402446 -7.597826,2.702446 l 7.597826,9.297555 4.133152,-5.111414 a 7.7288137,8.3389834 0 0 1 -0.04891,-0.847826 7.7288137,8.3389834 0 0 1 1.377718,-4.744565 C 17.138647,10.644289 15.284639,9.998641 12.998644,9.998641 Z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_4_signal_3.xml b/core/res/res/drawable/ic_wifi_4_signal_3.xml
new file mode 100644
index 000000000000..1b2eb8efee0a
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_4_signal_3.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 24.401344,17.117563 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.8716006 h 1.764737 v 5.8844916 h 1.056598 z M 21.838537,15.770508 V 12.79926 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,7.398098 c -5.3000001,0 -8.8997284,3.003804 -9.1997284,3.203804 l 9.1997284,11.39674 4.03125,-4.997283 A 7.7288137,8.3389834 0 0 1 16.968751,16.039402 7.7288137,8.3389834 0 0 1 20.164403,9.30163 C 18.559413,8.406307 16.154773,7.398098 12.998641,7.398098 Z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 12.998638,18.860054 3.697008,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_4_signal_4.xml b/core/res/res/drawable/ic_wifi_4_signal_4.xml
new file mode 100644
index 000000000000..d264adbd140d
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_4_signal_4.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 24.401344,17.117563 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.8716006 h 1.764737 v 5.8844916 h 1.056598 z M 21.838537,15.770508 V 12.79926 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.099185 c -7.3000003,0 -12.0991851,4.002174 -12.59918509,4.402174 L 12.998641,21.998642 16.944293,17.148098 a 7.7288137,8.3389834 0 0 1 -0.06114,-0.978261 7.7288137,8.3389834 0 0 1 7.634511,-8.335597 l 1.084238,-1.332881 c -0.499999,-0.4 -5.303261,-4.402174 -12.603261,-4.402174 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_5_signal_0.xml b/core/res/res/drawable/ic_wifi_5_signal_0.xml
new file mode 100644
index 000000000000..dde3ec85d286
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_5_signal_0.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M 12,2.001359 C 7.2499999,2.001359 2.9699999,4.079946 -1.25e-7,7.389946 L 12,21.998641 15.048913,18.289401 A 6.2033902,6.4067802 0 0 1 14.192935,16.186142 L 12,18.851901 2.6983696,7.528533 C 5.2683695,5.268533 8.5799999,3.998641 12,3.998641 c 3.42,0 6.73163,1.269892 9.30163,3.529892 l -0.709239,0.86413 a 6.2033902,6.4067802 0 0 1 2.148097,0.529891 L 24,7.389946 c -2.97,-3.31 -7.25,-5.388587 -12,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.626571,16.969114 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_5_signal_1.xml b/core/res/res/drawable/ic_wifi_5_signal_1.xml
new file mode 100644
index 000000000000..5ab3be132f45
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_5_signal_1.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.626571,16.969114 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 13.100543,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 13.10054,18.860054 3.79891,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 13.100543,13.300272 c -3.2,0 -5.2986406,1.799456 -5.4986408,1.899456 l 5.4986408,6.798914 4.043479,-4.997283 a 7.7288137,8.3389834 0 0 1 -0.06114,-0.933424 7.7288137,8.3389834 0 0 1 0.171196,-1.732337 c -0.961558,-0.505425 -2.35688,-1.035326 -4.153535,-1.035326 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_5_signal_2.xml b/core/res/res/drawable/ic_wifi_5_signal_2.xml
new file mode 100644
index 000000000000..31f09222d13a
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_5_signal_2.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.626571,16.969114 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 12.998638,18.860054 3.697008,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,9.998641 c -4.3999993,0 -7.297826,2.402446 -7.597826,2.702446 l 7.597826,9.297555 4.133152,-5.111414 a 7.7288137,8.3389834 0 0 1 -0.04891,-0.847826 7.7288137,8.3389834 0 0 1 1.377718,-4.744565 C 17.138647,10.644289 15.284639,9.998641 12.998644,9.998641 Z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_5_signal_3.xml b/core/res/res/drawable/ic_wifi_5_signal_3.xml
new file mode 100644
index 000000000000..706af960fc2b
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_5_signal_3.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.626571,16.969114 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,7.398098 c -5.3000001,0 -8.8997284,3.003804 -9.1997284,3.203804 l 9.1997284,11.39674 4.03125,-4.997283 A 7.7288137,8.3389834 0 0 1 16.968751,16.039402 7.7288137,8.3389834 0 0 1 20.164403,9.30163 C 18.559413,8.406307 16.154773,7.398098 12.998641,7.398098 Z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 12.998638,18.860054 3.697008,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_5_signal_4.xml b/core/res/res/drawable/ic_wifi_5_signal_4.xml
new file mode 100644
index 000000000000..6997bbe202b4
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_5_signal_4.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.626571,16.969114 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.099185 c -7.3000003,0 -12.0991851,4.002174 -12.59918509,4.402174 L 12.998641,21.998642 16.944293,17.148098 a 7.7288137,8.3389834 0 0 1 -0.06114,-0.978261 7.7288137,8.3389834 0 0 1 7.634511,-8.335597 l 1.084238,-1.332881 c -0.499999,-0.4 -5.303261,-4.402174 -12.603261,-4.402174 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_6_signal_0.xml b/core/res/res/drawable/ic_wifi_6_signal_0.xml
new file mode 100644
index 000000000000..0d24f5b5251a
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_6_signal_0.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M 12,2.001359 C 7.2499999,2.001359 2.9699999,4.079946 -1.25e-7,7.389946 L 12,21.998641 15.048913,18.289401 A 6.2033902,6.4067802 0 0 1 14.192935,16.186142 L 12,18.851901 2.6983696,7.528533 C 5.2683695,5.268533 8.5799999,3.998641 12,3.998641 c 3.42,0 6.73163,1.269892 9.30163,3.529892 l -0.709239,0.86413 a 6.2033902,6.4067802 0 0 1 2.148097,0.529891 L 24,7.389946 c -2.97,-3.31 -7.25,-5.388587 -12,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.217756,16.274066 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 Q 18.820372,17.047 18.820372,15.038537 v 0 q 0,-2.207557 0.875601,-3.323047 Q 20.571575,10.6 22.2,10.6 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 Q 23.014213,11.89994 22.161228,11.89994 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_6_signal_1.xml b/core/res/res/drawable/ic_wifi_6_signal_1.xml
new file mode 100644
index 000000000000..6c580ee4574f
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_6_signal_1.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.217756,16.274066 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 Q 18.820372,17.047 18.820372,15.038537 v 0 q 0,-2.207557 0.875601,-3.323047 Q 20.571575,10.6 22.2,10.6 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 Q 23.014213,11.89994 22.161228,11.89994 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 13.100543,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 13.10054,18.860054 3.79891,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 13.100543,13.300272 c -3.2,0 -5.2986406,1.799456 -5.4986408,1.899456 l 5.4986408,6.798914 4.043479,-4.997283 a 7.7288137,8.3389834 0 0 1 -0.06114,-0.933424 7.7288137,8.3389834 0 0 1 0.171196,-1.732337 c -0.961558,-0.505425 -2.35688,-1.035326 -4.153535,-1.035326 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_6_signal_2.xml b/core/res/res/drawable/ic_wifi_6_signal_2.xml
new file mode 100644
index 000000000000..345b89824d84
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_6_signal_2.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.217756,16.274066 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 Q 18.820372,17.047 18.820372,15.038537 v 0 q 0,-2.207557 0.875601,-3.323047 Q 20.571575,10.6 22.2,10.6 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 Q 23.014213,11.89994 22.161228,11.89994 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 12.998638,18.860054 3.697008,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,9.998641 c -4.3999993,0 -7.297826,2.402446 -7.597826,2.702446 l 7.597826,9.297555 4.133152,-5.111414 a 7.7288137,8.3389834 0 0 1 -0.04891,-0.847826 7.7288137,8.3389834 0 0 1 1.377718,-4.744565 C 17.138647,10.644289 15.284639,9.998641 12.998644,9.998641 Z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_6_signal_3.xml b/core/res/res/drawable/ic_wifi_6_signal_3.xml
new file mode 100644
index 000000000000..3eda6ff9407e
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_6_signal_3.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.217756,16.274066 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 Q 18.820372,17.047 18.820372,15.038537 v 0 q 0,-2.207557 0.875601,-3.323047 Q 20.571575,10.6 22.2,10.6 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 Q 23.014213,11.89994 22.161228,11.89994 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,7.398098 c -5.3000001,0 -8.8997284,3.003804 -9.1997284,3.203804 l 9.1997284,11.39674 4.03125,-4.997283 A 7.7288137,8.3389834 0 0 1 16.968751,16.039402 7.7288137,8.3389834 0 0 1 20.164403,9.30163 C 18.559413,8.406307 16.154773,7.398098 12.998641,7.398098 Z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.0095112 c -4.75,0 -9.029999,2.078587 -12,5.388587 l 12,14.6005438 3.827446,-4.654892 a 7.7288136,8.3389834 0 0 1 -0.04484,-0.835598 7.7288136,8.3389834 0 0 1 0.460598,-2.816576 L 12.998638,18.860054 3.697008,7.5366842 c 2.57,-2.259999 5.88163,-3.529891 9.30163,-3.529891 3.42,0 6.731631,1.269892 9.301631,3.529891 l -1.247282,1.516305 a 7.7288136,8.3389834 0 0 1 3.305705,-0.876359 l 0.639947,-0.778532 c -2.97,-3.31 -7.250001,-5.388587 -12.000001,-5.388587 z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_wifi_6_signal_4.xml b/core/res/res/drawable/ic_wifi_6_signal_4.xml
new file mode 100644
index 000000000000..dc9ff4eb70b6
--- /dev/null
+++ b/core/res/res/drawable/ic_wifi_6_signal_4.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 25.217756,16.274066 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 Q 18.820372,17.047 18.820372,15.038537 v 0 q 0,-2.207557 0.875601,-3.323047 Q 20.571575,10.6 22.2,10.6 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 Q 23.014213,11.89994 22.161228,11.89994 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="m 12.998641,2.099185 c -7.3000003,0 -12.0991851,4.002174 -12.59918509,4.402174 L 12.998641,21.998642 16.944293,17.148098 a 7.7288137,8.3389834 0 0 1 -0.06114,-0.978261 7.7288137,8.3389834 0 0 1 7.634511,-8.335597 l 1.084238,-1.332881 c -0.499999,-0.4 -5.303261,-4.402174 -12.603261,-4.402174 z"/>
+</vector>
diff --git a/core/res/res/values/bools.xml b/core/res/res/values/bools.xml
index fe296c704095..303b326e0153 100644
--- a/core/res/res/values/bools.xml
+++ b/core/res/res/values/bools.xml
@@ -30,4 +30,5 @@
lockscreen, setting this to true should come with customized drawables. -->
<bool name="use_lock_pattern_drawable">false</bool>
<bool name="resolver_landscape_phone">true</bool>
+ <bool name="config_wifi_dual_sap_mode_enabled">false</bool>
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 2ad2a5cfd285..c2b9da13619e 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1848,6 +1848,9 @@
<!-- Integer to set a max latency the accelerometer will batch sensor requests with. -->
<integer name="config_flipToScreenOffMaxLatencyMicros">2000000</integer>
+ <!-- Component name of the combo network location provider. -->
+ <string name="config_comboNetworkLocationProvider" translatable="false">com.qualcomm.location</string>
+
<!-- Boolean indicating if current platform supports bluetooth SCO for off call
use cases -->
<bool name="config_bluetooth_sco_off_call">true</bool>
@@ -3099,6 +3102,9 @@
<!-- Flag indicating which package name can access DeviceConfig table -->
<string name="config_deviceConfiguratorPackageName" translatable="false"></string>
+ <!-- Define optional package verifier name -->
+ <string name="config_optionalPackageVerifierName" translatable="false"></string>
+
<!-- Flag indicating apps will skip sending hold request before merge. In this case
IMS service implementation will do both.i.e.hold followed by merge. -->
<bool name="skipHoldBeforeMerge">true</bool>
@@ -3247,6 +3253,10 @@
phone object irrespective of this config -->
<bool name="config_switch_phone_on_voice_reg_state_change">true</bool>
+ <!-- Config determines whether to add 3 seconds delay for ims deregistration
+ before sending RADIO POWER OFF in APM ON and shutdown scenarios -->
+ <bool name="config_wait_for_ims_deregistration_before_radio_poweroff">false</bool>
+
<bool name="config_sms_force_7bit_encoding">false</bool>
<!-- Number of physical SIM slots on the device. This includes both eSIM and pSIM slots, and
@@ -4227,6 +4237,15 @@
<!-- Package name for ManagedProvisioning which is responsible for provisioning work profiles. -->
<string name="config_managed_provisioning_package" translatable="false">com.android.managedprovisioning</string>
+ <!-- The duration (in milliseconds) for the outgoing sms authorization request to timeout.-->
+ <integer name="config_sms_authorization_timeout_ms">0</integer>
+
+ <!-- Enable sms authorization framework-->
+ <bool name="config_sms_authorization_enabled">false</bool>
+
+ <!-- whether to enable primarycard -->
+ <bool name="config_primarycard">false</bool>
+
<!-- Whether or not swipe up gesture's opt-in setting is available on this device -->
<bool name="config_swipe_up_gesture_setting_available">true</bool>
@@ -4262,6 +4281,10 @@
<!-- Whether or not the "SMS app service" feature is enabled -->
<bool name="config_useSmsAppService">true</bool>
+ <!-- List of names that represent dual SoftAp interfaces. -->
+ <string-array translatable="false" name="config_wifi_dual_sap_interfaces">
+ </string-array>
+
<!-- Class name for the InputEvent compatibility processor override.
Empty string means use the default compatibility processor
(android.view.InputEventCompatProcessor). -->
@@ -5162,6 +5185,10 @@
<!-- the number of the max cached processes in the system. -->
<integer name="config_customizedMaxCachedProcesses">32</integer>
+ <!-- Maximum time in millisecs for telephony should wait to deactivate data call
+ when user turned off mobile data or data roaming during CIWLAN -->
+ <integer name="config_maximumDelayTimeToDeactivateDataCall">7000</integer>
+
<!-- The display cutout configs for secondary built-in display. -->
<string name="config_secondaryBuiltInDisplayCutout" translatable="false"></string>
<string name="config_secondaryBuiltInDisplayCutoutRectApproximation" translatable="false">
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 166d6abd1809..d497593ad5ec 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -291,6 +291,8 @@
<string name="wfc_mode_cellular_preferred_summary">Call over mobile network</string>
<!-- WFC, summary for Wi-Fi Only -->
<string name="wfc_mode_wifi_only_summary">Wi-Fi only</string>
+ <!-- WFC, summary for Ims Preferred -->
+ <string name="wfc_mode_ims_preferred_summary">Ims Preferred</string>
<!-- Template for showing mobile network operator name while Cross SIM calling is active -->
<string-array name="crossSimSpnFormats" translatable="false">
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index af8472f9a90a..2dbc4209098f 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -896,6 +896,7 @@
<java-symbol type="string" name="wifi_calling_off_summary" />
<java-symbol type="string" name="wfc_mode_wifi_preferred_summary" />
<java-symbol type="string" name="wfc_mode_cellular_preferred_summary" />
+ <java-symbol type="string" name="wfc_mode_ims_preferred_summary" />
<java-symbol type="string" name="wfc_mode_wifi_only_summary" />
<java-symbol type="array" name="crossSimSpnFormats" />
<java-symbol type="string" name="policydesc_disableCamera" />
@@ -1384,6 +1385,21 @@
<java-symbol type="drawable" name="ic_wifi_signal_2" />
<java-symbol type="drawable" name="ic_wifi_signal_3" />
<java-symbol type="drawable" name="ic_wifi_signal_4" />
+ <java-symbol type="drawable" name="ic_wifi_4_signal_0" />
+ <java-symbol type="drawable" name="ic_wifi_4_signal_1" />
+ <java-symbol type="drawable" name="ic_wifi_4_signal_2" />
+ <java-symbol type="drawable" name="ic_wifi_4_signal_3" />
+ <java-symbol type="drawable" name="ic_wifi_4_signal_4" />
+ <java-symbol type="drawable" name="ic_wifi_5_signal_0" />
+ <java-symbol type="drawable" name="ic_wifi_5_signal_1" />
+ <java-symbol type="drawable" name="ic_wifi_5_signal_2" />
+ <java-symbol type="drawable" name="ic_wifi_5_signal_3" />
+ <java-symbol type="drawable" name="ic_wifi_5_signal_4" />
+ <java-symbol type="drawable" name="ic_wifi_6_signal_0" />
+ <java-symbol type="drawable" name="ic_wifi_6_signal_1" />
+ <java-symbol type="drawable" name="ic_wifi_6_signal_2" />
+ <java-symbol type="drawable" name="ic_wifi_6_signal_3" />
+ <java-symbol type="drawable" name="ic_wifi_6_signal_4" />
<java-symbol type="drawable" name="ic_signal_wifi_transient_animation" />
<java-symbol type="drawable" name="ic_hotspot_transient_animation" />
<java-symbol type="drawable" name="ic_bluetooth_transient_animation" />
@@ -2101,6 +2117,7 @@
<java-symbol type="string" name="config_geocoderProviderPackageName" />
<java-symbol type="string" name="config_geofenceProviderPackageName" />
<java-symbol type="string" name="config_networkLocationProviderPackageName" />
+ <java-symbol type="string" name="config_comboNetworkLocationProvider" />
<java-symbol type="string" name="config_wimaxManagerClassname" />
<java-symbol type="string" name="config_wimaxNativeLibLocation" />
<java-symbol type="string" name="config_wimaxServiceClassname" />
@@ -2230,6 +2247,7 @@
<java-symbol type="string" name="config_primaryLocationTimeZoneProviderPackageName" />
<java-symbol type="bool" name="config_enableSecondaryLocationTimeZoneProvider" />
<java-symbol type="string" name="config_secondaryLocationTimeZoneProviderPackageName" />
+ <java-symbol type="string" name="config_optionalPackageVerifierName" />
<java-symbol type="bool" name="config_autoResetAirplaneMode" />
<java-symbol type="string" name="config_notificationAccessConfirmationActivity" />
@@ -2722,6 +2740,7 @@
<java-symbol type="bool" name="config_restart_radio_on_pdp_fail_regular_deactivation" />
<java-symbol type="array" name="networks_not_clear_data" />
<java-symbol type="bool" name="config_switch_phone_on_voice_reg_state_change" />
+ <java-symbol type="bool" name="config_wait_for_ims_deregistration_before_radio_poweroff" />
<java-symbol type="string" name="whichHomeApplicationNamed" />
<java-symbol type="string" name="whichHomeApplicationLabel" />
<java-symbol type="bool" name="config_sms_force_7bit_encoding" />
@@ -3837,7 +3856,11 @@
<java-symbol type="dimen" name="car_padding_4" />
<java-symbol type="style" name="Theme.DeviceDefault.Light.Dialog.Alert.UserSwitchingDialog" />
+ <java-symbol type="integer" name="config_sms_authorization_timeout_ms" />
+ <java-symbol type="bool" name="config_sms_authorization_enabled" />
+
<java-symbol type="string" name="battery_saver_description_with_learn_more" />
+ <java-symbol type="bool" name="config_primarycard" />
<java-symbol type="string" name="confirm_battery_saver" />
<java-symbol type="attr" name="opticalInsetLeft" />
@@ -3849,6 +3872,10 @@
<java-symbol type="drawable" name="ic_arrow_forward" />
<java-symbol type="drawable" name="ic_permission" />
+ <!-- For Dual SoftaAp -->
+ <java-symbol type="array" name="config_wifi_dual_sap_interfaces" />
+ <java-symbol type="bool" name="config_wifi_dual_sap_mode_enabled" />
+
<java-symbol type="integer" name="config_defaultHapticFeedbackIntensity" />
<java-symbol type="integer" name="config_defaultNotificationVibrationIntensity" />
<java-symbol type="integer" name="config_defaultRingVibrationIntensity" />
@@ -4461,6 +4488,8 @@
<java-symbol type="color" name="overview_background"/>
+ <java-symbol type="integer" name="config_maximumDelayTimeToDeactivateDataCall" />
+
<java-symbol type="string" name="config_secondaryBuiltInDisplayCutout" />
<java-symbol type="string" name="config_secondaryBuiltInDisplayCutoutRectApproximation" />
<java-symbol type="bool" name="config_fillSecondaryBuiltInDisplayCutout" />
diff --git a/core/tests/ConnectivityManagerTest/AndroidManifest.xml b/core/tests/ConnectivityManagerTest/AndroidManifest.xml
index 796d7e8ff407..b647191c2aec 100644
--- a/core/tests/ConnectivityManagerTest/AndroidManifest.xml
+++ b/core/tests/ConnectivityManagerTest/AndroidManifest.xml
@@ -83,5 +83,6 @@
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.INJECT_EVENTS" />
<uses-permission android:name="android.permission.DEVICE_POWER" />
+ <uses-permission android:name="android.permission.MANAGE_TEST_NETWORKS" />
</manifest>
diff --git a/core/tests/coretests/src/com/android/internal/os/BinderDeathDispatcherTest.java b/core/tests/coretests/src/com/android/internal/os/BinderDeathDispatcherTest.java
index 83103333f68b..942045c8bf35 100644
--- a/core/tests/coretests/src/com/android/internal/os/BinderDeathDispatcherTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BinderDeathDispatcherTest.java
@@ -17,7 +17,6 @@ package com.android.internal.os;
import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
@@ -32,14 +31,14 @@ import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ShellCallback;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.FileDescriptor;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
public class BinderDeathDispatcherTest {
@@ -121,7 +120,7 @@ public class BinderDeathDispatcherTest {
public void die() {
isAlive = false;
if (mRecipient != null) {
- mRecipient.binderDied(this);
+ mRecipient.binderDied();
}
mRecipient = null;
}
@@ -228,33 +227,33 @@ public class BinderDeathDispatcherTest {
// Kill the targets.
t1.die();
- verify(r1, times(1)).binderDied(t1);
- verify(r2, times(1)).binderDied(t1);
- verify(r3, times(1)).binderDied(t1);
- verify(r4, times(0)).binderDied(any());
- verify(r5, times(0)).binderDied(any());
+ verify(r1, times(1)).binderDied();
+ verify(r2, times(1)).binderDied();
+ verify(r3, times(1)).binderDied();
+ verify(r4, times(0)).binderDied();
+ verify(r5, times(0)).binderDied();
assertThat(d.getTargetsForTest().size()).isEqualTo(2);
reset(r1, r2, r3, r4, r5);
t2.die();
- verify(r1, times(1)).binderDied(t2);
- verify(r2, times(0)).binderDied(any());
- verify(r3, times(0)).binderDied(any());
- verify(r4, times(0)).binderDied(any());
- verify(r5, times(0)).binderDied(any());
+ verify(r1, times(1)).binderDied();
+ verify(r2, times(0)).binderDied();
+ verify(r3, times(0)).binderDied();
+ verify(r4, times(0)).binderDied();
+ verify(r5, times(0)).binderDied();
assertThat(d.getTargetsForTest().size()).isEqualTo(1);
reset(r1, r2, r3, r4, r5);
t3.die();
- verify(r1, times(0)).binderDied(any());
- verify(r2, times(0)).binderDied(any());
- verify(r3, times(1)).binderDied(t3);
- verify(r4, times(0)).binderDied(any());
- verify(r5, times(1)).binderDied(t3);
+ verify(r1, times(0)).binderDied();
+ verify(r2, times(0)).binderDied();
+ verify(r3, times(1)).binderDied();
+ verify(r4, times(0)).binderDied();
+ verify(r5, times(1)).binderDied();
assertThat(d.getTargetsForTest().size()).isEqualTo(0);
@@ -263,27 +262,4 @@ public class BinderDeathDispatcherTest {
assertThat(d.getTargetsForTest().size()).isEqualTo(0);
}
-
- @Test
- public void duplicateRegistrations() {
- BinderDeathDispatcher<MyTarget> d = new BinderDeathDispatcher<>();
-
- MyTarget t1 = new MyTarget();
-
- DeathRecipient r1 = mock(DeathRecipient.class);
- DeathRecipient r2 = mock(DeathRecipient.class);
-
- for (int i = 0; i < 5; i++) {
- assertThat(d.linkToDeath(t1, r1)).isEqualTo(1);
- }
- assertThat(d.linkToDeath(t1, r2)).isEqualTo(2);
-
- t1.die();
- verify(r1, times(1)).binderDied(t1);
- verify(r2, times(1)).binderDied(t1);
-
- d.unlinkToDeath(t1, r1);
- d.unlinkToDeath(t1, r2);
- assertThat(d.getTargetsForTest()).isEmpty();
- }
}
diff --git a/data/etc/framework-sysconfig.xml b/data/etc/framework-sysconfig.xml
index 2162ec421dcd..9ed0171f63a1 100644..100755
--- a/data/etc/framework-sysconfig.xml
+++ b/data/etc/framework-sysconfig.xml
@@ -56,4 +56,8 @@
<!-- Whitelist of bundled applications which all handle URLs to their websites by default -->
<app-link package="com.android.carrierdefaultapp" />
+
+ <!-- Whitelist of what components are permitted to run in the background -->
+ <allow-in-power-save package="com.android.deskclock" />
+
</config>
diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java
index 2faa532a241d..a45c104a016c 100644
--- a/graphics/java/android/graphics/BLASTBufferQueue.java
+++ b/graphics/java/android/graphics/BLASTBufferQueue.java
@@ -32,6 +32,8 @@ public final class BLASTBufferQueue {
private static native long nativeCreate(String name);
private static native void nativeDestroy(long ptr);
private static native Surface nativeGetSurface(long ptr, boolean includeSurfaceControlHandle);
+ private static native void nativeSetUndequeuedBufferCount(long ptr, int count);
+ private static native int nativeGetUndequeuedBufferCount(long ptr);
private static native void nativeSetNextTransaction(long ptr, long transactionPtr);
private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height,
int format, long transactionPtr);
@@ -83,6 +85,20 @@ public final class BLASTBufferQueue {
}
/**
+ * Set undequeued buffer count
+ */
+ public void setUndequeuedBufferCount(int count) {
+ nativeSetUndequeuedBufferCount(mNativeObject, count);
+ }
+
+ /**
+ * @return the count of undequeued buffer
+ */
+ public int getUndequeuedBufferCount() {
+ return nativeGetUndequeuedBufferCount(mNativeObject);
+ }
+
+ /**
* Send the transaction to BBQ so the next frame can be added and not applied immediately.
* This gives the caller a chance to apply the transaction when it's ready.
* @param t The transaction to add the frame to. This can be null to clear the transaction.
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 526b84e85e38..b9336bfa65f1 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -791,6 +791,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
@Nullable
public Location getLastKnownLocation(@NonNull String provider) {
+ android.util.SeempLog.record(46);
return getLastKnownLocation(provider, new LastLocationRequest.Builder().build());
}
@@ -977,6 +978,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestSingleUpdate(
@NonNull String provider, @NonNull LocationListener listener, @Nullable Looper looper) {
+ android.util.SeempLog.record(64);
Preconditions.checkArgument(provider != null, "invalid null provider");
Handler handler = looper == null ? new Handler() : new Handler(looper);
@@ -1016,6 +1018,7 @@ public class LocationManager {
@NonNull Criteria criteria,
@NonNull LocationListener listener,
@Nullable Looper looper) {
+ android.util.SeempLog.record(64);
Preconditions.checkArgument(criteria != null, "invalid null criteria");
Handler handler = looper == null ? new Handler() : new Handler(looper);
@@ -1049,6 +1052,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestSingleUpdate(@NonNull String provider,
@NonNull PendingIntent pendingIntent) {
+ android.util.SeempLog.record(64);
Preconditions.checkArgument(provider != null, "invalid null provider");
requestLocationUpdates(
@@ -1083,6 +1087,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestSingleUpdate(@NonNull Criteria criteria,
@NonNull PendingIntent pendingIntent) {
+ android.util.SeempLog.record(64);
Preconditions.checkArgument(criteria != null, "invalid null criteria");
requestLocationUpdates(
@@ -1119,6 +1124,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(@NonNull String provider, long minTimeMs, float minDistanceM,
@NonNull LocationListener listener) {
+ android.util.SeempLog.record(47);
requestLocationUpdates(provider, minTimeMs, minDistanceM, listener, null);
}
@@ -1147,6 +1153,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(@NonNull String provider, long minTimeMs, float minDistanceM,
@NonNull LocationListener listener, @Nullable Looper looper) {
+ android.util.SeempLog.record(47);
Handler handler = looper == null ? new Handler() : new Handler(looper);
requestLocationUpdates(provider, minTimeMs, minDistanceM, new HandlerExecutor(handler),
listener);
@@ -1181,6 +1188,7 @@ public class LocationManager {
float minDistanceM,
@NonNull @CallbackExecutor Executor executor,
@NonNull LocationListener listener) {
+ android.util.SeempLog.record(47);
Preconditions.checkArgument(provider != null, "invalid null provider");
requestLocationUpdates(
@@ -1218,6 +1226,7 @@ public class LocationManager {
public void requestLocationUpdates(long minTimeMs, float minDistanceM,
@NonNull Criteria criteria, @NonNull LocationListener listener,
@Nullable Looper looper) {
+ android.util.SeempLog.record(47);
Handler handler = looper == null ? new Handler() : new Handler(looper);
requestLocationUpdates(minTimeMs, minDistanceM, criteria, new HandlerExecutor(handler),
listener);
@@ -1256,6 +1265,7 @@ public class LocationManager {
@NonNull Criteria criteria,
@NonNull @CallbackExecutor Executor executor,
@NonNull LocationListener listener) {
+ android.util.SeempLog.record(47);
Preconditions.checkArgument(criteria != null, "invalid null criteria");
requestLocationUpdates(
@@ -1284,6 +1294,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(@NonNull String provider, long minTimeMs, float minDistanceM,
@NonNull PendingIntent pendingIntent) {
+ android.util.SeempLog.record(47);
Preconditions.checkArgument(provider != null, "invalid null provider");
requestLocationUpdates(
@@ -1318,6 +1329,7 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(long minTimeMs, float minDistanceM,
@NonNull Criteria criteria, @NonNull PendingIntent pendingIntent) {
+ android.util.SeempLog.record(47);
Preconditions.checkArgument(criteria != null, "invalid null criteria");
requestLocationUpdates(
FUSED_PROVIDER,
@@ -1356,6 +1368,7 @@ public class LocationManager {
@Nullable LocationRequest locationRequest,
@NonNull LocationListener listener,
@Nullable Looper looper) {
+ android.util.SeempLog.record(47);
Handler handler = looper == null ? new Handler() : new Handler(looper);
requestLocationUpdates(locationRequest, new HandlerExecutor(handler), listener);
}
@@ -1386,6 +1399,7 @@ public class LocationManager {
@Nullable LocationRequest locationRequest,
@NonNull @CallbackExecutor Executor executor,
@NonNull LocationListener listener) {
+ android.util.SeempLog.record(47);
if (locationRequest == null) {
locationRequest = LocationRequest.create();
}
@@ -1529,6 +1543,7 @@ public class LocationManager {
public void requestLocationUpdates(@NonNull String provider,
@NonNull LocationRequest locationRequest,
@NonNull PendingIntent pendingIntent) {
+ android.util.SeempLog.record(47);
Preconditions.checkArgument(provider != null, "invalid null provider");
Preconditions.checkArgument(locationRequest != null, "invalid null location request");
Preconditions.checkArgument(pendingIntent != null, "invalid null pending intent");
@@ -1950,6 +1965,7 @@ public class LocationManager {
*/
public boolean sendExtraCommand(
@NonNull String provider, @NonNull String command, @Nullable Bundle extras) {
+ android.util.SeempLog.record(48);
Preconditions.checkArgument(provider != null, "invalid null provider");
Preconditions.checkArgument(command != null, "invalid null command");
@@ -2183,8 +2199,8 @@ public class LocationManager {
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void addProximityAlert(double latitude, double longitude, float radius, long expiration,
@NonNull PendingIntent pendingIntent) {
+ android.util.SeempLog.record(45);
Preconditions.checkArgument(pendingIntent != null, "invalid null pending intent");
-
if (Compatibility.isChangeEnabled(BLOCK_UNTARGETED_PENDING_INTENTS)) {
Preconditions.checkArgument(pendingIntent.isTargetedToPackage(),
"pending intent must be targeted to a package");
@@ -2340,6 +2356,7 @@ public class LocationManager {
@Deprecated
@RequiresPermission(ACCESS_FINE_LOCATION)
public boolean addGpsStatusListener(GpsStatus.Listener listener) {
+ android.util.SeempLog.record(43);
if (Compatibility.isChangeEnabled(BLOCK_GPS_STATUS_USAGE)) {
throw new UnsupportedOperationException(
"GpsStatus APIs not supported, please use GnssStatus APIs instead");
@@ -2450,6 +2467,7 @@ public class LocationManager {
@Deprecated
@RequiresPermission(ACCESS_FINE_LOCATION)
public boolean addNmeaListener(@NonNull GpsStatus.NmeaListener listener) {
+ android.util.SeempLog.record(44);
return false;
}
diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java
index a8199c4d028e..2988ca8c715c 100644
--- a/media/java/android/media/AudioFormat.java
+++ b/media/java/android/media/AudioFormat.java
@@ -355,6 +355,31 @@ public final class AudioFormat implements Parcelable {
/** Audio data format: DRA compressed */
public static final int ENCODING_DRA = 28;
+ /** Audio data format: AMRNB
+ * @hide
+ * */
+ public static final int ENCODING_AMRNB = 100;
+ /** Audio data format: AMRWB
+ * @hide
+ * */
+ public static final int ENCODING_AMRWB = 101;
+ /** Audio data format: EVRC
+ * @hide
+ * */
+ public static final int ENCODING_EVRC = 102;
+ /** Audio data format: EVRCB
+ * @hide
+ * */
+ public static final int ENCODING_EVRCB = 103;
+ /** Audio data format: EVRCWB
+ * @hide
+ * */
+ public static final int ENCODING_EVRCWB = 104;
+ /** Audio data format: EVRCNW
+ * @hide
+ * */
+ public static final int ENCODING_EVRCNW = 105;
+
/** @hide */
public static String toLogFriendlyEncoding(int enc) {
switch(enc) {
@@ -673,6 +698,11 @@ public final class AudioFormat implements Parcelable {
public static final int CHANNEL_IN_STEREO = (CHANNEL_IN_LEFT | CHANNEL_IN_RIGHT);
/** @hide */
public static final int CHANNEL_IN_FRONT_BACK = CHANNEL_IN_FRONT | CHANNEL_IN_BACK;
+ /** @hide */
+ public static final int CHANNEL_IN_5POINT1 = (CHANNEL_IN_LEFT |
+ CHANNEL_IN_RIGHT | CHANNEL_IN_FRONT | CHANNEL_IN_BACK |
+ CHANNEL_IN_LEFT_PROCESSED | CHANNEL_IN_RIGHT_PROCESSED);
+
// CHANNEL_IN_ALL is not yet defined; if added then it should match AUDIO_CHANNEL_IN_ALL
/** @hide */
@@ -691,6 +721,15 @@ public final class AudioFormat implements Parcelable {
case ENCODING_PCM_FLOAT:
case ENCODING_PCM_32BIT:
return 4;
+ case ENCODING_AMRNB:
+ return 32;
+ case ENCODING_AMRWB:
+ return 61;
+ case ENCODING_EVRC:
+ case ENCODING_EVRCB:
+ case ENCODING_EVRCWB:
+ case ENCODING_EVRCNW:
+ return 23;
case ENCODING_INVALID:
default:
throw new IllegalArgumentException("Bad audio format " + audioFormat);
@@ -717,6 +756,12 @@ public final class AudioFormat implements Parcelable {
case ENCODING_AAC_ELD:
case ENCODING_AAC_XHE:
case ENCODING_AC4:
+ case ENCODING_AMRNB:
+ case ENCODING_AMRWB:
+ case ENCODING_EVRC:
+ case ENCODING_EVRCB:
+ case ENCODING_EVRCWB:
+ case ENCODING_EVRCNW:
case ENCODING_E_AC3_JOC:
case ENCODING_DOLBY_MAT:
case ENCODING_OPUS:
@@ -796,6 +841,12 @@ public final class AudioFormat implements Parcelable {
case ENCODING_AAC_ELD:
case ENCODING_AAC_XHE:
case ENCODING_AC4:
+ case ENCODING_AMRNB:
+ case ENCODING_AMRWB:
+ case ENCODING_EVRC:
+ case ENCODING_EVRCB:
+ case ENCODING_EVRCWB:
+ case ENCODING_EVRCNW:
case ENCODING_E_AC3_JOC:
case ENCODING_DOLBY_MAT:
case ENCODING_OPUS:
@@ -1122,6 +1173,12 @@ public final class AudioFormat implements Parcelable {
case ENCODING_AAC_ELD:
case ENCODING_AAC_XHE:
case ENCODING_AC4:
+ case ENCODING_AMRNB:
+ case ENCODING_AMRWB:
+ case ENCODING_EVRC:
+ case ENCODING_EVRCB:
+ case ENCODING_EVRCWB:
+ case ENCODING_EVRCNW:
case ENCODING_E_AC3_JOC:
case ENCODING_DOLBY_MAT:
case ENCODING_OPUS:
@@ -1351,6 +1408,12 @@ public final class AudioFormat implements Parcelable {
ENCODING_AAC_ELD,
ENCODING_AAC_XHE,
ENCODING_AC4,
+ ENCODING_AMRNB,
+ ENCODING_AMRWB,
+ ENCODING_EVRC,
+ ENCODING_EVRCB,
+ ENCODING_EVRCWB,
+ ENCODING_EVRCNW,
ENCODING_E_AC3_JOC,
ENCODING_DOLBY_MAT,
ENCODING_OPUS,
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 38f9607c9529..bc8ccc333002 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1576,6 +1576,8 @@ public class AudioManager {
*/
public void setSpeakerphoneOn(boolean on){
final IAudioService service = getService();
+ Log.i(TAG, "In setSpeakerphoneOn(), on: " + on + ", calling application: "
+ + mApplicationContext.getOpPackageName());
try {
service.setSpeakerphoneOn(mICallBack, on);
} catch (RemoteException e) {
@@ -1589,6 +1591,8 @@ public class AudioManager {
* @return true if speakerphone is on, false if it's off
*/
public boolean isSpeakerphoneOn() {
+ Log.i(TAG, "In isSpeakerphoneOn(), calling application: "
+ + mApplicationContext.getOpPackageName());
final IAudioService service = getService();
try {
return service.isSpeakerphoneOn();
@@ -2533,8 +2537,12 @@ public class AudioManager {
* @see #startBluetoothSco()
*/
public boolean isBluetoothScoAvailableOffCall() {
- return getContext().getResources().getBoolean(
- com.android.internal.R.bool.config_bluetooth_sco_off_call);
+ boolean retval;
+ retval = getContext().getResources().getBoolean(
+ com.android.internal.R.bool.config_bluetooth_sco_off_call);
+ Log.i(TAG, "In isBluetoothScoAvailableOffCall(), calling appilication: " +
+ mApplicationContext.getOpPackageName()+", return value: " + retval);
+ return retval;
}
/**
@@ -2584,6 +2592,8 @@ public class AudioManager {
*/
public void startBluetoothSco(){
final IAudioService service = getService();
+ Log.i(TAG, "In startbluetoothSco(), calling application: "
+ + mApplicationContext.getOpPackageName());
try {
service.startBluetoothSco(mICallBack,
getContext().getApplicationInfo().targetSdkVersion);
@@ -2609,6 +2619,8 @@ public class AudioManager {
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public void startBluetoothScoVirtualCall() {
+ Log.i(TAG, "In startBluetoothScoVirtualCall(), calling application: "
+ + mApplicationContext.getOpPackageName());
final IAudioService service = getService();
try {
service.startBluetoothScoVirtualCall(mICallBack);
@@ -2629,6 +2641,8 @@ public class AudioManager {
// Also used for connections started with {@link #startBluetoothScoVirtualCall()}
public void stopBluetoothSco(){
final IAudioService service = getService();
+ Log.i(TAG, "In stopBluetoothSco(), calling application: "
+ + mApplicationContext.getOpPackageName());
try {
service.stopBluetoothSco(mICallBack);
} catch (RemoteException e) {
@@ -2647,6 +2661,8 @@ public class AudioManager {
*/
public void setBluetoothScoOn(boolean on){
final IAudioService service = getService();
+ Log.i(TAG, "In setBluetoothScoOn(), on: " + on + ", calling application: "
+ + mApplicationContext.getOpPackageName());
try {
service.setBluetoothScoOn(on);
} catch (RemoteException e) {
@@ -2662,6 +2678,8 @@ public class AudioManager {
*/
public boolean isBluetoothScoOn() {
final IAudioService service = getService();
+ Log.i(TAG, "In isBluetoothScoOn(), calling application: "
+ + mApplicationContext.getOpPackageName());
try {
return service.isBluetoothScoOn();
} catch (RemoteException e) {
@@ -3265,6 +3283,12 @@ public class AudioManager {
*/
public void setParameters(String keyValuePairs) {
AudioSystem.setParameters(keyValuePairs);
+ final IAudioService service = getService();
+ try {
+ service.cacheParameters(keyValuePairs);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
@@ -5853,6 +5877,38 @@ public class AudioManager {
}
}
+ /**
+ * Indicate A2DP source or sink active device change and eventually suppress
+ * the {@link AudioManager.ACTION_AUDIO_BECOMING_NOISY} intent.
+ * This operation is asynchronous but its execution will still be sequentially scheduled
+ * relative to calls to {@link #setBluetoothHearingAidDeviceConnectionState(BluetoothDevice,
+ * int, boolean, int)} and
+ * {@link #handleBluetoothA2dpDeviceConfigChange(BluetoothDevice)}.
+ * @param device Bluetooth device connected/disconnected
+ * @param state new connection state (BluetoothProfile.STATE_xxx)
+ * @param profile profile for the A2DP device
+ * (either {@link android.bluetooth.BluetoothProfile.A2DP} or
+ * {@link android.bluetooth.BluetoothProfile.A2DP_SINK})
+ * @param a2dpVolume New volume for the connecting device. Does nothing if
+ * disconnecting. Pass value -1 in case you want this field to be ignored
+ * @param suppressNoisyIntent if true the
+ * {@link AudioManager.ACTION_AUDIO_BECOMING_NOISY} intent will not be sent.
+ * @return a delay in ms that the caller should wait before broadcasting
+ * BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED intent.
+ * {@hide}
+ */
+ public void handleBluetoothA2dpActiveDeviceChange(
+ BluetoothDevice device, int state, int profile,
+ boolean suppressNoisyIntent, int a2dpVolume) {
+ final IAudioService service = getService();
+ try {
+ service.handleBluetoothA2dpActiveDeviceChange(device,
+ state, profile, suppressNoisyIntent, a2dpVolume);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
/** {@hide} */
public IRingtonePlayer getRingtonePlayer() {
try {
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index 7c6ae28bdd30..2315b2d4c957 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -990,6 +990,12 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
case AudioFormat.ENCODING_PCM_FLOAT:
case AudioFormat.ENCODING_PCM_16BIT:
case AudioFormat.ENCODING_PCM_8BIT:
+ case AudioFormat.ENCODING_AMRNB:
+ case AudioFormat.ENCODING_AMRWB:
+ case AudioFormat.ENCODING_EVRC:
+ case AudioFormat.ENCODING_EVRCB:
+ case AudioFormat.ENCODING_EVRCWB:
+ case AudioFormat.ENCODING_EVRCNW:
mAudioFormat = audioFormat;
break;
default:
@@ -1233,6 +1239,9 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
case (AudioFormat.CHANNEL_IN_FRONT | AudioFormat.CHANNEL_IN_BACK):
channelCount = 2;
break;
+ case AudioFormat.CHANNEL_IN_5POINT1:
+ channelCount = 6;
+ break;
case AudioFormat.CHANNEL_INVALID:
default:
loge("getMinBufferSize(): Invalid channel configuration.");
@@ -1280,6 +1289,7 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
*/
public void startRecording()
throws IllegalStateException {
+ android.util.SeempLog.record(70);
if (mState != STATE_INITIALIZED) {
throw new IllegalStateException("startRecording() called on an "
+ "uninitialized AudioRecord.");
@@ -1303,6 +1313,7 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
*/
public void startRecording(MediaSyncEvent syncEvent)
throws IllegalStateException {
+ android.util.SeempLog.record(70);
if (mState != STATE_INITIALIZED) {
throw new IllegalStateException("startRecording() called on an "
+ "uninitialized AudioRecord.");
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 6ff551a68c18..f1197edd453d 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -230,6 +230,14 @@ public class AudioSystem
public static final int AUDIO_FORMAT_APTX_HD = 0x21000000;
/** @hide */
public static final int AUDIO_FORMAT_LDAC = 0x23000000;
+ /** @hide */
+ public static final int AUDIO_FORMAT_CELT = 0x26000000;
+ /** @hide */
+ public static final int AUDIO_FORMAT_APTX_ADAPTIVE = 0x27000000;
+ /** @hide */
+ public static final int AUDIO_FORMAT_APTX_TWSP = 0x2A000000;
+ /** @hide */
+ public static final int VX_AUDIO_FORMAT_LC3 = 0x2B000000;
/** @hide */
@IntDef(flag = false, prefix = "AUDIO_FORMAT_", value = {
@@ -256,6 +264,13 @@ public class AudioSystem
case AUDIO_FORMAT_APTX: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX;
case AUDIO_FORMAT_APTX_HD: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD;
case AUDIO_FORMAT_LDAC: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC;
+ case AUDIO_FORMAT_CELT: return BluetoothCodecConfig.SOURCE_CODEC_TYPE_CELT;
+ case AUDIO_FORMAT_APTX_ADAPTIVE:
+ return BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_ADAPTIVE;
+ case AUDIO_FORMAT_APTX_TWSP:
+ return BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_TWSP;
+ case VX_AUDIO_FORMAT_LC3:
+ return BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3;
default:
Log.e(TAG, "Unknown audio format 0x" + Integer.toHexString(audioFormat)
+ " for conversion to BT codec");
@@ -281,6 +296,14 @@ public class AudioSystem
return AudioSystem.AUDIO_FORMAT_APTX_HD;
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC:
return AudioSystem.AUDIO_FORMAT_LDAC;
+ case BluetoothCodecConfig.SOURCE_CODEC_TYPE_CELT:
+ return AudioSystem.AUDIO_FORMAT_CELT;
+ case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_ADAPTIVE:
+ return AudioSystem.AUDIO_FORMAT_APTX_ADAPTIVE;
+ case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_TWSP:
+ return AudioSystem.AUDIO_FORMAT_APTX_TWSP;
+ case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3:
+ return AudioSystem.VX_AUDIO_FORMAT_LC3;
default:
Log.e(TAG, "Unknown BT codec 0x" + Integer.toHexString(btCodec)
+ " for conversion to audio format");
@@ -381,6 +404,8 @@ public class AudioSystem
return "AUDIO_FORMAT_LHDC_LL";
case /* AUDIO_FORMAT_APTX_TWSP */ 0x2A000000:
return "AUDIO_FORMAT_APTX_TWSP";
+ case /* VX_AUDIO_FORMAT_LC3 */ 0x2B000000:
+ return "VX_AUDIO_FORMAT_LC3";
/* Aliases */
case /* AUDIO_FORMAT_PCM_16_BIT */ 0x1:
diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl
index abd067cfe2f3..d06871b41111 100755
--- a/media/java/android/media/IAudioService.aidl
+++ b/media/java/android/media/IAudioService.aidl
@@ -216,6 +216,9 @@ interface IAudioService {
void handleBluetoothA2dpDeviceConfigChange(in BluetoothDevice device);
+ void handleBluetoothA2dpActiveDeviceChange(in BluetoothDevice device,
+ int state, int profile, boolean suppressNoisyIntent, int a2dpVolume);
+
@UnsupportedAppUsage
AudioRoutesInfo startWatchingRoutes(in IAudioRoutesObserver observer);
@@ -332,6 +335,8 @@ interface IAudioService {
oneway void setMultiAudioFocusEnabled(in boolean enabled);
+ void cacheParameters(in String keyValuePairs);
+
int setPreferredDevicesForCapturePreset(
in int capturePreset, in List<AudioDeviceAttributes> devices);
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index c3b1bca8e143..dadeed110f01 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -181,10 +181,15 @@ public final class MediaCodecInfo {
public String mName;
public int mValue;
public boolean mDefault;
+ public boolean mInternal;
public Feature(String name, int value, boolean def) {
+ this(name, value, def, false /* internal */);
+ }
+ public Feature(String name, int value, boolean def, boolean internal) {
mName = name;
mValue = value;
mDefault = def;
+ mInternal = internal;
}
}
@@ -571,6 +576,11 @@ public final class MediaCodecInfo {
public static final String FEATURE_LowLatency = "low-latency";
/**
+ * Do not include in REGULAR_CODECS list in MediaCodecList.
+ */
+ private static final String FEATURE_SpecialCodec = "special-codec";
+
+ /**
* <b>video encoder only</b>: codec supports quantization parameter bounds.
* @see MediaFormat#KEY_VIDEO_QP_MAX
* @see MediaFormat#KEY_VIDEO_QP_MIN
@@ -608,6 +618,8 @@ public final class MediaCodecInfo {
new Feature(FEATURE_MultipleFrames, (1 << 5), false),
new Feature(FEATURE_DynamicTimestamp, (1 << 6), false),
new Feature(FEATURE_LowLatency, (1 << 7), true),
+ // feature to exclude codec from REGULAR codec list
+ new Feature(FEATURE_SpecialCodec, (1 << 30), false, true),
};
private static final Feature[] encoderFeatures = {
@@ -615,6 +627,8 @@ public final class MediaCodecInfo {
new Feature(FEATURE_MultipleFrames, (1 << 1), false),
new Feature(FEATURE_DynamicTimestamp, (1 << 2), false),
new Feature(FEATURE_QpBounds, (1 << 3), false),
+ // feature to exclude codec from REGULAR codec list
+ new Feature(FEATURE_SpecialCodec, (1 << 30), false, true),
};
/** @hide */
@@ -622,7 +636,9 @@ public final class MediaCodecInfo {
Feature[] features = getValidFeatures();
String[] res = new String[features.length];
for (int i = 0; i < res.length; i++) {
- res[i] = features[i].mName;
+ if (!features[i].mInternal) {
+ res[i] = features[i].mName;
+ }
}
return res;
}
@@ -770,6 +786,10 @@ public final class MediaCodecInfo {
// check feature support
for (Feature feat: getValidFeatures()) {
+ if (feat.mInternal) {
+ continue;
+ }
+
Integer yesNo = (Integer)map.get(MediaFormat.KEY_FEATURE_ + feat.mName);
if (yesNo == null) {
continue;
@@ -1083,7 +1103,9 @@ public final class MediaCodecInfo {
mFlagsRequired |= feat.mValue;
}
mFlagsSupported |= feat.mValue;
- mDefaultFormat.setInteger(key, 1);
+ if (!feat.mInternal) {
+ mDefaultFormat.setInteger(key, 1);
+ }
// TODO restrict features by mFlagsVerified once all codecs reliably verify them
}
}
@@ -2281,12 +2303,6 @@ public final class MediaCodecInfo {
if (size == null || size.getWidth() * size.getHeight() <= 0) {
continue;
}
- if (size.getWidth() > SIZE_RANGE.getUpper()
- || size.getHeight() > SIZE_RANGE.getUpper()) {
- size = new Size(
- Math.min(size.getWidth(), SIZE_RANGE.getUpper()),
- Math.min(size.getHeight(), SIZE_RANGE.getUpper()));
- }
Range<Long> range = Utils.parseLongRange(map.get(key), null);
if (range == null || range.getLower() < 0 || range.getUpper() < 0) {
continue;
diff --git a/media/java/android/media/MediaFile.java b/media/java/android/media/MediaFile.java
index 70d79378da3d..87458fd0ce50 100644
--- a/media/java/android/media/MediaFile.java
+++ b/media/java/android/media/MediaFile.java
@@ -157,6 +157,20 @@ public class MediaFile {
"application/vnd.ms-powerpoint");
addFileType(MtpConstants.FORMAT_MS_POWERPOINT_PRESENTATION,
"application/vnd.openxmlformats-officedocument.presentationml.presentation");
+
+ // addFileType(MtpConstants.FORMAT_DIVX, "video/divx");
+ // addFileType(MtpConstants.FORMAT_FLV, "video/flv");
+ // addFileType(MtpConstants.FORMAT_QCP, "audio/qcelp");
+ // addFileType(MtpConstants.FORMAT_AC3, "audio/ac3");
+ // addFileType(MtpConstants.FORMAT_EC3, "audio/eac3");
+ // addFileType(MtpConstants.FORMAT_AIFF, "audio/x-aiff");
+ // addFileType(MtpConstants.FORMAT_APE, "audio/x-ape");
+ // addFileType(MtpConstants.FORMAT_DSD, "audio/x-dsf");
+ // addFileType(MtpConstants.FORMAT_DSD, "audio/x-dff");
+ // addFileType(MtpConstants.FORMAT_DSD, "audio/dsd");
+ // addFileType(MtpConstants.FORMAT_MHAS, "audio/mhas");
+ // addFileType(MtpConstants.FORMAT_MP4, "audio/mhas");
+
}
/** @deprecated file types no longer exist */
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index 7d80e931c943..74d55e5eda3f 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -609,6 +609,12 @@ public class MediaRecorder implements AudioRouting,
/** Opus data in a Ogg container */
public static final int OGG = 11;
+
+ /** @hide QCP file format */
+ public static final int QCP = 20;
+
+ /** @hide WAVE media file format*/
+ public static final int WAVE = 21;
};
/**
@@ -654,6 +660,14 @@ public class MediaRecorder implements AudioRouting,
public static final int VORBIS = 6;
/** Opus audio codec */
public static final int OPUS = 7;
+ /** @hide EVRC audio codec */
+ public static final int EVRC = 10;
+ /** @hide QCELP audio codec */
+ public static final int QCELP = 11;
+ /** @hide Linear PCM audio codec */
+ public static final int LPCM = 12;
+ /** @hide MPEGH audio codec */
+ public static final int MPEGH = 13;
}
/**
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 2636ab227646..8dcdc989ec8f 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -953,7 +953,7 @@ android_media_MediaPlayer_native_setup(JNIEnv *env, jobject thiz, jobject weak_t
Parcel* parcel = parcelForJavaObject(env, jAttributionSource);
android::content::AttributionSourceState attributionSource;
attributionSource.readFromParcel(parcel);
- sp<MediaPlayer> mp = new MediaPlayer(attributionSource);
+ sp<MediaPlayer> mp = sp<MediaPlayer>::make(attributionSource);
if (mp == NULL) {
jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
return;
diff --git a/mime/java-res/vendor.mime.types b/mime/java-res/vendor.mime.types
index afb8f9e4ef39..1861909f1e7a 100644
--- a/mime/java-res/vendor.mime.types
+++ b/mime/java-res/vendor.mime.types
@@ -39,3 +39,11 @@
#
# Add your custom mappings below this line (with no "#" at the start of the line):
+?audio/qcelp qcp
+?audio/ac3 ac3
+?audio/eac3 ec3
+?audio/x-ape ape
+?audio/x-dsf dsf
+?audio/x-dff dff
+?audio/dsd dsd
+?video/divx divx \ No newline at end of file
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java
index c627dfb8abac..65e2140df256 100644
--- a/obex/javax/obex/ClientOperation.java
+++ b/obex/javax/obex/ClientOperation.java
@@ -50,7 +50,7 @@ import android.util.Log;
*/
public final class ClientOperation implements Operation, BaseStream {
- private static final String TAG = "ClientOperation";
+ private static final String TAG = "ObexClientOperation";
private static final boolean V = ObexHelper.VDBG;
@@ -460,6 +460,7 @@ public final class ClientOperation implements Operation, BaseStream {
> mMaxPacketSize) {
int end = 0;
int start = 0;
+ int processedLen = 0;
// split & send the headerArray in multiple packets.
while (end != headerArray.length) {
@@ -486,10 +487,17 @@ public final class ClientOperation implements Operation, BaseStream {
byte[] sendHeader = new byte[end - start];
System.arraycopy(headerArray, start, sendHeader, 0, sendHeader.length);
+ processedLen += sendHeader.length;
+ opCode = (processedLen == headerArray.length) ? ObexHelper.OBEX_OPCODE_GET_FINAL
+ : ObexHelper.OBEX_OPCODE_GET;
+ //Set GET FINAL (0x83) for Last Request Header packet as per GOEP2.1
if (!mParent.sendRequest(opCode, sendHeader, mReplyHeader, mPrivateInput, false)) {
return false;
}
-
+ if (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_OK) {
+ Log.i(TAG, "sendRequest return OBEX_HTTP_OK");
+ return true;
+ }
if (mReplyHeader.responseCode != ResponseCodes.OBEX_HTTP_CONTINUE) {
return false;
}
diff --git a/obex/javax/obex/ClientSession.java b/obex/javax/obex/ClientSession.java
index 272a920754f5..9aaf7bcda034 100644
--- a/obex/javax/obex/ClientSession.java
+++ b/obex/javax/obex/ClientSession.java
@@ -47,7 +47,7 @@ import android.util.Log;
*/
public final class ClientSession extends ObexSession {
- private static final String TAG = "ClientSession";
+ private static final String TAG = "ObexClientSession";
private boolean mOpen;
diff --git a/obex/javax/obex/ObexHelper.java b/obex/javax/obex/ObexHelper.java
index 843793ad98f8..0922be283912 100644
--- a/obex/javax/obex/ObexHelper.java
+++ b/obex/javax/obex/ObexHelper.java
@@ -53,7 +53,8 @@ import java.util.TimeZone;
public final class ObexHelper {
private static final String TAG = "ObexHelper";
- public static final boolean VDBG = false;
+ public static final String LOG_TAG = "BluetoothObex";
+ public static final boolean VDBG = Log.isLoggable(LOG_TAG, Log.VERBOSE);
/**
* Defines the basic packet length used by OBEX. Every OBEX packet has the
* same basic format:<BR>
@@ -90,6 +91,8 @@ public final class ObexHelper {
*/
public static final int MAX_CLIENT_PACKET_SIZE = 0xFC00;
+ public static final int A2DP_SCO_OBEX_MAX_CLIENT_PACKET_SIZE = 0x2000;
+
public static final int OBEX_OPCODE_FINAL_BIT_MASK = 0x80;
public static final int OBEX_OPCODE_CONNECT = 0x80;
@@ -194,6 +197,7 @@ public final class ObexHelper {
try {
while (index < headerArray.length) {
headerID = 0xFF & headerArray[index];
+ if (VDBG) Log.v(TAG,"updateHeaderSet headerID = " + headerID);
switch (headerID & (0xC0)) {
/*
@@ -212,9 +216,9 @@ public final class ObexHelper {
length = ((0xFF & headerArray[index]) << 8) +
(0xFF & headerArray[index + 1]);
index += 2;
- if (length <= OBEX_BYTE_SEQ_HEADER_LEN) {
+ if (length < OBEX_BYTE_SEQ_HEADER_LEN) {
Log.e(TAG, "Remote sent an OBEX packet with " +
- "incorrect header length = " + length);
+ "incorrect header length : " + length);
break;
}
length -= OBEX_BYTE_SEQ_HEADER_LEN;
@@ -382,8 +386,9 @@ public final class ObexHelper {
* Determine if there is a connection ID to send. If there is,
* then it should be the first header in the packet.
*/
+ if (VDBG) Log.v(TAG,"createHeader = " + head);
if ((headImpl.mConnectionID != null) && (headImpl.getHeader(HeaderSet.TARGET) == null)) {
-
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.CONNECTION_ID);
out.write((byte)HeaderSet.CONNECTION_ID);
out.write(headImpl.mConnectionID);
}
@@ -391,6 +396,7 @@ public final class ObexHelper {
// Count Header
intHeader = (Long)headImpl.getHeader(HeaderSet.COUNT);
if (intHeader != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.COUNT);
out.write((byte)HeaderSet.COUNT);
value = ObexHelper.convertToByteArray(intHeader.longValue());
out.write(value);
@@ -402,6 +408,7 @@ public final class ObexHelper {
// Name Header
stringHeader = (String)headImpl.getHeader(HeaderSet.NAME);
if (stringHeader != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.NAME);
out.write((byte)HeaderSet.NAME);
value = ObexHelper.convertToUnicodeByteArray(stringHeader);
length = value.length + 3;
@@ -422,6 +429,7 @@ public final class ObexHelper {
// Type Header
stringHeader = (String)headImpl.getHeader(HeaderSet.TYPE);
if (stringHeader != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.TYPE);
out.write((byte)HeaderSet.TYPE);
try {
value = stringHeader.getBytes("ISO8859_1");
@@ -443,6 +451,7 @@ public final class ObexHelper {
// Length Header
intHeader = (Long)headImpl.getHeader(HeaderSet.LENGTH);
if (intHeader != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.LENGTH);
out.write((byte)HeaderSet.LENGTH);
value = ObexHelper.convertToByteArray(intHeader.longValue());
out.write(value);
@@ -454,7 +463,7 @@ public final class ObexHelper {
// Time ISO Header
dateHeader = (Calendar)headImpl.getHeader(HeaderSet.TIME_ISO_8601);
if (dateHeader != null) {
-
+ if (VDBG) Log.v(TAG," Add dateHeader = " + HeaderSet.TIME_ISO_8601);
/*
* The ISO Header should take the form YYYYMMDDTHHMMSSZ. The
* 'Z' will only be included if it is a UTC time.
@@ -516,6 +525,7 @@ public final class ObexHelper {
// Time 4 Byte Header
dateHeader = (Calendar)headImpl.getHeader(HeaderSet.TIME_4_BYTE);
if (dateHeader != null) {
+ if (VDBG) Log.v(TAG," Add dateHeader = " + HeaderSet.TIME_4_BYTE);
out.write(HeaderSet.TIME_4_BYTE);
/*
@@ -550,6 +560,7 @@ public final class ObexHelper {
// Target Header
value = (byte[])headImpl.getHeader(HeaderSet.TARGET);
if (value != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.TARGET);
out.write((byte)HeaderSet.TARGET);
length = value.length + 3;
lengthArray[0] = (byte)(255 & (length >> 8));
@@ -578,6 +589,7 @@ public final class ObexHelper {
// Who Header
value = (byte[])headImpl.getHeader(HeaderSet.WHO);
if (value != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.WHO);
out.write((byte)HeaderSet.WHO);
length = value.length + 3;
lengthArray[0] = (byte)(255 & (length >> 8));
@@ -592,6 +604,7 @@ public final class ObexHelper {
// Connection ID Header
value = (byte[])headImpl.getHeader(HeaderSet.APPLICATION_PARAMETER);
if (value != null) {
+ if (VDBG) Log.v(TAG," Add APP PARAM Header = " + HeaderSet.APPLICATION_PARAMETER);
out.write((byte)HeaderSet.APPLICATION_PARAMETER);
length = value.length + 3;
lengthArray[0] = (byte)(255 & (length >> 8));
@@ -630,6 +643,7 @@ public final class ObexHelper {
lengthArray[1] = (byte)(255 & length);
out.write(lengthArray);
out.write(value);
+ if (VDBG) Log.v(TAG," Add Unicode String value = " + value);
if (nullOut) {
headImpl.setHeader(i + 0x30, null);
}
@@ -644,6 +658,7 @@ public final class ObexHelper {
lengthArray[1] = (byte)(255 & length);
out.write(lengthArray);
out.write(value);
+ if (VDBG) Log.v(TAG," Add ByteSeq value = " + value);
if (nullOut) {
headImpl.setHeader(i + 0x70, null);
}
@@ -654,6 +669,7 @@ public final class ObexHelper {
if (byteHeader != null) {
out.write((byte)i + 0xB0);
out.write(byteHeader.byteValue());
+ if (VDBG) Log.v(TAG," Add ByteHeader value = " + byteHeader.byteValue());
if (nullOut) {
headImpl.setHeader(i + 0xB0, null);
}
@@ -664,6 +680,7 @@ public final class ObexHelper {
if (intHeader != null) {
out.write((byte)i + 0xF0);
out.write(ObexHelper.convertToByteArray(intHeader.longValue()));
+ if (VDBG) Log.v(TAG," Add Int value = " + intHeader.longValue());
if (nullOut) {
headImpl.setHeader(i + 0xF0, null);
}
@@ -678,6 +695,7 @@ public final class ObexHelper {
lengthArray[1] = (byte)(255 & length);
out.write(lengthArray);
out.write(headImpl.mAuthChall);
+ if (VDBG) Log.v(TAG," Add mAuthChall value = " + headImpl.mAuthChall);
if (nullOut) {
headImpl.mAuthChall = null;
}
@@ -691,6 +709,7 @@ public final class ObexHelper {
lengthArray[1] = (byte)(255 & length);
out.write(lengthArray);
out.write(headImpl.mAuthResp);
+ if (VDBG) Log.v(TAG," Add mAuthChall value = " + headImpl.mAuthResp);
if (nullOut) {
headImpl.mAuthResp = null;
}
@@ -706,8 +725,10 @@ public final class ObexHelper {
// Add the SRM header
byteHeader = (Byte)headImpl.getHeader(HeaderSet.SINGLE_RESPONSE_MODE);
if (byteHeader != null) {
+ if (VDBG) Log.v(TAG," Add SRM Header = " + HeaderSet.SINGLE_RESPONSE_MODE);
out.write((byte)HeaderSet.SINGLE_RESPONSE_MODE);
out.write(byteHeader.byteValue());
+ if (VDBG) Log.v(TAG," Add SRM value = " + byteHeader.byteValue());
if (nullOut) {
headImpl.setHeader(HeaderSet.SINGLE_RESPONSE_MODE, null);
}
@@ -716,6 +737,7 @@ public final class ObexHelper {
// Add the SRM parameter header
byteHeader = (Byte)headImpl.getHeader(HeaderSet.SINGLE_RESPONSE_MODE_PARAMETER);
if (byteHeader != null) {
+ if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.SINGLE_RESPONSE_MODE_PARAMETER);
out.write((byte)HeaderSet.SINGLE_RESPONSE_MODE_PARAMETER);
out.write(byteHeader.byteValue());
if (nullOut) {
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java
index 15ea36789e2c..1cc720b3a914 100644
--- a/obex/javax/obex/ServerOperation.java
+++ b/obex/javax/obex/ServerOperation.java
@@ -57,7 +57,7 @@ import android.util.Log;
*/
public final class ServerOperation implements Operation, BaseStream {
- private static final String TAG = "ServerOperation";
+ private static final String TAG = "ObexServerOperation";
private static final boolean V = ObexHelper.VDBG; // Verbose debugging
@@ -124,6 +124,7 @@ public final class ServerOperation implements Operation, BaseStream {
*/
public ServerOperation(ServerSession p, InputStream in, int request, int maxSize,
ServerRequestHandler listen) throws IOException {
+ if (V) Log.v(TAG, "ServerOperation");
isAborted = false;
mParent = p;
@@ -340,14 +341,17 @@ public final class ServerOperation implements Operation, BaseStream {
*/
public synchronized boolean continueOperation(boolean sendEmpty, boolean inStream)
throws IOException {
+ if (V) Log.v(TAG, "continueOperation");
if (!mGetOperation) {
if (!finalBitSet) {
if (sendEmpty) {
sendReply(ResponseCodes.OBEX_HTTP_CONTINUE);
+ if (V) Log.v(TAG, "continueOperation:ServerSet SRM sendEmpty clause");
return true;
} else {
if ((mResponseSize > 3) || (mPrivateOutput.size() > 0)) {
sendReply(ResponseCodes.OBEX_HTTP_CONTINUE);
+ if (V) Log.v(TAG, "continueOperation: Server setting SRM");
return true;
} else {
return false;
@@ -357,6 +361,7 @@ public final class ServerOperation implements Operation, BaseStream {
return false;
}
} else {
+ if (V) Log.v(TAG, "Get continueOperation ");
sendReply(ResponseCodes.OBEX_HTTP_CONTINUE);
return true;
}
@@ -405,6 +410,8 @@ public final class ServerOperation implements Operation, BaseStream {
bodyLength = mPrivateOutput.size();
orginalBodyLength = bodyLength;
}
+ if(V) Log.v(TAG, "mMaxPcKLen :" + mMaxPacketLength + " headerArryLen :"
+ + headerArray.length);
if ((ObexHelper.BASE_PACKET_LENGTH + headerArray.length) > mMaxPacketLength) {
diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java
index dbfeefdfb037..a45687f766fc 100644
--- a/obex/javax/obex/ServerSession.java
+++ b/obex/javax/obex/ServerSession.java
@@ -63,6 +63,12 @@ public final class ServerSession extends ObexSession implements Runnable {
private boolean mClosed;
+ private boolean setMTU = false;
+
+ private boolean updateMtu = false;
+
+ private int updatedMtuSize = 0;
+
/**
* Creates new ServerSession.
* @param trans the connection to the client
@@ -85,6 +91,25 @@ public final class ServerSession extends ObexSession implements Runnable {
mProcessThread.start();
}
+ public void setMaxPacketSize(int size) {
+ if (V) Log.v(TAG, "setMaxPacketSize" + size);
+ mMaxPacketLength = size;
+ }
+
+ public int getMaxPacketSize() {
+ return mMaxPacketLength;
+ }
+
+ public void reduceMTU(boolean enable) {
+ setMTU = enable;
+ }
+
+ public void updateMTU(int mtuSize) {
+ updateMtu = true;
+ updatedMtuSize = mtuSize;
+ Log.i(TAG,"updateMTU: " + mtuSize);
+ }
+
/**
* Processes requests made to the server and forwards them to the
* appropriate event listener.
@@ -124,6 +149,7 @@ public final class ServerSession extends ObexSession implements Runnable {
break;
case -1:
+ Log.d(TAG, "Read request returned -1, exiting from loop");
done = true;
break;
@@ -194,6 +220,7 @@ public final class ServerSession extends ObexSession implements Runnable {
* @throws IOException if an error occurred at the transport layer
*/
private void handlePutRequest(int type) throws IOException {
+ if (V) Log.v(TAG, "handlePutRequest");
ServerOperation op = new ServerOperation(this, mInput, type, mMaxPacketLength, mListener);
try {
int response = -1;
@@ -205,10 +232,12 @@ public final class ServerSession extends ObexSession implements Runnable {
response = validateResponseCode(mListener.onPut(op));
}
if (response != ResponseCodes.OBEX_HTTP_OK && !op.isAborted) {
+ if (V) Log.v(TAG, "handlePutRequest pre != HTTP_OK sendReply");
op.sendReply(response);
} else if (!op.isAborted) {
// wait for the final bit
while (!op.finalBitSet) {
+ if (V) Log.v(TAG, "handlePutRequest pre looped sendReply");
op.sendReply(ResponseCodes.OBEX_HTTP_CONTINUE);
}
op.sendReply(response);
@@ -240,6 +269,7 @@ public final class ServerSession extends ObexSession implements Runnable {
* @throws IOException if an error occurred at the transport layer
*/
private void handleGetRequest(int type) throws IOException {
+ if (V) Log.v(TAG, "handleGetRequest");
ServerOperation op = new ServerOperation(this, mInput, type, mMaxPacketLength, mListener);
try {
int response = validateResponseCode(mListener.onGet(op));
@@ -262,6 +292,7 @@ public final class ServerSession extends ObexSession implements Runnable {
public void sendResponse(int code, byte[] header) throws IOException {
int totalLength = 3;
byte[] data = null;
+ if (V) Log.v(TAG,"sendResponse code " + code + " header : " + header);
OutputStream op = mOutput;
if (op == null) {
return;
@@ -269,6 +300,7 @@ public final class ServerSession extends ObexSession implements Runnable {
if (header != null) {
totalLength += header.length;
+ if (V) Log.v(TAG, "header != null totalLength = " + totalLength);
data = new byte[totalLength];
data[0] = (byte)code;
data[1] = (byte)(totalLength >> 8);
@@ -558,9 +590,19 @@ public final class ServerSession extends ObexSession implements Runnable {
+ " MaxLength: " + mMaxPacketLength + " flags: " + flags);
// should we check it?
- if (mMaxPacketLength > ObexHelper.MAX_PACKET_SIZE_INT) {
+ if (setMTU) {
+ mMaxPacketLength = ObexHelper.A2DP_SCO_OBEX_MAX_CLIENT_PACKET_SIZE;
+ setMTU = false;
+ } else if (updateMtu) {
+ Log.d(TAG, "mMaxPacketLength: " + mMaxPacketLength +
+ ", updatedMtuSize: " + updatedMtuSize);
+ if (mMaxPacketLength > updatedMtuSize)
+ mMaxPacketLength = updatedMtuSize;
+ updateMtu = false;
+ } else if (mMaxPacketLength > ObexHelper.MAX_PACKET_SIZE_INT) {
mMaxPacketLength = ObexHelper.MAX_PACKET_SIZE_INT;
}
+ Log.d(TAG,"handleConnectRequest() - Updated MaxPacketLengh: " + mMaxPacketLength);
if(mMaxPacketLength > ObexHelper.getMaxTxPacketSize(mTransport)) {
Log.w(TAG, "Requested MaxObexPacketSize " + mMaxPacketLength
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java
index 75131b0f6b9c..f2de887ba7b1 100644
--- a/opengl/java/android/opengl/GLSurfaceView.java
+++ b/opengl/java/android/opengl/GLSurfaceView.java
@@ -1570,6 +1570,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
if (view != null) {
try {
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onDrawFrame");
+ if (mFinishDrawingRunnable != null) {
+ finishDrawingRunnable = mFinishDrawingRunnable;
+ mFinishDrawingRunnable = null;
+ }
view.mRenderer.onDrawFrame(gl);
if (finishDrawingRunnable != null) {
finishDrawingRunnable.run();
diff --git a/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java b/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java
new file mode 100644
index 000000000000..c47231d80948
--- /dev/null
+++ b/packages/NetworkStack/src/android/net/dhcp/DhcpClient.java
@@ -0,0 +1,1149 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.dhcp;
+
+import static android.net.dhcp.DhcpPacket.DHCP_BROADCAST_ADDRESS;
+import static android.net.dhcp.DhcpPacket.DHCP_DNS_SERVER;
+import static android.net.dhcp.DhcpPacket.DHCP_DOMAIN_NAME;
+import static android.net.dhcp.DhcpPacket.DHCP_LEASE_TIME;
+import static android.net.dhcp.DhcpPacket.DHCP_MTU;
+import static android.net.dhcp.DhcpPacket.DHCP_REBINDING_TIME;
+import static android.net.dhcp.DhcpPacket.DHCP_RENEWAL_TIME;
+import static android.net.dhcp.DhcpPacket.DHCP_ROUTER;
+import static android.net.dhcp.DhcpPacket.DHCP_SUBNET_MASK;
+import static android.net.dhcp.DhcpPacket.DHCP_VENDOR_INFO;
+import static android.net.dhcp.DhcpPacket.INADDR_ANY;
+import static android.net.dhcp.DhcpPacket.INADDR_BROADCAST;
+import static android.net.util.NetworkStackUtils.closeSocketQuietly;
+import static android.net.util.SocketUtils.makePacketSocketAddress;
+import static android.system.OsConstants.AF_INET;
+import static android.system.OsConstants.AF_PACKET;
+import static android.system.OsConstants.ETH_P_IP;
+import static android.system.OsConstants.IPPROTO_UDP;
+import static android.system.OsConstants.SOCK_DGRAM;
+import static android.system.OsConstants.SOCK_RAW;
+import static android.system.OsConstants.SOL_SOCKET;
+import static android.system.OsConstants.SO_BROADCAST;
+import static android.system.OsConstants.SO_RCVBUF;
+import static android.system.OsConstants.SO_REUSEADDR;
+
+import static com.android.server.util.NetworkStackConstants.IPV4_ADDR_ANY;
+
+import android.content.Context;
+import android.net.DhcpResults;
+import android.net.InetAddresses;
+import android.net.TrafficStats;
+import android.net.ip.IpClient;
+import android.net.metrics.DhcpClientEvent;
+import android.net.metrics.DhcpErrorEvent;
+import android.net.metrics.IpConnectivityLog;
+import android.net.util.InterfaceParams;
+import android.net.util.NetworkStackUtils;
+import android.net.util.SocketUtils;
+import android.os.Message;
+import android.os.SystemClock;
+import android.system.ErrnoException;
+import android.system.Os;
+import android.util.EventLog;
+import android.util.Log;
+import android.util.SparseArray;
+
+import com.android.internal.util.HexDump;
+import com.android.internal.util.MessageUtils;
+import com.android.internal.util.State;
+import com.android.internal.util.StateMachine;
+import com.android.internal.util.TrafficStatsConstants;
+import com.android.internal.util.WakeupMessage;
+import com.android.networkstack.R;
+
+import java.io.FileDescriptor;
+import java.io.IOException;
+import java.net.Inet4Address;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.Random;
+
+/**
+ * A DHCPv4 client.
+ *
+ * Written to behave similarly to the DhcpStateMachine + dhcpcd 5.5.6 combination used in Android
+ * 5.1 and below, as configured on Nexus 6. The interface is the same as DhcpStateMachine.
+ *
+ * TODO:
+ *
+ * - Exponential backoff when receiving NAKs (not specified by the RFC, but current behaviour).
+ * - Support persisting lease state and support INIT-REBOOT. Android 5.1 does this, but it does not
+ * do so correctly: instead of requesting the lease last obtained on a particular network (e.g., a
+ * given SSID), it requests the last-leased IP address on the same interface, causing a delay if
+ * the server NAKs or a timeout if it doesn't.
+ *
+ * Known differences from current behaviour:
+ *
+ * - Does not request the "static routes" option.
+ * - Does not support BOOTP servers. DHCP has been around since 1993, should be everywhere now.
+ * - Requests the "broadcast" option, but does nothing with it.
+ * - Rejects invalid subnet masks such as 255.255.255.1 (current code treats that as 255.255.255.0).
+ *
+ * @hide
+ */
+public class DhcpClient extends StateMachine {
+
+ private static final String TAG = "DhcpClient";
+ private static final boolean DBG = true;
+ private static final boolean STATE_DBG = Log.isLoggable(TAG, Log.DEBUG);
+ private static final boolean MSG_DBG = Log.isLoggable(TAG, Log.DEBUG);
+ private static final boolean PACKET_DBG = Log.isLoggable(TAG, Log.DEBUG);
+
+ // Metrics events: must be kept in sync with server-side aggregation code.
+ /** Represents transitions from DhcpInitState to DhcpBoundState */
+ private static final String EVENT_INITIAL_BOUND = "InitialBoundState";
+ /** Represents transitions from and to DhcpBoundState via DhcpRenewingState */
+ private static final String EVENT_RENEWING_BOUND = "RenewingBoundState";
+
+ // Timers and timeouts.
+ private static final int SECONDS = 1000;
+ private static final int FIRST_TIMEOUT_MS = 2 * SECONDS;
+ private static final int MAX_TIMEOUT_MS = 128 * SECONDS;
+
+ // This is not strictly needed, since the client is asynchronous and implements exponential
+ // backoff. It's maintained for backwards compatibility with the previous DHCP code, which was
+ // a blocking operation with a 30-second timeout. We pick 36 seconds so we can send packets at
+ // t=0, t=2, t=6, t=14, t=30, allowing for 10% jitter.
+ private static final int DHCP_TIMEOUT_MS = 36 * SECONDS;
+
+ // DhcpClient uses IpClient's handler.
+ private static final int PUBLIC_BASE = IpClient.DHCPCLIENT_CMD_BASE;
+
+ // Below constants are picked up by MessageUtils and exempt from ProGuard optimization.
+ /* Commands from controller to start/stop DHCP */
+ public static final int CMD_START_DHCP = PUBLIC_BASE + 1;
+ public static final int CMD_STOP_DHCP = PUBLIC_BASE + 2;
+
+ /* Notification from DHCP state machine prior to DHCP discovery/renewal */
+ public static final int CMD_PRE_DHCP_ACTION = PUBLIC_BASE + 3;
+ /* Notification from DHCP state machine post DHCP discovery/renewal. Indicates
+ * success/failure */
+ public static final int CMD_POST_DHCP_ACTION = PUBLIC_BASE + 4;
+ /* Notification from DHCP state machine before quitting */
+ public static final int CMD_ON_QUIT = PUBLIC_BASE + 5;
+
+ /* Command from controller to indicate DHCP discovery/renewal can continue
+ * after pre DHCP action is complete */
+ public static final int CMD_PRE_DHCP_ACTION_COMPLETE = PUBLIC_BASE + 6;
+
+ /* Command and event notification to/from IpManager requesting the setting
+ * (or clearing) of an IPv4 LinkAddress.
+ */
+ public static final int CMD_CLEAR_LINKADDRESS = PUBLIC_BASE + 7;
+ public static final int CMD_CONFIGURE_LINKADDRESS = PUBLIC_BASE + 8;
+ public static final int EVENT_LINKADDRESS_CONFIGURED = PUBLIC_BASE + 9;
+
+ /* Command from controller to start DHCP with Rapid commit */
+ public static final int CMD_START_DHCP_RAPID_COMMIT = PUBLIC_BASE + 10;
+
+ /* Message.arg1 arguments to CMD_POST_DHCP_ACTION notification */
+ public static final int DHCP_SUCCESS = 1;
+ public static final int DHCP_FAILURE = 2;
+
+ // Internal messages.
+ private static final int PRIVATE_BASE = IpClient.DHCPCLIENT_CMD_BASE + 100;
+ private static final int CMD_KICK = PRIVATE_BASE + 1;
+ private static final int CMD_RECEIVED_PACKET = PRIVATE_BASE + 2;
+ private static final int CMD_TIMEOUT = PRIVATE_BASE + 3;
+ private static final int CMD_RENEW_DHCP = PRIVATE_BASE + 4;
+ private static final int CMD_REBIND_DHCP = PRIVATE_BASE + 5;
+ private static final int CMD_EXPIRE_DHCP = PRIVATE_BASE + 6;
+
+ // For message logging.
+ private static final Class[] sMessageClasses = { DhcpClient.class };
+ private static final SparseArray<String> sMessageNames =
+ MessageUtils.findMessageNames(sMessageClasses);
+
+ // DHCP parameters that we request.
+ /* package */ static final byte[] REQUESTED_PARAMS = new byte[] {
+ DHCP_SUBNET_MASK,
+ DHCP_ROUTER,
+ DHCP_DNS_SERVER,
+ DHCP_DOMAIN_NAME,
+ DHCP_MTU,
+ DHCP_BROADCAST_ADDRESS, // TODO: currently ignored.
+ DHCP_LEASE_TIME,
+ DHCP_RENEWAL_TIME,
+ DHCP_REBINDING_TIME,
+ DHCP_VENDOR_INFO,
+ };
+
+ // DHCP flag that means "yes, we support unicast."
+ private static final boolean DO_UNICAST = false;
+
+ // System services / libraries we use.
+ private final Context mContext;
+ private final Random mRandom;
+ private final IpConnectivityLog mMetricsLog = new IpConnectivityLog();
+
+ // Sockets.
+ // - We use a packet socket to receive, because servers send us packets bound for IP addresses
+ // which we have not yet configured, and the kernel protocol stack drops these.
+ // - We use a UDP socket to send, so the kernel handles ARP and routing for us (DHCP servers can
+ // be off-link as well as on-link).
+ private FileDescriptor mPacketSock;
+ private FileDescriptor mUdpSock;
+ private ReceiveThread mReceiveThread;
+
+ // State variables.
+ private final StateMachine mController;
+ private final WakeupMessage mKickAlarm;
+ private final WakeupMessage mTimeoutAlarm;
+ private final WakeupMessage mRenewAlarm;
+ private final WakeupMessage mRebindAlarm;
+ private final WakeupMessage mExpiryAlarm;
+ private final String mIfaceName;
+
+ private boolean mRegisteredForPreDhcpNotification;
+ private InterfaceParams mIface;
+ // TODO: MacAddress-ify more of this class hierarchy.
+ private byte[] mHwAddr;
+ private SocketAddress mInterfaceBroadcastAddr;
+ private int mTransactionId;
+ private long mTransactionStartMillis;
+ private DhcpResults mDhcpLease;
+ private long mDhcpLeaseExpiry;
+ private DhcpResults mOffer;
+ public boolean mRapidCommit;
+ public boolean mDiscoverSent;
+
+ // Milliseconds SystemClock timestamps used to record transition times to DhcpBoundState.
+ private long mLastInitEnterTime;
+ private long mLastBoundExitTime;
+
+ // States.
+ private State mStoppedState = new StoppedState();
+ private State mDhcpState = new DhcpState();
+ private State mDhcpInitState = new DhcpInitState();
+ private State mDhcpRapidCommitInitState = new DhcpRapidCommitInitState();
+ private State mDhcpSelectingState = new DhcpSelectingState();
+ private State mDhcpRequestingState = new DhcpRequestingState();
+ private State mDhcpHaveLeaseState = new DhcpHaveLeaseState();
+ private State mConfiguringInterfaceState = new ConfiguringInterfaceState();
+ private State mDhcpBoundState = new DhcpBoundState();
+ private State mDhcpRenewingState = new DhcpRenewingState();
+ private State mDhcpRebindingState = new DhcpRebindingState();
+ private State mDhcpInitRebootState = new DhcpInitRebootState();
+ private State mDhcpRebootingState = new DhcpRebootingState();
+ private State mWaitBeforeStartState = new WaitBeforeStartState(mDhcpInitState);
+ private State mRapidCommitWaitBeforeStartState = new WaitBeforeStartState(mDhcpRapidCommitInitState);
+ private State mWaitBeforeRenewalState = new WaitBeforeRenewalState(mDhcpRenewingState);
+
+ private WakeupMessage makeWakeupMessage(String cmdName, int cmd) {
+ cmdName = DhcpClient.class.getSimpleName() + "." + mIfaceName + "." + cmdName;
+ return new WakeupMessage(mContext, getHandler(), cmdName, cmd);
+ }
+
+ // TODO: Take an InterfaceParams instance instead of an interface name String.
+ private DhcpClient(Context context, StateMachine controller, String iface) {
+ super(TAG, controller.getHandler());
+
+ mContext = context;
+ mController = controller;
+ mIfaceName = iface;
+
+ addState(mStoppedState);
+ addState(mDhcpState);
+ addState(mDhcpInitState, mDhcpState);
+ addState(mDhcpRapidCommitInitState, mDhcpState);
+ addState(mWaitBeforeStartState, mDhcpState);
+ addState(mRapidCommitWaitBeforeStartState, mDhcpState);
+ addState(mDhcpSelectingState, mDhcpState);
+ addState(mDhcpRequestingState, mDhcpState);
+ addState(mDhcpHaveLeaseState, mDhcpState);
+ addState(mConfiguringInterfaceState, mDhcpHaveLeaseState);
+ addState(mDhcpBoundState, mDhcpHaveLeaseState);
+ addState(mWaitBeforeRenewalState, mDhcpHaveLeaseState);
+ addState(mDhcpRenewingState, mDhcpHaveLeaseState);
+ addState(mDhcpRebindingState, mDhcpHaveLeaseState);
+ addState(mDhcpInitRebootState, mDhcpState);
+ addState(mDhcpRebootingState, mDhcpState);
+
+ setInitialState(mStoppedState);
+
+ mRandom = new Random();
+
+ // Used to schedule packet retransmissions.
+ mKickAlarm = makeWakeupMessage("KICK", CMD_KICK);
+ // Used to time out PacketRetransmittingStates.
+ mTimeoutAlarm = makeWakeupMessage("TIMEOUT", CMD_TIMEOUT);
+ // Used to schedule DHCP reacquisition.
+ mRenewAlarm = makeWakeupMessage("RENEW", CMD_RENEW_DHCP);
+ mRebindAlarm = makeWakeupMessage("REBIND", CMD_REBIND_DHCP);
+ mExpiryAlarm = makeWakeupMessage("EXPIRY", CMD_EXPIRE_DHCP);
+ }
+
+ public void registerForPreDhcpNotification() {
+ mRegisteredForPreDhcpNotification = true;
+ }
+
+ public static DhcpClient makeDhcpClient(
+ Context context, StateMachine controller, InterfaceParams ifParams) {
+ DhcpClient client = new DhcpClient(context, controller, ifParams.name);
+ client.mIface = ifParams;
+ client.start();
+ return client;
+ }
+
+ private boolean initInterface() {
+ if (mIface == null) mIface = InterfaceParams.getByName(mIfaceName);
+ if (mIface == null) {
+ Log.e(TAG, "Can't determine InterfaceParams for " + mIfaceName);
+ return false;
+ }
+
+ mHwAddr = mIface.macAddr.toByteArray();
+ mInterfaceBroadcastAddr = makePacketSocketAddress(mIface.index, DhcpPacket.ETHER_BROADCAST);
+ return true;
+ }
+
+ private void startNewTransaction() {
+ mTransactionId = mRandom.nextInt();
+ mTransactionStartMillis = SystemClock.elapsedRealtime();
+ }
+
+ private boolean initSockets() {
+ return initPacketSocket() && initUdpSocket();
+ }
+
+ private boolean initPacketSocket() {
+ try {
+ mPacketSock = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IP);
+ SocketAddress addr = makePacketSocketAddress((short) ETH_P_IP, mIface.index);
+ Os.bind(mPacketSock, addr);
+ NetworkStackUtils.attachDhcpFilter(mPacketSock);
+ } catch(SocketException|ErrnoException e) {
+ Log.e(TAG, "Error creating packet socket", e);
+ return false;
+ }
+ return true;
+ }
+
+ private boolean initUdpSocket() {
+ final int oldTag = TrafficStats.getAndSetThreadStatsTag(
+ TrafficStatsConstants.TAG_SYSTEM_DHCP);
+ try {
+ mUdpSock = Os.socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ SocketUtils.bindSocketToInterface(mUdpSock, mIfaceName);
+ Os.setsockoptInt(mUdpSock, SOL_SOCKET, SO_REUSEADDR, 1);
+ Os.setsockoptInt(mUdpSock, SOL_SOCKET, SO_BROADCAST, 1);
+ Os.setsockoptInt(mUdpSock, SOL_SOCKET, SO_RCVBUF, 0);
+ Os.bind(mUdpSock, IPV4_ADDR_ANY, DhcpPacket.DHCP_CLIENT);
+ } catch(SocketException|ErrnoException e) {
+ Log.e(TAG, "Error creating UDP socket", e);
+ return false;
+ } finally {
+ TrafficStats.setThreadStatsTag(oldTag);
+ }
+ return true;
+ }
+
+ private boolean connectUdpSock(Inet4Address to) {
+ try {
+ Os.connect(mUdpSock, to, DhcpPacket.DHCP_SERVER);
+ return true;
+ } catch (SocketException|ErrnoException e) {
+ Log.e(TAG, "Error connecting UDP socket", e);
+ return false;
+ }
+ }
+
+ private void closeSockets() {
+ closeSocketQuietly(mUdpSock);
+ closeSocketQuietly(mPacketSock);
+ }
+
+ class ReceiveThread extends Thread {
+
+ private final byte[] mPacket = new byte[DhcpPacket.MAX_LENGTH];
+ private volatile boolean mStopped = false;
+
+ public void halt() {
+ mStopped = true;
+ closeSockets(); // Interrupts the read() call the thread is blocked in.
+ }
+
+ @Override
+ public void run() {
+ if (DBG) Log.d(TAG, "Receive thread started");
+ while (!mStopped) {
+ int length = 0; // Or compiler can't tell it's initialized if a parse error occurs.
+ try {
+ length = Os.read(mPacketSock, mPacket, 0, mPacket.length);
+ DhcpPacket packet = null;
+ packet = DhcpPacket.decodeFullPacket(mPacket, length, DhcpPacket.ENCAP_L2);
+ if (DBG) Log.d(TAG, "Received packet: " + packet);
+ sendMessage(CMD_RECEIVED_PACKET, packet);
+ } catch (IOException|ErrnoException e) {
+ if (!mStopped) {
+ Log.e(TAG, "Read error", e);
+ logError(DhcpErrorEvent.RECEIVE_ERROR);
+ }
+ } catch (DhcpPacket.ParseException e) {
+ Log.e(TAG, "Can't parse packet: " + e.getMessage());
+ if (PACKET_DBG) {
+ Log.d(TAG, HexDump.dumpHexString(mPacket, 0, length));
+ }
+ if (e.errorCode == DhcpErrorEvent.DHCP_NO_COOKIE) {
+ int snetTagId = 0x534e4554;
+ String bugId = "31850211";
+ int uid = -1;
+ String data = DhcpPacket.ParseException.class.getName();
+ EventLog.writeEvent(snetTagId, bugId, uid, data);
+ }
+ logError(e.errorCode);
+ }
+ }
+ if (DBG) Log.d(TAG, "Receive thread stopped");
+ }
+ }
+
+ private short getSecs() {
+ return (short) ((SystemClock.elapsedRealtime() - mTransactionStartMillis) / 1000);
+ }
+
+ private boolean transmitPacket(ByteBuffer buf, String description, int encap, Inet4Address to) {
+ try {
+ if (encap == DhcpPacket.ENCAP_L2) {
+ if (DBG) Log.d(TAG, "Broadcasting " + description);
+ Os.sendto(mPacketSock, buf.array(), 0, buf.limit(), 0, mInterfaceBroadcastAddr);
+ } else if (encap == DhcpPacket.ENCAP_BOOTP && to.equals(INADDR_BROADCAST)) {
+ if (DBG) Log.d(TAG, "Broadcasting " + description);
+ // We only send L3-encapped broadcasts in DhcpRebindingState,
+ // where we have an IP address and an unconnected UDP socket.
+ //
+ // N.B.: We only need this codepath because DhcpRequestPacket
+ // hardcodes the source IP address to 0.0.0.0. We could reuse
+ // the packet socket if this ever changes.
+ Os.sendto(mUdpSock, buf, 0, to, DhcpPacket.DHCP_SERVER);
+ } else {
+ // It's safe to call getpeername here, because we only send unicast packets if we
+ // have an IP address, and we connect the UDP socket in DhcpBoundState#enter.
+ if (DBG) Log.d(TAG, String.format("Unicasting %s to %s",
+ description, Os.getpeername(mUdpSock)));
+ Os.write(mUdpSock, buf);
+ }
+ } catch(ErrnoException|IOException e) {
+ Log.e(TAG, "Can't send packet: ", e);
+ return false;
+ }
+ return true;
+ }
+
+ public ByteBuffer buildDiscoverWithRapidCommitPacket() {
+ startNewTransaction();
+ return DhcpPacket.buildDiscoverPacket(
+ DhcpPacket.ENCAP_L2, mTransactionId, getSecs(), mHwAddr,
+ DO_UNICAST, REQUESTED_PARAMS, mRapidCommit);
+ }
+
+ private boolean sendDiscoverPacket() {
+ ByteBuffer packet = DhcpPacket.buildDiscoverPacket(
+ DhcpPacket.ENCAP_L2, mTransactionId, getSecs(), mHwAddr,
+ DO_UNICAST, REQUESTED_PARAMS, mRapidCommit);
+ return transmitPacket(packet, "DHCPDISCOVER", DhcpPacket.ENCAP_L2, INADDR_BROADCAST);
+ }
+
+ private boolean sendRequestPacket(
+ Inet4Address clientAddress, Inet4Address requestedAddress,
+ Inet4Address serverAddress, Inet4Address to) {
+ // TODO: should we use the transaction ID from the server?
+ final int encap = INADDR_ANY.equals(clientAddress)
+ ? DhcpPacket.ENCAP_L2 : DhcpPacket.ENCAP_BOOTP;
+
+ ByteBuffer packet = DhcpPacket.buildRequestPacket(
+ encap, mTransactionId, getSecs(), clientAddress,
+ DO_UNICAST, mHwAddr, requestedAddress,
+ serverAddress, REQUESTED_PARAMS, null);
+ String serverStr = (serverAddress != null) ? serverAddress.getHostAddress() : null;
+ String description = "DHCPREQUEST ciaddr=" + clientAddress.getHostAddress() +
+ " request=" + requestedAddress.getHostAddress() +
+ " serverid=" + serverStr;
+ return transmitPacket(packet, description, encap, to);
+ }
+
+ private void scheduleLeaseTimers() {
+ if (mDhcpLeaseExpiry == 0) {
+ Log.d(TAG, "Infinite lease, no timer scheduling needed");
+ return;
+ }
+
+ final long now = SystemClock.elapsedRealtime();
+
+ // TODO: consider getting the renew and rebind timers from T1 and T2.
+ // See also:
+ // https://tools.ietf.org/html/rfc2131#section-4.4.5
+ // https://tools.ietf.org/html/rfc1533#section-9.9
+ // https://tools.ietf.org/html/rfc1533#section-9.10
+ final long remainingDelay = mDhcpLeaseExpiry - now;
+ final long renewDelay = remainingDelay / 2;
+ final long rebindDelay = remainingDelay * 7 / 8;
+ mRenewAlarm.schedule(now + renewDelay);
+ mRebindAlarm.schedule(now + rebindDelay);
+ mExpiryAlarm.schedule(now + remainingDelay);
+ Log.d(TAG, "Scheduling renewal in " + (renewDelay / 1000) + "s");
+ Log.d(TAG, "Scheduling rebind in " + (rebindDelay / 1000) + "s");
+ Log.d(TAG, "Scheduling expiry in " + (remainingDelay / 1000) + "s");
+ }
+
+ private void notifySuccess() {
+ mController.sendMessage(
+ CMD_POST_DHCP_ACTION, DHCP_SUCCESS, 0, new DhcpResults(mDhcpLease));
+ }
+
+ private void notifyFailure() {
+ mController.sendMessage(CMD_POST_DHCP_ACTION, DHCP_FAILURE, 0, null);
+ }
+
+ private void acceptDhcpResults(DhcpResults results, String msg) {
+ mDhcpLease = results;
+ if (mDhcpLease.dnsServers.isEmpty()) {
+ // supplement customized dns servers
+ String[] dnsServersList =
+ mContext.getResources().getStringArray(R.array.config_default_dns_servers);
+ for (final String dnsServer : dnsServersList) {
+ try {
+ mDhcpLease.dnsServers.add(InetAddresses.parseNumericAddress(dnsServer));
+ } catch (IllegalArgumentException e) {
+ Log.e(TAG, "Invalid default DNS server: " + dnsServer, e);
+ }
+ }
+ }
+ mOffer = null;
+ Log.d(TAG, msg + " lease: " + mDhcpLease);
+ notifySuccess();
+ }
+
+ private void clearDhcpState() {
+ mDhcpLease = null;
+ mDhcpLeaseExpiry = 0;
+ mOffer = null;
+ }
+
+ /**
+ * Quit the DhcpStateMachine.
+ *
+ * @hide
+ */
+ public void doQuit() {
+ Log.d(TAG, "doQuit");
+ quit();
+ }
+
+ @Override
+ protected void onQuitting() {
+ Log.d(TAG, "onQuitting");
+ mController.sendMessage(CMD_ON_QUIT);
+ }
+
+ abstract class LoggingState extends State {
+ private long mEnterTimeMs;
+
+ @Override
+ public void enter() {
+ if (STATE_DBG) Log.d(TAG, "Entering state " + getName());
+ mEnterTimeMs = SystemClock.elapsedRealtime();
+ }
+
+ @Override
+ public void exit() {
+ long durationMs = SystemClock.elapsedRealtime() - mEnterTimeMs;
+ logState(getName(), (int) durationMs);
+ }
+
+ private String messageName(int what) {
+ return sMessageNames.get(what, Integer.toString(what));
+ }
+
+ private String messageToString(Message message) {
+ long now = SystemClock.uptimeMillis();
+ return new StringBuilder(" ")
+ .append(message.getWhen() - now)
+ .append(messageName(message.what))
+ .append(" ").append(message.arg1)
+ .append(" ").append(message.arg2)
+ .append(" ").append(message.obj)
+ .toString();
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ if (MSG_DBG) {
+ Log.d(TAG, getName() + messageToString(message));
+ }
+ return NOT_HANDLED;
+ }
+
+ @Override
+ public String getName() {
+ // All DhcpClient's states are inner classes with a well defined name.
+ // Use getSimpleName() and avoid super's getName() creating new String instances.
+ return getClass().getSimpleName();
+ }
+ }
+
+ // Sends CMD_PRE_DHCP_ACTION to the controller, waits for the controller to respond with
+ // CMD_PRE_DHCP_ACTION_COMPLETE, and then transitions to mOtherState.
+ abstract class WaitBeforeOtherState extends LoggingState {
+ protected State mOtherState;
+
+ @Override
+ public void enter() {
+ super.enter();
+ mController.sendMessage(CMD_PRE_DHCP_ACTION);
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ super.processMessage(message);
+ switch (message.what) {
+ case CMD_PRE_DHCP_ACTION_COMPLETE:
+ transitionTo(mOtherState);
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+ }
+
+ class StoppedState extends State {
+ @Override
+ public boolean processMessage(Message message) {
+ switch (message.what) {
+ case CMD_START_DHCP:
+ if (mRegisteredForPreDhcpNotification) {
+ transitionTo(mWaitBeforeStartState);
+ } else {
+ transitionTo(mDhcpInitState);
+ }
+ return HANDLED;
+ case CMD_START_DHCP_RAPID_COMMIT:
+ mRapidCommit = message.arg1 == 1 ? true: false;
+ mDiscoverSent = message.arg2 == 1 ? true : false;
+ if (mRegisteredForPreDhcpNotification) {
+ if (mRapidCommit) {
+ transitionTo(mRapidCommitWaitBeforeStartState);
+ } else {
+ transitionTo(mWaitBeforeStartState);
+ }
+ } else {
+ if (mRapidCommit) {
+ transitionTo(mDhcpRapidCommitInitState);
+ } else {
+ transitionTo(mDhcpInitState);
+ }
+ }
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+ }
+
+ class DhcpRapidCommitInitState extends PacketRetransmittingState {
+ public DhcpRapidCommitInitState() {
+ super();
+ }
+
+ @Override
+ public void enter() {
+ super.enter();
+ if (!mDiscoverSent) {
+ startNewTransaction();
+ }
+ mLastInitEnterTime = SystemClock.elapsedRealtime();
+ }
+
+ protected boolean sendPacket() {
+ if (mDiscoverSent) {
+ mDiscoverSent = false;
+ return true;
+ }
+ return sendDiscoverPacket();
+ }
+
+ protected void receivePacket(DhcpPacket packet) {
+ if (!isValidPacket(packet)) return;
+ if (packet instanceof DhcpOfferPacket) {
+ mOffer = packet.toDhcpResults();
+ if (mOffer != null) {
+ Log.d(TAG, "DhcpRapidCommitInitState:Got pending lease: " + mOffer);
+ transitionTo(mDhcpRequestingState);
+ }
+ } else if ((packet instanceof DhcpAckPacket)) {
+ DhcpResults results = packet.toDhcpResults();
+ Log.d(TAG,"Received ACK in DhcpRapidCommitInitState");
+ if (results != null) {
+ setDhcpLeaseExpiry(packet);
+ acceptDhcpResults(results, "Confirmed");
+ transitionTo(mConfiguringInterfaceState);
+ }
+ } else if (packet instanceof DhcpNakPacket) {
+ Log.d(TAG, "Received NAK in DhcpRapidCommitInitState, returning to INIT");
+ mOffer = null;
+ transitionTo(mDhcpInitState);
+ }
+ }
+ }
+
+ class WaitBeforeStartState extends WaitBeforeOtherState {
+ public WaitBeforeStartState(State otherState) {
+ super();
+ mOtherState = otherState;
+ }
+ }
+
+ class WaitBeforeRenewalState extends WaitBeforeOtherState {
+ public WaitBeforeRenewalState(State otherState) {
+ super();
+ mOtherState = otherState;
+ }
+ }
+
+ class DhcpState extends State {
+ @Override
+ public void enter() {
+ clearDhcpState();
+ if (initInterface() && initSockets()) {
+ mReceiveThread = new ReceiveThread();
+ mReceiveThread.start();
+ } else {
+ notifyFailure();
+ transitionTo(mStoppedState);
+ }
+ }
+
+ @Override
+ public void exit() {
+ if (mReceiveThread != null) {
+ mReceiveThread.halt(); // Also closes sockets.
+ mReceiveThread = null;
+ }
+ clearDhcpState();
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ super.processMessage(message);
+ switch (message.what) {
+ case CMD_STOP_DHCP:
+ transitionTo(mStoppedState);
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+ }
+
+ public boolean isValidPacket(DhcpPacket packet) {
+ // TODO: check checksum.
+ int xid = packet.getTransactionId();
+ if (xid != mTransactionId) {
+ Log.d(TAG, "Unexpected transaction ID " + xid + ", expected " + mTransactionId);
+ return false;
+ }
+ if (!Arrays.equals(packet.getClientMac(), mHwAddr)) {
+ Log.d(TAG, "MAC addr mismatch: got " +
+ HexDump.toHexString(packet.getClientMac()) + ", expected " +
+ HexDump.toHexString(packet.getClientMac()));
+ return false;
+ }
+ return true;
+ }
+
+ public void setDhcpLeaseExpiry(DhcpPacket packet) {
+ long leaseTimeMillis = packet.getLeaseTimeMillis();
+ mDhcpLeaseExpiry =
+ (leaseTimeMillis > 0) ? SystemClock.elapsedRealtime() + leaseTimeMillis : 0;
+ }
+
+ /**
+ * Retransmits packets using jittered exponential backoff with an optional timeout. Packet
+ * transmission is triggered by CMD_KICK, which is sent by an AlarmManager alarm. If a subclass
+ * sets mTimeout to a positive value, then timeout() is called by an AlarmManager alarm mTimeout
+ * milliseconds after entering the state. Kicks and timeouts are cancelled when leaving the
+ * state.
+ *
+ * Concrete subclasses must implement sendPacket, which is called when the alarm fires and a
+ * packet needs to be transmitted, and receivePacket, which is triggered by CMD_RECEIVED_PACKET
+ * sent by the receive thread. They may also set mTimeout and implement timeout.
+ */
+ abstract class PacketRetransmittingState extends LoggingState {
+
+ private int mTimer;
+ protected int mTimeout = 0;
+
+ @Override
+ public void enter() {
+ super.enter();
+ initTimer();
+ maybeInitTimeout();
+ sendMessage(CMD_KICK);
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ super.processMessage(message);
+ switch (message.what) {
+ case CMD_KICK:
+ sendPacket();
+ scheduleKick();
+ return HANDLED;
+ case CMD_RECEIVED_PACKET:
+ receivePacket((DhcpPacket) message.obj);
+ return HANDLED;
+ case CMD_TIMEOUT:
+ timeout();
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+
+ @Override
+ public void exit() {
+ super.exit();
+ mKickAlarm.cancel();
+ mTimeoutAlarm.cancel();
+ }
+
+ abstract protected boolean sendPacket();
+ abstract protected void receivePacket(DhcpPacket packet);
+ protected void timeout() {}
+
+ protected void initTimer() {
+ mTimer = FIRST_TIMEOUT_MS;
+ }
+
+ protected int jitterTimer(int baseTimer) {
+ int maxJitter = baseTimer / 10;
+ int jitter = mRandom.nextInt(2 * maxJitter) - maxJitter;
+ return baseTimer + jitter;
+ }
+
+ protected void scheduleKick() {
+ long now = SystemClock.elapsedRealtime();
+ long timeout = jitterTimer(mTimer);
+ long alarmTime = now + timeout;
+ mKickAlarm.schedule(alarmTime);
+ mTimer *= 2;
+ if (mTimer > MAX_TIMEOUT_MS) {
+ mTimer = MAX_TIMEOUT_MS;
+ }
+ }
+
+ protected void maybeInitTimeout() {
+ if (mTimeout > 0) {
+ long alarmTime = SystemClock.elapsedRealtime() + mTimeout;
+ mTimeoutAlarm.schedule(alarmTime);
+ }
+ }
+ }
+
+ class DhcpInitState extends PacketRetransmittingState {
+ public DhcpInitState() {
+ super();
+ }
+
+ @Override
+ public void enter() {
+ super.enter();
+ startNewTransaction();
+ mLastInitEnterTime = SystemClock.elapsedRealtime();
+ }
+
+ protected boolean sendPacket() {
+ return sendDiscoverPacket();
+ }
+
+ protected void receivePacket(DhcpPacket packet) {
+ if (!isValidPacket(packet)) return;
+ if (!(packet instanceof DhcpOfferPacket)) return;
+ mOffer = packet.toDhcpResults();
+ if (mOffer != null) {
+ Log.d(TAG, "Got pending lease: " + mOffer);
+ transitionTo(mDhcpRequestingState);
+ }
+ }
+ }
+
+ // Not implemented. We request the first offer we receive.
+ class DhcpSelectingState extends LoggingState {
+ }
+
+ class DhcpRequestingState extends PacketRetransmittingState {
+ public DhcpRequestingState() {
+ mTimeout = DHCP_TIMEOUT_MS / 2;
+ }
+
+ protected boolean sendPacket() {
+ return sendRequestPacket(
+ INADDR_ANY, // ciaddr
+ (Inet4Address) mOffer.ipAddress.getAddress(), // DHCP_REQUESTED_IP
+ (Inet4Address) mOffer.serverAddress, // DHCP_SERVER_IDENTIFIER
+ INADDR_BROADCAST); // packet destination address
+ }
+
+ protected void receivePacket(DhcpPacket packet) {
+ if (!isValidPacket(packet)) return;
+ if ((packet instanceof DhcpAckPacket)) {
+ DhcpResults results = packet.toDhcpResults();
+ if (results != null) {
+ setDhcpLeaseExpiry(packet);
+ acceptDhcpResults(results, "Confirmed");
+ transitionTo(mConfiguringInterfaceState);
+ }
+ } else if (packet instanceof DhcpNakPacket) {
+ // TODO: Wait a while before returning into INIT state.
+ Log.d(TAG, "Received NAK, returning to INIT");
+ mOffer = null;
+ transitionTo(mDhcpInitState);
+ }
+ }
+
+ @Override
+ protected void timeout() {
+ // After sending REQUESTs unsuccessfully for a while, go back to init.
+ transitionTo(mDhcpInitState);
+ }
+ }
+
+ class DhcpHaveLeaseState extends State {
+ @Override
+ public boolean processMessage(Message message) {
+ switch (message.what) {
+ case CMD_EXPIRE_DHCP:
+ Log.d(TAG, "Lease expired!");
+ notifyFailure();
+ transitionTo(mDhcpInitState);
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+
+ @Override
+ public void exit() {
+ // Clear any extant alarms.
+ mRenewAlarm.cancel();
+ mRebindAlarm.cancel();
+ mExpiryAlarm.cancel();
+ clearDhcpState();
+ // Tell IpManager to clear the IPv4 address. There is no need to
+ // wait for confirmation since any subsequent packets are sent from
+ // INADDR_ANY anyway (DISCOVER, REQUEST).
+ mController.sendMessage(CMD_CLEAR_LINKADDRESS);
+ }
+ }
+
+ class ConfiguringInterfaceState extends LoggingState {
+ @Override
+ public void enter() {
+ super.enter();
+ mController.sendMessage(CMD_CONFIGURE_LINKADDRESS, mDhcpLease.ipAddress);
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ super.processMessage(message);
+ switch (message.what) {
+ case EVENT_LINKADDRESS_CONFIGURED:
+ transitionTo(mDhcpBoundState);
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+ }
+
+ class DhcpBoundState extends LoggingState {
+ @Override
+ public void enter() {
+ super.enter();
+ if (mDhcpLease.serverAddress != null && !connectUdpSock(mDhcpLease.serverAddress)) {
+ // There's likely no point in going into DhcpInitState here, we'll probably
+ // just repeat the transaction, get the same IP address as before, and fail.
+ //
+ // NOTE: It is observed that connectUdpSock() basically never fails, due to
+ // SO_BINDTODEVICE. Examining the local socket address shows it will happily
+ // return an IPv4 address from another interface, or even return "0.0.0.0".
+ //
+ // TODO: Consider deleting this check, following testing on several kernels.
+ notifyFailure();
+ transitionTo(mStoppedState);
+ }
+
+ scheduleLeaseTimers();
+ logTimeToBoundState();
+ }
+
+ @Override
+ public void exit() {
+ super.exit();
+ mLastBoundExitTime = SystemClock.elapsedRealtime();
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ super.processMessage(message);
+ switch (message.what) {
+ case CMD_RENEW_DHCP:
+ if (mRegisteredForPreDhcpNotification) {
+ transitionTo(mWaitBeforeRenewalState);
+ } else {
+ transitionTo(mDhcpRenewingState);
+ }
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+
+ private void logTimeToBoundState() {
+ long now = SystemClock.elapsedRealtime();
+ if (mLastBoundExitTime > mLastInitEnterTime) {
+ logState(EVENT_RENEWING_BOUND, (int) (now - mLastBoundExitTime));
+ } else {
+ logState(EVENT_INITIAL_BOUND, (int) (now - mLastInitEnterTime));
+ }
+ }
+ }
+
+ abstract class DhcpReacquiringState extends PacketRetransmittingState {
+ protected String mLeaseMsg;
+
+ @Override
+ public void enter() {
+ super.enter();
+ startNewTransaction();
+ }
+
+ abstract protected Inet4Address packetDestination();
+
+ protected boolean sendPacket() {
+ return sendRequestPacket(
+ (Inet4Address) mDhcpLease.ipAddress.getAddress(), // ciaddr
+ INADDR_ANY, // DHCP_REQUESTED_IP
+ null, // DHCP_SERVER_IDENTIFIER
+ packetDestination()); // packet destination address
+ }
+
+ protected void receivePacket(DhcpPacket packet) {
+ if (!isValidPacket(packet)) return;
+ if ((packet instanceof DhcpAckPacket)) {
+ final DhcpResults results = packet.toDhcpResults();
+ if (results != null) {
+ if (!mDhcpLease.ipAddress.equals(results.ipAddress)) {
+ Log.d(TAG, "Renewed lease not for our current IP address!");
+ notifyFailure();
+ transitionTo(mDhcpInitState);
+ }
+ setDhcpLeaseExpiry(packet);
+ // Updating our notion of DhcpResults here only causes the
+ // DNS servers and routes to be updated in LinkProperties
+ // in IpManager and by any overridden relevant handlers of
+ // the registered IpManager.Callback. IP address changes
+ // are not supported here.
+ acceptDhcpResults(results, mLeaseMsg);
+ transitionTo(mDhcpBoundState);
+ }
+ } else if (packet instanceof DhcpNakPacket) {
+ Log.d(TAG, "Received NAK, returning to INIT");
+ notifyFailure();
+ transitionTo(mDhcpInitState);
+ }
+ }
+ }
+
+ class DhcpRenewingState extends DhcpReacquiringState {
+ public DhcpRenewingState() {
+ mLeaseMsg = "Renewed";
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ if (super.processMessage(message) == HANDLED) {
+ return HANDLED;
+ }
+
+ switch (message.what) {
+ case CMD_REBIND_DHCP:
+ transitionTo(mDhcpRebindingState);
+ return HANDLED;
+ default:
+ return NOT_HANDLED;
+ }
+ }
+
+ @Override
+ protected Inet4Address packetDestination() {
+ // Not specifying a SERVER_IDENTIFIER option is a violation of RFC 2131, but...
+ // http://b/25343517 . Try to make things work anyway by using broadcast renews.
+ return (mDhcpLease.serverAddress != null) ?
+ mDhcpLease.serverAddress : INADDR_BROADCAST;
+ }
+ }
+
+ class DhcpRebindingState extends DhcpReacquiringState {
+ public DhcpRebindingState() {
+ mLeaseMsg = "Rebound";
+ }
+
+ @Override
+ public void enter() {
+ super.enter();
+
+ // We need to broadcast and possibly reconnect the socket to a
+ // completely different server.
+ closeSocketQuietly(mUdpSock);
+ if (!initUdpSocket()) {
+ Log.e(TAG, "Failed to recreate UDP socket");
+ transitionTo(mDhcpInitState);
+ }
+ }
+
+ @Override
+ protected Inet4Address packetDestination() {
+ return INADDR_BROADCAST;
+ }
+ }
+
+ class DhcpInitRebootState extends LoggingState {
+ }
+
+ class DhcpRebootingState extends LoggingState {
+ }
+
+ private void logError(int errorCode) {
+ mMetricsLog.log(mIfaceName, new DhcpErrorEvent(errorCode));
+ }
+
+ private void logState(String name, int durationMs) {
+ final DhcpClientEvent event = new DhcpClientEvent.Builder()
+ .setMsg(name)
+ .setDurationMs(durationMs)
+ .build();
+ mMetricsLog.log(mIfaceName, event);
+ }
+}
diff --git a/packages/NetworkStack/src/android/net/dhcp/DhcpDiscoverPacket.java b/packages/NetworkStack/src/android/net/dhcp/DhcpDiscoverPacket.java
new file mode 100644
index 000000000000..19beb0881683
--- /dev/null
+++ b/packages/NetworkStack/src/android/net/dhcp/DhcpDiscoverPacket.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.dhcp;
+
+import java.net.Inet4Address;
+import java.nio.ByteBuffer;
+
+/**
+ * This class implements the DHCP-DISCOVER packet.
+ */
+class DhcpDiscoverPacket extends DhcpPacket {
+ /**
+ * The IP address of the client which sent this packet.
+ */
+ final Inet4Address mSrcIp;
+
+ /**
+ * Generates a DISCOVER packet with the specified parameters.
+ */
+ DhcpDiscoverPacket(int transId, short secs, Inet4Address relayIp, byte[] clientMac,
+ boolean broadcast, Inet4Address srcIp) {
+ super(transId, secs, INADDR_ANY, INADDR_ANY, INADDR_ANY, relayIp, clientMac, broadcast);
+ mSrcIp = srcIp;
+ }
+ DhcpDiscoverPacket(int transId, short secs, byte[] clientMac, boolean broadcast,
+ boolean rapidCommit) {
+ super(transId, secs, INADDR_ANY, INADDR_ANY, INADDR_ANY, INADDR_ANY,
+ clientMac, broadcast, rapidCommit);
+ mSrcIp = INADDR_ANY;
+ }
+
+ public String toString() {
+ String s = super.toString();
+ return s + " DISCOVER " +
+ (mBroadcast ? "broadcast " : "unicast ");
+ }
+
+ /**
+ * Fills in a packet with the requested DISCOVER parameters.
+ */
+ public ByteBuffer buildPacket(int encap, short destUdp, short srcUdp) {
+ ByteBuffer result = ByteBuffer.allocate(MAX_LENGTH);
+ fillInPacket(encap, INADDR_BROADCAST, mSrcIp, destUdp, srcUdp, result, DHCP_BOOTREQUEST,
+ mBroadcast);
+ result.flip();
+ return result;
+ }
+
+ /**
+ * Adds optional parameters to a DISCOVER packet.
+ */
+ void finishPacket(ByteBuffer buffer) {
+ addTlv(buffer, DHCP_MESSAGE_TYPE, DHCP_MESSAGE_TYPE_DISCOVER);
+ addTlv(buffer, DHCP_CLIENT_IDENTIFIER, getClientId());
+ addCommonClientTlvs(buffer);
+ addTlv(buffer, DHCP_PARAMETER_LIST, mRequestedParams);
+ if (mRapidCommit) {
+ addTlv(buffer, DHCP_OPTION_RAPID_COMMIT);
+ }
+ addTlvEnd(buffer);
+ }
+}
diff --git a/packages/NetworkStack/src/android/net/dhcp/DhcpPacket.java b/packages/NetworkStack/src/android/net/dhcp/DhcpPacket.java
new file mode 100644
index 000000000000..c382733041e0
--- /dev/null
+++ b/packages/NetworkStack/src/android/net/dhcp/DhcpPacket.java
@@ -0,0 +1,1428 @@
+package android.net.dhcp;
+
+import static com.android.server.util.NetworkStackConstants.IPV4_ADDR_ALL;
+import static com.android.server.util.NetworkStackConstants.IPV4_ADDR_ANY;
+
+import android.annotation.Nullable;
+import android.net.DhcpResults;
+import android.net.LinkAddress;
+import android.net.metrics.DhcpErrorEvent;
+import android.net.shared.Inet4AddressUtils;
+import android.os.Build;
+import android.os.SystemProperties;
+import android.system.OsConstants;
+import android.text.TextUtils;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.io.UnsupportedEncodingException;
+import java.net.Inet4Address;
+import java.net.UnknownHostException;
+import java.nio.BufferUnderflowException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.ShortBuffer;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Defines basic data and operations needed to build and use packets for the
+ * DHCP protocol. Subclasses create the specific packets used at each
+ * stage of the negotiation.
+ *
+ * @hide
+ */
+public abstract class DhcpPacket {
+ protected static final String TAG = "DhcpPacket";
+
+ // TODO: use NetworkStackConstants.IPV4_MIN_MTU once this class is moved to the network stack.
+ private static final int IPV4_MIN_MTU = 68;
+
+ // dhcpcd has a minimum lease of 20 seconds, but DhcpStateMachine would refuse to wake up the
+ // CPU for anything shorter than 5 minutes. For sanity's sake, this must be higher than the
+ // DHCP client timeout.
+ public static final int MINIMUM_LEASE = 60;
+ public static final int INFINITE_LEASE = (int) 0xffffffff;
+
+ public static final Inet4Address INADDR_ANY = IPV4_ADDR_ANY;
+ public static final Inet4Address INADDR_BROADCAST = IPV4_ADDR_ALL;
+ public static final byte[] ETHER_BROADCAST = new byte[] {
+ (byte) 0xff, (byte) 0xff, (byte) 0xff,
+ (byte) 0xff, (byte) 0xff, (byte) 0xff,
+ };
+
+ /**
+ * Packet encapsulations.
+ */
+ public static final int ENCAP_L2 = 0; // EthernetII header included
+ public static final int ENCAP_L3 = 1; // IP/UDP header included
+ public static final int ENCAP_BOOTP = 2; // BOOTP contents only
+
+ /**
+ * Minimum length of a DHCP packet, excluding options, in the above encapsulations.
+ */
+ public static final int MIN_PACKET_LENGTH_BOOTP = 236; // See diagram in RFC 2131, section 2.
+ public static final int MIN_PACKET_LENGTH_L3 = MIN_PACKET_LENGTH_BOOTP + 20 + 8;
+ public static final int MIN_PACKET_LENGTH_L2 = MIN_PACKET_LENGTH_L3 + 14;
+
+ public static final int HWADDR_LEN = 16;
+ public static final int MAX_OPTION_LEN = 255;
+
+ /**
+ * The minimum and maximum MTU that we are prepared to use. We set the minimum to the minimum
+ * IPv6 MTU because the IPv6 stack enters unusual codepaths when the link MTU drops below 1280,
+ * and does not recover if the MTU is brought above 1280 again. We set the maximum to 1500
+ * because in general it is risky to assume that the hardware is able to send/receive packets
+ * larger than 1500 bytes even if the network supports it.
+ */
+ private static final int MIN_MTU = 1280;
+ private static final int MAX_MTU = 1500;
+
+ /**
+ * IP layer definitions.
+ */
+ private static final byte IP_TYPE_UDP = (byte) 0x11;
+
+ /**
+ * IP: Version 4, Header Length 20 bytes
+ */
+ private static final byte IP_VERSION_HEADER_LEN = (byte) 0x45;
+
+ /**
+ * IP: Flags 0, Fragment Offset 0, Don't Fragment
+ */
+ private static final short IP_FLAGS_OFFSET = (short) 0x4000;
+
+ /**
+ * IP: TOS
+ */
+ private static final byte IP_TOS_LOWDELAY = (byte) 0x10;
+
+ /**
+ * IP: TTL -- use default 64 from RFC1340
+ */
+ private static final byte IP_TTL = (byte) 0x40;
+
+ /**
+ * The client DHCP port.
+ */
+ static final short DHCP_CLIENT = (short) 68;
+
+ /**
+ * The server DHCP port.
+ */
+ static final short DHCP_SERVER = (short) 67;
+
+ /**
+ * The message op code indicating a request from a client.
+ */
+ protected static final byte DHCP_BOOTREQUEST = (byte) 1;
+
+ /**
+ * The message op code indicating a response from the server.
+ */
+ protected static final byte DHCP_BOOTREPLY = (byte) 2;
+
+ /**
+ * The code type used to identify an Ethernet MAC address in the
+ * Client-ID field.
+ */
+ protected static final byte CLIENT_ID_ETHER = (byte) 1;
+
+ /**
+ * The maximum length of a packet that can be constructed.
+ */
+ protected static final int MAX_LENGTH = 1500;
+
+ /**
+ * The magic cookie that identifies this as a DHCP packet instead of BOOTP.
+ */
+ private static final int DHCP_MAGIC_COOKIE = 0x63825363;
+
+ /**
+ * DHCP Optional Type: DHCP Subnet Mask
+ */
+ protected static final byte DHCP_SUBNET_MASK = 1;
+ protected Inet4Address mSubnetMask;
+
+ /**
+ * DHCP Optional Type: DHCP Router
+ */
+ protected static final byte DHCP_ROUTER = 3;
+ protected List <Inet4Address> mGateways;
+
+ /**
+ * DHCP Optional Type: DHCP DNS Server
+ */
+ protected static final byte DHCP_DNS_SERVER = 6;
+ protected List<Inet4Address> mDnsServers;
+
+ /**
+ * DHCP Optional Type: DHCP Host Name
+ */
+ protected static final byte DHCP_HOST_NAME = 12;
+ protected String mHostName;
+
+ /**
+ * DHCP Optional Type: DHCP DOMAIN NAME
+ */
+ protected static final byte DHCP_DOMAIN_NAME = 15;
+ protected String mDomainName;
+
+ /**
+ * DHCP Optional Type: DHCP Interface MTU
+ */
+ protected static final byte DHCP_MTU = 26;
+ protected Short mMtu;
+
+ /**
+ * DHCP Optional Type: DHCP BROADCAST ADDRESS
+ */
+ protected static final byte DHCP_BROADCAST_ADDRESS = 28;
+ protected Inet4Address mBroadcastAddress;
+
+ /**
+ * DHCP Optional Type: Vendor specific information
+ */
+ protected static final byte DHCP_VENDOR_INFO = 43;
+ protected String mVendorInfo;
+
+ /**
+ * Value of the vendor specific option used to indicate that the network is metered
+ */
+ public static final String VENDOR_INFO_ANDROID_METERED = "ANDROID_METERED";
+
+ /**
+ * DHCP Optional Type: Option overload option
+ */
+ protected static final byte DHCP_OPTION_OVERLOAD = 52;
+
+ /**
+ * Possible values of the option overload option.
+ */
+ private static final byte OPTION_OVERLOAD_FILE = 1;
+ private static final byte OPTION_OVERLOAD_SNAME = 2;
+ private static final byte OPTION_OVERLOAD_BOTH = 3;
+
+ /**
+ * DHCP Optional Type: DHCP Requested IP Address
+ */
+ protected static final byte DHCP_REQUESTED_IP = 50;
+ protected Inet4Address mRequestedIp;
+
+ /**
+ * DHCP Optional Type: DHCP Lease Time
+ */
+ protected static final byte DHCP_LEASE_TIME = 51;
+ protected Integer mLeaseTime;
+
+ /**
+ * DHCP Optional Type: DHCP Message Type
+ */
+ protected static final byte DHCP_MESSAGE_TYPE = 53;
+ // the actual type values
+ protected static final byte DHCP_MESSAGE_TYPE_DISCOVER = 1;
+ protected static final byte DHCP_MESSAGE_TYPE_OFFER = 2;
+ protected static final byte DHCP_MESSAGE_TYPE_REQUEST = 3;
+ protected static final byte DHCP_MESSAGE_TYPE_DECLINE = 4;
+ protected static final byte DHCP_MESSAGE_TYPE_ACK = 5;
+ protected static final byte DHCP_MESSAGE_TYPE_NAK = 6;
+ protected static final byte DHCP_MESSAGE_TYPE_RELEASE = 7;
+ protected static final byte DHCP_MESSAGE_TYPE_INFORM = 8;
+
+ /**
+ * DHCP Optional Type: DHCP Server Identifier
+ */
+ protected static final byte DHCP_SERVER_IDENTIFIER = 54;
+ protected Inet4Address mServerIdentifier;
+
+ /**
+ * DHCP Optional Type: DHCP Parameter List
+ */
+ protected static final byte DHCP_PARAMETER_LIST = 55;
+ protected byte[] mRequestedParams;
+
+ /**
+ * DHCP Optional Type: DHCP MESSAGE
+ */
+ protected static final byte DHCP_MESSAGE = 56;
+ protected String mMessage;
+
+ /**
+ * DHCP Optional Type: Maximum DHCP Message Size
+ */
+ protected static final byte DHCP_MAX_MESSAGE_SIZE = 57;
+ protected Short mMaxMessageSize;
+
+ /**
+ * DHCP Optional Type: DHCP Renewal Time Value
+ */
+ protected static final byte DHCP_RENEWAL_TIME = 58;
+ protected Integer mT1;
+
+ /**
+ * DHCP Optional Type: Rebinding Time Value
+ */
+ protected static final byte DHCP_REBINDING_TIME = 59;
+ protected Integer mT2;
+
+ /**
+ * DHCP Optional Type: Vendor Class Identifier
+ */
+ protected static final byte DHCP_VENDOR_CLASS_ID = 60;
+ protected String mVendorId;
+
+ /**
+ * DHCP Optional Type: DHCP Client Identifier
+ */
+ protected static final byte DHCP_CLIENT_IDENTIFIER = 61;
+ protected byte[] mClientId;
+
+ /**
+ * DHCP zero-length option code: rapid commit
+ */
+ protected static final byte DHCP_OPTION_RAPID_COMMIT = 80;
+
+ /**
+ * DHCP zero-length option code: pad
+ */
+ protected static final byte DHCP_OPTION_PAD = 0x00;
+
+ /**
+ * DHCP zero-length option code: end of options
+ */
+ protected static final byte DHCP_OPTION_END = (byte) 0xff;
+
+ /**
+ * The transaction identifier used in this particular DHCP negotiation
+ */
+ protected final int mTransId;
+
+ /**
+ * The seconds field in the BOOTP header. Per RFC, should be nonzero in client requests only.
+ */
+ protected final short mSecs;
+
+ /**
+ * The IP address of the client host. This address is typically
+ * proposed by the client (from an earlier DHCP negotiation) or
+ * supplied by the server.
+ */
+ protected final Inet4Address mClientIp;
+ protected final Inet4Address mYourIp;
+ private final Inet4Address mNextIp;
+ protected final Inet4Address mRelayIp;
+
+ /**
+ * Does the client request a broadcast response?
+ */
+ protected boolean mBroadcast;
+
+ /**
+ * The six-octet MAC of the client.
+ */
+ protected final byte[] mClientMac;
+
+ /**
+ * The server host name from server.
+ */
+ protected String mServerHostName;
+
+ /**
+ * Whether the packet should be built with rapid commit option
+ */
+ protected boolean mRapidCommit;
+
+ /**
+ * Asks the packet object to create a ByteBuffer serialization of
+ * the packet for transmission.
+ */
+ public abstract ByteBuffer buildPacket(int encap, short destUdp,
+ short srcUdp);
+
+ /**
+ * Allows the concrete class to fill in packet-type-specific details,
+ * typically optional parameters at the end of the packet.
+ */
+ abstract void finishPacket(ByteBuffer buffer);
+
+ // Set in unit tests, to ensure that the test does not break when run on different devices and
+ // on different releases.
+ static String testOverrideVendorId = null;
+ static String testOverrideHostname = null;
+
+ protected DhcpPacket(int transId, short secs, Inet4Address clientIp, Inet4Address yourIp,
+ Inet4Address nextIp, Inet4Address relayIp,
+ byte[] clientMac, boolean broadcast, boolean rapidCommit) {
+ mTransId = transId;
+ mSecs = secs;
+ mClientIp = clientIp;
+ mYourIp = yourIp;
+ mNextIp = nextIp;
+ mRelayIp = relayIp;
+ mClientMac = clientMac;
+ mBroadcast = broadcast;
+ mRapidCommit = rapidCommit;
+ }
+
+ protected DhcpPacket(int transId, short secs, Inet4Address clientIp, Inet4Address yourIp,
+ Inet4Address nextIp, Inet4Address relayIp,
+ byte[] clientMac, boolean broadcast) {
+ this(transId, secs, clientIp, yourIp, nextIp,
+ relayIp, clientMac, broadcast, false);
+ }
+
+ /**
+ * Returns the transaction ID.
+ */
+ public int getTransactionId() {
+ return mTransId;
+ }
+
+ /**
+ * Returns the client MAC.
+ */
+ public byte[] getClientMac() {
+ return mClientMac;
+ }
+
+ // TODO: refactor DhcpClient to set clientId when constructing packets and remove
+ // hasExplicitClientId logic
+ /**
+ * Returns whether a client ID was set in the options for this packet.
+ */
+ public boolean hasExplicitClientId() {
+ return mClientId != null;
+ }
+
+ /**
+ * Convenience method to return the client ID if it was set explicitly, or null otherwise.
+ */
+ @Nullable
+ public byte[] getExplicitClientIdOrNull() {
+ return hasExplicitClientId() ? getClientId() : null;
+ }
+
+ /**
+ * Returns the client ID. If not set explicitly, this follows RFC 2132 and creates a client ID
+ * based on the hardware address.
+ */
+ public byte[] getClientId() {
+ final byte[] clientId;
+ if (hasExplicitClientId()) {
+ clientId = Arrays.copyOf(mClientId, mClientId.length);
+ } else {
+ clientId = new byte[mClientMac.length + 1];
+ clientId[0] = CLIENT_ID_ETHER;
+ System.arraycopy(mClientMac, 0, clientId, 1, mClientMac.length);
+ }
+ return clientId;
+ }
+
+ /**
+ * Returns whether a parameter is included in the parameter request list option of this packet.
+ *
+ * <p>If there is no parameter request list option in the packet, false is returned.
+ *
+ * @param paramId ID of the parameter, such as {@link #DHCP_MTU} or {@link #DHCP_HOST_NAME}.
+ */
+ public boolean hasRequestedParam(byte paramId) {
+ if (mRequestedParams == null) {
+ return false;
+ }
+
+ for (byte reqParam : mRequestedParams) {
+ if (reqParam == paramId) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Creates a new L3 packet (including IP header) containing the
+ * DHCP udp packet. This method relies upon the delegated method
+ * finishPacket() to insert the per-packet contents.
+ */
+ protected void fillInPacket(int encap, Inet4Address destIp,
+ Inet4Address srcIp, short destUdp, short srcUdp, ByteBuffer buf,
+ byte requestCode, boolean broadcast) {
+ byte[] destIpArray = destIp.getAddress();
+ byte[] srcIpArray = srcIp.getAddress();
+ int ipHeaderOffset = 0;
+ int ipLengthOffset = 0;
+ int ipChecksumOffset = 0;
+ int endIpHeader = 0;
+ int udpHeaderOffset = 0;
+ int udpLengthOffset = 0;
+ int udpChecksumOffset = 0;
+
+ buf.clear();
+ buf.order(ByteOrder.BIG_ENDIAN);
+
+ if (encap == ENCAP_L2) {
+ buf.put(ETHER_BROADCAST);
+ buf.put(mClientMac);
+ buf.putShort((short) OsConstants.ETH_P_IP);
+ }
+
+ // if a full IP packet needs to be generated, put the IP & UDP
+ // headers in place, and pre-populate with artificial values
+ // needed to seed the IP checksum.
+ if (encap <= ENCAP_L3) {
+ ipHeaderOffset = buf.position();
+ buf.put(IP_VERSION_HEADER_LEN);
+ buf.put(IP_TOS_LOWDELAY); // tos: IPTOS_LOWDELAY
+ ipLengthOffset = buf.position();
+ buf.putShort((short)0); // length
+ buf.putShort((short)0); // id
+ buf.putShort(IP_FLAGS_OFFSET); // ip offset: don't fragment
+ buf.put(IP_TTL); // TTL: use default 64 from RFC1340
+ buf.put(IP_TYPE_UDP);
+ ipChecksumOffset = buf.position();
+ buf.putShort((short) 0); // checksum
+
+ buf.put(srcIpArray);
+ buf.put(destIpArray);
+ endIpHeader = buf.position();
+
+ // UDP header
+ udpHeaderOffset = buf.position();
+ buf.putShort(srcUdp);
+ buf.putShort(destUdp);
+ udpLengthOffset = buf.position();
+ buf.putShort((short) 0); // length
+ udpChecksumOffset = buf.position();
+ buf.putShort((short) 0); // UDP checksum -- initially zero
+ }
+
+ // DHCP payload
+ buf.put(requestCode);
+ buf.put((byte) 1); // Hardware Type: Ethernet
+ buf.put((byte) mClientMac.length); // Hardware Address Length
+ buf.put((byte) 0); // Hop Count
+ buf.putInt(mTransId); // Transaction ID
+ buf.putShort(mSecs); // Elapsed Seconds
+
+ if (broadcast) {
+ buf.putShort((short) 0x8000); // Flags
+ } else {
+ buf.putShort((short) 0x0000); // Flags
+ }
+
+ buf.put(mClientIp.getAddress());
+ buf.put(mYourIp.getAddress());
+ buf.put(mNextIp.getAddress());
+ buf.put(mRelayIp.getAddress());
+ buf.put(mClientMac);
+ buf.position(buf.position() +
+ (HWADDR_LEN - mClientMac.length) // pad addr to 16 bytes
+ + 64 // empty server host name (64 bytes)
+ + 128); // empty boot file name (128 bytes)
+ buf.putInt(DHCP_MAGIC_COOKIE); // magic number
+ finishPacket(buf);
+
+ // round up to an even number of octets
+ if ((buf.position() & 1) == 1) {
+ buf.put((byte) 0);
+ }
+
+ // If an IP packet is being built, the IP & UDP checksums must be
+ // computed.
+ if (encap <= ENCAP_L3) {
+ // fix UDP header: insert length
+ short udpLen = (short)(buf.position() - udpHeaderOffset);
+ buf.putShort(udpLengthOffset, udpLen);
+ // fix UDP header: checksum
+ // checksum for UDP at udpChecksumOffset
+ int udpSeed = 0;
+
+ // apply IPv4 pseudo-header. Read IP address src and destination
+ // values from the IP header and accumulate checksum.
+ udpSeed += intAbs(buf.getShort(ipChecksumOffset + 2));
+ udpSeed += intAbs(buf.getShort(ipChecksumOffset + 4));
+ udpSeed += intAbs(buf.getShort(ipChecksumOffset + 6));
+ udpSeed += intAbs(buf.getShort(ipChecksumOffset + 8));
+
+ // accumulate extra data for the pseudo-header
+ udpSeed += IP_TYPE_UDP;
+ udpSeed += udpLen;
+ // and compute UDP checksum
+ buf.putShort(udpChecksumOffset, (short) checksum(buf, udpSeed,
+ udpHeaderOffset,
+ buf.position()));
+ // fix IP header: insert length
+ buf.putShort(ipLengthOffset, (short)(buf.position() - ipHeaderOffset));
+ // fixup IP-header checksum
+ buf.putShort(ipChecksumOffset,
+ (short) checksum(buf, 0, ipHeaderOffset, endIpHeader));
+ }
+ }
+
+ /**
+ * Converts a signed short value to an unsigned int value. Needed
+ * because Java does not have unsigned types.
+ */
+ private static int intAbs(short v) {
+ return v & 0xFFFF;
+ }
+
+ /**
+ * Performs an IP checksum (used in IP header and across UDP
+ * payload) on the specified portion of a ByteBuffer. The seed
+ * allows the checksum to commence with a specified value.
+ */
+ private int checksum(ByteBuffer buf, int seed, int start, int end) {
+ int sum = seed;
+ int bufPosition = buf.position();
+
+ // set position of original ByteBuffer, so that the ShortBuffer
+ // will be correctly initialized
+ buf.position(start);
+ ShortBuffer shortBuf = buf.asShortBuffer();
+
+ // re-set ByteBuffer position
+ buf.position(bufPosition);
+
+ short[] shortArray = new short[(end - start) / 2];
+ shortBuf.get(shortArray);
+
+ for (short s : shortArray) {
+ sum += intAbs(s);
+ }
+
+ start += shortArray.length * 2;
+
+ // see if a singleton byte remains
+ if (end != start) {
+ short b = buf.get(start);
+
+ // make it unsigned
+ if (b < 0) {
+ b += 256;
+ }
+
+ sum += b * 256;
+ }
+
+ sum = ((sum >> 16) & 0xFFFF) + (sum & 0xFFFF);
+ sum = ((sum + ((sum >> 16) & 0xFFFF)) & 0xFFFF);
+ int negated = ~sum;
+ return intAbs((short) negated);
+ }
+
+ /**
+ * Adds an optional parameter not containing any payload.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type) {
+ buf.put(type);
+ buf.put((byte) 0);
+ }
+
+ /**
+ * Adds an optional parameter containing a single byte value.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, byte value) {
+ buf.put(type);
+ buf.put((byte) 1);
+ buf.put(value);
+ }
+
+ /**
+ * Adds an optional parameter containing an array of bytes.
+ *
+ * <p>This method is a no-op if the payload argument is null.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, @Nullable byte[] payload) {
+ if (payload != null) {
+ if (payload.length > MAX_OPTION_LEN) {
+ throw new IllegalArgumentException("DHCP option too long: "
+ + payload.length + " vs. " + MAX_OPTION_LEN);
+ }
+ buf.put(type);
+ buf.put((byte) payload.length);
+ buf.put(payload);
+ }
+ }
+
+ /**
+ * Adds an optional parameter containing an IP address.
+ *
+ * <p>This method is a no-op if the address argument is null.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, @Nullable Inet4Address addr) {
+ if (addr != null) {
+ addTlv(buf, type, addr.getAddress());
+ }
+ }
+
+ /**
+ * Adds an optional parameter containing a list of IP addresses.
+ *
+ * <p>This method is a no-op if the addresses argument is null or empty.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, @Nullable List<Inet4Address> addrs) {
+ if (addrs == null || addrs.size() == 0) return;
+
+ int optionLen = 4 * addrs.size();
+ if (optionLen > MAX_OPTION_LEN) {
+ throw new IllegalArgumentException("DHCP option too long: "
+ + optionLen + " vs. " + MAX_OPTION_LEN);
+ }
+
+ buf.put(type);
+ buf.put((byte)(optionLen));
+
+ for (Inet4Address addr : addrs) {
+ buf.put(addr.getAddress());
+ }
+ }
+
+ /**
+ * Adds an optional parameter containing a short integer.
+ *
+ * <p>This method is a no-op if the value argument is null.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, @Nullable Short value) {
+ if (value != null) {
+ buf.put(type);
+ buf.put((byte) 2);
+ buf.putShort(value.shortValue());
+ }
+ }
+
+ /**
+ * Adds an optional parameter containing a simple integer.
+ *
+ * <p>This method is a no-op if the value argument is null.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, @Nullable Integer value) {
+ if (value != null) {
+ buf.put(type);
+ buf.put((byte) 4);
+ buf.putInt(value.intValue());
+ }
+ }
+
+ /**
+ * Adds an optional parameter containing an ASCII string.
+ *
+ * <p>This method is a no-op if the string argument is null.
+ */
+ protected static void addTlv(ByteBuffer buf, byte type, @Nullable String str) {
+ if (str != null) {
+ try {
+ addTlv(buf, type, str.getBytes("US-ASCII"));
+ } catch (UnsupportedEncodingException e) {
+ throw new IllegalArgumentException("String is not US-ASCII: " + str);
+ }
+ }
+ }
+
+ /**
+ * Adds the special end-of-optional-parameters indicator.
+ */
+ protected static void addTlvEnd(ByteBuffer buf) {
+ buf.put((byte) 0xFF);
+ }
+
+ private String getVendorId() {
+ if (testOverrideVendorId != null) return testOverrideVendorId;
+ return "android-dhcp-" + Build.VERSION.RELEASE;
+ }
+
+ private String getHostname() {
+ if (testOverrideHostname != null) return testOverrideHostname;
+ return SystemProperties.get("net.hostname");
+ }
+
+ /**
+ * Adds common client TLVs.
+ *
+ * TODO: Does this belong here? The alternative would be to modify all the buildXyzPacket
+ * methods to take them.
+ */
+ protected void addCommonClientTlvs(ByteBuffer buf) {
+ addTlv(buf, DHCP_MAX_MESSAGE_SIZE, (short) MAX_LENGTH);
+ addTlv(buf, DHCP_VENDOR_CLASS_ID, getVendorId());
+ final String hn = getHostname();
+ if (!TextUtils.isEmpty(hn)) addTlv(buf, DHCP_HOST_NAME, hn);
+ }
+
+ protected void addCommonServerTlvs(ByteBuffer buf) {
+ addTlv(buf, DHCP_LEASE_TIME, mLeaseTime);
+ if (mLeaseTime != null && mLeaseTime != INFINITE_LEASE) {
+ // The client should renew at 1/2 the lease-expiry interval
+ addTlv(buf, DHCP_RENEWAL_TIME, (int) (Integer.toUnsignedLong(mLeaseTime) / 2));
+ // Default rebinding time is set as below by RFC2131
+ addTlv(buf, DHCP_REBINDING_TIME,
+ (int) (Integer.toUnsignedLong(mLeaseTime) * 875L / 1000L));
+ }
+ addTlv(buf, DHCP_SUBNET_MASK, mSubnetMask);
+ addTlv(buf, DHCP_BROADCAST_ADDRESS, mBroadcastAddress);
+ addTlv(buf, DHCP_ROUTER, mGateways);
+ addTlv(buf, DHCP_DNS_SERVER, mDnsServers);
+ addTlv(buf, DHCP_DOMAIN_NAME, mDomainName);
+ addTlv(buf, DHCP_HOST_NAME, mHostName);
+ addTlv(buf, DHCP_VENDOR_INFO, mVendorInfo);
+ if (mMtu != null && Short.toUnsignedInt(mMtu) >= IPV4_MIN_MTU) {
+ addTlv(buf, DHCP_MTU, mMtu);
+ }
+ }
+
+ /**
+ * Converts a MAC from an array of octets to an ASCII string.
+ */
+ public static String macToString(byte[] mac) {
+ String macAddr = "";
+
+ for (int i = 0; i < mac.length; i++) {
+ String hexString = "0" + Integer.toHexString(mac[i]);
+
+ // substring operation grabs the last 2 digits: this
+ // allows signed bytes to be converted correctly.
+ macAddr += hexString.substring(hexString.length() - 2);
+
+ if (i != (mac.length - 1)) {
+ macAddr += ":";
+ }
+ }
+
+ return macAddr;
+ }
+
+ public String toString() {
+ String macAddr = macToString(mClientMac);
+
+ return macAddr;
+ }
+
+ /**
+ * Reads a four-octet value from a ByteBuffer and construct
+ * an IPv4 address from that value.
+ */
+ private static Inet4Address readIpAddress(ByteBuffer packet) {
+ Inet4Address result = null;
+ byte[] ipAddr = new byte[4];
+ packet.get(ipAddr);
+
+ try {
+ result = (Inet4Address) Inet4Address.getByAddress(ipAddr);
+ } catch (UnknownHostException ex) {
+ // ipAddr is numeric, so this should not be
+ // triggered. However, if it is, just nullify
+ result = null;
+ }
+
+ return result;
+ }
+
+ /**
+ * Reads a string of specified length from the buffer.
+ */
+ private static String readAsciiString(ByteBuffer buf, int byteCount, boolean nullOk) {
+ byte[] bytes = new byte[byteCount];
+ buf.get(bytes);
+ int length = bytes.length;
+ if (!nullOk) {
+ // Stop at the first null byte. This is because some DHCP options (e.g., the domain
+ // name) are passed to netd via FrameworkListener, which refuses arguments containing
+ // null bytes. We don't do this by default because vendorInfo is an opaque string which
+ // could in theory contain null bytes.
+ for (length = 0; length < bytes.length; length++) {
+ if (bytes[length] == 0) {
+ break;
+ }
+ }
+ }
+ return new String(bytes, 0, length, StandardCharsets.US_ASCII);
+ }
+
+ private static boolean isPacketToOrFromClient(short udpSrcPort, short udpDstPort) {
+ return (udpSrcPort == DHCP_CLIENT) || (udpDstPort == DHCP_CLIENT);
+ }
+
+ private static boolean isPacketServerToServer(short udpSrcPort, short udpDstPort) {
+ return (udpSrcPort == DHCP_SERVER) && (udpDstPort == DHCP_SERVER);
+ }
+
+ public static class ParseException extends Exception {
+ public final int errorCode;
+ public ParseException(int errorCode, String msg, Object... args) {
+ super(String.format(msg, args));
+ this.errorCode = errorCode;
+ }
+ }
+
+ /**
+ * Creates a concrete DhcpPacket from the supplied ByteBuffer. The
+ * buffer may have an L2 encapsulation (which is the full EthernetII
+ * format starting with the source-address MAC) or an L3 encapsulation
+ * (which starts with the IP header).
+ * <br>
+ * A subset of the optional parameters are parsed and are stored
+ * in object fields.
+ */
+ @VisibleForTesting
+ static DhcpPacket decodeFullPacket(ByteBuffer packet, int pktType) throws ParseException
+ {
+ // bootp parameters
+ int transactionId;
+ short secs;
+ Inet4Address clientIp;
+ Inet4Address yourIp;
+ Inet4Address nextIp;
+ Inet4Address relayIp;
+ byte[] clientMac;
+ byte[] clientId = null;
+ List<Inet4Address> dnsServers = new ArrayList<>();
+ List<Inet4Address> gateways = new ArrayList<>(); // aka router
+ Inet4Address serverIdentifier = null;
+ Inet4Address netMask = null;
+ String message = null;
+ String vendorId = null;
+ String vendorInfo = null;
+ byte[] expectedParams = null;
+ String hostName = null;
+ String domainName = null;
+ Inet4Address ipSrc = null;
+ Inet4Address ipDst = null;
+ Inet4Address bcAddr = null;
+ Inet4Address requestedIp = null;
+ String serverHostName;
+ byte optionOverload = 0;
+
+ // The following are all unsigned integers. Internally we store them as signed integers of
+ // the same length because that way we're guaranteed that they can't be out of the range of
+ // the unsigned field in the packet. Callers wanting to pass in an unsigned value will need
+ // to cast it.
+ Short mtu = null;
+ Short maxMessageSize = null;
+ Integer leaseTime = null;
+ Integer T1 = null;
+ Integer T2 = null;
+
+ // dhcp options
+ byte dhcpType = (byte) 0xFF;
+
+ packet.order(ByteOrder.BIG_ENDIAN);
+
+ // check to see if we need to parse L2, IP, and UDP encaps
+ if (pktType == ENCAP_L2) {
+ if (packet.remaining() < MIN_PACKET_LENGTH_L2) {
+ throw new ParseException(DhcpErrorEvent.L2_TOO_SHORT,
+ "L2 packet too short, %d < %d", packet.remaining(), MIN_PACKET_LENGTH_L2);
+ }
+
+ byte[] l2dst = new byte[6];
+ byte[] l2src = new byte[6];
+
+ packet.get(l2dst);
+ packet.get(l2src);
+
+ short l2type = packet.getShort();
+
+ if (l2type != OsConstants.ETH_P_IP) {
+ throw new ParseException(DhcpErrorEvent.L2_WRONG_ETH_TYPE,
+ "Unexpected L2 type 0x%04x, expected 0x%04x", l2type, OsConstants.ETH_P_IP);
+ }
+ }
+
+ if (pktType <= ENCAP_L3) {
+ if (packet.remaining() < MIN_PACKET_LENGTH_L3) {
+ throw new ParseException(DhcpErrorEvent.L3_TOO_SHORT,
+ "L3 packet too short, %d < %d", packet.remaining(), MIN_PACKET_LENGTH_L3);
+ }
+
+ byte ipTypeAndLength = packet.get();
+ int ipVersion = (ipTypeAndLength & 0xf0) >> 4;
+ if (ipVersion != 4) {
+ throw new ParseException(
+ DhcpErrorEvent.L3_NOT_IPV4, "Invalid IP version %d", ipVersion);
+ }
+
+ // System.out.println("ipType is " + ipType);
+ byte ipDiffServicesField = packet.get();
+ short ipTotalLength = packet.getShort();
+ short ipIdentification = packet.getShort();
+ byte ipFlags = packet.get();
+ byte ipFragOffset = packet.get();
+ byte ipTTL = packet.get();
+ byte ipProto = packet.get();
+ short ipChksm = packet.getShort();
+
+ ipSrc = readIpAddress(packet);
+ ipDst = readIpAddress(packet);
+
+ if (ipProto != IP_TYPE_UDP) {
+ throw new ParseException(
+ DhcpErrorEvent.L4_NOT_UDP, "Protocol not UDP: %d", ipProto);
+ }
+
+ // Skip options. This cannot cause us to read beyond the end of the buffer because the
+ // IPv4 header cannot be more than (0x0f * 4) = 60 bytes long, and that is less than
+ // MIN_PACKET_LENGTH_L3.
+ int optionWords = ((ipTypeAndLength & 0x0f) - 5);
+ for (int i = 0; i < optionWords; i++) {
+ packet.getInt();
+ }
+
+ // assume UDP
+ short udpSrcPort = packet.getShort();
+ short udpDstPort = packet.getShort();
+ short udpLen = packet.getShort();
+ short udpChkSum = packet.getShort();
+
+ // Only accept packets to or from the well-known client port (expressly permitting
+ // packets from ports other than the well-known server port; http://b/24687559), and
+ // server-to-server packets, e.g. for relays.
+ if (!isPacketToOrFromClient(udpSrcPort, udpDstPort) &&
+ !isPacketServerToServer(udpSrcPort, udpDstPort)) {
+ // This should almost never happen because we use SO_ATTACH_FILTER on the packet
+ // socket to drop packets that don't have the right source ports. However, it's
+ // possible that a packet arrives between when the socket is bound and when the
+ // filter is set. http://b/26696823 .
+ throw new ParseException(DhcpErrorEvent.L4_WRONG_PORT,
+ "Unexpected UDP ports %d->%d", udpSrcPort, udpDstPort);
+ }
+ }
+
+ // We need to check the length even for ENCAP_L3 because the IPv4 header is variable-length.
+ if (pktType > ENCAP_BOOTP || packet.remaining() < MIN_PACKET_LENGTH_BOOTP) {
+ throw new ParseException(DhcpErrorEvent.BOOTP_TOO_SHORT,
+ "Invalid type or BOOTP packet too short, %d < %d",
+ packet.remaining(), MIN_PACKET_LENGTH_BOOTP);
+ }
+
+ byte type = packet.get();
+ byte hwType = packet.get();
+ int addrLen = packet.get() & 0xff;
+ byte hops = packet.get();
+ transactionId = packet.getInt();
+ secs = packet.getShort();
+ short bootpFlags = packet.getShort();
+ boolean broadcast = (bootpFlags & 0x8000) != 0;
+ byte[] ipv4addr = new byte[4];
+
+ try {
+ packet.get(ipv4addr);
+ clientIp = (Inet4Address) Inet4Address.getByAddress(ipv4addr);
+ packet.get(ipv4addr);
+ yourIp = (Inet4Address) Inet4Address.getByAddress(ipv4addr);
+ packet.get(ipv4addr);
+ nextIp = (Inet4Address) Inet4Address.getByAddress(ipv4addr);
+ packet.get(ipv4addr);
+ relayIp = (Inet4Address) Inet4Address.getByAddress(ipv4addr);
+ } catch (UnknownHostException ex) {
+ throw new ParseException(DhcpErrorEvent.L3_INVALID_IP,
+ "Invalid IPv4 address: %s", Arrays.toString(ipv4addr));
+ }
+
+ // Some DHCP servers have been known to announce invalid client hardware address values such
+ // as 0xff. The legacy DHCP client accepted these becuause it does not check the length at
+ // all but only checks that the interface MAC address matches the first bytes of the address
+ // in the packets. We're a bit stricter: if the length is obviously invalid (i.e., bigger
+ // than the size of the field), we fudge it to 6 (Ethernet). http://b/23725795
+ // TODO: evaluate whether to make this test more liberal.
+ if (addrLen > HWADDR_LEN) {
+ addrLen = ETHER_BROADCAST.length;
+ }
+
+ clientMac = new byte[addrLen];
+ packet.get(clientMac);
+
+ // skip over address padding (16 octets allocated)
+ packet.position(packet.position() + (16 - addrLen));
+ serverHostName = readAsciiString(packet, 64, false);
+ packet.position(packet.position() + 128);
+
+ // Ensure this is a DHCP packet with a magic cookie, and not BOOTP. http://b/31850211
+ if (packet.remaining() < 4) {
+ throw new ParseException(DhcpErrorEvent.DHCP_NO_COOKIE, "not a DHCP message");
+ }
+
+ int dhcpMagicCookie = packet.getInt();
+ if (dhcpMagicCookie != DHCP_MAGIC_COOKIE) {
+ throw new ParseException(DhcpErrorEvent.DHCP_BAD_MAGIC_COOKIE,
+ "Bad magic cookie 0x%08x, should be 0x%08x",
+ dhcpMagicCookie, DHCP_MAGIC_COOKIE);
+ }
+
+ // parse options
+ boolean notFinishedOptions = true;
+
+ while ((packet.position() < packet.limit()) && notFinishedOptions) {
+ final byte optionType = packet.get(); // cannot underflow because position < limit
+ try {
+ if (optionType == DHCP_OPTION_END) {
+ notFinishedOptions = false;
+ } else if (optionType == DHCP_OPTION_PAD) {
+ // The pad option doesn't have a length field. Nothing to do.
+ } else {
+ int optionLen = packet.get() & 0xFF;
+ int expectedLen = 0;
+
+ switch(optionType) {
+ case DHCP_SUBNET_MASK:
+ netMask = readIpAddress(packet);
+ expectedLen = 4;
+ break;
+ case DHCP_ROUTER:
+ for (expectedLen = 0; expectedLen < optionLen; expectedLen += 4) {
+ gateways.add(readIpAddress(packet));
+ }
+ break;
+ case DHCP_DNS_SERVER:
+ for (expectedLen = 0; expectedLen < optionLen; expectedLen += 4) {
+ dnsServers.add(readIpAddress(packet));
+ }
+ break;
+ case DHCP_HOST_NAME:
+ expectedLen = optionLen;
+ hostName = readAsciiString(packet, optionLen, false);
+ break;
+ case DHCP_MTU:
+ expectedLen = 2;
+ mtu = packet.getShort();
+ break;
+ case DHCP_DOMAIN_NAME:
+ expectedLen = optionLen;
+ domainName = readAsciiString(packet, optionLen, false);
+ break;
+ case DHCP_BROADCAST_ADDRESS:
+ bcAddr = readIpAddress(packet);
+ expectedLen = 4;
+ break;
+ case DHCP_REQUESTED_IP:
+ requestedIp = readIpAddress(packet);
+ expectedLen = 4;
+ break;
+ case DHCP_LEASE_TIME:
+ leaseTime = Integer.valueOf(packet.getInt());
+ expectedLen = 4;
+ break;
+ case DHCP_MESSAGE_TYPE:
+ dhcpType = packet.get();
+ expectedLen = 1;
+ break;
+ case DHCP_SERVER_IDENTIFIER:
+ serverIdentifier = readIpAddress(packet);
+ expectedLen = 4;
+ break;
+ case DHCP_PARAMETER_LIST:
+ expectedParams = new byte[optionLen];
+ packet.get(expectedParams);
+ expectedLen = optionLen;
+ break;
+ case DHCP_MESSAGE:
+ expectedLen = optionLen;
+ message = readAsciiString(packet, optionLen, false);
+ break;
+ case DHCP_MAX_MESSAGE_SIZE:
+ expectedLen = 2;
+ maxMessageSize = Short.valueOf(packet.getShort());
+ break;
+ case DHCP_RENEWAL_TIME:
+ expectedLen = 4;
+ T1 = Integer.valueOf(packet.getInt());
+ break;
+ case DHCP_REBINDING_TIME:
+ expectedLen = 4;
+ T2 = Integer.valueOf(packet.getInt());
+ break;
+ case DHCP_VENDOR_CLASS_ID:
+ expectedLen = optionLen;
+ // Embedded nulls are safe as this does not get passed to netd.
+ vendorId = readAsciiString(packet, optionLen, true);
+ break;
+ case DHCP_CLIENT_IDENTIFIER: { // Client identifier
+ byte[] id = new byte[optionLen];
+ packet.get(id);
+ expectedLen = optionLen;
+ } break;
+ case DHCP_VENDOR_INFO:
+ expectedLen = optionLen;
+ // Embedded nulls are safe as this does not get passed to netd.
+ vendorInfo = readAsciiString(packet, optionLen, true);
+ break;
+ case DHCP_OPTION_OVERLOAD:
+ expectedLen = 1;
+ optionOverload = packet.get();
+ optionOverload &= OPTION_OVERLOAD_BOTH;
+ break;
+ default:
+ // ignore any other parameters
+ for (int i = 0; i < optionLen; i++) {
+ expectedLen++;
+ byte throwaway = packet.get();
+ }
+ }
+
+ if (expectedLen != optionLen) {
+ final int errorCode = DhcpErrorEvent.errorCodeWithOption(
+ DhcpErrorEvent.DHCP_INVALID_OPTION_LENGTH, optionType);
+ throw new ParseException(errorCode,
+ "Invalid length %d for option %d, expected %d",
+ optionLen, optionType, expectedLen);
+ }
+ }
+ } catch (BufferUnderflowException e) {
+ final int errorCode = DhcpErrorEvent.errorCodeWithOption(
+ DhcpErrorEvent.BUFFER_UNDERFLOW, optionType);
+ throw new ParseException(errorCode, "BufferUnderflowException");
+ }
+ }
+
+ DhcpPacket newPacket;
+
+ switch(dhcpType) {
+ case (byte) 0xFF:
+ throw new ParseException(DhcpErrorEvent.DHCP_NO_MSG_TYPE,
+ "No DHCP message type option");
+ case DHCP_MESSAGE_TYPE_DISCOVER:
+ newPacket = new DhcpDiscoverPacket(transactionId, secs, relayIp, clientMac,
+ broadcast, ipSrc);
+ break;
+ case DHCP_MESSAGE_TYPE_OFFER:
+ newPacket = new DhcpOfferPacket(
+ transactionId, secs, broadcast, ipSrc, relayIp, clientIp, yourIp, clientMac);
+ break;
+ case DHCP_MESSAGE_TYPE_REQUEST:
+ newPacket = new DhcpRequestPacket(
+ transactionId, secs, clientIp, relayIp, clientMac, broadcast);
+ break;
+ case DHCP_MESSAGE_TYPE_DECLINE:
+ newPacket = new DhcpDeclinePacket(
+ transactionId, secs, clientIp, yourIp, nextIp, relayIp,
+ clientMac);
+ break;
+ case DHCP_MESSAGE_TYPE_ACK:
+ newPacket = new DhcpAckPacket(
+ transactionId, secs, broadcast, ipSrc, relayIp, clientIp, yourIp, clientMac);
+ break;
+ case DHCP_MESSAGE_TYPE_NAK:
+ newPacket = new DhcpNakPacket(
+ transactionId, secs, relayIp, clientMac, broadcast);
+ break;
+ case DHCP_MESSAGE_TYPE_RELEASE:
+ if (serverIdentifier == null) {
+ throw new ParseException(DhcpErrorEvent.MISC_ERROR,
+ "DHCPRELEASE without server identifier");
+ }
+ newPacket = new DhcpReleasePacket(
+ transactionId, serverIdentifier, clientIp, relayIp, clientMac);
+ break;
+ case DHCP_MESSAGE_TYPE_INFORM:
+ newPacket = new DhcpInformPacket(
+ transactionId, secs, clientIp, yourIp, nextIp, relayIp,
+ clientMac);
+ break;
+ default:
+ throw new ParseException(DhcpErrorEvent.DHCP_UNKNOWN_MSG_TYPE,
+ "Unimplemented DHCP type %d", dhcpType);
+ }
+
+ newPacket.mBroadcastAddress = bcAddr;
+ newPacket.mClientId = clientId;
+ newPacket.mDnsServers = dnsServers;
+ newPacket.mDomainName = domainName;
+ newPacket.mGateways = gateways;
+ newPacket.mHostName = hostName;
+ newPacket.mLeaseTime = leaseTime;
+ newPacket.mMessage = message;
+ newPacket.mMtu = mtu;
+ newPacket.mRequestedIp = requestedIp;
+ newPacket.mRequestedParams = expectedParams;
+ newPacket.mServerIdentifier = serverIdentifier;
+ newPacket.mSubnetMask = netMask;
+ newPacket.mMaxMessageSize = maxMessageSize;
+ newPacket.mT1 = T1;
+ newPacket.mT2 = T2;
+ newPacket.mVendorId = vendorId;
+ newPacket.mVendorInfo = vendorInfo;
+ if ((optionOverload & OPTION_OVERLOAD_SNAME) == 0) {
+ newPacket.mServerHostName = serverHostName;
+ } else {
+ newPacket.mServerHostName = "";
+ }
+ return newPacket;
+ }
+
+ /**
+ * Parse a packet from an array of bytes, stopping at the given length.
+ */
+ public static DhcpPacket decodeFullPacket(byte[] packet, int length, int pktType)
+ throws ParseException {
+ ByteBuffer buffer = ByteBuffer.wrap(packet, 0, length).order(ByteOrder.BIG_ENDIAN);
+ try {
+ return decodeFullPacket(buffer, pktType);
+ } catch (ParseException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new ParseException(DhcpErrorEvent.PARSING_ERROR, e.getMessage());
+ }
+ }
+
+ /**
+ * Construct a DhcpResults object from a DHCP reply packet.
+ */
+ public DhcpResults toDhcpResults() {
+ Inet4Address ipAddress = mYourIp;
+ if (ipAddress.equals(IPV4_ADDR_ANY)) {
+ ipAddress = mClientIp;
+ if (ipAddress.equals(IPV4_ADDR_ANY)) {
+ return null;
+ }
+ }
+
+ int prefixLength;
+ if (mSubnetMask != null) {
+ try {
+ prefixLength = Inet4AddressUtils.netmaskToPrefixLength(mSubnetMask);
+ } catch (IllegalArgumentException e) {
+ // Non-contiguous netmask.
+ return null;
+ }
+ } else {
+ prefixLength = Inet4AddressUtils.getImplicitNetmask(ipAddress);
+ }
+
+ DhcpResults results = new DhcpResults();
+ try {
+ results.ipAddress = new LinkAddress(ipAddress, prefixLength);
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+
+ if (mGateways.size() > 0) {
+ results.gateway = mGateways.get(0);
+ }
+
+ results.dnsServers.addAll(mDnsServers);
+ results.domains = mDomainName;
+ results.serverAddress = mServerIdentifier;
+ results.vendorInfo = mVendorInfo;
+ results.leaseDuration = (mLeaseTime != null) ? mLeaseTime : INFINITE_LEASE;
+ results.mtu = (mMtu != null && MIN_MTU <= mMtu && mMtu <= MAX_MTU) ? mMtu : 0;
+ results.serverHostName = mServerHostName;
+
+ return results;
+ }
+
+ /**
+ * Returns the parsed lease time, in milliseconds, or 0 for infinite.
+ */
+ public long getLeaseTimeMillis() {
+ // dhcpcd treats the lack of a lease time option as an infinite lease.
+ if (mLeaseTime == null || mLeaseTime == INFINITE_LEASE) {
+ return 0;
+ } else if (0 <= mLeaseTime && mLeaseTime < MINIMUM_LEASE) {
+ return MINIMUM_LEASE * 1000;
+ } else {
+ return (mLeaseTime & 0xffffffffL) * 1000;
+ }
+ }
+
+ /**
+ * Builds a DHCP-DISCOVER packet from the required specified
+ * parameters.
+ */
+ public static ByteBuffer buildDiscoverPacket(int encap, int transactionId,
+ short secs, byte[] clientMac, boolean broadcast, byte[] expectedParams) {
+ return buildDiscoverPacket(encap, transactionId, secs, clientMac,
+ broadcast, expectedParams, false);
+ }
+ public static ByteBuffer buildDiscoverPacket(int encap, int transactionId,
+ short secs, byte[] clientMac, boolean broadcast, byte[] expectedParams,
+ boolean rapidCommit) {
+ DhcpPacket pkt = new DhcpDiscoverPacket(transactionId, secs, clientMac, broadcast, rapidCommit);
+ pkt.mRequestedParams = expectedParams;
+ return pkt.buildPacket(encap, DHCP_SERVER, DHCP_CLIENT);
+ }
+
+ /**
+ * Builds a DHCP-OFFER packet from the required specified
+ * parameters.
+ */
+ public static ByteBuffer buildOfferPacket(int encap, int transactionId,
+ boolean broadcast, Inet4Address serverIpAddr, Inet4Address relayIp,
+ Inet4Address yourIp, byte[] mac, Integer timeout, Inet4Address netMask,
+ Inet4Address bcAddr, List<Inet4Address> gateways, List<Inet4Address> dnsServers,
+ Inet4Address dhcpServerIdentifier, String domainName, String hostname, boolean metered,
+ short mtu) {
+ DhcpPacket pkt = new DhcpOfferPacket(
+ transactionId, (short) 0, broadcast, serverIpAddr, relayIp,
+ INADDR_ANY /* clientIp */, yourIp, mac);
+ pkt.mGateways = gateways;
+ pkt.mDnsServers = dnsServers;
+ pkt.mLeaseTime = timeout;
+ pkt.mDomainName = domainName;
+ pkt.mHostName = hostname;
+ pkt.mServerIdentifier = dhcpServerIdentifier;
+ pkt.mSubnetMask = netMask;
+ pkt.mBroadcastAddress = bcAddr;
+ pkt.mMtu = mtu;
+ if (metered) {
+ pkt.mVendorInfo = VENDOR_INFO_ANDROID_METERED;
+ }
+ return pkt.buildPacket(encap, DHCP_CLIENT, DHCP_SERVER);
+ }
+
+ /**
+ * Builds a DHCP-ACK packet from the required specified parameters.
+ */
+ public static ByteBuffer buildAckPacket(int encap, int transactionId,
+ boolean broadcast, Inet4Address serverIpAddr, Inet4Address relayIp, Inet4Address yourIp,
+ Inet4Address requestClientIp, byte[] mac, Integer timeout, Inet4Address netMask,
+ Inet4Address bcAddr, List<Inet4Address> gateways, List<Inet4Address> dnsServers,
+ Inet4Address dhcpServerIdentifier, String domainName, String hostname, boolean metered,
+ short mtu) {
+ DhcpPacket pkt = new DhcpAckPacket(
+ transactionId, (short) 0, broadcast, serverIpAddr, relayIp, requestClientIp, yourIp,
+ mac);
+ pkt.mGateways = gateways;
+ pkt.mDnsServers = dnsServers;
+ pkt.mLeaseTime = timeout;
+ pkt.mDomainName = domainName;
+ pkt.mHostName = hostname;
+ pkt.mSubnetMask = netMask;
+ pkt.mServerIdentifier = dhcpServerIdentifier;
+ pkt.mBroadcastAddress = bcAddr;
+ pkt.mMtu = mtu;
+ if (metered) {
+ pkt.mVendorInfo = VENDOR_INFO_ANDROID_METERED;
+ }
+ return pkt.buildPacket(encap, DHCP_CLIENT, DHCP_SERVER);
+ }
+
+ /**
+ * Builds a DHCP-NAK packet from the required specified parameters.
+ */
+ public static ByteBuffer buildNakPacket(int encap, int transactionId, Inet4Address serverIpAddr,
+ Inet4Address relayIp, byte[] mac, boolean broadcast, String message) {
+ DhcpPacket pkt = new DhcpNakPacket(
+ transactionId, (short) 0, relayIp, mac, broadcast);
+ pkt.mMessage = message;
+ pkt.mServerIdentifier = serverIpAddr;
+ return pkt.buildPacket(encap, DHCP_CLIENT, DHCP_SERVER);
+ }
+
+ /**
+ * Builds a DHCP-REQUEST packet from the required specified parameters.
+ */
+ public static ByteBuffer buildRequestPacket(int encap,
+ int transactionId, short secs, Inet4Address clientIp, boolean broadcast,
+ byte[] clientMac, Inet4Address requestedIpAddress,
+ Inet4Address serverIdentifier, byte[] requestedParams, String hostName) {
+ DhcpPacket pkt = new DhcpRequestPacket(transactionId, secs, clientIp,
+ INADDR_ANY /* relayIp */, clientMac, broadcast);
+ pkt.mRequestedIp = requestedIpAddress;
+ pkt.mServerIdentifier = serverIdentifier;
+ pkt.mHostName = hostName;
+ pkt.mRequestedParams = requestedParams;
+ ByteBuffer result = pkt.buildPacket(encap, DHCP_SERVER, DHCP_CLIENT);
+ return result;
+ }
+}
diff --git a/packages/NetworkStack/src/android/net/ip/IpClient.java b/packages/NetworkStack/src/android/net/ip/IpClient.java
new file mode 100644
index 000000000000..e37b0d3adeae
--- /dev/null
+++ b/packages/NetworkStack/src/android/net/ip/IpClient.java
@@ -0,0 +1,1795 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.ip;
+
+import static android.net.RouteInfo.RTN_UNICAST;
+import static android.net.shared.IpConfigurationParcelableUtil.toStableParcelable;
+
+import static com.android.server.util.PermissionUtil.checkNetworkStackCallingPermission;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.DhcpResults;
+import android.net.INetd;
+import android.net.IpPrefix;
+import android.net.LinkAddress;
+import android.net.LinkProperties;
+import android.net.NattKeepalivePacketDataParcelable;
+import android.net.NetworkStackIpMemoryStore;
+import android.net.ProvisioningConfigurationParcelable;
+import android.net.ProxyInfo;
+import android.net.RouteInfo;
+import android.net.TcpKeepalivePacketDataParcelable;
+import android.net.apf.ApfCapabilities;
+import android.net.apf.ApfFilter;
+import android.net.dhcp.DhcpClient;
+import android.net.metrics.IpConnectivityLog;
+import android.net.metrics.IpManagerEvent;
+import android.net.shared.InitialConfiguration;
+import android.net.shared.ProvisioningConfiguration;
+import android.net.util.InterfaceParams;
+import android.net.util.SharedLog;
+import android.os.ConditionVariable;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.RemoteException;
+import android.os.SystemClock;
+import android.text.TextUtils;
+import android.util.LocalLog;
+import android.util.Log;
+import android.util.Pair;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.IState;
+import com.android.internal.util.IndentingPrintWriter;
+import com.android.internal.util.MessageUtils;
+import com.android.internal.util.Preconditions;
+import com.android.internal.util.State;
+import com.android.internal.util.StateMachine;
+import com.android.internal.util.WakeupMessage;
+import com.android.server.NetworkObserverRegistry;
+import com.android.server.NetworkStackService.NetworkStackServiceManager;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.net.InetAddress;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import java.nio.ByteBuffer;
+
+
+/**
+ * IpClient
+ *
+ * This class provides the interface to IP-layer provisioning and maintenance
+ * functionality that can be used by transport layers like Wi-Fi, Ethernet,
+ * et cetera.
+ *
+ * [ Lifetime ]
+ * IpClient is designed to be instantiated as soon as the interface name is
+ * known and can be as long-lived as the class containing it (i.e. declaring
+ * it "private final" is okay).
+ *
+ * @hide
+ */
+public class IpClient extends StateMachine {
+ private static final boolean DBG = false;
+
+ // For message logging.
+ private static final Class[] sMessageClasses = { IpClient.class, DhcpClient.class };
+ private static final SparseArray<String> sWhatToString =
+ MessageUtils.findMessageNames(sMessageClasses);
+ // Two static concurrent hashmaps of interface name to logging classes.
+ // One holds StateMachine logs and the other connectivity packet logs.
+ private static final ConcurrentHashMap<String, SharedLog> sSmLogs = new ConcurrentHashMap<>();
+ private static final ConcurrentHashMap<String, LocalLog> sPktLogs = new ConcurrentHashMap<>();
+ private final NetworkStackIpMemoryStore mIpMemoryStore;
+
+ /**
+ * Dump all state machine and connectivity packet logs to the specified writer.
+ * @param skippedIfaces Interfaces for which logs should not be dumped.
+ */
+ public static void dumpAllLogs(PrintWriter writer, Set<String> skippedIfaces) {
+ for (String ifname : sSmLogs.keySet()) {
+ if (skippedIfaces.contains(ifname)) continue;
+
+ writer.println(String.format("--- BEGIN %s ---", ifname));
+
+ final SharedLog smLog = sSmLogs.get(ifname);
+ if (smLog != null) {
+ writer.println("State machine log:");
+ smLog.dump(null, writer, null);
+ }
+
+ writer.println("");
+
+ final LocalLog pktLog = sPktLogs.get(ifname);
+ if (pktLog != null) {
+ writer.println("Connectivity packet log:");
+ pktLog.readOnlyLocalLog().dump(null, writer, null);
+ }
+
+ writer.println(String.format("--- END %s ---", ifname));
+ }
+ }
+
+ // Use a wrapper class to log in order to ensure complete and detailed
+ // logging. This method is lighter weight than annotations/reflection
+ // and has the following benefits:
+ //
+ // - No invoked method can be forgotten.
+ // Any new method added to IpClient.Callback must be overridden
+ // here or it will never be called.
+ //
+ // - No invoking call site can be forgotten.
+ // Centralized logging in this way means call sites don't need to
+ // remember to log, and therefore no call site can be forgotten.
+ //
+ // - No variation in log format among call sites.
+ // Encourages logging of any available arguments, and all call sites
+ // are necessarily logged identically.
+ //
+ // NOTE: Log first because passed objects may or may not be thread-safe and
+ // once passed on to the callback they may be modified by another thread.
+ //
+ // TODO: Find an lighter weight approach.
+ public static class IpClientCallbacksWrapper {
+ private static final String PREFIX = "INVOKE ";
+ private final IIpClientCallbacks mCallback;
+ private final SharedLog mLog;
+
+ @VisibleForTesting
+ protected IpClientCallbacksWrapper(IIpClientCallbacks callback, SharedLog log) {
+ mCallback = callback;
+ mLog = log;
+ }
+
+ private void log(String msg) {
+ mLog.log(PREFIX + msg);
+ }
+
+ private void log(String msg, Throwable e) {
+ mLog.e(PREFIX + msg, e);
+ }
+
+ public void onPreDhcpAction() {
+ log("onPreDhcpAction()");
+ try {
+ mCallback.onPreDhcpAction();
+ } catch (RemoteException e) {
+ log("Failed to call onPreDhcpAction", e);
+ }
+ }
+
+ public void onPostDhcpAction() {
+ log("onPostDhcpAction()");
+ try {
+ mCallback.onPostDhcpAction();
+ } catch (RemoteException e) {
+ log("Failed to call onPostDhcpAction", e);
+ }
+ }
+
+ public void onNewDhcpResults(DhcpResults dhcpResults) {
+ log("onNewDhcpResults({" + dhcpResults + "})");
+ try {
+ mCallback.onNewDhcpResults(toStableParcelable(dhcpResults));
+ } catch (RemoteException e) {
+ log("Failed to call onNewDhcpResults", e);
+ }
+ }
+
+ public void onProvisioningSuccess(LinkProperties newLp) {
+ log("onProvisioningSuccess({" + newLp + "})");
+ try {
+ mCallback.onProvisioningSuccess(newLp);
+ } catch (RemoteException e) {
+ log("Failed to call onProvisioningSuccess", e);
+ }
+ }
+
+ public void onProvisioningFailure(LinkProperties newLp) {
+ log("onProvisioningFailure({" + newLp + "})");
+ try {
+ mCallback.onProvisioningFailure(newLp);
+ } catch (RemoteException e) {
+ log("Failed to call onProvisioningFailure", e);
+ }
+ }
+
+ public void onLinkPropertiesChange(LinkProperties newLp) {
+ log("onLinkPropertiesChange({" + newLp + "})");
+ try {
+ mCallback.onLinkPropertiesChange(newLp);
+ } catch (RemoteException e) {
+ log("Failed to call onLinkPropertiesChange", e);
+ }
+ }
+
+ public void onReachabilityLost(String logMsg) {
+ log("onReachabilityLost(" + logMsg + ")");
+ try {
+ mCallback.onReachabilityLost(logMsg);
+ } catch (RemoteException e) {
+ log("Failed to call onReachabilityLost", e);
+ }
+ }
+
+ public void onQuit() {
+ log("onQuit()");
+ try {
+ mCallback.onQuit();
+ } catch (RemoteException e) {
+ log("Failed to call onQuit", e);
+ }
+ }
+
+ public void installPacketFilter(byte[] filter) {
+ log("installPacketFilter(byte[" + filter.length + "])");
+ try {
+ mCallback.installPacketFilter(filter);
+ } catch (RemoteException e) {
+ log("Failed to call installPacketFilter", e);
+ }
+ }
+
+ public void startReadPacketFilter() {
+ log("startReadPacketFilter()");
+ try {
+ mCallback.startReadPacketFilter();
+ } catch (RemoteException e) {
+ log("Failed to call startReadPacketFilter", e);
+ }
+ }
+
+ public void setFallbackMulticastFilter(boolean enabled) {
+ log("setFallbackMulticastFilter(" + enabled + ")");
+ try {
+ mCallback.setFallbackMulticastFilter(enabled);
+ } catch (RemoteException e) {
+ log("Failed to call setFallbackMulticastFilter", e);
+ }
+ }
+
+ public void setNeighborDiscoveryOffload(boolean enable) {
+ log("setNeighborDiscoveryOffload(" + enable + ")");
+ try {
+ mCallback.setNeighborDiscoveryOffload(enable);
+ } catch (RemoteException e) {
+ log("Failed to call setNeighborDiscoveryOffload", e);
+ }
+ }
+ }
+
+ public static final String DUMP_ARG_CONFIRM = "confirm";
+
+ // Below constants are picked up by MessageUtils and exempt from ProGuard optimization.
+ private static final int CMD_TERMINATE_AFTER_STOP = 1;
+ private static final int CMD_STOP = 2;
+ private static final int CMD_START = 3;
+ private static final int CMD_CONFIRM = 4;
+ private static final int EVENT_PRE_DHCP_ACTION_COMPLETE = 5;
+ // Triggered by NetlinkTracker to communicate netlink events.
+ private static final int EVENT_NETLINK_LINKPROPERTIES_CHANGED = 6;
+ private static final int CMD_UPDATE_TCP_BUFFER_SIZES = 7;
+ private static final int CMD_UPDATE_HTTP_PROXY = 8;
+ private static final int CMD_SET_MULTICAST_FILTER = 9;
+ private static final int EVENT_PROVISIONING_TIMEOUT = 10;
+ private static final int EVENT_DHCPACTION_TIMEOUT = 11;
+ private static final int EVENT_READ_PACKET_FILTER_COMPLETE = 12;
+ private static final int CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF = 13;
+ private static final int CMD_REMOVE_KEEPALIVE_PACKET_FILTER_FROM_APF = 14;
+ private static final int CMD_UPDATE_L2KEY_GROUPHINT = 15;
+
+ // Internal commands to use instead of trying to call transitionTo() inside
+ // a given State's enter() method. Calling transitionTo() from enter/exit
+ // encounters a Log.wtf() that can cause trouble on eng builds.
+ private static final int CMD_JUMP_STARTED_TO_RUNNING = 100;
+ private static final int CMD_JUMP_RUNNING_TO_STOPPING = 101;
+ private static final int CMD_JUMP_STOPPING_TO_STOPPED = 102;
+
+ // IpClient shares a handler with DhcpClient: commands must not overlap
+ public static final int DHCPCLIENT_CMD_BASE = 1000;
+
+ private static final int MAX_LOG_RECORDS = 500;
+ private static final int MAX_PACKET_RECORDS = 100;
+
+ private static final boolean NO_CALLBACKS = false;
+ private static final boolean SEND_CALLBACKS = true;
+
+ // This must match the interface prefix in clatd.c.
+ // TODO: Revert this hack once IpClient and Nat464Xlat work in concert.
+ private static final String CLAT_PREFIX = "v4-";
+
+ private static final int IMMEDIATE_FAILURE_DURATION = 0;
+
+ private static final int PROV_CHANGE_STILL_NOT_PROVISIONED = 1;
+ private static final int PROV_CHANGE_LOST_PROVISIONING = 2;
+ private static final int PROV_CHANGE_GAINED_PROVISIONING = 3;
+ private static final int PROV_CHANGE_STILL_PROVISIONED = 4;
+
+ private final State mStoppedState = new StoppedState();
+ private final State mStoppingState = new StoppingState();
+ private final State mStartedState = new StartedState();
+ private final State mRunningState = new RunningState();
+
+ private final String mTag;
+ private final Context mContext;
+ private final String mInterfaceName;
+ private final String mClatInterfaceName;
+ @VisibleForTesting
+ protected final IpClientCallbacksWrapper mCallback;
+ private final Dependencies mDependencies;
+ private final CountDownLatch mShutdownLatch;
+ private final ConnectivityManager mCm;
+ private final INetd mNetd;
+ private final NetworkObserverRegistry mObserverRegistry;
+ private final IpClientLinkObserver mLinkObserver;
+ private final WakeupMessage mProvisioningTimeoutAlarm;
+ private final WakeupMessage mDhcpActionTimeoutAlarm;
+ private final SharedLog mLog;
+ private final LocalLog mConnectivityPacketLog;
+ private final MessageHandlingLogger mMsgStateLogger;
+ private final IpConnectivityLog mMetricsLog = new IpConnectivityLog();
+ private final InterfaceController mInterfaceCtrl;
+
+ private InterfaceParams mInterfaceParams;
+
+ /**
+ * Non-final member variables accessed only from within our StateMachine.
+ */
+ private LinkProperties mLinkProperties;
+ private android.net.shared.ProvisioningConfiguration mConfiguration;
+ private IpReachabilityMonitor mIpReachabilityMonitor;
+ private DhcpClient mDhcpClient;
+ private DhcpResults mDhcpResults;
+ private String mTcpBufferSizes;
+ private ProxyInfo mHttpProxy;
+ private ApfFilter mApfFilter;
+ private String mL2Key; // The L2 key for this network, for writing into the memory store
+ private String mGroupHint; // The group hint for this network, for writing into the memory store
+ private boolean mMulticastFiltering;
+ private long mStartTimeMillis;
+
+ /**
+ * Reading the snapshot is an asynchronous operation initiated by invoking
+ * Callback.startReadPacketFilter() and completed when the WiFi Service responds with an
+ * EVENT_READ_PACKET_FILTER_COMPLETE message. The mApfDataSnapshotComplete condition variable
+ * signals when a new snapshot is ready.
+ */
+ private final ConditionVariable mApfDataSnapshotComplete = new ConditionVariable();
+
+ public static class Dependencies {
+ /**
+ * Get interface parameters for the specified interface.
+ */
+ public InterfaceParams getInterfaceParams(String ifname) {
+ return InterfaceParams.getByName(ifname);
+ }
+
+ /**
+ * Get a INetd connector.
+ */
+ public INetd getNetd(Context context) {
+ return INetd.Stub.asInterface((IBinder) context.getSystemService(Context.NETD_SERVICE));
+ }
+ }
+
+ public IpClient(Context context, String ifName, IIpClientCallbacks callback,
+ NetworkObserverRegistry observerRegistry, NetworkStackServiceManager nssManager) {
+ this(context, ifName, callback, observerRegistry, nssManager, new Dependencies());
+ }
+
+ @VisibleForTesting
+ IpClient(Context context, String ifName, IIpClientCallbacks callback,
+ NetworkObserverRegistry observerRegistry, NetworkStackServiceManager nssManager,
+ Dependencies deps) {
+ super(IpClient.class.getSimpleName() + "." + ifName);
+ Preconditions.checkNotNull(ifName);
+ Preconditions.checkNotNull(callback);
+
+ mTag = getName();
+
+ mContext = context;
+ mInterfaceName = ifName;
+ mClatInterfaceName = CLAT_PREFIX + ifName;
+ mDependencies = deps;
+ mShutdownLatch = new CountDownLatch(1);
+ mCm = mContext.getSystemService(ConnectivityManager.class);
+ mObserverRegistry = observerRegistry;
+ mIpMemoryStore =
+ new NetworkStackIpMemoryStore(context, nssManager.getIpMemoryStoreService());
+
+ sSmLogs.putIfAbsent(mInterfaceName, new SharedLog(MAX_LOG_RECORDS, mTag));
+ mLog = sSmLogs.get(mInterfaceName);
+ sPktLogs.putIfAbsent(mInterfaceName, new LocalLog(MAX_PACKET_RECORDS));
+ mConnectivityPacketLog = sPktLogs.get(mInterfaceName);
+ mMsgStateLogger = new MessageHandlingLogger();
+ mCallback = new IpClientCallbacksWrapper(callback, mLog);
+
+ // TODO: Consider creating, constructing, and passing in some kind of
+ // InterfaceController.Dependencies class.
+ mNetd = deps.getNetd(mContext);
+ mInterfaceCtrl = new InterfaceController(mInterfaceName, mNetd, mLog);
+
+ mLinkObserver = new IpClientLinkObserver(
+ mInterfaceName,
+ () -> sendMessage(EVENT_NETLINK_LINKPROPERTIES_CHANGED)) {
+ @Override
+ public void onInterfaceAdded(String iface) {
+ super.onInterfaceAdded(iface);
+ if (mClatInterfaceName.equals(iface)) {
+ mCallback.setNeighborDiscoveryOffload(false);
+ } else if (!mInterfaceName.equals(iface)) {
+ return;
+ }
+
+ final String msg = "interfaceAdded(" + iface + ")";
+ logMsg(msg);
+ }
+
+ @Override
+ public void onInterfaceRemoved(String iface) {
+ super.onInterfaceRemoved(iface);
+ // TODO: Also observe mInterfaceName going down and take some
+ // kind of appropriate action.
+ if (mClatInterfaceName.equals(iface)) {
+ // TODO: consider sending a message to the IpClient main
+ // StateMachine thread, in case "NDO enabled" state becomes
+ // tied to more things that 464xlat operation.
+ mCallback.setNeighborDiscoveryOffload(true);
+ } else if (!mInterfaceName.equals(iface)) {
+ return;
+ }
+
+ final String msg = "interfaceRemoved(" + iface + ")";
+ logMsg(msg);
+ }
+
+ private void logMsg(String msg) {
+ Log.d(mTag, msg);
+ getHandler().post(() -> mLog.log("OBSERVED " + msg));
+ }
+ };
+
+ mLinkProperties = new LinkProperties();
+ mLinkProperties.setInterfaceName(mInterfaceName);
+
+ mProvisioningTimeoutAlarm = new WakeupMessage(mContext, getHandler(),
+ mTag + ".EVENT_PROVISIONING_TIMEOUT", EVENT_PROVISIONING_TIMEOUT);
+ mDhcpActionTimeoutAlarm = new WakeupMessage(mContext, getHandler(),
+ mTag + ".EVENT_DHCPACTION_TIMEOUT", EVENT_DHCPACTION_TIMEOUT);
+
+ // Anything the StateMachine may access must have been instantiated
+ // before this point.
+ configureAndStartStateMachine();
+
+ // Anything that may send messages to the StateMachine must only be
+ // configured to do so after the StateMachine has started (above).
+ startStateMachineUpdaters();
+ }
+
+ /**
+ * Make a IIpClient connector to communicate with this IpClient.
+ */
+ public IIpClient makeConnector() {
+ return new IpClientConnector();
+ }
+
+ class IpClientConnector extends IIpClient.Stub {
+ @Override
+ public void completedPreDhcpAction() {
+ checkNetworkStackCallingPermission();
+ IpClient.this.completedPreDhcpAction();
+ }
+ @Override
+ public void confirmConfiguration() {
+ checkNetworkStackCallingPermission();
+ IpClient.this.confirmConfiguration();
+ }
+ @Override
+ public void readPacketFilterComplete(byte[] data) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.readPacketFilterComplete(data);
+ }
+ @Override
+ public void shutdown() {
+ checkNetworkStackCallingPermission();
+ IpClient.this.shutdown();
+ }
+ @Override
+ public void startProvisioning(ProvisioningConfigurationParcelable req) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.startProvisioning(ProvisioningConfiguration.fromStableParcelable(req));
+ }
+ @Override
+ public void stop() {
+ checkNetworkStackCallingPermission();
+ IpClient.this.stop();
+ }
+ @Override
+ public void setL2KeyAndGroupHint(String l2Key, String groupHint) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.setL2KeyAndGroupHint(l2Key, groupHint);
+ }
+ @Override
+ public void setTcpBufferSizes(String tcpBufferSizes) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.setTcpBufferSizes(tcpBufferSizes);
+ }
+ @Override
+ public void setHttpProxy(ProxyInfo proxyInfo) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.setHttpProxy(proxyInfo);
+ }
+ @Override
+ public void setMulticastFilter(boolean enabled) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.setMulticastFilter(enabled);
+ }
+ @Override
+ public void addKeepalivePacketFilter(int slot, TcpKeepalivePacketDataParcelable pkt) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.addKeepalivePacketFilter(slot, pkt);
+ }
+ @Override
+ public void addNattKeepalivePacketFilter(int slot, NattKeepalivePacketDataParcelable pkt) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.addNattKeepalivePacketFilter(slot, pkt);
+ }
+ @Override
+ public void removeKeepalivePacketFilter(int slot) {
+ checkNetworkStackCallingPermission();
+ IpClient.this.removeKeepalivePacketFilter(slot);
+ }
+
+ @Override
+ public int getInterfaceVersion() {
+ return this.VERSION;
+ }
+ }
+
+ public String getInterfaceName() {
+ return mInterfaceName;
+ }
+
+ private void configureAndStartStateMachine() {
+ // CHECKSTYLE:OFF IndentationCheck
+ addState(mStoppedState);
+ addState(mStartedState);
+ addState(mRunningState, mStartedState);
+ addState(mStoppingState);
+ // CHECKSTYLE:ON IndentationCheck
+
+ setInitialState(mStoppedState);
+
+ super.start();
+ }
+
+ private void startStateMachineUpdaters() {
+ mObserverRegistry.registerObserverForNonblockingCallback(mLinkObserver);
+ }
+
+ private void stopStateMachineUpdaters() {
+ mObserverRegistry.unregisterObserver(mLinkObserver);
+ }
+
+ @Override
+ protected void onQuitting() {
+ mCallback.onQuit();
+ mShutdownLatch.countDown();
+ }
+
+ /**
+ * Shut down this IpClient instance altogether.
+ */
+ public void shutdown() {
+ stop();
+ sendMessage(CMD_TERMINATE_AFTER_STOP);
+ }
+
+ /**
+ * Start provisioning with the provided parameters.
+ */
+ public void startProvisioning(ProvisioningConfiguration req) {
+ if (!req.isValid()) {
+ doImmediateProvisioningFailure(IpManagerEvent.ERROR_INVALID_PROVISIONING);
+ return;
+ }
+
+ mInterfaceParams = mDependencies.getInterfaceParams(mInterfaceName);
+ if (mInterfaceParams == null) {
+ logError("Failed to find InterfaceParams for " + mInterfaceName);
+ doImmediateProvisioningFailure(IpManagerEvent.ERROR_INTERFACE_NOT_FOUND);
+ return;
+ }
+
+ mCallback.setNeighborDiscoveryOffload(true);
+ sendMessage(CMD_START, new android.net.shared.ProvisioningConfiguration(req));
+ }
+
+ /**
+ * Stop this IpClient.
+ *
+ * <p>This does not shut down the StateMachine itself, which is handled by {@link #shutdown()}.
+ */
+ public void stop() {
+ sendMessage(CMD_STOP);
+ }
+
+ /**
+ * Confirm the provisioning configuration.
+ */
+ public void confirmConfiguration() {
+ sendMessage(CMD_CONFIRM);
+ }
+
+ /**
+ * For clients using {@link ProvisioningConfiguration.Builder#withPreDhcpAction()}, must be
+ * called after {@link IIpClientCallbacks#onPreDhcpAction} to indicate that DHCP is clear to
+ * proceed.
+ */
+ public void completedPreDhcpAction() {
+ sendMessage(EVENT_PRE_DHCP_ACTION_COMPLETE);
+ }
+
+ /**
+ * Indicate that packet filter read is complete.
+ */
+ public void readPacketFilterComplete(byte[] data) {
+ sendMessage(EVENT_READ_PACKET_FILTER_COMPLETE, data);
+ }
+
+ /**
+ * Set the TCP buffer sizes to use.
+ *
+ * This may be called, repeatedly, at any time before or after a call to
+ * #startProvisioning(). The setting is cleared upon calling #stop().
+ */
+ public void setTcpBufferSizes(String tcpBufferSizes) {
+ sendMessage(CMD_UPDATE_TCP_BUFFER_SIZES, tcpBufferSizes);
+ }
+
+ /**
+ * Set the L2 key and group hint for storing info into the memory store.
+ */
+ public void setL2KeyAndGroupHint(String l2Key, String groupHint) {
+ sendMessage(CMD_UPDATE_L2KEY_GROUPHINT, new Pair<>(l2Key, groupHint));
+ }
+
+ /**
+ * Set the HTTP Proxy configuration to use.
+ *
+ * This may be called, repeatedly, at any time before or after a call to
+ * #startProvisioning(). The setting is cleared upon calling #stop().
+ */
+ public void setHttpProxy(ProxyInfo proxyInfo) {
+ sendMessage(CMD_UPDATE_HTTP_PROXY, proxyInfo);
+ }
+
+ /**
+ * Enable or disable the multicast filter. Attempts to use APF to accomplish the filtering,
+ * if not, Callback.setFallbackMulticastFilter() is called.
+ */
+ public void setMulticastFilter(boolean enabled) {
+ sendMessage(CMD_SET_MULTICAST_FILTER, enabled);
+ }
+
+ /**
+ * Called by WifiStateMachine to add TCP keepalive packet filter before setting up
+ * keepalive offload.
+ */
+ public void addKeepalivePacketFilter(int slot, @NonNull TcpKeepalivePacketDataParcelable pkt) {
+ sendMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF, slot, 0 /* Unused */, pkt);
+ }
+
+ /**
+ * Called by WifiStateMachine to add NATT keepalive packet filter before setting up
+ * keepalive offload.
+ */
+ public void addNattKeepalivePacketFilter(int slot,
+ @NonNull NattKeepalivePacketDataParcelable pkt) {
+ sendMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF, slot, 0 /* Unused */ , pkt);
+ }
+
+ /**
+ * Called by WifiStateMachine to remove keepalive packet filter after stopping keepalive
+ * offload.
+ */
+ public void removeKeepalivePacketFilter(int slot) {
+ sendMessage(CMD_REMOVE_KEEPALIVE_PACKET_FILTER_FROM_APF, slot, 0 /* Unused */);
+ }
+
+ /**
+ * Dump logs of this IpClient.
+ */
+ public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
+ if (args != null && args.length > 0 && DUMP_ARG_CONFIRM.equals(args[0])) {
+ // Execute confirmConfiguration() and take no further action.
+ confirmConfiguration();
+ return;
+ }
+
+ // Thread-unsafe access to mApfFilter but just used for debugging.
+ final ApfFilter apfFilter = mApfFilter;
+ final android.net.shared.ProvisioningConfiguration provisioningConfig = mConfiguration;
+ final ApfCapabilities apfCapabilities = (provisioningConfig != null)
+ ? provisioningConfig.mApfCapabilities : null;
+
+ IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
+ pw.println(mTag + " APF dump:");
+ pw.increaseIndent();
+ if (apfFilter != null) {
+ if (apfCapabilities.hasDataAccess()) {
+ // Request a new snapshot, then wait for it.
+ mApfDataSnapshotComplete.close();
+ mCallback.startReadPacketFilter();
+ if (!mApfDataSnapshotComplete.block(1000)) {
+ pw.print("TIMEOUT: DUMPING STALE APF SNAPSHOT");
+ }
+ }
+ apfFilter.dump(pw);
+
+ } else {
+ pw.print("No active ApfFilter; ");
+ if (provisioningConfig == null) {
+ pw.println("IpClient not yet started.");
+ } else if (apfCapabilities == null || apfCapabilities.apfVersionSupported == 0) {
+ pw.println("Hardware does not support APF.");
+ } else {
+ pw.println("ApfFilter not yet started, APF capabilities: " + apfCapabilities);
+ }
+ }
+ pw.decreaseIndent();
+ pw.println();
+ pw.println(mTag + " current ProvisioningConfiguration:");
+ pw.increaseIndent();
+ pw.println(Objects.toString(provisioningConfig, "N/A"));
+ pw.decreaseIndent();
+
+ final IpReachabilityMonitor iprm = mIpReachabilityMonitor;
+ if (iprm != null) {
+ pw.println();
+ pw.println(mTag + " current IpReachabilityMonitor state:");
+ pw.increaseIndent();
+ iprm.dump(pw);
+ pw.decreaseIndent();
+ }
+
+ pw.println();
+ pw.println(mTag + " StateMachine dump:");
+ pw.increaseIndent();
+ mLog.dump(fd, pw, args);
+ pw.decreaseIndent();
+
+ pw.println();
+ pw.println(mTag + " connectivity packet log:");
+ pw.println();
+ pw.println("Debug with python and scapy via:");
+ pw.println("shell$ python");
+ pw.println(">>> from scapy import all as scapy");
+ pw.println(">>> scapy.Ether(\"<paste_hex_string>\".decode(\"hex\")).show2()");
+ pw.println();
+
+ pw.increaseIndent();
+ mConnectivityPacketLog.readOnlyLocalLog().dump(fd, pw, args);
+ pw.decreaseIndent();
+ }
+
+
+ /**
+ * Internals.
+ */
+
+ @Override
+ protected String getWhatToString(int what) {
+ return sWhatToString.get(what, "UNKNOWN: " + Integer.toString(what));
+ }
+
+ @Override
+ protected String getLogRecString(Message msg) {
+ final String logLine = String.format(
+ "%s/%d %d %d %s [%s]",
+ mInterfaceName, (mInterfaceParams == null) ? -1 : mInterfaceParams.index,
+ msg.arg1, msg.arg2, Objects.toString(msg.obj), mMsgStateLogger);
+
+ final String richerLogLine = getWhatToString(msg.what) + " " + logLine;
+ mLog.log(richerLogLine);
+ if (DBG) {
+ Log.d(mTag, richerLogLine);
+ }
+
+ mMsgStateLogger.reset();
+ return logLine;
+ }
+
+ @Override
+ protected boolean recordLogRec(Message msg) {
+ // Don't log EVENT_NETLINK_LINKPROPERTIES_CHANGED. They can be noisy,
+ // and we already log any LinkProperties change that results in an
+ // invocation of IpClient.Callback#onLinkPropertiesChange().
+ final boolean shouldLog = (msg.what != EVENT_NETLINK_LINKPROPERTIES_CHANGED);
+ if (!shouldLog) {
+ mMsgStateLogger.reset();
+ }
+ return shouldLog;
+ }
+
+ private void logError(String fmt, Object... args) {
+ final String msg = "ERROR " + String.format(fmt, args);
+ Log.e(mTag, msg);
+ mLog.log(msg);
+ }
+
+ // This needs to be called with care to ensure that our LinkProperties
+ // are in sync with the actual LinkProperties of the interface. For example,
+ // we should only call this if we know for sure that there are no IP addresses
+ // assigned to the interface, etc.
+ private void resetLinkProperties() {
+ mLinkObserver.clearLinkProperties();
+ mConfiguration = null;
+ mDhcpResults = null;
+ mTcpBufferSizes = "";
+ mHttpProxy = null;
+
+ mLinkProperties = new LinkProperties();
+ mLinkProperties.setInterfaceName(mInterfaceName);
+ }
+
+ private void recordMetric(final int type) {
+ // We may record error metrics prior to starting.
+ // Map this to IMMEDIATE_FAILURE_DURATION.
+ final long duration = (mStartTimeMillis > 0)
+ ? (SystemClock.elapsedRealtime() - mStartTimeMillis)
+ : IMMEDIATE_FAILURE_DURATION;
+ mMetricsLog.log(mInterfaceName, new IpManagerEvent(type, duration));
+ }
+
+ // For now: use WifiStateMachine's historical notion of provisioned.
+ @VisibleForTesting
+ static boolean isProvisioned(LinkProperties lp, InitialConfiguration config) {
+ // For historical reasons, we should connect even if all we have is
+ // an IPv4 address and nothing else.
+ if (lp.hasIpv4Address() || lp.isProvisioned()) {
+ return true;
+ }
+ if (config == null) {
+ return false;
+ }
+
+ // When an InitialConfiguration is specified, ignore any difference with previous
+ // properties and instead check if properties observed match the desired properties.
+ return config.isProvisionedBy(lp.getLinkAddresses(), lp.getRoutes());
+ }
+
+ // TODO: Investigate folding all this into the existing static function
+ // LinkProperties.compareProvisioning() or some other single function that
+ // takes two LinkProperties objects and returns a ProvisioningChange
+ // object that is a correct and complete assessment of what changed, taking
+ // account of the asymmetries described in the comments in this function.
+ // Then switch to using it everywhere (IpReachabilityMonitor, etc.).
+ private int compareProvisioning(LinkProperties oldLp, LinkProperties newLp) {
+ int delta;
+ InitialConfiguration config = mConfiguration != null ? mConfiguration.mInitialConfig : null;
+ final boolean wasProvisioned = isProvisioned(oldLp, config);
+ final boolean isProvisioned = isProvisioned(newLp, config);
+
+ if (!wasProvisioned && isProvisioned) {
+ delta = PROV_CHANGE_GAINED_PROVISIONING;
+ } else if (wasProvisioned && isProvisioned) {
+ delta = PROV_CHANGE_STILL_PROVISIONED;
+ } else if (!wasProvisioned && !isProvisioned) {
+ delta = PROV_CHANGE_STILL_NOT_PROVISIONED;
+ } else {
+ // (wasProvisioned && !isProvisioned)
+ //
+ // Note that this is true even if we lose a configuration element
+ // (e.g., a default gateway) that would not be required to advance
+ // into provisioned state. This is intended: if we have a default
+ // router and we lose it, that's a sure sign of a problem, but if
+ // we connect to a network with no IPv4 DNS servers, we consider
+ // that to be a network without DNS servers and connect anyway.
+ //
+ // See the comment below.
+ delta = PROV_CHANGE_LOST_PROVISIONING;
+ }
+
+ final boolean lostIPv6 = oldLp.isIpv6Provisioned() && !newLp.isIpv6Provisioned();
+ final boolean lostIPv4Address = oldLp.hasIpv4Address() && !newLp.hasIpv4Address();
+ final boolean lostIPv6Router = oldLp.hasIpv6DefaultRoute() && !newLp.hasIpv6DefaultRoute();
+
+ // If bad wifi avoidance is disabled, then ignore IPv6 loss of
+ // provisioning. Otherwise, when a hotspot that loses Internet
+ // access sends out a 0-lifetime RA to its clients, the clients
+ // will disconnect and then reconnect, avoiding the bad hotspot,
+ // instead of getting stuck on the bad hotspot. http://b/31827713 .
+ //
+ // This is incorrect because if the hotspot then regains Internet
+ // access with a different prefix, TCP connections on the
+ // deprecated addresses will remain stuck.
+ //
+ // Note that we can still be disconnected by IpReachabilityMonitor
+ // if the IPv6 default gateway (but not the IPv6 DNS servers; see
+ // accompanying code in IpReachabilityMonitor) is unreachable.
+ final boolean ignoreIPv6ProvisioningLoss =
+ mConfiguration != null && mConfiguration.mUsingMultinetworkPolicyTracker
+ && mCm.shouldAvoidBadWifi();
+
+ // Additionally:
+ //
+ // Partial configurations (e.g., only an IPv4 address with no DNS
+ // servers and no default route) are accepted as long as DHCPv4
+ // succeeds. On such a network, isProvisioned() will always return
+ // false, because the configuration is not complete, but we want to
+ // connect anyway. It might be a disconnected network such as a
+ // Chromecast or a wireless printer, for example.
+ //
+ // Because on such a network isProvisioned() will always return false,
+ // delta will never be LOST_PROVISIONING. So check for loss of
+ // provisioning here too.
+ if (lostIPv4Address || (lostIPv6 && !ignoreIPv6ProvisioningLoss)) {
+ delta = PROV_CHANGE_LOST_PROVISIONING;
+ }
+
+ // Additionally:
+ //
+ // If the previous link properties had a global IPv6 address and an
+ // IPv6 default route then also consider the loss of that default route
+ // to be a loss of provisioning. See b/27962810.
+ if (oldLp.hasGlobalIpv6Address() && (lostIPv6Router && !ignoreIPv6ProvisioningLoss)) {
+ delta = PROV_CHANGE_LOST_PROVISIONING;
+ }
+
+ return delta;
+ }
+
+ private void dispatchCallback(int delta, LinkProperties newLp) {
+ switch (delta) {
+ case PROV_CHANGE_GAINED_PROVISIONING:
+ if (DBG) {
+ Log.d(mTag, "onProvisioningSuccess()");
+ }
+ recordMetric(IpManagerEvent.PROVISIONING_OK);
+ mCallback.onProvisioningSuccess(newLp);
+ break;
+
+ case PROV_CHANGE_LOST_PROVISIONING:
+ if (DBG) {
+ Log.d(mTag, "onProvisioningFailure()");
+ }
+ recordMetric(IpManagerEvent.PROVISIONING_FAIL);
+ mCallback.onProvisioningFailure(newLp);
+ break;
+
+ default:
+ if (DBG) {
+ Log.d(mTag, "onLinkPropertiesChange()");
+ }
+ mCallback.onLinkPropertiesChange(newLp);
+ break;
+ }
+ }
+
+ // Updates all IpClient-related state concerned with LinkProperties.
+ // Returns a ProvisioningChange for possibly notifying other interested
+ // parties that are not fronted by IpClient.
+ private int setLinkProperties(LinkProperties newLp) {
+ if (mApfFilter != null) {
+ mApfFilter.setLinkProperties(newLp);
+ }
+ if (mIpReachabilityMonitor != null) {
+ mIpReachabilityMonitor.updateLinkProperties(newLp);
+ }
+
+ int delta = compareProvisioning(mLinkProperties, newLp);
+ mLinkProperties = new LinkProperties(newLp);
+
+ if (delta == PROV_CHANGE_GAINED_PROVISIONING) {
+ // TODO: Add a proper ProvisionedState and cancel the alarm in
+ // its enter() method.
+ mProvisioningTimeoutAlarm.cancel();
+ }
+
+ return delta;
+ }
+
+ private LinkProperties assembleLinkProperties() {
+ // [1] Create a new LinkProperties object to populate.
+ LinkProperties newLp = new LinkProperties();
+ newLp.setInterfaceName(mInterfaceName);
+
+ // [2] Pull in data from netlink:
+ // - IPv4 addresses
+ // - IPv6 addresses
+ // - IPv6 routes
+ // - IPv6 DNS servers
+ //
+ // N.B.: this is fundamentally race-prone and should be fixed by
+ // changing IpClientLinkObserver from a hybrid edge/level model to an
+ // edge-only model, or by giving IpClient its own netlink socket(s)
+ // so as to track all required information directly.
+ LinkProperties netlinkLinkProperties = mLinkObserver.getLinkProperties();
+ newLp.setLinkAddresses(netlinkLinkProperties.getLinkAddresses());
+ for (RouteInfo route : netlinkLinkProperties.getRoutes()) {
+ newLp.addRoute(route);
+ }
+ addAllReachableDnsServers(newLp, netlinkLinkProperties.getDnsServers());
+
+ // [3] Add in data from DHCPv4, if available.
+ //
+ // mDhcpResults is never shared with any other owner so we don't have
+ // to worry about concurrent modification.
+ if (mDhcpResults != null) {
+ final List<RouteInfo> routes =
+ mDhcpResults.toStaticIpConfiguration().getRoutes(mInterfaceName);
+ for (RouteInfo route : routes) {
+ newLp.addRoute(route);
+ }
+ addAllReachableDnsServers(newLp, mDhcpResults.dnsServers);
+ newLp.setDomains(mDhcpResults.domains);
+
+ if (mDhcpResults.mtu != 0) {
+ newLp.setMtu(mDhcpResults.mtu);
+ }
+ }
+
+ // [4] Add in TCP buffer sizes and HTTP Proxy config, if available.
+ if (!TextUtils.isEmpty(mTcpBufferSizes)) {
+ newLp.setTcpBufferSizes(mTcpBufferSizes);
+ }
+ if (mHttpProxy != null) {
+ newLp.setHttpProxy(mHttpProxy);
+ }
+
+ // [5] Add data from InitialConfiguration
+ if (mConfiguration != null && mConfiguration.mInitialConfig != null) {
+ InitialConfiguration config = mConfiguration.mInitialConfig;
+ // Add InitialConfiguration routes and dns server addresses once all addresses
+ // specified in the InitialConfiguration have been observed with Netlink.
+ if (config.isProvisionedBy(newLp.getLinkAddresses(), null)) {
+ for (IpPrefix prefix : config.directlyConnectedRoutes) {
+ newLp.addRoute(new RouteInfo(prefix, null, mInterfaceName, RTN_UNICAST));
+ }
+ }
+ addAllReachableDnsServers(newLp, config.dnsServers);
+ }
+ final LinkProperties oldLp = mLinkProperties;
+ if (DBG) {
+ Log.d(mTag, String.format("Netlink-seen LPs: %s, new LPs: %s; old LPs: %s",
+ netlinkLinkProperties, newLp, oldLp));
+ }
+
+ // TODO: also learn via netlink routes specified by an InitialConfiguration and specified
+ // from a static IP v4 config instead of manually patching them in in steps [3] and [5].
+ return newLp;
+ }
+
+ private static void addAllReachableDnsServers(
+ LinkProperties lp, Iterable<InetAddress> dnses) {
+ // TODO: Investigate deleting this reachability check. We should be
+ // able to pass everything down to netd and let netd do evaluation
+ // and RFC6724-style sorting.
+ for (InetAddress dns : dnses) {
+ if (!dns.isAnyLocalAddress() && lp.isReachable(dns)) {
+ lp.addDnsServer(dns);
+ }
+ }
+ }
+
+ // Returns false if we have lost provisioning, true otherwise.
+ private boolean handleLinkPropertiesUpdate(boolean sendCallbacks) {
+ final LinkProperties newLp = assembleLinkProperties();
+ if (Objects.equals(newLp, mLinkProperties)) {
+ return true;
+ }
+ final int delta = setLinkProperties(newLp);
+ // Most of the attributes stored in the memory store are deduced from
+ // the link properties, therefore when the properties update the memory
+ // store record should be updated too.
+ maybeSaveNetworkToIpMemoryStore();
+ if (sendCallbacks) {
+ dispatchCallback(delta, newLp);
+ }
+ return (delta != PROV_CHANGE_LOST_PROVISIONING);
+ }
+
+ private void handleIPv4Success(DhcpResults dhcpResults) {
+ mDhcpResults = new DhcpResults(dhcpResults);
+ final LinkProperties newLp = assembleLinkProperties();
+ final int delta = setLinkProperties(newLp);
+
+ if (DBG) {
+ Log.d(mTag, "onNewDhcpResults(" + Objects.toString(dhcpResults) + ")");
+ }
+ mCallback.onNewDhcpResults(dhcpResults);
+ maybeSaveNetworkToIpMemoryStore();
+ dispatchCallback(delta, newLp);
+ }
+
+ private void handleIPv4Failure() {
+ // TODO: Investigate deleting this clearIPv4Address() call.
+ //
+ // DhcpClient will send us CMD_CLEAR_LINKADDRESS in all circumstances
+ // that could trigger a call to this function. If we missed handling
+ // that message in StartedState for some reason we would still clear
+ // any addresses upon entry to StoppedState.
+ mInterfaceCtrl.clearIPv4Address();
+ mDhcpResults = null;
+ if (DBG) {
+ Log.d(mTag, "onNewDhcpResults(null)");
+ }
+ mCallback.onNewDhcpResults(null);
+
+ handleProvisioningFailure();
+ }
+
+ private void handleProvisioningFailure() {
+ final LinkProperties newLp = assembleLinkProperties();
+ int delta = setLinkProperties(newLp);
+ // If we've gotten here and we're still not provisioned treat that as
+ // a total loss of provisioning.
+ //
+ // Either (a) static IP configuration failed or (b) DHCPv4 failed AND
+ // there was no usable IPv6 obtained before a non-zero provisioning
+ // timeout expired.
+ //
+ // Regardless: GAME OVER.
+ if (delta == PROV_CHANGE_STILL_NOT_PROVISIONED) {
+ delta = PROV_CHANGE_LOST_PROVISIONING;
+ }
+
+ dispatchCallback(delta, newLp);
+ if (delta == PROV_CHANGE_LOST_PROVISIONING) {
+ transitionTo(mStoppingState);
+ }
+ }
+
+ private void doImmediateProvisioningFailure(int failureType) {
+ logError("onProvisioningFailure(): %s", failureType);
+ recordMetric(failureType);
+ mCallback.onProvisioningFailure(new LinkProperties(mLinkProperties));
+ }
+
+ private boolean startIPv4() {
+ // If we have a StaticIpConfiguration attempt to apply it and
+ // handle the result accordingly.
+ if (mConfiguration.mStaticIpConfig != null) {
+ if (mInterfaceCtrl.setIPv4Address(mConfiguration.mStaticIpConfig.getIpAddress())) {
+ handleIPv4Success(new DhcpResults(mConfiguration.mStaticIpConfig));
+ } else {
+ return false;
+ }
+ } else {
+ // Start DHCPv4.
+ mDhcpClient = DhcpClient.makeDhcpClient(mContext, IpClient.this, mInterfaceParams);
+ mDhcpClient.registerForPreDhcpNotification();
+ if (mConfiguration.mRapidCommit || mConfiguration.mDiscoverSent)
+ mDhcpClient.sendMessage(DhcpClient.CMD_START_DHCP_RAPID_COMMIT,
+ (mConfiguration.mRapidCommit ? 1: 0),
+ (mConfiguration.mDiscoverSent ? 1: 0));
+ else
+ mDhcpClient.sendMessage(DhcpClient.CMD_START_DHCP);
+ }
+
+ return true;
+ }
+
+ private boolean startIPv6() {
+ return mInterfaceCtrl.setIPv6PrivacyExtensions(true)
+ && mInterfaceCtrl.setIPv6AddrGenModeIfSupported(mConfiguration.mIPv6AddrGenMode)
+ && mInterfaceCtrl.enableIPv6();
+ }
+
+ private boolean applyInitialConfig(InitialConfiguration config) {
+ // TODO: also support specifying a static IPv4 configuration in InitialConfiguration.
+ for (LinkAddress addr : findAll(config.ipAddresses, LinkAddress::isIpv6)) {
+ if (!mInterfaceCtrl.addAddress(addr)) return false;
+ }
+
+ return true;
+ }
+
+ private boolean startIpReachabilityMonitor() {
+ try {
+ // TODO: Fetch these parameters from settings, and install a
+ // settings observer to watch for update and re-program these
+ // parameters (Q: is this level of dynamic updatability really
+ // necessary or does reading from settings at startup suffice?).
+ final int numSolicits = 5;
+ final int interSolicitIntervalMs = 750;
+ setNeighborParameters(mNetd, mInterfaceName, numSolicits, interSolicitIntervalMs);
+ } catch (Exception e) {
+ mLog.e("Failed to adjust neighbor parameters", e);
+ // Carry on using the system defaults (currently: 3, 1000);
+ }
+
+ try {
+ mIpReachabilityMonitor = new IpReachabilityMonitor(
+ mContext,
+ mInterfaceParams,
+ getHandler(),
+ mLog,
+ new IpReachabilityMonitor.Callback() {
+ @Override
+ public void notifyLost(InetAddress ip, String logMsg) {
+ mCallback.onReachabilityLost(logMsg);
+ }
+ },
+ mConfiguration.mUsingMultinetworkPolicyTracker);
+ } catch (IllegalArgumentException iae) {
+ // Failed to start IpReachabilityMonitor. Log it and call
+ // onProvisioningFailure() immediately.
+ //
+ // See http://b/31038971.
+ logError("IpReachabilityMonitor failure: %s", iae);
+ mIpReachabilityMonitor = null;
+ }
+
+ return (mIpReachabilityMonitor != null);
+ }
+
+
+ public ByteBuffer buildDiscoverWithRapidCommitPacket() {
+ return mDhcpClient.buildDiscoverWithRapidCommitPacket();
+ }
+
+ private void stopAllIP() {
+ // We don't need to worry about routes, just addresses, because:
+ // - disableIpv6() will clear autoconf IPv6 routes as well, and
+ // - we don't get IPv4 routes from netlink
+ // so we neither react to nor need to wait for changes in either.
+
+ mInterfaceCtrl.disableIPv6();
+ mInterfaceCtrl.clearAllAddresses();
+ }
+
+ private void maybeSaveNetworkToIpMemoryStore() {
+ // TODO : implement this
+ }
+
+ class StoppedState extends State {
+ @Override
+ public void enter() {
+ stopAllIP();
+
+ resetLinkProperties();
+ if (mStartTimeMillis > 0) {
+ // Completed a life-cycle; send a final empty LinkProperties
+ // (cleared in resetLinkProperties() above) and record an event.
+ mCallback.onLinkPropertiesChange(new LinkProperties(mLinkProperties));
+ recordMetric(IpManagerEvent.COMPLETE_LIFECYCLE);
+ mStartTimeMillis = 0;
+ }
+ }
+
+ @Override
+ public boolean processMessage(Message msg) {
+ switch (msg.what) {
+ case CMD_TERMINATE_AFTER_STOP:
+ stopStateMachineUpdaters();
+ quit();
+ break;
+
+ case CMD_STOP:
+ break;
+
+ case CMD_START:
+ mConfiguration = (android.net.shared.ProvisioningConfiguration) msg.obj;
+ transitionTo(mStartedState);
+ break;
+
+ case EVENT_NETLINK_LINKPROPERTIES_CHANGED:
+ handleLinkPropertiesUpdate(NO_CALLBACKS);
+ break;
+
+ case CMD_UPDATE_TCP_BUFFER_SIZES:
+ mTcpBufferSizes = (String) msg.obj;
+ handleLinkPropertiesUpdate(NO_CALLBACKS);
+ break;
+
+ case CMD_UPDATE_HTTP_PROXY:
+ mHttpProxy = (ProxyInfo) msg.obj;
+ handleLinkPropertiesUpdate(NO_CALLBACKS);
+ break;
+
+ case CMD_UPDATE_L2KEY_GROUPHINT: {
+ final Pair<String, String> args = (Pair<String, String>) msg.obj;
+ mL2Key = args.first;
+ mGroupHint = args.second;
+ break;
+ }
+
+ case CMD_SET_MULTICAST_FILTER:
+ mMulticastFiltering = (boolean) msg.obj;
+ break;
+
+ case DhcpClient.CMD_ON_QUIT:
+ // Everything is already stopped.
+ logError("Unexpected CMD_ON_QUIT (already stopped).");
+ break;
+
+ default:
+ return NOT_HANDLED;
+ }
+
+ mMsgStateLogger.handled(this, getCurrentState());
+ return HANDLED;
+ }
+ }
+
+ class StoppingState extends State {
+ @Override
+ public void enter() {
+ if (mDhcpClient == null) {
+ // There's no DHCPv4 for which to wait; proceed to stopped.
+ deferMessage(obtainMessage(CMD_JUMP_STOPPING_TO_STOPPED));
+ }
+ }
+
+ @Override
+ public boolean processMessage(Message msg) {
+ switch (msg.what) {
+ case CMD_JUMP_STOPPING_TO_STOPPED:
+ transitionTo(mStoppedState);
+ break;
+
+ case CMD_STOP:
+ break;
+
+ case DhcpClient.CMD_CLEAR_LINKADDRESS:
+ mInterfaceCtrl.clearIPv4Address();
+ break;
+
+ case DhcpClient.CMD_ON_QUIT:
+ mDhcpClient = null;
+ transitionTo(mStoppedState);
+ break;
+
+ default:
+ deferMessage(msg);
+ }
+
+ mMsgStateLogger.handled(this, getCurrentState());
+ return HANDLED;
+ }
+ }
+
+ class StartedState extends State {
+ @Override
+ public void enter() {
+ mStartTimeMillis = SystemClock.elapsedRealtime();
+
+ if (mConfiguration.mProvisioningTimeoutMs > 0) {
+ final long alarmTime = SystemClock.elapsedRealtime()
+ + mConfiguration.mProvisioningTimeoutMs;
+ mProvisioningTimeoutAlarm.schedule(alarmTime);
+ }
+
+ if (readyToProceed()) {
+ deferMessage(obtainMessage(CMD_JUMP_STARTED_TO_RUNNING));
+ } else {
+ // Clear all IPv4 and IPv6 before proceeding to RunningState.
+ // Clean up any leftover state from an abnormal exit from
+ // tethering or during an IpClient restart.
+ stopAllIP();
+ }
+ }
+
+ @Override
+ public void exit() {
+ mProvisioningTimeoutAlarm.cancel();
+ }
+
+ @Override
+ public boolean processMessage(Message msg) {
+ switch (msg.what) {
+ case CMD_JUMP_STARTED_TO_RUNNING:
+ transitionTo(mRunningState);
+ break;
+
+ case CMD_STOP:
+ transitionTo(mStoppingState);
+ break;
+
+ case EVENT_NETLINK_LINKPROPERTIES_CHANGED:
+ handleLinkPropertiesUpdate(NO_CALLBACKS);
+ if (readyToProceed()) {
+ transitionTo(mRunningState);
+ }
+ break;
+
+ case CMD_UPDATE_L2KEY_GROUPHINT: {
+ final Pair<String, String> args = (Pair<String, String>) msg.obj;
+ mL2Key = args.first;
+ mGroupHint = args.second;
+ // TODO : attributes should be saved to the memory store with
+ // these new values if they differ from the previous ones.
+ // If the state machine is in pure StartedState, then the values to input
+ // are not known yet and should be updated when the LinkProperties are updated.
+ // If the state machine is in RunningState (which is a child of StartedState)
+ // then the next NUD check should be used to store the new values to avoid
+ // inputting current values for what may be a different L3 network.
+ break;
+ }
+
+ case EVENT_PROVISIONING_TIMEOUT:
+ handleProvisioningFailure();
+ break;
+
+ default:
+ // It's safe to process messages out of order because the
+ // only message that can both
+ // a) be received at this time and
+ // b) affect provisioning state
+ // is EVENT_NETLINK_LINKPROPERTIES_CHANGED (handled above).
+ deferMessage(msg);
+ }
+
+ mMsgStateLogger.handled(this, getCurrentState());
+ return HANDLED;
+ }
+
+ private boolean readyToProceed() {
+ return (!mLinkProperties.hasIpv4Address() && !mLinkProperties.hasGlobalIpv6Address());
+ }
+ }
+
+ class RunningState extends State {
+ private ConnectivityPacketTracker mPacketTracker;
+ private boolean mDhcpActionInFlight;
+
+ @Override
+ public void enter() {
+ ApfFilter.ApfConfiguration apfConfig = new ApfFilter.ApfConfiguration();
+ apfConfig.apfCapabilities = mConfiguration.mApfCapabilities;
+ apfConfig.multicastFilter = mMulticastFiltering;
+ // Get the Configuration for ApfFilter from Context
+ apfConfig.ieee802_3Filter = ApfCapabilities.getApfDrop8023Frames();
+ apfConfig.ethTypeBlackList = ApfCapabilities.getApfEtherTypeBlackList();
+ mApfFilter = ApfFilter.maybeCreate(mContext, apfConfig, mInterfaceParams, mCallback);
+ // TODO: investigate the effects of any multicast filtering racing/interfering with the
+ // rest of this IP configuration startup.
+ if (mApfFilter == null) {
+ mCallback.setFallbackMulticastFilter(mMulticastFiltering);
+ }
+
+ mPacketTracker = createPacketTracker();
+ if (mPacketTracker != null) mPacketTracker.start(mConfiguration.mDisplayName);
+
+ if (mConfiguration.mEnableIPv6 && !startIPv6()) {
+ doImmediateProvisioningFailure(IpManagerEvent.ERROR_STARTING_IPV6);
+ enqueueJumpToStoppingState();
+ return;
+ }
+
+ if (mConfiguration.mEnableIPv4 && !startIPv4()) {
+ doImmediateProvisioningFailure(IpManagerEvent.ERROR_STARTING_IPV4);
+ enqueueJumpToStoppingState();
+ return;
+ }
+
+ final InitialConfiguration config = mConfiguration.mInitialConfig;
+ if ((config != null) && !applyInitialConfig(config)) {
+ // TODO introduce a new IpManagerEvent constant to distinguish this error case.
+ doImmediateProvisioningFailure(IpManagerEvent.ERROR_INVALID_PROVISIONING);
+ enqueueJumpToStoppingState();
+ return;
+ }
+
+ if (mConfiguration.mUsingIpReachabilityMonitor && !startIpReachabilityMonitor()) {
+ doImmediateProvisioningFailure(
+ IpManagerEvent.ERROR_STARTING_IPREACHABILITYMONITOR);
+ enqueueJumpToStoppingState();
+ return;
+ }
+ }
+
+ @Override
+ public void exit() {
+ stopDhcpAction();
+
+ if (mIpReachabilityMonitor != null) {
+ mIpReachabilityMonitor.stop();
+ mIpReachabilityMonitor = null;
+ }
+
+ if (mDhcpClient != null) {
+ mDhcpClient.sendMessage(DhcpClient.CMD_STOP_DHCP);
+ mDhcpClient.doQuit();
+ }
+
+ if (mPacketTracker != null) {
+ mPacketTracker.stop();
+ mPacketTracker = null;
+ }
+
+ if (mApfFilter != null) {
+ mApfFilter.shutdown();
+ mApfFilter = null;
+ }
+
+ resetLinkProperties();
+ }
+
+ private void enqueueJumpToStoppingState() {
+ deferMessage(obtainMessage(CMD_JUMP_RUNNING_TO_STOPPING));
+ }
+
+ private ConnectivityPacketTracker createPacketTracker() {
+ try {
+ return new ConnectivityPacketTracker(
+ getHandler(), mInterfaceParams, mConnectivityPacketLog);
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+ }
+
+ private void ensureDhcpAction() {
+ if (!mDhcpActionInFlight) {
+ mCallback.onPreDhcpAction();
+ mDhcpActionInFlight = true;
+ final long alarmTime = SystemClock.elapsedRealtime()
+ + mConfiguration.mRequestedPreDhcpActionMs;
+ mDhcpActionTimeoutAlarm.schedule(alarmTime);
+ }
+ }
+
+ private void stopDhcpAction() {
+ mDhcpActionTimeoutAlarm.cancel();
+ if (mDhcpActionInFlight) {
+ mCallback.onPostDhcpAction();
+ mDhcpActionInFlight = false;
+ }
+ }
+
+ @Override
+ public boolean processMessage(Message msg) {
+ switch (msg.what) {
+ case CMD_JUMP_RUNNING_TO_STOPPING:
+ case CMD_STOP:
+ transitionTo(mStoppingState);
+ break;
+
+ case CMD_START:
+ logError("ALERT: START received in StartedState. Please fix caller.");
+ break;
+
+ case CMD_CONFIRM:
+ // TODO: Possibly introduce a second type of confirmation
+ // that both probes (a) on-link neighbors and (b) does
+ // a DHCPv4 RENEW. We used to do this on Wi-Fi framework
+ // roams.
+ if (mIpReachabilityMonitor != null) {
+ mIpReachabilityMonitor.probeAll();
+ }
+ break;
+
+ case EVENT_PRE_DHCP_ACTION_COMPLETE:
+ // It's possible to reach here if, for example, someone
+ // calls completedPreDhcpAction() after provisioning with
+ // a static IP configuration.
+ if (mDhcpClient != null) {
+ mDhcpClient.sendMessage(DhcpClient.CMD_PRE_DHCP_ACTION_COMPLETE);
+ }
+ break;
+
+ case EVENT_NETLINK_LINKPROPERTIES_CHANGED:
+ if (!handleLinkPropertiesUpdate(SEND_CALLBACKS)) {
+ transitionTo(mStoppingState);
+ }
+ break;
+
+ case CMD_UPDATE_TCP_BUFFER_SIZES:
+ mTcpBufferSizes = (String) msg.obj;
+ // This cannot possibly change provisioning state.
+ handleLinkPropertiesUpdate(SEND_CALLBACKS);
+ break;
+
+ case CMD_UPDATE_HTTP_PROXY:
+ mHttpProxy = (ProxyInfo) msg.obj;
+ // This cannot possibly change provisioning state.
+ handleLinkPropertiesUpdate(SEND_CALLBACKS);
+ break;
+
+ case CMD_SET_MULTICAST_FILTER: {
+ mMulticastFiltering = (boolean) msg.obj;
+ if (mApfFilter != null) {
+ mApfFilter.setMulticastFilter(mMulticastFiltering);
+ } else {
+ mCallback.setFallbackMulticastFilter(mMulticastFiltering);
+ }
+ break;
+ }
+
+ case EVENT_READ_PACKET_FILTER_COMPLETE: {
+ if (mApfFilter != null) {
+ mApfFilter.setDataSnapshot((byte[]) msg.obj);
+ }
+ mApfDataSnapshotComplete.open();
+ break;
+ }
+
+ case CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF: {
+ final int slot = msg.arg1;
+
+ if (mApfFilter != null) {
+ if (msg.obj instanceof NattKeepalivePacketDataParcelable) {
+ mApfFilter.addNattKeepalivePacketFilter(slot,
+ (NattKeepalivePacketDataParcelable) msg.obj);
+ } else if (msg.obj instanceof TcpKeepalivePacketDataParcelable) {
+ mApfFilter.addTcpKeepalivePacketFilter(slot,
+ (TcpKeepalivePacketDataParcelable) msg.obj);
+ }
+ }
+ break;
+ }
+
+ case CMD_REMOVE_KEEPALIVE_PACKET_FILTER_FROM_APF: {
+ final int slot = msg.arg1;
+ if (mApfFilter != null) {
+ mApfFilter.removeKeepalivePacketFilter(slot);
+ }
+ break;
+ }
+
+ case EVENT_DHCPACTION_TIMEOUT:
+ stopDhcpAction();
+ break;
+
+ case DhcpClient.CMD_PRE_DHCP_ACTION:
+ if (mConfiguration.mRequestedPreDhcpActionMs > 0) {
+ ensureDhcpAction();
+ } else {
+ sendMessage(EVENT_PRE_DHCP_ACTION_COMPLETE);
+ }
+ break;
+
+ case DhcpClient.CMD_CLEAR_LINKADDRESS:
+ mInterfaceCtrl.clearIPv4Address();
+ break;
+
+ case DhcpClient.CMD_CONFIGURE_LINKADDRESS: {
+ final LinkAddress ipAddress = (LinkAddress) msg.obj;
+ if (mInterfaceCtrl.setIPv4Address(ipAddress)) {
+ mDhcpClient.sendMessage(DhcpClient.EVENT_LINKADDRESS_CONFIGURED);
+ } else {
+ logError("Failed to set IPv4 address.");
+ dispatchCallback(PROV_CHANGE_LOST_PROVISIONING,
+ new LinkProperties(mLinkProperties));
+ transitionTo(mStoppingState);
+ }
+ break;
+ }
+
+ // This message is only received when:
+ //
+ // a) initial address acquisition succeeds,
+ // b) renew succeeds or is NAK'd,
+ // c) rebind succeeds or is NAK'd, or
+ // c) the lease expires,
+ //
+ // but never when initial address acquisition fails. The latter
+ // condition is now governed by the provisioning timeout.
+ case DhcpClient.CMD_POST_DHCP_ACTION:
+ stopDhcpAction();
+
+ switch (msg.arg1) {
+ case DhcpClient.DHCP_SUCCESS:
+ handleIPv4Success((DhcpResults) msg.obj);
+ break;
+ case DhcpClient.DHCP_FAILURE:
+ handleIPv4Failure();
+ break;
+ default:
+ logError("Unknown CMD_POST_DHCP_ACTION status: %s", msg.arg1);
+ }
+ break;
+
+ case DhcpClient.CMD_ON_QUIT:
+ // DHCPv4 quit early for some reason.
+ logError("Unexpected CMD_ON_QUIT.");
+ mDhcpClient = null;
+ break;
+
+ default:
+ return NOT_HANDLED;
+ }
+
+ mMsgStateLogger.handled(this, getCurrentState());
+ return HANDLED;
+ }
+ }
+
+ private static class MessageHandlingLogger {
+ public String processedInState;
+ public String receivedInState;
+
+ public void reset() {
+ processedInState = null;
+ receivedInState = null;
+ }
+
+ public void handled(State processedIn, IState receivedIn) {
+ processedInState = processedIn.getClass().getSimpleName();
+ receivedInState = receivedIn.getName();
+ }
+
+ public String toString() {
+ return String.format("rcvd_in=%s, proc_in=%s",
+ receivedInState, processedInState);
+ }
+ }
+
+ private static void setNeighborParameters(
+ INetd netd, String ifName, int numSolicits, int interSolicitIntervalMs)
+ throws RemoteException, IllegalArgumentException {
+ Preconditions.checkNotNull(netd);
+ Preconditions.checkArgument(!TextUtils.isEmpty(ifName));
+ Preconditions.checkArgument(numSolicits > 0);
+ Preconditions.checkArgument(interSolicitIntervalMs > 0);
+
+ for (int family : new Integer[]{INetd.IPV4, INetd.IPV6}) {
+ netd.setProcSysNet(family, INetd.NEIGH, ifName, "retrans_time_ms",
+ Integer.toString(interSolicitIntervalMs));
+ netd.setProcSysNet(family, INetd.NEIGH, ifName, "ucast_solicit",
+ Integer.toString(numSolicits));
+ }
+ }
+
+ // TODO: extract out into CollectionUtils.
+ static <T> boolean any(Iterable<T> coll, Predicate<T> fn) {
+ for (T t : coll) {
+ if (fn.test(t)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ static <T> boolean all(Iterable<T> coll, Predicate<T> fn) {
+ return !any(coll, not(fn));
+ }
+
+ static <T> Predicate<T> not(Predicate<T> fn) {
+ return (t) -> !fn.test(t);
+ }
+
+ static <T> String join(String delimiter, Collection<T> coll) {
+ return coll.stream().map(Object::toString).collect(Collectors.joining(delimiter));
+ }
+
+ static <T> T find(Iterable<T> coll, Predicate<T> fn) {
+ for (T t: coll) {
+ if (fn.test(t)) {
+ return t;
+ }
+ }
+ return null;
+ }
+
+ static <T> List<T> findAll(Collection<T> coll, Predicate<T> fn) {
+ return coll.stream().filter(fn).collect(Collectors.toList());
+ }
+}
diff --git a/packages/SettingsLib/Android.bp b/packages/SettingsLib/Android.bp
index 7560c41b2e29..73d5eff21aeb 100644
--- a/packages/SettingsLib/Android.bp
+++ b/packages/SettingsLib/Android.bp
@@ -7,12 +7,35 @@ package {
default_applicable_licenses: ["frameworks_base_license"],
}
+soong_config_module_type_import {
+ from: "device/qcom/qssi/Android.bp",
+ module_types: [
+ "bredr_vs_btadva_java_defaults",
+ ],
+}
+
+bredr_vs_btadva_java_defaults {
+ name: "btadva_settings_lib_java_defaults",
+
+ soong_config_variables: {
+ bredr_or_btadva: {
+ btadva: {
+ srcs: [
+ ":framework-settingslib-adva-srcs",
+ ],
+ }
+ }
+ }
+}
+
android_library {
name: "SettingsLib",
defaults: [
"SettingsLibDependenciesWithoutWifiTracker",
+ "framework-wifi-vendor-hide-access-defaults",
+ "btadva_settings_lib_java_defaults",
],
// TODO(b/149540986): revert this change.
diff --git a/packages/SettingsLib/res/drawable/ic_5g_uwb_mobiledata.xml b/packages/SettingsLib/res/drawable/ic_5g_uwb_mobiledata.xml
new file mode 100644
index 000000000000..41a82af16d5d
--- /dev/null
+++ b/packages/SettingsLib/res/drawable/ic_5g_uwb_mobiledata.xml
@@ -0,0 +1,49 @@
+<!--Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="36dp"
+ android:height="14dp"
+ android:viewportWidth="36"
+ android:viewportHeight="14">
+
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M2.4,5.5c-0.3,0-0.6,0.1-0.9,0.2C2.3,5.8,2.2,5.9,2,6.1l0.3-2.8h3.4v-1H1.1L0.6,7.4l1.1,0.1C1.9,7.2,2.1,7,2.2,6.9c0.2-0.2,0.5-0.3,0.9-0.3s0.9,0.2,1,0.6C4.5,7.5,4.6,8,4.6,8.7s-0.1,1.2-0.4,1.6c-0.3,0.4-0.6,0.6-1,0.6c-0.4,0-0.8-0.2-0.9-0.5C2,10.1,1.9,9.7,1.9,9.1H0.6l0,0c0,0.9,0.2,1.5,0.8,1.9c0.5,0.5,1.1,0.7,1.9,0.7c0.9,0,1.6-0.3,2.1-0.9S6,9.5,6,8.6c0-0.9-0.2-1.7-0.7-2.3C4.8,5.8,4.2,5.5,3.4,5.5z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M9.5,7v0.9h1.7v2.2c-0.1,0.2-0.3,0.4-0.6,0.5s-0.7,0.2-1,0.2c-0.6,0-1-0.2-1.4-0.7C7.8,9.7,7.6,9.1,7.6,8.3V5.4c0-0.8,0.2-1.4,0.5-1.8C8.5,3.3,9,3.1,9.5,3.1c0.6,0,0.9,0.2,1.2,0.5c0.3,0.3,0.5,0.8,0.5,1.3h1.2l0,0c0-0.9-0.2-1.5-0.8-2c-0.5-0.5-1.2-0.8-2.2-0.8c-0.9,0-1.7,0.3-2.4,0.9S6.3,4.4,6.3,5.5v2.8c0,1.1,0.3,2,0.9,2.6c0.6,0.6,1.4,0.9,2.4,0.9c0.8,0,1.4-0.1,1.9-0.4c0.5-0.3,0.9-0.6,1-0.9V7H9.5z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M17.5,2.2v6.3c0,1.7,0.6,2.2,1.3,2.2c0.8,0,1.3-0.6,1.3-2.2V2.2h1.1v6.1c0,2.4-1,3.3-2.4,3.3c-1.4,0-2.3-0.9-2.3-3.2V2.2H17.5z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M23.5,11.5l-1.8-9.3h1.1l0.8,4.5c0.2,1.2,0.3,2.2,0.5,3.4h0.1c0.1-1.2,0.3-2.2,0.6-3.4l0.9-4.5h0.9l0.9,4.4c0.2,1.1,0.4,2.2,0.5,3.5h0c0.2-1.3,0.3-2.4,0.5-3.4l0.8-4.4h1l-1.8,9.3h-1L26.4,7c-0.2-1-0.4-2-0.5-3.1h0C25.8,5,25.7,6,25.4,7l-0.9,4.5H23.5z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M30.8,2.2c0.5,0,1,0,1.6,0c0.8,0,1.6,0.2,2.1,0.7c0.4,0.4,0.6,0.9,0.6,1.6c0,1-0.5,1.7-1.4,2.1v0c1.1,0.3,1.7,1.2,1.7,2.4c0,0.8-0.2,1.4-0.7,1.9c-0.5,0.6-1.4,0.8-2.5,0.8c-0.7,0-1.1,0-1.4-0.1V2.2zM31.9,6.1h0.5c0.9,0,1.6-0.7,1.6-1.6C34,3.6,33.6,3,32.5,3C32.2,3,32,3,31.9,3V6.1zM31.9,10.7c0.1,0,0.3,0.1,0.5,0.1c1.1,0,1.8-0.7,1.8-1.9c0-1.3-0.9-1.9-1.9-1.9h-0.5V10.7z" />
+</vector>
diff --git a/packages/SettingsLib/res/drawable/ic_adv_audio.xml b/packages/SettingsLib/res/drawable/ic_adv_audio.xml
new file mode 100644
index 000000000000..34f670fcb369
--- /dev/null
+++ b/packages/SettingsLib/res/drawable/ic_adv_audio.xml
@@ -0,0 +1,76 @@
+<!--
+Copyright (c) 2020, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="999"
+ android:viewportHeight="1024">
+ <path
+ android:fillColor="#000"
+ android:pathData="M126.97,182.76c-69.56,50.96 -64.68,331.98 6.48,372.82 40.96,
+ 23.51 103.33,7.01 155.5,-41.12 11.31,-10.43 23.38,-18.97 26.84,-18.97 3.45,
+ 0 6.28,89.19 6.28,198.19v198.19h97.29l5.89,-154.84c12.93,-339.91 6.16,
+ -424.43 -37.81,-471.62 -8.7,-9.34 -15.82,-18.82 -15.82,-21.08 0,
+ -8.58 -42.51,-46.14 -52.22,-46.14 -5.6,0 -18.17,-5.6 -27.94,-12.44 -33.07,
+ -23.17 -134.44,-25.01 -164.49,-2.99zM677.16,172.87c-140.96,32.47 -196.8,
+ 164.49 -174.23,411.9 4.99,54.65 9.07,146.1 9.07,203.23v103.87h99.1v-198.19c0,
+ -109.01 2.83,-198.19 6.28,-198.19s15.79,8.82 27.42,19.6c78.81,73.08 184.06,
+ 62.19 200.65,-20.75 8.23,-41.14 5.84,-231.48 -3.31,-263.11 -15.38,-53.2 -83.2,
+ -77.2 -164.97,-58.36zM173.42,372.1c0,165.4 -0.69,172.93 -15.95,172.93 -67.68,
+ 0 -75.96,-327.13 -8.82,-348.86 23.27,-7.53 24.77,3.17 24.77,175.93zM299.36,
+ 207.78c7.95,4.13 14.45,11.1 14.45,15.48 0,4.38 3.53,7.97 7.83,7.97 11.05,0 49.97,
+ 37.26 49.97,47.84 0,4.83 5.84,14.62 12.98,21.76 20.07,20.07 31.7,
+ 148.52 24.55,271.05l-6.15,105.29h-64.4v-103.22c0,-111.14 -11.44,-130.96 -51.26,
+ -88.77 -18.66,19.77 -37.85,35.1 -43.95,35.1 -2.79,0 -10.64,5.58 -17.45,12.39 -33.37,
+ 33.37 -35.98,21.32 -35.98,-165.75v-178.14l47.48,5.76c26.12,3.17 53.99,9.14 61.94,
+ 13.27zM743.23,367.48c0,116.88 -2.92,177.55 -8.55,177.55 -12.77,0 -58.22,-29.95 -91.65,
+ -60.38 -41.28,-37.58 -52.36,-19.13 -54.9,91.35l-2.32,101.16h-54.51l-9.64,-98.54c-10.42,
+ -106.47 -2.79,-204.87 19.66,-253.67 6.59,-14.31 12.11,-29.18 12.27,-33.03 1.21,
+ -28.46 85.25,-91.54 127.7,-95.85 18.17,-1.84 39.54,-3.98 47.49,-4.74 13.36,-1.28 14.45,
+ 12.04 14.45,176.16zM812.47,218.55c22.28,34.01 19.36,270.05 -3.74,302.5 -37.51,
+ 52.68 -41.31,38.36 -39.66,-149.44 1.64,-185.86 7.76,-207.46 43.4,-153.06zM616.83,
+ 253.02c-6.6,6.6 0.86,19.49 11.27,19.49 4.27,0 7.77,-5.57 7.77,-12.39 0,-12.77 -9.74,
+ -16.41 -19.04,-7.1zM645.57,406.71c-1.32,35.85 0.16,39.14 17.14,38.27 13.26,-0.68 14.57,
+ -2.01 4.58,-4.65 -9.63,-2.54 -14.98,-14.48 -17.14,-38.27l-3.14,-34.58 -1.44,39.23zM688.67,
+ 383.3c-10.64,27.73 0.38,58.47 21.52,60.03 11.92,0.88 14.54,-0.25 6.19,-2.67 -7.95,
+ -2.31 -14.45,-9.22 -14.45,-15.37s6.5,-12.88 14.45,-14.95c13.76,-3.6 13.76,-3.82 0,
+ -4.73 -17.58,-1.17 -19.51,-17.47 -2.07,-17.47 6.82,0 12.39,-3.72 12.39,-8.26 0,
+ -12.74 -32.97,-9.77 -38.04,3.43zM214.71,412.9c0,30.76 1.56,32.97 22.71,
+ 32.08 13.97,-0.59 17.15,-2.41 8.26,-4.73 -10.22,-2.67 -14.45,-12.07 -14.45,
+ -32.08 0,-15.56 -3.72,-28.3 -8.26,-28.3s-8.26,14.87 -8.26,33.03zM264.26,412.9c0,
+ 30.76 1.56,32.97 22.71,32.08 13.97,-0.59 17.15,-2.41 8.26,-4.73 -7.95,-2.08 -14.45,
+ -8.81 -14.45,-14.95s6.5,-12.88 14.45,-14.95c13.76,-3.6 13.76,-3.82 0,-4.73 -7.95,
+ -0.53 -14.45,-4.4 -14.45,-8.61s6.5,-9.35 14.45,-11.43c8.89,-2.32 5.71,-4.14 -8.26,
+ -4.73 -21.15,-0.89 -22.71,1.31 -22.71,32.07zM396.39,
+ 788.64v86.71h-57.81v-173.42h57.81v86.71zM586.32,
+ 788.64v86.71h-49.55v-173.42h49.55v86.71zM546.68,807.22c1.86,35.6 5.58,
+ 47.49 14.86,47.49 9.29,0 13.01,-11.88 14.86,-47.49 2.27,-43.52 1.03,-47.48 -14.86,
+ -47.48 -15.89,0 -17.13,3.97 -14.86,47.48zM367.2,778.14c-7.37,19.21 -0.98,76.57 8.54,
+ 76.57 11.27,0 15.55,-70.34 4.93,-80.96 -5.85,-5.85 -10.07,-4.48 -13.47,4.38z" />
+</vector> \ No newline at end of file
diff --git a/packages/SettingsLib/res/drawable/ic_vowifi.xml b/packages/SettingsLib/res/drawable/ic_vowifi.xml
new file mode 100644
index 000000000000..6f9245f39d37
--- /dev/null
+++ b/packages/SettingsLib/res/drawable/ic_vowifi.xml
@@ -0,0 +1,51 @@
+<!--
+ Copyright (c) 2020, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14dp"
+ android:height="14dp"
+ android:viewportWidth="14"
+ android:viewportHeight="14">
+ <path
+ android:pathData="M9.21,6.91a3.13,3.13 0,0 0,-4.42 0,2.54 2.54,0 0,0 -0.29,0.36l1,0.79a1.13,1.13 0,0 1,0.22 -0.27,1.88 1.88,0 0,1 2.64,0 1.13,1.13 0,0 1,0.22 0.27l1,-0.79A2.54,2.54 0,0 0,9.21 6.91Z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M6.56,8.68a0.44,0.44 0,0 0,-0.12 0.18L7,9.32l0.56,-0.46a0.44,0.44 0,0 0,-0.12 -0.18A0.61,0.61 0,0 0,6.56 8.68Z"
+ android:strokeWidth="0.25"
+ android:fillColor="#FFFFFF"
+ android:strokeColor="#FFFFFF"/>
+ <path
+ android:pathData="M7,3.5A5.57,5.57 0,0 0,3 5.14a5.7,5.7 0,0 0,-0.45 0.55l1,0.79A5.19,5.19 0,0 1,3.91 6a4.37,4.37 0,0 1,6.18 0,5.19 5.19,0 0,1 0.37,0.45l1,-0.79A5.7,5.7 0,0 0,11 5.14,5.57 5.57,0 0,0 7,3.5Z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M12.74,3.38a8.11,8.11 0,0 0,-11.48 0,7.1 7.1,0 0,0 -0.63,0.71l1,0.81a8.06,8.06 0,0 1,0.52 -0.64,6.88 6.88,0 0,1 9.72,0 8.06,8.06 0,0 1,0.52 0.64l1,-0.81A7.1,7.1 0,0 0,12.74 3.38Z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M12.3,7.58a0.14,0.14 0,0 1,0.16 0l0,0 1.26,1.63a0.19,0.19 0,0 1,0 0.28l-0.08,0.09a9.22,9.22 0,0 1,-13.27 0,1.68 1.68,0 0,1 -0.16,-0.15 0.15,0.15 0,0 1,0 -0.19L0.44,9 1.66,7.6a0.13,0.13 0,0 1,0.19 0L4.09,9.4a0.12,0.12 0,0 1,0 0.15l-0.43,1a8.66,8.66 0,0 0,6.74 0l-0.43,-1a0.15,0.15 0,0 1,0 -0.13l0,0Z"
+ android:fillColor="#FFFFFF"/>
+</vector> \ No newline at end of file
diff --git a/packages/SettingsLib/res/drawable/ic_vowifi_calling.xml b/packages/SettingsLib/res/drawable/ic_vowifi_calling.xml
new file mode 100644
index 000000000000..6f9245f39d37
--- /dev/null
+++ b/packages/SettingsLib/res/drawable/ic_vowifi_calling.xml
@@ -0,0 +1,51 @@
+<!--
+ Copyright (c) 2020, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14dp"
+ android:height="14dp"
+ android:viewportWidth="14"
+ android:viewportHeight="14">
+ <path
+ android:pathData="M9.21,6.91a3.13,3.13 0,0 0,-4.42 0,2.54 2.54,0 0,0 -0.29,0.36l1,0.79a1.13,1.13 0,0 1,0.22 -0.27,1.88 1.88,0 0,1 2.64,0 1.13,1.13 0,0 1,0.22 0.27l1,-0.79A2.54,2.54 0,0 0,9.21 6.91Z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M6.56,8.68a0.44,0.44 0,0 0,-0.12 0.18L7,9.32l0.56,-0.46a0.44,0.44 0,0 0,-0.12 -0.18A0.61,0.61 0,0 0,6.56 8.68Z"
+ android:strokeWidth="0.25"
+ android:fillColor="#FFFFFF"
+ android:strokeColor="#FFFFFF"/>
+ <path
+ android:pathData="M7,3.5A5.57,5.57 0,0 0,3 5.14a5.7,5.7 0,0 0,-0.45 0.55l1,0.79A5.19,5.19 0,0 1,3.91 6a4.37,4.37 0,0 1,6.18 0,5.19 5.19,0 0,1 0.37,0.45l1,-0.79A5.7,5.7 0,0 0,11 5.14,5.57 5.57,0 0,0 7,3.5Z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M12.74,3.38a8.11,8.11 0,0 0,-11.48 0,7.1 7.1,0 0,0 -0.63,0.71l1,0.81a8.06,8.06 0,0 1,0.52 -0.64,6.88 6.88,0 0,1 9.72,0 8.06,8.06 0,0 1,0.52 0.64l1,-0.81A7.1,7.1 0,0 0,12.74 3.38Z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M12.3,7.58a0.14,0.14 0,0 1,0.16 0l0,0 1.26,1.63a0.19,0.19 0,0 1,0 0.28l-0.08,0.09a9.22,9.22 0,0 1,-13.27 0,1.68 1.68,0 0,1 -0.16,-0.15 0.15,0.15 0,0 1,0 -0.19L0.44,9 1.66,7.6a0.13,0.13 0,0 1,0.19 0L4.09,9.4a0.12,0.12 0,0 1,0 0.15l-0.43,1a8.66,8.66 0,0 0,6.74 0l-0.43,-1a0.15,0.15 0,0 1,0 -0.13l0,0Z"
+ android:fillColor="#FFFFFF"/>
+</vector> \ No newline at end of file
diff --git a/packages/SettingsLib/res/values-af/arrays.xml b/packages/SettingsLib/res/values-af/arrays.xml
index 6e066e5ed121..73b79afaf11e 100644
--- a/packages/SettingsLib/res/values-af/arrays.xml
+++ b/packages/SettingsLib/res/values-af/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-oudio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-oudio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-oudio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-oudio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Gebruik stelselkeuse (verstek)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-oudio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-oudio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-oudio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-oudio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Gebruik stelselkeuse (verstek)"</item>
diff --git a/packages/SettingsLib/res/values-am/arrays.xml b/packages/SettingsLib/res/values-am/arrays.xml
index 1f96752c0f1e..36d3053e99f0 100644
--- a/packages/SettingsLib/res/values-am/arrays.xml
+++ b/packages/SettingsLib/res/values-am/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ኦዲዮ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ኦዲዮ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ኦዲዮ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ኦዲዮ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"የስርዓቱን ምርጫ (ነባሪ) ተጠቀም"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ኦዲዮ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ኦዲዮ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ኦዲዮ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ኦዲዮ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"የስርዓቱን ምርጫ (ነባሪ) ተጠቀም"</item>
diff --git a/packages/SettingsLib/res/values-ar/arrays.xml b/packages/SettingsLib/res/values-ar/arrays.xml
index f512db09659c..4f3ae3f9ef23 100644
--- a/packages/SettingsLib/res/values-ar/arrays.xml
+++ b/packages/SettingsLib/res/values-ar/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"استخدام اختيار النظام (تلقائي)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"استخدام اختيار النظام (تلقائي)"</item>
diff --git a/packages/SettingsLib/res/values-as/arrays.xml b/packages/SettingsLib/res/values-as/arrays.xml
index 6a658859a815..691cf066e087 100644
--- a/packages/SettingsLib/res/values-as/arrays.xml
+++ b/packages/SettingsLib/res/values-as/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> অডিঅ\'"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> অডিঅ’"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> অডিঅ\'"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> অডিঅ\'""</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ছিষ্টেমৰ বাছনি ব্যৱহাৰ কৰক (ডিফ\'ল্ট)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> অডিঅ’"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> অডিঅ’"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> অডিঅ\'"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> অডিঅ\'""</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ছিষ্টেমৰ বাছনি ব্যৱহাৰ কৰক (ডিফ\'ল্ট)"</item>
diff --git a/packages/SettingsLib/res/values-az/arrays.xml b/packages/SettingsLib/res/values-az/arrays.xml
index 4224e5a93d39..c1859aa88ba0 100644
--- a/packages/SettingsLib/res/values-az/arrays.xml
+++ b/packages/SettingsLib/res/values-az/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Sistem Seçimini istifadə edin (Defolt)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Sistem Seçimini istifadə edin (Defolt)"</item>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/arrays.xml b/packages/SettingsLib/res/values-b+sr+Latn/arrays.xml
index 9da8745e9473..2e0cbdd83d9c 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/arrays.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Koristi izbor sistema (podrazumevano)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Koristi izbor sistema (podrazumevano)"</item>
diff --git a/packages/SettingsLib/res/values-be/arrays.xml b/packages/SettingsLib/res/values-be/arrays.xml
index d03f9baaef56..8dfb715a70d1 100644
--- a/packages/SettingsLib/res/values-be/arrays.xml
+++ b/packages/SettingsLib/res/values-be/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Выбар сістэмы (стандартны)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Аўдыя <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Выбар сістэмы (стандартны)"</item>
diff --git a/packages/SettingsLib/res/values-bg/arrays.xml b/packages/SettingsLib/res/values-bg/arrays.xml
index b57324d8d957..18265424a6dd 100644
--- a/packages/SettingsLib/res/values-bg/arrays.xml
+++ b/packages/SettingsLib/res/values-bg/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Аудио: <xliff:g id="APTX">aptX™</xliff:g> от <xliff:g id="QUALCOMM">Qualcomm®</xliff:g>"</item>
<item msgid="2908219194098827570">"Аудио: <xliff:g id="APTX_HD">aptX™ HD</xliff:g> от <xliff:g id="QUALCOMM">Qualcomm®</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Аудио: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Аудио: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Използване на сист. избор (стандартно)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Аудио: <xliff:g id="APTX">aptX™</xliff:g> от <xliff:g id="QUALCOMM">Qualcomm®</xliff:g>"</item>
<item msgid="3517061573669307965">"Аудио: <xliff:g id="APTX_HD">aptX™ HD</xliff:g> от <xliff:g id="QUALCOMM">Qualcomm®</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Аудио: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Аудио: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Използване на сист. избор (стандартно)"</item>
diff --git a/packages/SettingsLib/res/values-bn/arrays.xml b/packages/SettingsLib/res/values-bn/arrays.xml
index c476ce91bbed..9faec6025334 100644
--- a/packages/SettingsLib/res/values-bn/arrays.xml
+++ b/packages/SettingsLib/res/values-bn/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> অডিও"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> অডিও"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> অডিওa"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> অডিও"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"সিস্টেমের নির্বাচন ব্যবহার করুন (ডিফল্ট)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> অডিও"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> অডিও"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> অডিওa"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> অডিও"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"সিস্টেমের নির্বাচন ব্যবহার করুন (ডিফল্ট)"</item>
diff --git a/packages/SettingsLib/res/values-bs/arrays.xml b/packages/SettingsLib/res/values-bs/arrays.xml
index a246f0088ae3..ed0a0ab4363c 100644
--- a/packages/SettingsLib/res/values-bs/arrays.xml
+++ b/packages/SettingsLib/res/values-bs/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Korištenje odabira sistema (zadano)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Korištenje odabira sistema (zadano)"</item>
diff --git a/packages/SettingsLib/res/values-ca/arrays.xml b/packages/SettingsLib/res/values-ca/arrays.xml
index 73f9c1fda319..7614a6ff86bb 100644
--- a/packages/SettingsLib/res/values-ca/arrays.xml
+++ b/packages/SettingsLib/res/values-ca/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Utilitza la selecció del sistema (predeterminada)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Àudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Utilitza la selecció del sistema (predeterminada)"</item>
diff --git a/packages/SettingsLib/res/values-cs/arrays.xml b/packages/SettingsLib/res/values-cs/arrays.xml
index 54e809679bc7..29fd0bd43780 100644
--- a/packages/SettingsLib/res/values-cs/arrays.xml
+++ b/packages/SettingsLib/res/values-cs/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Použít systémový výběr (výchozí)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Zvuk <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Použít systémový výběr (výchozí)"</item>
diff --git a/packages/SettingsLib/res/values-da/arrays.xml b/packages/SettingsLib/res/values-da/arrays.xml
index 07c6ab8505b6..9c925116cd69 100644
--- a/packages/SettingsLib/res/values-da/arrays.xml
+++ b/packages/SettingsLib/res/values-da/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-lyd"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-lyd"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-lyd"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-lyd"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Brug systemvalg (standard)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-lyd"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-lyd"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-lyd"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-lyd"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Brug systemvalg (standard)"</item>
diff --git a/packages/SettingsLib/res/values-de/arrays.xml b/packages/SettingsLib/res/values-de/arrays.xml
index be226c386015..0ffb6054a549 100644
--- a/packages/SettingsLib/res/values-de/arrays.xml
+++ b/packages/SettingsLib/res/values-de/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-Audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-Audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-Audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-Audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Systemauswahl verwenden (Standard)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-Audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-Audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-Audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-Audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Systemauswahl verwenden (Standard)"</item>
diff --git a/packages/SettingsLib/res/values-el/arrays.xml b/packages/SettingsLib/res/values-el/arrays.xml
index 9e7c85ad87a3..f02a933d8ed7 100644
--- a/packages/SettingsLib/res/values-el/arrays.xml
+++ b/packages/SettingsLib/res/values-el/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Χρήση επιλογής συστήματος (Προεπιλογή)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Ήχος <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Χρήση επιλογής συστήματος (Προεπιλογή)"</item>
diff --git a/packages/SettingsLib/res/values-en-rAU/arrays.xml b/packages/SettingsLib/res/values-en-rAU/arrays.xml
index 83cdadb2e101..84fd2148c856 100644
--- a/packages/SettingsLib/res/values-en-rAU/arrays.xml
+++ b/packages/SettingsLib/res/values-en-rAU/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"Disabled"</item>
<item msgid="6336372935919715515">"Enabled Filtered"</item>
<item msgid="2779123106632690576">"Enabled"</item>
+ <item>Enabled Headers Filtered</item>
+ <item>Enabled Media Pkts Filtered</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5 (Default)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Use system selection (default)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Use system selection (default)"</item>
diff --git a/packages/SettingsLib/res/values-en-rCA/arrays.xml b/packages/SettingsLib/res/values-en-rCA/arrays.xml
index 83cdadb2e101..84fd2148c856 100644
--- a/packages/SettingsLib/res/values-en-rCA/arrays.xml
+++ b/packages/SettingsLib/res/values-en-rCA/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"Disabled"</item>
<item msgid="6336372935919715515">"Enabled Filtered"</item>
<item msgid="2779123106632690576">"Enabled"</item>
+ <item>Enabled Headers Filtered</item>
+ <item>Enabled Media Pkts Filtered</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5 (Default)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Use system selection (default)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Use system selection (default)"</item>
diff --git a/packages/SettingsLib/res/values-en-rGB/arrays.xml b/packages/SettingsLib/res/values-en-rGB/arrays.xml
index 83cdadb2e101..84fd2148c856 100644
--- a/packages/SettingsLib/res/values-en-rGB/arrays.xml
+++ b/packages/SettingsLib/res/values-en-rGB/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"Disabled"</item>
<item msgid="6336372935919715515">"Enabled Filtered"</item>
<item msgid="2779123106632690576">"Enabled"</item>
+ <item>Enabled Headers Filtered</item>
+ <item>Enabled Media Pkts Filtered</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5 (Default)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Use system selection (default)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Use system selection (default)"</item>
diff --git a/packages/SettingsLib/res/values-en-rIN/arrays.xml b/packages/SettingsLib/res/values-en-rIN/arrays.xml
index 83cdadb2e101..84fd2148c856 100644
--- a/packages/SettingsLib/res/values-en-rIN/arrays.xml
+++ b/packages/SettingsLib/res/values-en-rIN/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"Disabled"</item>
<item msgid="6336372935919715515">"Enabled Filtered"</item>
<item msgid="2779123106632690576">"Enabled"</item>
+ <item>Enabled Headers Filtered</item>
+ <item>Enabled Media Pkts Filtered</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5 (Default)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Use system selection (default)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Use system selection (default)"</item>
diff --git a/packages/SettingsLib/res/values-en-rXC/arrays.xml b/packages/SettingsLib/res/values-en-rXC/arrays.xml
index a35d3ab5ec88..39a66674f42b 100644
--- a/packages/SettingsLib/res/values-en-rXC/arrays.xml
+++ b/packages/SettingsLib/res/values-en-rXC/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‎‏‎‎‏‏‎‏‎‎‏‏‏‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‏‏‏‎‎‎‏‎‏‎‏‎‎‏‎‏‏‎‎‏‏‎‎‎‏‏‏‏‎‏‏‏‏‎Disabled‎‏‎‎‏‎"</item>
<item msgid="6336372935919715515">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‎‏‏‏‏‏‏‎‏‏‏‏‎‏‎‏‎‎‎‏‏‎‎‏‏‏‎‏‎‎‎‏‏‎‎‏‏‏‏‎‎‏‎‎‏‏‎‎‎‏‎‎‏‎‏‏‏‎‏‏‎Enabled Filtered‎‏‎‎‏‎"</item>
<item msgid="2779123106632690576">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‏‏‎‏‎‎‏‎‎‎‏‎‏‏‎‏‏‎‏‏‎‏‏‏‏‎‏‏‎‏‏‎‏‎‏‏‏‏‎‏‎‏‏‏‏‏‎‏‎‏‏‏‎‎‏‎‎‎‎‎Enabled‎‏‎‎‏‎"</item>
+ <item>Enabled Headers Filtered</item>
+ <item>Enabled Media Pkts Filtered</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‏‎‏‏‏‎‏‎‎‏‎‏‏‎‏‏‎‎‏‎‏‎‎‎‎‏‏‏‎‏‏‎‏‏‎‎‎‏‎‎‎‎‎‏‎‎‎‏‏‏‏‏‏‏‏‎‎‎‎‎‎AVRCP 1.5 (Default)‎‏‎‎‏‎"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‎‏‏‏‎‏‎‎‏‎‎‎‎‎‏‏‎‎‏‎‏‎‎‏‏‎‏‏‏‏‏‏‎‎‎‏‎‎‎‎‏‎‏‏‏‏‏‏‎‏‎‏‎‏‎‏‏‎‏‏‏‎‎‏‎‎‏‏‎<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎<xliff:g id="APTX">aptX™</xliff:g>‎‏‎‎‏‏‏‎ audio‎‏‎‎‏‎"</item>
<item msgid="2908219194098827570">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‏‎‎‎‎‏‎‏‏‏‎‎‎‎‎‏‎‎‎‏‏‏‏‏‎‎‏‎‏‏‎‏‏‎‎‏‎‎‏‏‏‎‏‏‏‏‎‎‎‎‎‏‎‎‏‏‎‎‏‎‎‎‏‎‎‏‏‎<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎<xliff:g id="APTX_HD">aptX™ HD</xliff:g>‎‏‎‎‏‏‏‎ audio‎‏‎‎‏‎"</item>
<item msgid="3825367753087348007">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‏‎‏‎‎‎‏‎‏‏‎‎‏‏‎‏‏‏‏‏‎‏‏‎‏‎‎‎‎‏‎‏‎‏‎‎‎‎‎‎‎‎‏‎‏‏‎‏‏‎‏‎‎‏‎‎‏‏‏‎LDAC‎‏‎‎‏‎"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>‎ audio‎"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>‎ audio‎"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‏‎‏‏‎‎‎‏‎‎‎‏‏‏‎‏‏‎‏‎‏‎‏‎‎‏‏‏‏‎‎‏‎‏‎‎‏‎‏‎‎‎‏‏‎‎‏‎‎‏‏‏‎‏‏‏‎‎‎‎‎Use System Selection (Default)‎‏‎‎‏‎"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‎‏‏‏‏‎‏‏‏‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎‎‏‎‏‎‎‎‎‎‏‏‎‏‏‎‏‎‏‎‏‎‎‎‎‎‎‎‏‎‏‎‏‎‎‏‏‎‎‏‎‎‏‏‎<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎<xliff:g id="APTX">aptX™</xliff:g>‎‏‎‎‏‏‏‎ audio‎‏‎‎‏‎"</item>
<item msgid="3517061573669307965">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‎‎‎‏‏‎‎‏‏‏‏‎‎‎‏‏‏‎‎‏‏‎‏‏‏‎‏‏‏‏‏‎‏‏‏‏‎‏‏‏‏‎‎‎‏‎‎‎‏‏‎‎‎‏‏‏‏‎‏‎‎‏‎‎‏‏‎<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎<xliff:g id="APTX_HD">aptX™ HD</xliff:g>‎‏‎‎‏‏‏‎ audio‎‏‎‎‏‎"</item>
<item msgid="2553206901068987657">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‎‏‏‎‏‏‎‏‏‏‎‏‏‎‏‎‎‎‎‎‎‏‎‎‏‏‎‎‎‏‎‏‎‎‎‎‏‎‎‏‎‏‎‏‏‏‏‏‏‎‏‎‎‎‎‏‎‎‏‎LDAC‎‏‎‎‏‎"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>‎ audio‎"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>‎ audio‎"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‎‏‏‎‎‏‏‎‏‏‏‎‎‏‎‏‏‎‎‎‎‎‎‎‏‏‏‎‎‏‏‎‏‏‎‎‏‏‏‏‎‏‏‏‏‏‎‏‎‏‎‎‎‏‏‎‎‏‏‏‏‎Use System Selection (Default)‎‏‎‎‏‎"</item>
diff --git a/packages/SettingsLib/res/values-es-rUS/arrays.xml b/packages/SettingsLib/res/values-es-rUS/arrays.xml
index d187f268aa95..c1a69ea9eb21 100644
--- a/packages/SettingsLib/res/values-es-rUS/arrays.xml
+++ b/packages/SettingsLib/res/values-es-rUS/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Usar selección del sistema (predeterminado)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Usar selección del sistema (predeterminado)"</item>
diff --git a/packages/SettingsLib/res/values-es/arrays.xml b/packages/SettingsLib/res/values-es/arrays.xml
index eb39d62a79fe..3efb3916d15a 100644
--- a/packages/SettingsLib/res/values-es/arrays.xml
+++ b/packages/SettingsLib/res/values-es/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Usar preferencia del sistema (predeterminado)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Usar preferencia del sistema (predeterminado)"</item>
diff --git a/packages/SettingsLib/res/values-et/arrays.xml b/packages/SettingsLib/res/values-et/arrays.xml
index 13f7920faffd..ebfd1d2b2f23 100644
--- a/packages/SettingsLib/res/values-et/arrays.xml
+++ b/packages/SettingsLib/res/values-et/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Süsteemi valiku kasutamine (vaikeseade)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Heli: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Süsteemi valiku kasutamine (vaikeseade)"</item>
diff --git a/packages/SettingsLib/res/values-eu/arrays.xml b/packages/SettingsLib/res/values-eu/arrays.xml
index 894a05f7966f..d59cc95588c5 100644
--- a/packages/SettingsLib/res/values-eu/arrays.xml
+++ b/packages/SettingsLib/res/values-eu/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audioa"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audioa"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audioa"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audioa"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Erabili sistema-hautapena (lehenetsia)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audioa"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audioa"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audioa"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audioa"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Erabili sistema-hautapena (lehenetsia)"</item>
diff --git a/packages/SettingsLib/res/values-fa/arrays.xml b/packages/SettingsLib/res/values-fa/arrays.xml
index db1dffa423e7..b77461f592c1 100644
--- a/packages/SettingsLib/res/values-fa/arrays.xml
+++ b/packages/SettingsLib/res/values-fa/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"استفاده از انتخاب سیستم (پیش‌فرض)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"صوت <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"ﺹﻮﺗ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"استفاده از انتخاب سیستم (پیش‌فرض)"</item>
diff --git a/packages/SettingsLib/res/values-fi/arrays.xml b/packages/SettingsLib/res/values-fi/arrays.xml
index 90c40cebf956..73e55cc23e5c 100644
--- a/packages/SettingsLib/res/values-fi/arrays.xml
+++ b/packages/SettingsLib/res/values-fi/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ‑ääni"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ‑ääni"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ‑ääni"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ‑ääni"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Käytä järjestelmän valintaa (oletus)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ‑ääni"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ‑ääni"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ‑ääni"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ‑ääni"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Käytä järjestelmän valintaa (oletus)"</item>
diff --git a/packages/SettingsLib/res/values-fr-rCA/arrays.xml b/packages/SettingsLib/res/values-fr-rCA/arrays.xml
index c566e6ec1f21..1a4d80419bde 100644
--- a/packages/SettingsLib/res/values-fr-rCA/arrays.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Utiliser sélect. du système (par défaut)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Utiliser sélect. du système (par défaut)"</item>
diff --git a/packages/SettingsLib/res/values-fr/arrays.xml b/packages/SettingsLib/res/values-fr/arrays.xml
index 909324079661..41a793ee0a63 100644
--- a/packages/SettingsLib/res/values-fr/arrays.xml
+++ b/packages/SettingsLib/res/values-fr/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Utiliser la sélection du système (par défaut)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Utiliser la sélection du système (par défaut)"</item>
diff --git a/packages/SettingsLib/res/values-gl/arrays.xml b/packages/SettingsLib/res/values-gl/arrays.xml
index bd197e5014f7..14346666b3c0 100644
--- a/packages/SettingsLib/res/values-gl/arrays.xml
+++ b/packages/SettingsLib/res/values-gl/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Usa a selección do sistema (predeterminado)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Usar selección do sistema (predeterminado)"</item>
diff --git a/packages/SettingsLib/res/values-gu/arrays.xml b/packages/SettingsLib/res/values-gu/arrays.xml
index 6154d20fd490..a923f6c3a147 100644
--- a/packages/SettingsLib/res/values-gu/arrays.xml
+++ b/packages/SettingsLib/res/values-gu/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ઑડિયો"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ઑડિયો"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ઑડિઓ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ઑડિઓ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"સિસ્ટમ પસંદગીનો ઉપયોગ કરો (ડિફૉલ્ટ)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ઑડિયો"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ઑડિયો"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ઑડિઓ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ઑડિઓ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"સિસ્ટમ પસંદગીનો ઉપયોગ કરો (ડિફૉલ્ટ)"</item>
diff --git a/packages/SettingsLib/res/values-hi/arrays.xml b/packages/SettingsLib/res/values-hi/arrays.xml
index f8522aa2eb2d..e6e9f051c5be 100644
--- a/packages/SettingsLib/res/values-hi/arrays.xml
+++ b/packages/SettingsLib/res/values-hi/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ऑडियो"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ऑडियो"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>ऑडियो"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ऑडियो"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"सिस्टम से चुने जाने का उपयोग करें (डिफ़ॉल्ट)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ऑडियो"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ऑडियो"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>ऑडियो"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ऑडियो"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"सिस्टम से चुने जाने का उपयोग करें (डिफ़ॉल्ट)"</item>
diff --git a/packages/SettingsLib/res/values-hr/arrays.xml b/packages/SettingsLib/res/values-hr/arrays.xml
index e185f0467c1d..8a6967dd86f8 100644
--- a/packages/SettingsLib/res/values-hr/arrays.xml
+++ b/packages/SettingsLib/res/values-hr/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Upotreba odabira sustava (zadano)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Upotreba odabira sustava (zadano)"</item>
diff --git a/packages/SettingsLib/res/values-hu/arrays.xml b/packages/SettingsLib/res/values-hu/arrays.xml
index 2369aefdbb3d..cf299cb7d078 100644
--- a/packages/SettingsLib/res/values-hu/arrays.xml
+++ b/packages/SettingsLib/res/values-hu/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Rendszerérték (alapértelmezett)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Hang: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Rendszerérték (alapértelmezett)"</item>
diff --git a/packages/SettingsLib/res/values-hy/arrays.xml b/packages/SettingsLib/res/values-hy/arrays.xml
index d16027af6209..b20989664300 100644
--- a/packages/SettingsLib/res/values-hy/arrays.xml
+++ b/packages/SettingsLib/res/values-hy/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> աուդիո"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> աուդիո"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> աուդիո"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> աուդիո"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Օգտագործել համակարգի կարգավորումը (կանխադրված)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> աուդիո"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> աուդիո"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> աուդիո"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> աուդիո"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Օգտագործել համակարգի կարգավորումը (կանխադրված)"</item>
diff --git a/packages/SettingsLib/res/values-in/arrays.xml b/packages/SettingsLib/res/values-in/arrays.xml
index 7b4c9b6790ef..20662db52076 100644
--- a/packages/SettingsLib/res/values-in/arrays.xml
+++ b/packages/SettingsLib/res/values-in/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Gunakan Pilihan Sistem (Default)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Gunakan Pilihan Sistem (Default)"</item>
diff --git a/packages/SettingsLib/res/values-is/arrays.xml b/packages/SettingsLib/res/values-is/arrays.xml
index b3e7cb90d3b1..2ccca2b0ee4e 100644
--- a/packages/SettingsLib/res/values-is/arrays.xml
+++ b/packages/SettingsLib/res/values-is/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> hljóð"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> hljóð"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> hljóð"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> hljóð"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Nota val kerfisins (sjálfgefið)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> hljóð"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> hljóð"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> hljóð"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> hljóð"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Nota val kerfisins (sjálfgefið)"</item>
diff --git a/packages/SettingsLib/res/values-it/arrays.xml b/packages/SettingsLib/res/values-it/arrays.xml
index 80b78747a54c..7d279c47d589 100644
--- a/packages/SettingsLib/res/values-it/arrays.xml
+++ b/packages/SettingsLib/res/values-it/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Usa selezione di sistema (predefinita)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Usa selezione di sistema (predefinita)"</item>
diff --git a/packages/SettingsLib/res/values-iw/arrays.xml b/packages/SettingsLib/res/values-iw/arrays.xml
index 31abe2beaf49..e89d462bd1db 100644
--- a/packages/SettingsLib/res/values-iw/arrays.xml
+++ b/packages/SettingsLib/res/values-iw/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"שימוש בבחירת המערכת (ברירת המחדל)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"אודיו <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"שימוש בבחירת המערכת (ברירת המחדל)"</item>
diff --git a/packages/SettingsLib/res/values-ja/arrays.xml b/packages/SettingsLib/res/values-ja/arrays.xml
index ff5f3c227a82..f18f03d1da91 100644
--- a/packages/SettingsLib/res/values-ja/arrays.xml
+++ b/packages/SettingsLib/res/values-ja/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"無効"</item>
<item msgid="6336372935919715515">"有効(フィルタ済み)"</item>
<item msgid="2779123106632690576">"有効"</item>
+ <item>"有効(ヘッダーのみ)"</item>
+ <item>"有効(メディアパケット除外)"</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5(デフォルト)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> オーディオ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> オーディオ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> オーディオ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> オーディオ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"システムの選択(デフォルト)を使用"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> オーディオ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> オーディオ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> オーディオ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> オーディオ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"システムの選択(デフォルト)を使用"</item>
diff --git a/packages/SettingsLib/res/values-ka/arrays.xml b/packages/SettingsLib/res/values-ka/arrays.xml
index 327a77f62496..25792b26849a 100644
--- a/packages/SettingsLib/res/values-ka/arrays.xml
+++ b/packages/SettingsLib/res/values-ka/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> აუდიო"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> აუდიო"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> აუდიო"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> აუდიო"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"სისტემის არჩეულის გამოყენება (ნაგულისხმევი)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> აუდიო"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> აუდიო"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> აუდიო"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> აუდიო"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"სისტემის არჩეულის გამოყენება (ნაგულისხმევი)"</item>
diff --git a/packages/SettingsLib/res/values-kk/arrays.xml b/packages/SettingsLib/res/values-kk/arrays.xml
index 28f91dab214e..f45561b8917c 100644
--- a/packages/SettingsLib/res/values-kk/arrays.xml
+++ b/packages/SettingsLib/res/values-kk/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудиокодегі"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудиокодегі"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудиокодегі"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудиокодегі"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Жүйенің таңдағанын алу (әдепкі)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудиокодегі"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудиокодегі"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудиокодегі"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудиокодегі"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Жүйенің таңдағанын алу (әдепкі)"</item>
diff --git a/packages/SettingsLib/res/values-km/arrays.xml b/packages/SettingsLib/res/values-km/arrays.xml
index 136f3a558b0f..8ca45cc00069 100644
--- a/packages/SettingsLib/res/values-km/arrays.xml
+++ b/packages/SettingsLib/res/values-km/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>សំឡេង <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>សំឡេង <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ប្រើ​ការ​ជ្រើសរើស​ប្រព័ន្ធ (លំនាំ​ដើម)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>សំឡេង <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g>សំឡេង <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ប្រើ​ការ​ជ្រើសរើស​ប្រព័ន្ធ (លំនាំ​ដើម)"</item>
diff --git a/packages/SettingsLib/res/values-kn/arrays.xml b/packages/SettingsLib/res/values-kn/arrays.xml
index 9bf335076b40..0ed1ca993b13 100644
--- a/packages/SettingsLib/res/values-kn/arrays.xml
+++ b/packages/SettingsLib/res/values-kn/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ಆಡಿಯೋ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ಆಡಿಯೋ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ಆಡಿಯೋ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ಆಡಿಯೋ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ಸಿಸ್ಟಂ ಆಯ್ಕೆಯನ್ನು ಬಳಸಿ (ಡಿಫಾಲ್ಟ್)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ಆಡಿಯೋ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ಆಡಿಯೋ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ಆಡಿಯೋ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ಆಡಿಯೋ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ಸಿಸ್ಟಂ ಆಯ್ಕೆಯನ್ನು ಬಳಸಿ (ಡಿಫಾಲ್ಟ್)"</item>
diff --git a/packages/SettingsLib/res/values-ko/arrays.xml b/packages/SettingsLib/res/values-ko/arrays.xml
index 195fc47e8c64..50935b815d90 100644
--- a/packages/SettingsLib/res/values-ko/arrays.xml
+++ b/packages/SettingsLib/res/values-ko/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"사용 중지됨"</item>
<item msgid="6336372935919715515">"필터링 사용 설정됨"</item>
<item msgid="2779123106632690576">"사용 설정됨"</item>
+ <item>"헤더 필터링 사용 설정됨"</item>
+ <item>"미디어 패킷 필터링 사용 설정됨"</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5(기본값)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 오디오"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 오디오"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 오디오"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 오디오"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"시스템 설정 사용(기본)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 오디오"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 오디오"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 오디오"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 오디오"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"시스템 설정 사용(기본)"</item>
diff --git a/packages/SettingsLib/res/values-ky/arrays.xml b/packages/SettingsLib/res/values-ky/arrays.xml
index 7c0fbaee2768..993d81e570b5 100644
--- a/packages/SettingsLib/res/values-ky/arrays.xml
+++ b/packages/SettingsLib/res/values-ky/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Система тандаганды колдонуу (демейки)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Система тандаганды колдонуу (демейки)"</item>
diff --git a/packages/SettingsLib/res/values-lo/arrays.xml b/packages/SettingsLib/res/values-lo/arrays.xml
index 2487ebe2b8d5..287ba9e3ae18 100644
--- a/packages/SettingsLib/res/values-lo/arrays.xml
+++ b/packages/SettingsLib/res/values-lo/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ໃຊ້ການເລືອກຂອງລະບົບ (ຄ່າເລີ່ມຕົ້ນ)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"ສຽງ <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ໃຊ້ການເລືອກຂອງລະບົບ (ຄ່າເລີ່ມຕົ້ນ)"</item>
diff --git a/packages/SettingsLib/res/values-lt/arrays.xml b/packages/SettingsLib/res/values-lt/arrays.xml
index 72e55ff7cece..04d02aaf6c69 100644
--- a/packages/SettingsLib/res/values-lt/arrays.xml
+++ b/packages/SettingsLib/res/values-lt/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> garsas"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> garsas"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> garsas"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> garsas"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Naudoti sistemos pasirink. (numatytasis)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> garsas"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> garsas"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> garsas"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> garsas"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Naudoti sistemos pasirink. (numatytasis)"</item>
diff --git a/packages/SettingsLib/res/values-lv/arrays.xml b/packages/SettingsLib/res/values-lv/arrays.xml
index da3325c5d0cf..66935c48ecbb 100644
--- a/packages/SettingsLib/res/values-lv/arrays.xml
+++ b/packages/SettingsLib/res/values-lv/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Sistēmas atlases izmantošana (nokl.)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Sistēmas atlases izmantošana (nokl.)"</item>
diff --git a/packages/SettingsLib/res/values-mk/arrays.xml b/packages/SettingsLib/res/values-mk/arrays.xml
index 908571dd9480..d204529bcfe6 100644
--- a/packages/SettingsLib/res/values-mk/arrays.xml
+++ b/packages/SettingsLib/res/values-mk/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Користи избор на системот (стандардно)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Користи избор на системот (стандардно)"</item>
diff --git a/packages/SettingsLib/res/values-ml/arrays.xml b/packages/SettingsLib/res/values-ml/arrays.xml
index fd0c2e5b0dd8..48fe1e41aa0a 100644
--- a/packages/SettingsLib/res/values-ml/arrays.xml
+++ b/packages/SettingsLib/res/values-ml/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ഓഡിയോ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ഓഡിയോ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ഓഡിയോ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ഓഡിയോ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"സിസ്റ്റം സെലക്ഷൻ ഉപയോഗിക്കൂ ‌(ഡിഫോൾട്ട്)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ഓഡിയോ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ഓഡിയോ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ഓഡിയോ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ഓഡിയോ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"സിസ്റ്റം സെലക്ഷൻ ഉപയോഗിക്കൂ ‌(ഡിഫോൾട്ട്)"</item>
diff --git a/packages/SettingsLib/res/values-mn/arrays.xml b/packages/SettingsLib/res/values-mn/arrays.xml
index 2b02d620ac54..476c311c30e2 100644
--- a/packages/SettingsLib/res/values-mn/arrays.xml
+++ b/packages/SettingsLib/res/values-mn/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Системийн сонголтыг ашиглах (Өгөгдмөл)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Системийн сонголтыг ашиглах (Өгөгдмөл)"</item>
diff --git a/packages/SettingsLib/res/values-mr/arrays.xml b/packages/SettingsLib/res/values-mr/arrays.xml
index 6cc013071223..cb89f693e311 100644
--- a/packages/SettingsLib/res/values-mr/arrays.xml
+++ b/packages/SettingsLib/res/values-mr/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ऑडिओ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ऑडिओ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ऑडिओ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ऑडिओ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"सिस्टम निवड वापरा (डीफॉल्ट)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ऑडिओ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ऑडिओ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ऑडिओ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ऑडिओ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"सिस्टम निवड वापरा (डीफॉल्ट)"</item>
diff --git a/packages/SettingsLib/res/values-ms/arrays.xml b/packages/SettingsLib/res/values-ms/arrays.xml
index af6d3c27a371..7757fb81ea23 100644
--- a/packages/SettingsLib/res/values-ms/arrays.xml
+++ b/packages/SettingsLib/res/values-ms/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Gunakan Pilihan Sistem (Lalai)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Gunakan Pilihan Sistem (Lalai)"</item>
diff --git a/packages/SettingsLib/res/values-my/arrays.xml b/packages/SettingsLib/res/values-my/arrays.xml
index cb97802039d5..726f7db364a9 100644
--- a/packages/SettingsLib/res/values-my/arrays.xml
+++ b/packages/SettingsLib/res/values-my/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> အသံ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> အသံ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> အသံ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> အသံ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"စနစ်ရွေးချယ်မှုကို အသုံးပြုပါ (မူရင်း)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> အသံ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> အသံ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> အသံ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> အသံ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"စနစ်ရွေးချယ်မှုကို အသုံးပြုပါ (မူရင်း)"</item>
diff --git a/packages/SettingsLib/res/values-nb/arrays.xml b/packages/SettingsLib/res/values-nb/arrays.xml
index 79d3587ac366..54b5127b1f87 100644
--- a/packages/SettingsLib/res/values-nb/arrays.xml
+++ b/packages/SettingsLib/res/values-nb/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-lyd"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-lyd"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-lyd"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-lyd"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Bruk systemvalg (standard)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-lyd"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-lyd"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-lyd"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-lyd"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Bruk systemvalg (standard)"</item>
diff --git a/packages/SettingsLib/res/values-ne/arrays.xml b/packages/SettingsLib/res/values-ne/arrays.xml
index 3699bf3ec59c..cb0724ee6704 100644
--- a/packages/SettingsLib/res/values-ne/arrays.xml
+++ b/packages/SettingsLib/res/values-ne/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> अडियो"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> अडियो"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> अडियो"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> अडियो"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"सिस्टमको छनौट प्रयोग गरियोस् (डिफल्ट)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> अडियो"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> अडियो"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> अडियो"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> अडियो"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"सिस्टमको छनौट प्रयोग गरियोस् (डिफल्ट)"</item>
diff --git a/packages/SettingsLib/res/values-nl/arrays.xml b/packages/SettingsLib/res/values-nl/arrays.xml
index e73a33b18753..1fefbb2ad114 100644
--- a/packages/SettingsLib/res/values-nl/arrays.xml
+++ b/packages/SettingsLib/res/values-nl/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Gebruik systeemselectie (standaard)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Systeemselectie gebruiken (standaard)"</item>
diff --git a/packages/SettingsLib/res/values-or/arrays.xml b/packages/SettingsLib/res/values-or/arrays.xml
index 801e6976435d..1365b6ab8a7e 100644
--- a/packages/SettingsLib/res/values-or/arrays.xml
+++ b/packages/SettingsLib/res/values-or/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ଅଡିଓ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ଅଡିଓ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ଅଡିଓ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ଅଡିଓ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ସିଷ୍ଟମ୍‌ର ଚୟନ (ଡିଫଲ୍ଟ୍) ବ୍ୟବହାର କରନ୍ତୁ"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ଅଡିଓ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ଅଡିଓ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ଅଡିଓ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ଅଡିଓ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ସିଷ୍ଟମ୍‌ର ଚୟନ (ଡିଫଲ୍ଟ୍) ବ୍ୟବହାର କରନ୍ତୁ"</item>
diff --git a/packages/SettingsLib/res/values-pa/arrays.xml b/packages/SettingsLib/res/values-pa/arrays.xml
index a2daef2052b3..b6668920623e 100644
--- a/packages/SettingsLib/res/values-pa/arrays.xml
+++ b/packages/SettingsLib/res/values-pa/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ਆਡੀਓ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ਆਡੀਓ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ਆਡੀਓ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ਆਡੀਓ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ਸਿਸਟਮ ਚੋਣ ਦੀ ਵਰਤੋਂ ਕਰੋ (ਪੂਰਵ-ਨਿਰਧਾਰਿਤ)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ਆਡੀਓ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ਆਡੀਓ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ਆਡੀਓ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ਆਡੀਓ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ਸਿਸਟਮ ਚੋਣ ਦੀ ਵਰਤੋਂ ਕਰੋ (ਪੂਰਵ-ਨਿਰਧਾਰਿਤ)"</item>
diff --git a/packages/SettingsLib/res/values-pl/arrays.xml b/packages/SettingsLib/res/values-pl/arrays.xml
index 22b05399346b..95ec079429e3 100644
--- a/packages/SettingsLib/res/values-pl/arrays.xml
+++ b/packages/SettingsLib/res/values-pl/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Użyj wyboru systemu (domyślnie)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Użyj wyboru systemu (domyślnie)"</item>
diff --git a/packages/SettingsLib/res/values-pt-rBR/arrays.xml b/packages/SettingsLib/res/values-pt-rBR/arrays.xml
index 5155311b24a4..93f868e4ab75 100644
--- a/packages/SettingsLib/res/values-pt-rBR/arrays.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Usar seleção do sistema (padrão)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Usar seleção do sistema (padrão)"</item>
diff --git a/packages/SettingsLib/res/values-pt-rPT/arrays.xml b/packages/SettingsLib/res/values-pt-rPT/arrays.xml
index ff8e202815c6..9c14e8c6a6a3 100644
--- a/packages/SettingsLib/res/values-pt-rPT/arrays.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Utilizar seleção do sistema (predefinido)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Utilizar seleção do sistema (predefinido)"</item>
diff --git a/packages/SettingsLib/res/values-pt/arrays.xml b/packages/SettingsLib/res/values-pt/arrays.xml
index 5155311b24a4..dd60d9ea8aa8 100644
--- a/packages/SettingsLib/res/values-pt/arrays.xml
+++ b/packages/SettingsLib/res/values-pt/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Usar seleção do sistema (padrão)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Áudio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Usar seleção do sistema (padrão)"</item>
diff --git a/packages/SettingsLib/res/values-ro/arrays.xml b/packages/SettingsLib/res/values-ro/arrays.xml
index c4d61c3f0f73..9d7f22c3077c 100644
--- a/packages/SettingsLib/res/values-ro/arrays.xml
+++ b/packages/SettingsLib/res/values-ro/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Folosiți selectarea sistemului (prestabilit)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audio <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Folosiți selectarea sistemului (prestabilit)"</item>
diff --git a/packages/SettingsLib/res/values-ru/arrays.xml b/packages/SettingsLib/res/values-ru/arrays.xml
index 318944d748fc..ffb6b539c212 100644
--- a/packages/SettingsLib/res/values-ru/arrays.xml
+++ b/packages/SettingsLib/res/values-ru/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Выбор системы (по умолчанию)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Аудиокодек: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Выбор системы (по умолчанию)"</item>
diff --git a/packages/SettingsLib/res/values-si/arrays.xml b/packages/SettingsLib/res/values-si/arrays.xml
index b0fc7531e6d4..9f114291f793 100644
--- a/packages/SettingsLib/res/values-si/arrays.xml
+++ b/packages/SettingsLib/res/values-si/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ශ්‍රව්‍යය"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ශ්‍රව්‍යය"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ශ්‍රව්‍යය"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ශ්‍රව්‍යය"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"පද්ධති තේරීම භාවිත කරන්න (පෙරනිමි)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ශ්‍රව්‍යය"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ශ්‍රව්‍යය"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ශ්‍රව්‍යය"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ශ්‍රව්‍යය"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"පද්ධති තේරීම භාවිත කරන්න (පෙරනිමි)"</item>
diff --git a/packages/SettingsLib/res/values-sk/arrays.xml b/packages/SettingsLib/res/values-sk/arrays.xml
index 35cc015616bf..fc4915f3e261 100644
--- a/packages/SettingsLib/res/values-sk/arrays.xml
+++ b/packages/SettingsLib/res/values-sk/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Použiť voľbu systému (predvolené)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Zvuk: <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Použiť voľbu systému (predvolené)"</item>
diff --git a/packages/SettingsLib/res/values-sl/arrays.xml b/packages/SettingsLib/res/values-sl/arrays.xml
index a0ff15e554c7..95119d439f4d 100644
--- a/packages/SettingsLib/res/values-sl/arrays.xml
+++ b/packages/SettingsLib/res/values-sl/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Uporabi sistemsko izbiro (privzeto)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Zvok <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Uporabi sistemsko izbiro (privzeto)"</item>
diff --git a/packages/SettingsLib/res/values-sq/arrays.xml b/packages/SettingsLib/res/values-sq/arrays.xml
index d04c6ce9bec6..3cbb53045479 100644
--- a/packages/SettingsLib/res/values-sq/arrays.xml
+++ b/packages/SettingsLib/res/values-sq/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Përdor përzgjedhjen e sistemit (e parazgjedhur)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Audioja e <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Përdor përzgjedhjen e sistemit (e parazgjedhur)"</item>
diff --git a/packages/SettingsLib/res/values-sr/arrays.xml b/packages/SettingsLib/res/values-sr/arrays.xml
index 6fbc563313b6..5711eed9b10e 100644
--- a/packages/SettingsLib/res/values-sr/arrays.xml
+++ b/packages/SettingsLib/res/values-sr/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Користи избор система (подразумевано)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> аудио"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> аудио"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> аудио"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> аудио"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Користи избор система (подразумевано)"</item>
diff --git a/packages/SettingsLib/res/values-sv/arrays.xml b/packages/SettingsLib/res/values-sv/arrays.xml
index 721553e7e2b7..08d6462d1af1 100644
--- a/packages/SettingsLib/res/values-sv/arrays.xml
+++ b/packages/SettingsLib/res/values-sv/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-ljud"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-ljud"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-ljud"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-ljud"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Använd systemval (standardinställning)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>-ljud"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>-ljud"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>-ljud"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>-ljud"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Använd systemval (standardinställning)"</item>
diff --git a/packages/SettingsLib/res/values-sw/arrays.xml b/packages/SettingsLib/res/values-sw/arrays.xml
index b95d69c95fc7..ba2a2939d1a2 100644
--- a/packages/SettingsLib/res/values-sw/arrays.xml
+++ b/packages/SettingsLib/res/values-sw/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Tumia Uteuzi wa Mfumo (Chaguomsingi)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Sauti ya <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Tumia Uteuzi wa Mfumo (Chaguomsingi)"</item>
diff --git a/packages/SettingsLib/res/values-ta/arrays.xml b/packages/SettingsLib/res/values-ta/arrays.xml
index 79d7c575e7fd..85ed73a9d89e 100644
--- a/packages/SettingsLib/res/values-ta/arrays.xml
+++ b/packages/SettingsLib/res/values-ta/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ஆடியோ"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ஆடியோ"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ஆடியோ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ஆடியோ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"சாதனத் தேர்வைப் பயன்படுத்து (இயல்பு)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ஆடியோ"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ஆடியோ"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ஆடியோ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ஆடியோ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"சாதனத் தேர்வைப் பயன்படுத்து (இயல்பு)"</item>
diff --git a/packages/SettingsLib/res/values-te/arrays.xml b/packages/SettingsLib/res/values-te/arrays.xml
index 67decc9eff68..1ecbb3cbbcc2 100644
--- a/packages/SettingsLib/res/values-te/arrays.xml
+++ b/packages/SettingsLib/res/values-te/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ఆడియో"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ఆడియో"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ఆడియో"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ఆడియో"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"సిస్టమ్ ఎంపికను ఉపయోగించండి (ఆటోమేటిక్)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ఆడియో"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ఆడియో"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ఆడియో"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ఆడియో"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"సిస్టమ్ ఎంపికను ఉపయోగించండి (ఆటోమేటిక్)"</item>
diff --git a/packages/SettingsLib/res/values-th/arrays.xml b/packages/SettingsLib/res/values-th/arrays.xml
index 9f428e4be5d5..84dfd29f1a72 100644
--- a/packages/SettingsLib/res/values-th/arrays.xml
+++ b/packages/SettingsLib/res/values-th/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"ใช้การเลือกของระบบ (ค่าเริ่มต้น)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"เสียง <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"ใช้การเลือกของระบบ (ค่าเริ่มต้น)"</item>
diff --git a/packages/SettingsLib/res/values-tl/arrays.xml b/packages/SettingsLib/res/values-tl/arrays.xml
index 18800666c774..83cb71e46faf 100644
--- a/packages/SettingsLib/res/values-tl/arrays.xml
+++ b/packages/SettingsLib/res/values-tl/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> na audio"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> na audio"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> na audio"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> na audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Gamitin ang Pagpili ng System (Default)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> na audio"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> na audio"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> na audio"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> na audio"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Gamitin ang Pagpili ng System (Default)"</item>
diff --git a/packages/SettingsLib/res/values-tr/arrays.xml b/packages/SettingsLib/res/values-tr/arrays.xml
index b4dcfba953b3..a1e8ac0ee4ba 100644
--- a/packages/SettingsLib/res/values-tr/arrays.xml
+++ b/packages/SettingsLib/res/values-tr/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ses"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ses"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ses"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ses"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Sistem Seçimini Kullan (Varsayılan)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> ses"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> ses"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ses"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ses"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Sistem Seçimini Kullan (Varsayılan)"</item>
diff --git a/packages/SettingsLib/res/values-uk/arrays.xml b/packages/SettingsLib/res/values-uk/arrays.xml
index d48e20a2a613..210f28a15001 100644
--- a/packages/SettingsLib/res/values-uk/arrays.xml
+++ b/packages/SettingsLib/res/values-uk/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Використовувати вибір системи (за умовчанням)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Аудіо <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Використовувати вибір системи (за умовчанням)"</item>
diff --git a/packages/SettingsLib/res/values-ur/arrays.xml b/packages/SettingsLib/res/values-ur/arrays.xml
index ea6fdda370bd..903ef6233b2d 100644
--- a/packages/SettingsLib/res/values-ur/arrays.xml
+++ b/packages/SettingsLib/res/values-ur/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> آڈیو"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> آڈیو"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ﺁڈیﻭ"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ﺁڈیﻭ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"سسٹم انتخاب کا استعمال کریں (ڈیفالٹ)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> آڈیو"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> آڈیو"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> ﺁڈیﻭ"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> ﺁڈیﻭ"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"سسٹم انتخاب کا استعمال کریں (ڈیفالٹ)"</item>
diff --git a/packages/SettingsLib/res/values-uz/arrays.xml b/packages/SettingsLib/res/values-uz/arrays.xml
index 2fa8b0e1e525..d093b5c8668b 100644
--- a/packages/SettingsLib/res/values-uz/arrays.xml
+++ b/packages/SettingsLib/res/values-uz/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audiokodeki"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audiokodeki"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audiokodeki"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audiokodeki"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Tizim tanlovi (birlamchi)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> audiokodeki"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> audiokodeki"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> audiokodeki"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> audiokodeki"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Tizim tanlovi (birlamchi)"</item>
diff --git a/packages/SettingsLib/res/values-vi/arrays.xml b/packages/SettingsLib/res/values-vi/arrays.xml
index 5b59f4006a94..a53678879556 100644
--- a/packages/SettingsLib/res/values-vi/arrays.xml
+++ b/packages/SettingsLib/res/values-vi/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="2908219194098827570">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049225">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Sử dụng lựa chọn của hệ thống (Mặc định)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g>"</item>
<item msgid="3517061573669307965">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g>"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g>"</item>
+ <item msgid="6486050771049481">"Âm thanh <xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g>"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Sử dụng lựa chọn của hệ thống (Mặc định)"</item>
diff --git a/packages/SettingsLib/res/values-zh-rCN/arrays.xml b/packages/SettingsLib/res/values-zh-rCN/arrays.xml
index 400973b4e095..ac06e3e05407 100644
--- a/packages/SettingsLib/res/values-zh-rCN/arrays.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"已停用"</item>
<item msgid="6336372935919715515">"已启用“已过滤”"</item>
<item msgid="2779123106632690576">"已启用"</item>
+ <item>"已过滤已启用的标题"</item>
+ <item>"已过滤已启用的媒体包"</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5(默认)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 音频"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 音频"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 音频"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 音频"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"使用系统选择(默认)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 音频"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 音频"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 音频"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 音频"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"使用系统选择(默认)"</item>
diff --git a/packages/SettingsLib/res/values-zh-rHK/arrays.xml b/packages/SettingsLib/res/values-zh-rHK/arrays.xml
index 17e45c5ea423..9138c6253945 100644
--- a/packages/SettingsLib/res/values-zh-rHK/arrays.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"已停用"</item>
<item msgid="6336372935919715515">"已啟用篩選"</item>
<item msgid="2779123106632690576">"已啟用"</item>
+ <item>"已過濾已啟用的標題"</item>
+ <item>"已過濾已啟用的媒體包"</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5 (預設)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 音訊"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 音訊"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 音訊"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 音訊"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"使用系統選擇 (預設)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 音訊"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 音訊"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 音訊"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 音訊"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"使用系統選擇 (預設)"</item>
diff --git a/packages/SettingsLib/res/values-zh-rTW/arrays.xml b/packages/SettingsLib/res/values-zh-rTW/arrays.xml
index 0728f1aad28e..c6df11f7fc7d 100644
--- a/packages/SettingsLib/res/values-zh-rTW/arrays.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/arrays.xml
@@ -62,6 +62,8 @@
<item msgid="695678520785580527">"已停用"</item>
<item msgid="6336372935919715515">"已啟用篩選結果"</item>
<item msgid="2779123106632690576">"已啟用"</item>
+ <item>"已過濾已啟用的標題"</item>
+ <item>"已過濾已啟用的媒體包"</item>
</string-array>
<string-array name="bluetooth_avrcp_versions">
<item msgid="6603880723315236832">"AVRCP 1.5 (預設)"</item>
@@ -92,6 +94,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 音訊"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 音訊"</item>
<item msgid="3825367753087348007">"LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 音訊"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 音訊"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"系統自動選擇 (預設)"</item>
@@ -100,6 +104,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> 音訊"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> 音訊"</item>
<item msgid="2553206901068987657">"LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> 音訊"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> 音訊"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"系統自動選擇 (預設)"</item>
diff --git a/packages/SettingsLib/res/values-zu/arrays.xml b/packages/SettingsLib/res/values-zu/arrays.xml
index 06a029a52de6..4be9dd582aa5 100644
--- a/packages/SettingsLib/res/values-zu/arrays.xml
+++ b/packages/SettingsLib/res/values-zu/arrays.xml
@@ -92,6 +92,8 @@
<item msgid="1049450003868150455">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> umsindo"</item>
<item msgid="2908219194098827570">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> umsindo"</item>
<item msgid="3825367753087348007">"I-LDAC"</item>
+ <item msgid="8711430979086781450">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> umsindo"</item>
+ <item msgid="6486050771049225">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> umsindo"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_summaries">
<item msgid="8868109554557331312">"Sebenzisa ukukhetha kwesistimu (Okuzenzakalelayo)"</item>
@@ -100,6 +102,8 @@
<item msgid="8627333814413492563">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX">aptX™</xliff:g> umsindo"</item>
<item msgid="3517061573669307965">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_HD">aptX™ HD</xliff:g> umsindo"</item>
<item msgid="2553206901068987657">"I-LDAC"</item>
+ <item msgid="102988075927343894">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_ADAPTIVE">aptX™ Adaptive</xliff:g> umsindo"</item>
+ <item msgid="6486050771049481">"<xliff:g id="QUALCOMM">Qualcomm®</xliff:g> <xliff:g id="APTX_TWSP">aptX™ TWS+</xliff:g> umsindo"</item>
</string-array>
<string-array name="bluetooth_a2dp_codec_sample_rate_titles">
<item msgid="926809261293414607">"Sebenzisa ukukhetha kwesistimu (Okuzenzakalelayo)"</item>
diff --git a/packages/SettingsLib/res/values/arrays.xml b/packages/SettingsLib/res/values/arrays.xml
index 2b5e9cdc017d..6b9d43a4ebba 100644
--- a/packages/SettingsLib/res/values/arrays.xml
+++ b/packages/SettingsLib/res/values/arrays.xml
@@ -107,6 +107,8 @@
<item>Disabled</item>
<item>Enabled Filtered</item>
<item>Enabled</item>
+ <item>Enabled Headers Filtered</item>
+ <item>Enabled Media Pkts Filtered</item>
</string-array>
<!-- Values for Bluetooth HCI Snoop Logging -->
@@ -114,6 +116,8 @@
<item>disabled</item>
<item>filtered</item>
<item>full</item>
+ <item>snoopheadersfiltered</item>
+ <item>mediapktsfiltered</item>
</string-array>
<!-- Titles for Bluetooth AVRCP Versions -->
@@ -154,6 +158,8 @@
<item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx">aptX™</xliff:g> audio</item>
<item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx_hd">aptX™ HD</xliff:g> audio</item>
<item>LDAC</item>
+ <item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx_adaptive">aptX™ Adaptive</xliff:g> audio</item>
+ <item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx_twsp">aptX™ TWS+</xliff:g> audio</item>
</string-array>
<!-- Values for Bluetooth Audio Codec selection preference. -->
@@ -164,6 +170,8 @@
<item>2</item>
<item>3</item>
<item>4</item>
+ <item>5</item>
+ <item>6</item>
</string-array>
<!-- Summaries for Bluetooth Audio Codec selection preference. [CHAR LIMIT=50]-->
@@ -174,6 +182,8 @@
<item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx">aptX™</xliff:g> audio</item>
<item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx_hd">aptX™ HD</xliff:g> audio</item>
<item>LDAC</item>
+ <item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx_adaptive">aptX™ Adaptive</xliff:g> audio</item>
+ <item><xliff:g id="qualcomm">Qualcomm®</xliff:g> <xliff:g id="aptx_twsp">aptX™ TWS+</xliff:g> audio</item>
</string-array>
<!-- Titles for Bluetooth Audio Codec Sample Rate selection preference. [CHAR LIMIT=50] -->
diff --git a/packages/SettingsLib/res/values/config_qti.xml b/packages/SettingsLib/res/values/config_qti.xml
new file mode 100644
index 000000000000..ff999e09ce91
--- /dev/null
+++ b/packages/SettingsLib/res/values/config_qti.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<resources>
+ <bool name="kg_hide_emgcy_btn_when_oos">false</bool>
+ <bool name="config_showEmergencyButton">false</bool>
+ <bool name="config_show_customize_carrier_name">false</bool>
+ <bool name="config_showRsrpSignalLevelforLTE">false</bool>
+ <bool name="config_alwaysShowTypeIcon">false</bool>
+ <bool name="config_hideNoInternetState">false</bool>
+ <bool name="config_display_volte">false</bool>
+ <bool name="config_display_vowifi">false</bool>
+</resources>
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index 6b840bd7901d..57a3177c32e7 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -36,6 +36,8 @@
<string name="wifi_security_short_eap_wpa" translatable="false">WPA-EAP</string>
<!-- Do not translate. Concise terminology for wifi with WPA2/WPA3 802.1x EAP security -->
<string name="wifi_security_short_eap_wpa2_wpa3" translatable="false">RSN-EAP</string>
+ <!-- Do not translate. Concise terminology for wifi with DPP security -->
+ <string name="wifi_security_short_dpp" translatable="false">DPP</string>
<!-- Do not translate. Concise terminology for wifi with WPA3 security -->
<string name="wifi_security_short_sae" translatable="false">WPA3</string>
<!-- Do not translate. Concise terminology for wifi with WPA2/WPA3 transition security -->
@@ -72,6 +74,8 @@
<string name="wifi_security_eap_wpa3" translatable="false">WPA3-Enterprise</string>
<!-- Do not translate. Concise terminology for Passpoint network -->
<string name="wifi_security_passpoint" translatable="false">Passpoint</string>
+ <!-- Do not translate. Concise terminology for DPP network -->
+ <string name="wifi_security_dpp" translatable="false">DPP</string>
<!-- Do not translate. Terminology for wifi with WPA3 security -->
<string name="wifi_security_sae" translatable="false">WPA3-Personal</string>
<!-- Do not translate. Terminology for wifi with WPA2/WPA3 Transition mode security -->
@@ -234,6 +238,8 @@
<string name="bluetooth_profile_headset">Phone calls</string>
<!-- Bluetooth settings. The user-visible string that is used whenever referring to the OPP profile. -->
<string name="bluetooth_profile_opp">File transfer</string>
+ <!-- Bluetooth settings. The user-visible string that is used whenever referring to the Broadcast profile. -->
+ <string name="bluetooth_profile_broadcast">Broadcast</string>
<!-- Bluetooth settings. The user-visible string that is used whenever referring to the HID profile. -->
<string name="bluetooth_profile_hid">Input device</string>
<!-- Bluetooth settings. The user-visible string that is used whenever referring to the PAN profile (accessing Internet through remote device). [CHAR LIMIT=40] -->
@@ -248,6 +254,11 @@
<string name="bluetooth_profile_map">Text Messages</string>
<!-- Bluetooth settings. The user-visible string that is used whenever referring to the SAP profile (sharing SIM card). -->
<string name="bluetooth_profile_sap">SIM Access</string>
+ <!-- Bluetooth settings. The user-visible string that is used whenever referring to the dun profile. -->
+ <string name="bluetooth_profile_dun">Dial-up Network Access</string>
+ <!-- Bluetooth settings. The user-visible string that is used
+ whenever referring to the vcp profile. -->
+ <string name="bluetooth_profile_vcp">Volume control</string>
<!-- Bluetooth settings. The user-visible string for the setting controlling whether to use a high-quality codec if the device supports it, along with the name of the codec (eg AAC, LDAC, aptX) -->
<string name="bluetooth_profile_a2dp_high_quality">HD audio: <xliff:g id="codec_name">%1$s</xliff:g></string>
@@ -278,6 +289,8 @@
<string name="bluetooth_pan_user_profile_summary_connected">Connected to device for internet access</string>
<!-- Bluetooth settings. Connection options screen. The summary for the checkbox preference when PAN is connected (NAP role). [CHAR LIMIT=25]-->
<string name="bluetooth_pan_nap_profile_summary_connected">Sharing local internet connection with device</string>
+ <!-- Bluetooth settings. Connection options screen. The summary for the DUN checkbox preference when DUN is connected. -->
+ <string name="bluetooth_dun_profile_summary_connected">Connected to Dun Server</string>
<!-- Bluetooth settings. Connection options screen. The summary
for the PAN checkbox preference that describes how checking it
@@ -299,6 +312,8 @@
<string name="bluetooth_hid_profile_summary_use_for">Use for input</string>
<!-- Bluetooth settings. Connection options screen. The summary for the Hearing Aid checkbox preference that describes how checking it will set the Hearing Aid profile as preferred. -->
<string name="bluetooth_hearing_aid_profile_summary_use_for">Use for Hearing Aids</string>
+ <!-- Bluetooth settings. Connection options screen. The summary for the dun checkbox preference that describes how checking it will set the dun profile as preferred. -->
+ <string name="bluetooth_dun_profile_summary_use_for">Use for Dial-up Network access</string>
<!-- Button text for accepting an incoming pairing request. [CHAR LIMIT=20] -->
<string name="bluetooth_pairing_accept">Pair</string>
@@ -332,6 +347,9 @@
<!-- Message for telling the user the kind of BT device being displayed in list. [CHAR LIMIT=30 BACKUP_MESSAGE_ID=551146170554589119] -->
<string name="bluetooth_talkback_imaging">Imaging</string>
+ <!-- Message for telling the user the kind of BT device being displayed. [CHAR LIMIT=30] -->
+ <string name="bluetooth_talkback_group">Group Devices</string>
+
<!-- Message for telling the user the kind of BT device being displayed in list. [CHAR LIMIT=30 BACKUP_MESSAGE_ID=26580326066627664] -->
<string name="bluetooth_talkback_headphone">Headphone</string>
@@ -649,6 +667,8 @@
<!-- Setting Checkbox title whether to show options for wireless display certification -->
<string name="wifi_display_certification">Wireless display certification</string>
+ <!-- Setting Checkbox title whether to enable WiFi coverage extending feature. -->
+ <string name="wifi_coverage_extend">Enable Wi\u2011Fi Coverage Extend Feature</string>
<!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
<string name="wifi_verbose_logging">Enable Wi\u2011Fi Verbose Logging</string>
<!-- Setting Checkbox title whether to disable WiFi Scan Throttling. [CHAR LIMIT=40] -->
@@ -719,6 +739,9 @@
<!-- setting Checkbox summary whether to show options for wireless display certification -->
<string name="wifi_display_certification_summary">Show options for wireless display certification</string>
<!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR_LIMIT=NONE] -->
+ <!-- Setting Checkbox summary whether to enable WiFi coverage extending feature. -->
+ <string name="wifi_coverage_extend_summary">Enable extending Wi\u2011Fi coverage using Hotspot</string>
+ <!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR LIMIT=80] -->
<string name="wifi_verbose_logging_summary">Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker</string>
<!-- Setting Checkbox summary whether to disable Wifi scan throttling [CHAR LIMIT=NONE] -->
<string name="wifi_scan_throttling_summary">Reduces battery drain &amp; improves network performance</string>
diff --git a/packages/SettingsLib/res/values/strings_ba.xml b/packages/SettingsLib/res/values/strings_ba.xml
new file mode 100644
index 000000000000..34035048be1e
--- /dev/null
+++ b/packages/SettingsLib/res/values/strings_ba.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (c) 2020, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Bluetooth settings. The user-visible string that is used whenever
+ referring to BC profile. -->
+ <string name="bluetooth_profile_bc">BC Profile</string>
+ <!-- Bluetooth settings. Connection options screen.
+ The summary for the profile checkbox preference when BC is connected. -->
+ <string name="bluetooth_bc_profile_summary_connected">Connected to BA server
+ </string>
+ <!-- Bluetooth settings. Connection options screen.
+ The summary for the BC checkbox preference that describes how checking it
+ will set the BC profile as preferred. -->
+ <string name="bluetooth_bc_profile_summary_use_for">Use for BA</string>
+</resources>
diff --git a/packages/SettingsLib/res/values/strings_qti.xml b/packages/SettingsLib/res/values/strings_qti.xml
new file mode 100755
index 000000000000..a87f2ec3baca
--- /dev/null
+++ b/packages/SettingsLib/res/values/strings_qti.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <string-array name="origin_carrier_names"></string-array>
+
+ <string-array name="locale_carrier_names"></string-array>
+
+ <!-- config 2G/3G/4G RAT strings for carriers -->
+ <string name="config_rat_unknown" translatable="false">""</string>
+ <string name="config_rat_2g" translatable="false">2G</string>
+ <string name="config_rat_3g" translatable="false">3G</string>
+ <string name="config_rat_4g" translatable="false">4G</string>
+
+ <!-- Content description of the data connection type 5G Basic. [CHAR LIMIT=NONE] -->
+ <string name="data_connection_5g_basic" translate="false">5GBasic</string>
+
+ <!-- Content description of the data connection type 5G UWB. [CHAR LIMIT=NONE] -->
+ <string name="data_connection_5g_uwb" translate="false">5GUWB</string>
+
+ <!-- Content description of the data connection type 5G stand alone. [CHAR LIMIT=NONE] -->
+ <string name="data_connection_5g_sa" translate="false">5GSA</string>
+
+ <!--
+ The customization for last puk prompt
+ The format of array item:
+ MCCMNC:customized string
+ Example:
+ <string-array name="kg_wrong_puk_code_message_list">
+ <item>46000:SIM is unusable. Contact ...</item>
+ <item>46001:SIM is unusable. Contact ...</item>
+ </string-array>
+ -->
+ <string-array name="kg_wrong_puk_code_message_list"></string-array>
+
+</resources>
diff --git a/packages/SettingsLib/src/com/android/settingslib/Utils.java b/packages/SettingsLib/src/com/android/settingslib/Utils.java
index f637ff86e6d2..cdf0659712ea 100644
--- a/packages/SettingsLib/src/com/android/settingslib/Utils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/Utils.java
@@ -77,6 +77,30 @@ public class Utils {
R.drawable.ic_show_x_wifi_signal_4
};
+ static final int[] WIFI_4_PIE = {
+ com.android.internal.R.drawable.ic_wifi_4_signal_0,
+ com.android.internal.R.drawable.ic_wifi_4_signal_1,
+ com.android.internal.R.drawable.ic_wifi_4_signal_2,
+ com.android.internal.R.drawable.ic_wifi_4_signal_3,
+ com.android.internal.R.drawable.ic_wifi_4_signal_4
+ };
+
+ static final int[] WIFI_5_PIE = {
+ com.android.internal.R.drawable.ic_wifi_5_signal_0,
+ com.android.internal.R.drawable.ic_wifi_5_signal_1,
+ com.android.internal.R.drawable.ic_wifi_5_signal_2,
+ com.android.internal.R.drawable.ic_wifi_5_signal_3,
+ com.android.internal.R.drawable.ic_wifi_5_signal_4
+ };
+
+ static final int[] WIFI_6_PIE = {
+ com.android.internal.R.drawable.ic_wifi_6_signal_0,
+ com.android.internal.R.drawable.ic_wifi_6_signal_1,
+ com.android.internal.R.drawable.ic_wifi_6_signal_2,
+ com.android.internal.R.drawable.ic_wifi_6_signal_3,
+ com.android.internal.R.drawable.ic_wifi_6_signal_4
+ };
+
public static void updateLocationEnabled(Context context, boolean enabled, int userId,
int source) {
Settings.Secure.putIntForUser(
@@ -409,7 +433,7 @@ public class Utils {
* @throws IllegalArgumentException if an invalid RSSI level is given.
*/
public static int getWifiIconResource(int level) {
- return getWifiIconResource(false /* showX */, level);
+ return getWifiIconResource(false /* showX */, level, 0 /* standard */, false /* isReady */);
}
/**
@@ -421,10 +445,48 @@ public class Utils {
* @throws IllegalArgumentException if an invalid RSSI level is given.
*/
public static int getWifiIconResource(boolean showX, int level) {
+ return getWifiIconResource(showX, level, 0 /* standard */, false /* isReady */);
+ }
+
+ /**
+ * Returns the Wifi icon resource for a given RSSI level.
+ *
+ * @param level The number of bars to show (0-4)
+ * @throws IllegalArgumentException if an invalid RSSI level is given.
+ */
+ public static int getWifiIconResource(int level, int standard, boolean isReady) {
+ return getWifiIconResource(false /* showX */, level, standard, isReady);
+ }
+
+ /**
+ * Returns the Wifi icon resource for a given RSSI level.
+ *
+ * @param showX True if a connected Wi-Fi network has the problem which should show Pie+x
+ * signal icon to users.
+ * @param level The number of bars to show (0-4)
+ * @throws IllegalArgumentException if an invalid RSSI level is given.
+ */
+ public static int getWifiIconResource(boolean showX, int level, int standard, boolean isReady) {
if (level < 0 || level >= WIFI_PIE.length) {
throw new IllegalArgumentException("No Wifi icon found for level: " + level);
}
- return showX ? SHOW_X_WIFI_PIE[level] : WIFI_PIE[level];
+
+ if (showX) return SHOW_X_WIFI_PIE[level];
+
+ switch (standard) {
+ case 4:
+ return WIFI_4_PIE[level];
+ case 5:
+ if (isReady) {
+ return WIFI_6_PIE[level];
+ } else {
+ return WIFI_5_PIE[level];
+ }
+ case 6:
+ return WIFI_6_PIE[level];
+ default:
+ return WIFI_PIE[level];
+ }
}
public static int getDefaultStorageManagerDaysToRetain(Resources resources) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
index 3c7856048860..d768514b1ee0 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
@@ -39,6 +39,7 @@ import java.util.List;
public class A2dpProfile implements LocalBluetoothProfile {
private static final String TAG = "A2dpProfile";
+ private static boolean V = true;
private Context mContext;
@@ -218,6 +219,11 @@ public class A2dpProfile implements LocalBluetoothProfile {
}
public boolean supportsHighQualityAudio(BluetoothDevice device) {
+ if (V) Log.d(TAG, " execute supportsHighQualityAudio()");
+ if (mService == null) {
+ if (V) Log.d(TAG,"mService is null.");
+ return false;
+ }
BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
if (bluetoothDevice == null) {
return false;
@@ -227,6 +233,11 @@ public class A2dpProfile implements LocalBluetoothProfile {
}
public boolean isHighQualityAudioEnabled(BluetoothDevice device) {
+ if (V) Log.d(TAG, " execute isHighQualityAudioEnabled()");
+ if (mService == null) {
+ if (V) Log.d(TAG,"mService is null.");
+ return false;
+ }
BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
if (bluetoothDevice == null) {
return false;
@@ -252,14 +263,40 @@ public class A2dpProfile implements LocalBluetoothProfile {
}
}
- public void setHighQualityAudioEnabled(BluetoothDevice device, boolean enabled) {
+ public boolean isMandatoryCodec(BluetoothDevice device) {
+ if (V) Log.d(TAG, " execute isMandatoryCodec()");
+ if (mService == null) {
+ if (V) Log.d(TAG,"mService is null.");
+ return false;
+ }
BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
if (bluetoothDevice == null) {
- return;
+ return false;
+ }
+ BluetoothCodecConfig codecConfig = null;
+ if (mService.getCodecStatus(bluetoothDevice) != null) {
+ codecConfig = mService.getCodecStatus(bluetoothDevice).getCodecConfig();
}
+ if (codecConfig != null) {
+ return codecConfig.isMandatoryCodec();
+ } else {
+ return false;
+ }
+ }
+
+ public void setHighQualityAudioEnabled(BluetoothDevice device, boolean enabled) {
+ if (V) Log.d(TAG, " execute setHighQualityAudioEnabled()");
int prefValue = enabled
? BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED
: BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED;
+ if (mService == null) {
+ if (V) Log.d(TAG,"mService is null.");
+ return;
+ }
+ BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
+ if (bluetoothDevice == null) {
+ return;
+ }
mService.setOptionalCodecsEnabled(bluetoothDevice, prefValue);
if (getConnectionStatus(bluetoothDevice) != BluetoothProfile.STATE_CONNECTED) {
return;
@@ -272,6 +309,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
}
public String getHighQualityAudioOptionLabel(BluetoothDevice device) {
+ if (V) Log.d(TAG, " execute getHighQualityAudioOptionLabel()");
BluetoothDevice bluetoothDevice = (device != null) ? device : mService.getActiveDevice();
int unknownCodecId = R.string.bluetooth_profile_a2dp_high_quality_unknown_codec;
if (bluetoothDevice == null || !supportsHighQualityAudio(device)
@@ -281,7 +319,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
// We want to get the highest priority codec, since that's the one that will be used with
// this device, and see if it is high-quality (ie non-mandatory).
BluetoothCodecConfig[] selectable = null;
- if (mService.getCodecStatus(device) != null) {
+ if (mService != null && mService.getCodecStatus(device) != null) {
selectable = mService.getCodecStatus(device).getCodecsSelectableCapabilities();
// To get the highest priority, we sort in reverse.
Arrays.sort(selectable,
@@ -312,6 +350,12 @@ public class A2dpProfile implements LocalBluetoothProfile {
case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC:
index = 5;
break;
+ case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_ADAPTIVE:
+ index = 6;
+ break;
+ case BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_TWSP:
+ index = 7;
+ break;
}
if (index < 0) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
index 3152e65d5a36..7475685de281 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
@@ -16,6 +16,9 @@
package com.android.settingslib.bluetooth;
+import android.bluetooth.BluetoothCodecStatus;
+
+import java.util.UUID;
/**
* BluetoothCallback provides a callback interface for the settings
@@ -140,4 +143,59 @@ public interface BluetoothCallback {
*/
default void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {
}
+
+ /**
+ * Called when a2dp codec config is changed. It listens to
+ * {@link android.bluetooth.BluetoothA2dp#ACTION_CODEC_CONFIG_CHANGED}.
+ *
+ * @param cachedDevice Bluetooth device that changed
+ * @param codecStatus the current codec status of the a2dp profile
+ */
+ default void onA2dpCodecConfigChanged(CachedBluetoothDevice cachedDevice,
+ BluetoothCodecStatus codecStatus) {
+ }
+
+ /**
+ * Called when new device group has been identified with the bonded remote device
+ *
+ * @param cachedDevice Bluetooth device with which device group has been found.
+ * @param groupId Identifier of the device group.
+ * @param setPrimaryServiceUuid Primary service with which this Device Group
+ * is associated.
+ */
+ default void onNewGroupFound(CachedBluetoothDevice cachedDevice, int groupId,
+ UUID setPrimaryServiceUuid) {
+ }
+
+ /**
+ * Called when Group Discovery status has been changed.
+ *
+ * @param groupId Identifier of the coordinated set.
+ * @param status Status of the group discovery procedure.
+ * @param reason Reason for the change in status of discovery.
+ */
+ default void onGroupDiscoveryStatusChanged (int groupId, int status, int reason) {
+ }
+
+ /**
+ * Called when Broadcast state is changed. It listens to
+ * {@link android.bluetooth.BluetoothBroadcast#ACTION_BROADCAST_STATE_CHANGED}
+ *
+ * @param state the Bluetooth device connection state, the possible values are:
+ * {@link android.bluetooth.BluetoothBroadcast#STATE_DISABLED},
+ * {@link android.bluetooth.BluetoothBroadcast#STATE_ENABLING},
+ * {@link android.bluetooth.BluetoothBroadcast#STATE_ENABLED},
+ * {@link android.bluetooth.BluetoothBroadcast#STATE_DISABLING},
+ * {@link android.bluetooth.BluetoothBroadcast#STATE_STREAMING}
+ */
+ default void onBroadcastStateChanged(int state) {
+ }
+
+ /**
+ * Called when Broadcast key is changed. It listens to
+ * {@link android.bluetooth.BluetoothBroadcast#ACTION_BROADCAST_ENCRYPTION_KEY_GENERATED}
+ *
+ */
+ default void onBroadcastKeyGenerated() {
+ }
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
index 129aca4a689f..c75d059a3532 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
@@ -18,10 +18,12 @@ package com.android.settingslib.bluetooth;
import android.bluetooth.BluetoothA2dp;
import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothCodecStatus;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothHearingAid;
import android.bluetooth.BluetoothProfile;
+import android.bluetooth.BluetoothVcp;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -41,7 +43,9 @@ import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
-
+import java.util.UUID;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
/**
* BluetoothEventManager receives broadcasts and callbacks from the Bluetooth
* API and dispatches the event on the UI thread to the right class in the
@@ -61,6 +65,8 @@ public class BluetoothEventManager {
private final android.os.Handler mReceiverHandler;
private final UserHandle mUserHandle;
private final Context mContext;
+ private final String ACT_BROADCAST_SOURCE_INFO =
+ "android.bluetooth.BroadcastAudioSAManager.action.BROADCAST_SOURCE_INFO";
interface Handler {
void onReceive(Context context, Intent intent, BluetoothDevice device);
@@ -109,6 +115,8 @@ public class BluetoothEventManager {
addHandler(BluetoothDevice.ACTION_CLASS_CHANGED, new ClassChangedHandler());
addHandler(BluetoothDevice.ACTION_UUID, new UuidChangedHandler());
addHandler(BluetoothDevice.ACTION_BATTERY_LEVEL_CHANGED, new BatteryLevelChangedHandler());
+ addHandler(BluetoothHeadset.ACTION_HF_TWSP_BATTERY_STATE_CHANGED ,
+ new TwspBatteryLevelChangedHandler());
// Active device broadcasts
addHandler(BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED, new ActiveDeviceChangedHandler());
@@ -125,6 +133,33 @@ public class BluetoothEventManager {
// ACL connection changed broadcasts
addHandler(BluetoothDevice.ACTION_ACL_CONNECTED, new AclStateChangedHandler());
addHandler(BluetoothDevice.ACTION_ACL_DISCONNECTED, new AclStateChangedHandler());
+ addHandler(BluetoothA2dp.ACTION_CODEC_CONFIG_CHANGED, new A2dpCodecConfigChangedHandler());
+ Object sourceInfoHandler = null;
+ try {
+ Class<?> classSourceInfoHandler =
+ Class.forName("com.android.settingslib.bluetooth.BroadcastSourceInfoHandler");
+ Constructor ctor;
+ ctor = classSourceInfoHandler.getDeclaredConstructor(
+ new Class[] {CachedBluetoothDeviceManager.class});
+ sourceInfoHandler = ctor.newInstance(mDeviceManager);
+ } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
+ | InstantiationException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ if (sourceInfoHandler != null) {
+ Log.d(TAG, "adding SourceInfo Handler");
+ addHandler(ACT_BROADCAST_SOURCE_INFO,
+ (Handler)sourceInfoHandler);
+ }
+
+ // Broadcast broadcasts
+ addHandler("android.bluetooth.broadcast.profile.action.BROADCAST_STATE_CHANGED",
+ new BroadcastStateChangedHandler());
+ addHandler("android.bluetooth.broadcast.profile.action.BROADCAST_ENCRYPTION_KEY_GENERATED",
+ new BroadcastKeyGeneratedHandler());
+ // VCP state changed broadcasts
+ addHandler(BluetoothVcp.ACTION_CONNECTION_MODE_CHANGED, new VcpModeChangedHandler());
+ addHandler(BluetoothVcp.ACTION_VOLUME_CHANGED, new VcpVolumeChangedHandler());
registerAdapterIntentReceiver();
}
@@ -221,6 +256,18 @@ public class BluetoothEventManager {
}
}
+ private void dispatchBroadcastStateChanged(int state) {
+ for (BluetoothCallback callback : mCallbacks) {
+ callback.onBroadcastStateChanged(state);
+ }
+ }
+
+ private void dispatchBroadcastKeyGenerated() {
+ for (BluetoothCallback callback : mCallbacks) {
+ callback.onBroadcastKeyGenerated();
+ }
+ }
+
@VisibleForTesting
void dispatchActiveDeviceChanged(CachedBluetoothDevice activeDevice,
int bluetoothProfile) {
@@ -239,6 +286,33 @@ public class BluetoothEventManager {
}
}
+ private void dispatchA2dpCodecConfigChanged(CachedBluetoothDevice cachedDevice,
+ BluetoothCodecStatus codecStatus) {
+ for (BluetoothCallback callback : mCallbacks) {
+ callback.onA2dpCodecConfigChanged(cachedDevice, codecStatus);
+ }
+ }
+
+ protected void dispatchNewGroupFound(
+ CachedBluetoothDevice cachedDevice, int groupId, UUID setPrimaryServiceUuid) {
+ synchronized(mCallbacks) {
+ updateCacheDeviceInfo(groupId, cachedDevice);
+ for (BluetoothCallback callback : mCallbacks) {
+ callback.onNewGroupFound(cachedDevice, groupId,
+ setPrimaryServiceUuid);
+ }
+ }
+ }
+
+ protected void dispatchGroupDiscoveryStatusChanged(int groupId,
+ int status, int reason) {
+ synchronized(mCallbacks) {
+ for (BluetoothCallback callback : mCallbacks) {
+ callback.onGroupDiscoveryStatusChanged(groupId, status, reason);
+ }
+ }
+ }
+
@VisibleForTesting
void addHandler(String action, Handler handler) {
mHandlerMap.put(action, handler);
@@ -321,6 +395,22 @@ public class BluetoothEventManager {
}
}
+ private class BroadcastStateChangedHandler implements Handler {
+ //@Override
+ public void onReceive(Context context, Intent intent, BluetoothDevice device) {
+ int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE,
+ BluetoothAdapter.ERROR);
+ dispatchBroadcastStateChanged(state);
+ }
+ }
+
+ private class BroadcastKeyGeneratedHandler implements Handler {
+ //@Override
+ public void onReceive(Context context, Intent intent, BluetoothDevice device) {
+ dispatchBroadcastKeyGenerated();
+ }
+ }
+
private class NameChangedHandler implements Handler {
public void onReceive(Context context, Intent intent,
BluetoothDevice device) {
@@ -343,6 +433,21 @@ public class BluetoothEventManager {
cachedDevice = mDeviceManager.addDevice(device);
}
+ if(bondState == BluetoothDevice.BOND_BONDED) {
+ int groupId = intent.getIntExtra(BluetoothDevice.EXTRA_GROUP_ID,
+ BluetoothDevice.ERROR);
+ if (groupId != BluetoothDevice.ERROR && groupId >= 0) {
+ updateCacheDeviceInfo(groupId, cachedDevice);
+ } else if (intent.getBooleanExtra(BluetoothDevice.EXTRA_IS_PRIVATE_ADDRESS,
+ false)) {
+ /*
+ * Do not show private address in UI, just ignore assuming remaining
+ * events will receive on public address (connection, disconnection)
+ */
+ Log.d(TAG, "Hide showing private address in UI " + cachedDevice);
+ updateIgnoreDeviceFlag(cachedDevice);
+ }
+ }
for (BluetoothCallback callback : mCallbacks) {
callback.onDeviceBondStateChanged(cachedDevice, bondState);
}
@@ -424,6 +529,24 @@ public class BluetoothEventManager {
}
}
+ private class TwspBatteryLevelChangedHandler implements Handler {
+ public void onReceive(Context context, Intent intent,
+ BluetoothDevice device) {
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice != null) {
+ cachedDevice.mTwspBatteryState =
+ intent.getIntExtra(
+ BluetoothHeadset.EXTRA_HF_TWSP_BATTERY_STATE, -1);
+ cachedDevice.mTwspBatteryLevel =
+ intent.getIntExtra(
+ BluetoothHeadset.EXTRA_HF_TWSP_BATTERY_LEVEL, -1);
+ Log.i(TAG, cachedDevice + ": mTwspBatteryState: " + cachedDevice.mTwspBatteryState
+ + "mTwspBatteryLevel: " + cachedDevice.mTwspBatteryLevel);
+ cachedDevice.refresh();
+ }
+ }
+ }
+
private class ActiveDeviceChangedHandler implements Handler {
@Override
public void onReceive(Context context, Intent intent, BluetoothDevice device) {
@@ -500,4 +623,73 @@ public class BluetoothEventManager {
dispatchAudioModeChanged();
}
}
+
+ private class A2dpCodecConfigChangedHandler implements Handler {
+
+ @Override
+ public void onReceive(Context context, Intent intent, BluetoothDevice device) {
+ final String action = intent.getAction();
+ if (action == null) {
+ Log.w(TAG, "A2dpCodecConfigChangedHandler: action is null");
+ return;
+ }
+
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice == null) {
+ Log.w(TAG, "A2dpCodecConfigChangedHandler: device is null");
+ return;
+ }
+
+ BluetoothCodecStatus codecStatus = intent.getParcelableExtra(
+ BluetoothCodecStatus.EXTRA_CODEC_STATUS);
+ Log.d(TAG, "A2dpCodecConfigChangedHandler: device=" + device +
+ ", codecStatus=" + codecStatus);
+ dispatchA2dpCodecConfigChanged(cachedDevice, codecStatus);
+ }
+ }
+
+ private class VcpModeChangedHandler implements Handler {
+ @Override
+ public void onReceive(Context context, Intent intent, BluetoothDevice device) {
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ int mode = intent.getIntExtra(BluetoothVcp.EXTRA_MODE, 0);
+ if (cachedDevice != null) {
+ Log.i(TAG, cachedDevice + " Vcp connection mode change to " + mode);
+ cachedDevice.refresh();
+ }
+ }
+ }
+
+ private class VcpVolumeChangedHandler implements Handler {
+ @Override
+ public void onReceive(Context context, Intent intent, BluetoothDevice device) {
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice != null) {
+ Log.i(TAG, cachedDevice + " Vcp volume change");
+ cachedDevice.refresh();
+ }
+ }
+ }
+
+ private void updateCacheDeviceInfo(int groupId, CachedBluetoothDevice cachedDevice) {
+ BluetoothDevice device = cachedDevice.getDevice();
+ boolean isGroup = cachedDevice.isGroupDevice();
+ Log.d(TAG, "updateCacheDeviceInfo groupId " + groupId
+ + ", cachedDevice :" + cachedDevice + ", name :" + cachedDevice.getName()
+ +" isGroup :" + isGroup + " groupId " + cachedDevice.getGroupId());
+ if (isGroup) {
+ if (groupId != cachedDevice.getGroupId()) {
+ Log.d(TAG, "groupId mismatch ignore" + cachedDevice.getGroupId());
+ return;
+ }
+ Log.d(TAG, "updateCacheDeviceInfo update ignored ");
+ } else {
+ cachedDevice.setDeviceType(groupId);
+ }
+ }
+
+ private void updateIgnoreDeviceFlag(CachedBluetoothDevice cachedDevice) {
+ cachedDevice.setDeviceType(CachedBluetoothDevice.PRIVATE_ADDR);
+ }
+
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
index 253629c8d128..e86c8402d517 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
@@ -100,6 +100,12 @@ public class BluetoothUtils {
default:
// unrecognized device class; continue
}
+ int tmpBtClass = btClass.getClassOfDevice() & BluetoothClass.Service.GROUP;
+ if (tmpBtClass == BluetoothClass.Service.GROUP) {
+ return new Pair<>(
+ getBluetoothDrawable(context, R.drawable.ic_adv_audio),
+ context.getString(R.string.bluetooth_talkback_group));
+ }
}
List<LocalBluetoothProfile> profiles = cachedDevice.getProfiles();
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 7beb82457e18..90642768109e 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -39,6 +39,7 @@ import android.util.Log;
import android.util.LruCache;
import android.util.Pair;
+import android.os.SystemProperties;
import androidx.annotation.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
@@ -51,6 +52,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
/**
* CachedBluetoothDevice represents a remote Bluetooth device. It contains
@@ -67,6 +71,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
private static final long MAX_HEARING_AIDS_DELAY_FOR_AUTO_CONNECT = 15000;
private static final long MAX_HOGP_DELAY_FOR_AUTO_CONNECT = 30000;
private static final long MAX_MEDIA_PROFILE_CONNECT_DELAY = 60000;
+ private static final boolean mIsTwsConnectEnabled = false;
private final Context mContext;
private final BluetoothAdapter mLocalAdapter;
@@ -90,6 +95,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
private final Collection<Callback> mCallbacks = new CopyOnWriteArrayList<>();
+ public int mTwspBatteryState;
+ public int mTwspBatteryLevel;
/**
* Last time a bt profile auto-connect was attempted.
* If an ACTION_UUID intent comes in within
@@ -112,6 +119,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
@VisibleForTesting
LruCache<String, BitmapDrawable> mDrawableCache;
+ private int mGroupId = -1;
+
+ private boolean mIsGroupDevice = false;
+
+ private boolean mIsIgnore = false;
+
+ private final int UNKNOWN = -1, BREDR = 100, GROUPID_START = 0, GROUPID_END = 15;
+ private int mType = UNKNOWN;
+ static final int PRIVATE_ADDR = 101;
+
+
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
@@ -143,6 +161,20 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
fillData();
mHiSyncId = BluetoothHearingAid.HI_SYNC_ID_INVALID;
initDrawableCache();
+ mTwspBatteryState = -1;
+ mTwspBatteryLevel = -1;
+ }
+
+ CachedBluetoothDevice(CachedBluetoothDevice cachedDevice) {
+ mContext = cachedDevice.mContext;
+ mLocalAdapter = BluetoothAdapter.getDefaultAdapter();
+ mProfileManager = cachedDevice.mProfileManager;
+ mDevice = cachedDevice.mDevice;
+ fillData();
+ mHiSyncId = BluetoothHearingAid.HI_SYNC_ID_INVALID;
+ initDrawableCache();
+ mTwspBatteryState = -1;
+ mTwspBatteryLevel = -1;
}
private void initDrawableCache() {
@@ -157,6 +189,22 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
};
}
+ /* Gets Device for seondary TWS device
+ * @param mDevice Primary TWS device to get secondary
+ * @return Description of the device
+ */
+
+ private BluetoothDevice getTwsPeerDevice() {
+ BluetoothAdapter bluetoothAdapter;
+ BluetoothDevice peerDevice = null;
+ if (mDevice.isTwsPlusDevice()) {
+ bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ String peerAddress = mDevice.getTwsPlusPeerAddress();
+ peerDevice = bluetoothAdapter.getRemoteDevice(peerAddress);
+ }
+ return peerDevice;
+ }
+
/**
* Describes the current device and profile for logging.
*
@@ -239,6 +287,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
mProfiles.remove(profile);
mRemovedProfiles.add(profile);
mLocalNapRoleConnected = false;
+ } else if (profile instanceof HeadsetProfile
+ && newProfileState == BluetoothProfile.STATE_DISCONNECTED) {
+ mTwspBatteryState = -1;
+ mTwspBatteryLevel = -1;
}
}
@@ -306,6 +358,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
}
mConnectAttempted = SystemClock.elapsedRealtime();
+ Log.d(TAG, "connect: mConnectAttempted = " + mConnectAttempted);
connectAllEnabledProfiles();
}
@@ -341,6 +394,13 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
Log.d(TAG, "No profiles. Maybe we will connect later for device " + mDevice);
return;
}
+ // BondingInitiatedLocally flag should be reset in onBondingStateChanged
+ // But Settings executing onBondingStateChanged twice and its lead to auto connection
+ // failure. this flag will be moved from here once settings issue fixed.
+ if (mDevice.isBondingInitiatedLocally()) {
+ Log.w(TAG, "reset BondingInitiatedLocally flag");
+ mDevice.setBondingInitiatedLocally(false);
+ }
mLocalAdapter.connectAllEnabledProfiles(mDevice);
}
@@ -402,6 +462,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
if (state != BluetoothDevice.BOND_NONE) {
final BluetoothDevice dev = mDevice;
+ if (mDevice.isTwsPlusDevice()) {
+ BluetoothDevice peerDevice = getTwsPeerDevice();
+ if (peerDevice != null) {
+ final boolean peersuccessful = peerDevice.removeBond();
+ if (peersuccessful) {
+ if (BluetoothUtils.D) {
+ Log.d(TAG, "Command sent successfully:REMOVE_BOND " + peerDevice.getName());
+ }
+ }
+ }
+ }
if (dev != null) {
mUnpairing = true;
final boolean successful = dev.removeBond();
@@ -745,8 +816,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
refresh();
- if (bondState == BluetoothDevice.BOND_BONDED && mDevice.isBondingInitiatedLocally()) {
- connect();
+ if (bondState == BluetoothDevice.BOND_BONDED) {
+ boolean mIsBondingInitiatedLocally = mDevice.isBondingInitiatedLocally();
+ Log.w(TAG, "mIsBondingInitiatedLocally" + mIsBondingInitiatedLocally);
+ if (mIsTwsConnectEnabled) {
+ Log.d(TAG, "Initiating connection to" + mDevice);
+ if (mIsBondingInitiatedLocally || mDevice.isTwsPlusDevice()) {
+ connect();
+ }
+ } else if (mIsBondingInitiatedLocally) {
+ connect();
+ }
}
}
@@ -758,13 +838,49 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
return new ArrayList<>(mProfiles);
}
+ public boolean isBASeeker() {
+ if (mDevice == null) {
+ Log.e(TAG, "isBASeeker: mDevice is null");
+ return false;
+ }
+ boolean ret = false;
+ Class<?> bCProfileClass = null;
+ String BC_PROFILE_CLASS = "com.android.settingslib.bluetooth.BCProfile";
+ Method baSeeker;
+ try {
+ bCProfileClass = Class.forName(BC_PROFILE_CLASS);
+ baSeeker = bCProfileClass.getDeclaredMethod("isBASeeker", BluetoothDevice.class);
+ ret = (boolean)baSeeker.invoke(null, mDevice);
+ } catch (ClassNotFoundException | NoSuchMethodException
+ | IllegalAccessException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
public List<LocalBluetoothProfile> getConnectableProfiles() {
List<LocalBluetoothProfile> connectableProfiles =
new ArrayList<LocalBluetoothProfile>();
+ Class<?> bCProfileClass = null;
+ String BC_PROFILE_CLASS = "com.android.settingslib.bluetooth.BCProfile";
+ try {
+ bCProfileClass = Class.forName(BC_PROFILE_CLASS);
+ } catch (ClassNotFoundException ex) {
+ Log.e(TAG, "no BCProfileClass: exists");
+ bCProfileClass = null;
+ }
synchronized (mProfileLock) {
for (LocalBluetoothProfile profile : mProfiles) {
- if (profile.accessProfileEnabled()) {
- connectableProfiles.add(profile);
+ if (bCProfileClass != null && bCProfileClass.isInstance(profile)) {
+ if (isBASeeker()) {
+ connectableProfiles.add(profile);
+ } else {
+ Log.d(TAG, "BC profile is not enabled for" + mDevice);
+ }
+ } else {
+ if (profile.accessProfileEnabled()) {
+ connectableProfiles.add(profile);
+ }
}
}
}
@@ -981,11 +1097,28 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
// BluetoothDevice.BATTERY_LEVEL_BLUETOOTH_OFF, or BluetoothDevice.BATTERY_LEVEL_UNKNOWN,
// any other value should be a framework bug. Thus assume here that if value is greater
// than BluetoothDevice.BATTERY_LEVEL_UNKNOWN, it must be valid
- final int batteryLevel = getBatteryLevel();
- if (batteryLevel > BluetoothDevice.BATTERY_LEVEL_UNKNOWN) {
- // TODO: name com.android.settingslib.bluetooth.Utils something different
- batteryLevelPercentageString =
+
+ if (mDevice.isTwsPlusDevice() && mTwspBatteryState != -1 &&
+ mTwspBatteryLevel != -1) {
+ String s = "TWSP: ";
+ String chargingState;
+ if (mTwspBatteryState == 1) {
+ chargingState = "Charging, ";
+ } else {
+ chargingState = "Discharging, ";
+ }
+ s = s.concat (chargingState);
+ s = s.concat(
+ com.android.settingslib.Utils.formatPercentage(mTwspBatteryLevel));
+ batteryLevelPercentageString = s;
+ Log.i(TAG, "UI string" + batteryLevelPercentageString);
+ } else {
+ final int batteryLevel = getBatteryLevel();
+ if (batteryLevel > BluetoothDevice.BATTERY_LEVEL_UNKNOWN) {
+ // TODO: name com.android.settingslib.bluetooth.Utils something different
+ batteryLevelPercentageString =
com.android.settingslib.Utils.formatPercentage(batteryLevel);
+ }
}
int stringRes = R.string.bluetooth_pairing;
@@ -1167,8 +1300,16 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
*/
public boolean isConnectedA2dpDevice() {
A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile();
- return a2dpProfile != null && a2dpProfile.getConnectionStatus(mDevice) ==
+ A2dpSinkProfile a2dpSinkProfile = mProfileManager.getA2dpSinkProfile();
+ Log.i(TAG, "a2dpProfile :" + a2dpProfile + " a2dpSinkProfile :" + a2dpSinkProfile);
+ if (a2dpProfile != null) {
+ return a2dpProfile.getConnectionStatus(mDevice) ==
+ BluetoothProfile.STATE_CONNECTED;
+ } else if (a2dpSinkProfile != null) {
+ return a2dpSinkProfile.getConnectionStatus(mDevice) ==
BluetoothProfile.STATE_CONNECTED;
+ }
+ return false;
}
/**
@@ -1246,6 +1387,55 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
mDrawableCache.evictAll();
}
+ public int getGroupId(){
+ return mGroupId;
+ }
+
+ public boolean isGroupDevice() {
+ return mIsGroupDevice;
+ }
+
+ public boolean isPrivateAddr() {
+ return mIsIgnore;
+ }
+
+ public void setDeviceType(int deviceType) {
+ if (deviceType!= mType) {
+ // Log.d(TAG, "setDeviceType deviceType " + deviceType + " type " + mType);
+ mType = deviceType;
+ if (mType == UNKNOWN || mType == BREDR) {
+ mIsGroupDevice = false;
+ mGroupId = UNKNOWN;
+ mIsIgnore = false;
+ } else if (mType == PRIVATE_ADDR) {
+ mIsGroupDevice = false;
+ mGroupId = UNKNOWN;
+ mIsIgnore = true;
+ } else if (mType >= GROUPID_START && mType <= GROUPID_END ) {
+ mGroupId = mType;
+ mIsIgnore = false;
+ mIsGroupDevice = true;
+ } else {
+ Log.e(TAG, "setDeviceType error type " + mType);
+ }
+ }
+ /* Log.d(TAG, "setDeviceType mType " + mType + " mIsGroupDevice " + mIsGroupDevice
+ + " mGroupId " + mGroupId + " mIsIgnore " + mIsIgnore
+ + " name " + getName() + " addr " + getAddress()); */
+ }
+
+ public boolean isTypeUnKnown() {
+ if (mType == UNKNOWN) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public int getmType() {
+ return mType;
+ }
+
boolean getUnpairing() {
return mUnpairing;
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java
index cca9cfac2d22..ab6d5121779b 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java
@@ -194,6 +194,13 @@ public class CachedBluetoothDeviceManager {
}
}
+ public synchronized void clearAllDevices() {
+ for (int i = mCachedDevices.size() - 1; i >= 0; i--) {
+ CachedBluetoothDevice cachedDevice = mCachedDevices.get(i);
+ mCachedDevices.remove(i);
+ }
+ }
+
public synchronized void onScanningStateChanged(boolean started) {
if (!started) return;
// If starting a new scan, clear old visibility
@@ -224,6 +231,9 @@ public class CachedBluetoothDeviceManager {
cachedDevice.setJustDiscovered(false);
mCachedDevices.remove(i);
}
+ //Clear if there any Tws battery info on BT turning OFF
+ cachedDevice.mTwspBatteryState = -1;
+ cachedDevice.mTwspBatteryLevel = -1;
}
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/DeviceGroupClientProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/DeviceGroupClientProfile.java
new file mode 100644
index 000000000000..5a3f33a7c433
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/DeviceGroupClientProfile.java
@@ -0,0 +1,377 @@
+/******************************************************************************
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package com.android.settingslib.bluetooth;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothClass;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothDeviceGroup;
+import android.bluetooth.BluetoothGroupCallback;
+import android.bluetooth.BluetoothProfile;
+import android.bluetooth.DeviceGroup;
+import android.content.Context;
+import android.app.ActivityThread;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.Log;
+
+import com.android.settingslib.R;
+
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * DeviceGroupClientProfile handles group operations required in client Role.
+ */
+public class DeviceGroupClientProfile implements LocalBluetoothProfile {
+ private static final String TAG = "DeviceGroupClientProfile";
+
+ private BluetoothDeviceGroup mService;
+ private boolean mIsProfileReady;
+
+ private final CachedBluetoothDeviceManager mDeviceManager;
+ private final LocalBluetoothProfileManager mProfileManager;
+
+ static final String NAME = "DeviceGroup Client";
+ private static final String GROUP_APP = "com.android.settings";
+ private String mCallingPackage;
+
+ // Order of this profile in device profiles list
+ private static final int ORDINAL = 3;
+
+ DeviceGroupClientProfile(Context context,
+ CachedBluetoothDeviceManager deviceManager,
+ LocalBluetoothProfileManager profileManager) {
+ mDeviceManager = deviceManager;
+ mProfileManager = profileManager;
+ mCallingPackage = ActivityThread.currentOpPackageName();
+ BluetoothAdapter.getDefaultAdapter()
+ .getProfileProxy(context, new GroupClientServiceListener(),
+ BluetoothProfile.GROUP_CLIENT);
+ }
+
+ // These callbacks run on the main thread.
+ private final class GroupClientServiceListener
+ implements BluetoothProfile.ServiceListener {
+
+ public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ mService = (BluetoothDeviceGroup) proxy;
+ mIsProfileReady = true;
+ Log.d(TAG, "onServiceConnected: mCallingPackage = " + mCallingPackage);
+ // register Group Client App
+ if (GROUP_APP.equals(mCallingPackage)) {
+ mService.registerGroupClientApp(mGroupCallback,
+ new Handler(Looper.getMainLooper()));
+ }
+ }
+
+ public void onServiceDisconnected(int profile) {
+ mIsProfileReady=false;
+ }
+ }
+
+ private final BluetoothGroupCallback mGroupCallback = new BluetoothGroupCallback() {
+
+ @Override
+ public void onNewGroupFound (int groupId, BluetoothDevice device, UUID uuid) {
+ Log.d(TAG, "onNewGroupFound()");
+
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice == null) {
+ cachedDevice = mDeviceManager.addDevice(device);
+ }
+
+ mProfileManager.mEventManager.dispatchNewGroupFound(
+ cachedDevice, groupId, uuid);
+ Log.d(TAG, "Start Group Discovery for Audio capable device");
+ //if (device.isAdvAudioDevice())
+ mService.startGroupDiscovery(groupId);
+ }
+
+ @Override
+ public void onGroupDiscoveryStatusChanged (int groupId,
+ int status, int reason) {
+ Log.d(TAG, "onGroupDiscoveryStatusChanged()");
+
+ mProfileManager.mEventManager.dispatchGroupDiscoveryStatusChanged(
+ groupId, status, reason);
+ }
+
+ };
+
+ public boolean connectGroup (int groupId) {
+ Log.d(TAG, "connectGroup(): groupId = " + groupId);
+ boolean isTriggered = false;
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "connectGroup: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return false;
+ }
+
+ DeviceGroup mGroup = mService.getGroup(groupId);
+
+ if (mGroup == null || mGroup.getDeviceGroupMembers().size() == 0) {
+ Log.e(TAG, "Requested device group not found");
+ return false;
+ }
+
+ for (BluetoothDevice device: mGroup.getDeviceGroupMembers()) {
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice == null) {
+ Log.w(TAG, "CachedBluetoothDevice not found for device: " + device);
+ continue;
+ }
+
+ if (!cachedDevice.isConnected()) {
+ cachedDevice.connect(true);
+ isTriggered = true;
+ }
+ }
+ return isTriggered;
+ }
+
+ public boolean disconnectGroup (int groupId) {
+ Log.d(TAG, "disconnectGroup(): groupId = " + groupId);
+ boolean isTriggered = false;
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "connectGroup: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return false;
+ }
+
+ DeviceGroup mGroup = mService.getGroup(groupId);
+
+ if (mGroup == null || mGroup.getDeviceGroupMembers().size() == 0) {
+ Log.e(TAG, "Requested device group is not found");
+ return false;
+ }
+
+ for (BluetoothDevice device: mGroup.getDeviceGroupMembers()) {
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice == null) {
+ Log.w(TAG, "CachedBluetoothDevice not found for device: " + device);
+ continue;
+ }
+
+ if (cachedDevice.isConnected()) {
+ cachedDevice.disconnect();
+ isTriggered = true;
+ }
+ }
+
+ return isTriggered;
+ }
+
+ public boolean forgetGroup(int groupId) {
+ Log.d(TAG, "forgetGroup(): groupId = " + groupId);
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "forgetGroup: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return false;
+ }
+
+ DeviceGroup mGroup = mService.getGroup(groupId);
+ if (mGroup == null || mGroup.getDeviceGroupMembers().size() == 0) {
+ Log.e(TAG, "Requested device group is not found");
+ return false;
+ }
+
+ for (BluetoothDevice device: mGroup.getDeviceGroupMembers()) {
+ CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice == null) {
+ Log.w(TAG, "CachedBluetoothDevice not found for device: " + device);
+ continue;
+ }
+ cachedDevice.unpair();
+ }
+
+ return true;
+ }
+
+ public boolean startGroupDiscovery (int groupId) {
+ Log.d(TAG, "startGroupDiscovery: groupId = " + groupId);
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "startGroupDiscovery: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return false;
+ }
+
+ return mService.startGroupDiscovery(groupId);
+ }
+
+ public boolean stopGroupDiscovery (int groupId) {
+ Log.d(TAG, "stopGroupDiscovery: groupId = " + groupId);
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "stopGroupDiscovery: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return false;
+ }
+
+ return mService.stopGroupDiscovery(groupId);
+ }
+
+ public DeviceGroup getGroup (int groupId) {
+ Log.d(TAG, "getGroup: groupId = " + groupId);
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "getGroup: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return null;
+ }
+
+ return mService.getGroup(groupId, true);
+ }
+
+ public List<DeviceGroup> getDiscoveredGroups () {
+ Log.d(TAG, "getDiscoveredGroups");
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "getDiscoveredGroups: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return null;
+ }
+
+ return mService.getDiscoveredGroups(true);
+ }
+
+ public boolean isGroupDiscoveryInProgress (int groupId) {
+ Log.d(TAG, "isGroupDiscoveryInProgress: groupId = " + groupId);
+
+ if (mService == null) {
+ Log.e(TAG, "Not connected to Profile Service. Return.");
+ return false;
+ }
+
+ return mService.isGroupDiscoveryInProgress(groupId);
+ }
+
+ public int getRemoteDeviceGroupId (BluetoothDevice device) {
+ Log.d(TAG, "getRemoteDeviceGroupId: device = " + device);
+
+ if(mService == null || mIsProfileReady == false) {
+ Log.e(TAG, "getRemoteDeviceGroupId: mService = " + mService +
+ " mIsProfileReady = " + mIsProfileReady);
+ return BluetoothDeviceGroup.INVALID_GROUP_ID;
+ }
+
+ return mService.getRemoteDeviceGroupId(device, null, true);
+ }
+
+ public boolean isProfileReady() {
+ return mIsProfileReady;
+ }
+
+ @Override
+ public int getProfileId() {
+ return BluetoothProfile.GROUP_CLIENT;
+ }
+
+ public boolean accessProfileEnabled() {
+ return false;
+ }
+
+ public boolean isAutoConnectable() {
+ return false;
+ }
+
+ public void setPreferred(BluetoothDevice device, boolean preferred) {}
+
+ public int getPreferred(BluetoothDevice device) { return BluetoothProfile.PRIORITY_OFF;}
+
+ public boolean isPreferred(BluetoothDevice device) {return false;}
+
+ public boolean connect(BluetoothDevice device) { return false;}
+
+ public boolean disconnect(BluetoothDevice device) {return false;}
+
+ public int getConnectionStatus(BluetoothDevice device) {
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+
+ @Override
+ public boolean isEnabled(BluetoothDevice device) {
+ if (mService == null) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int getConnectionPolicy(BluetoothDevice device) {
+ return 0;
+ }
+
+ @Override
+ public boolean setEnabled(BluetoothDevice device, boolean enabled) {
+ boolean isEnabled = false;
+
+ return isEnabled;
+ }
+
+ public String toString() {
+ return NAME;
+ }
+
+ public int getOrdinal() {
+ return ORDINAL;
+ }
+
+ public int getNameResource(BluetoothDevice device) {
+ return 0;//R.string.bluetooth_profile_group_client;
+ }
+
+ public int getSummaryResourceForDevice(BluetoothDevice device) {
+ return 0;
+ }
+
+ public int getDrawableResource(BluetoothClass btClass) {
+ return 0;
+ }
+
+ protected void finalize() {
+ Log.d(TAG, "finalize()");
+ if (mService != null) {
+ try {
+ BluetoothAdapter.getDefaultAdapter()
+ .closeProfileProxy(BluetoothProfile.GROUP_CLIENT,
+ mService);
+ mService = null;
+ }catch (Throwable t) {
+ Log.w(TAG, "Error cleaning up BluetoothDeviceGroup proxy Object", t);
+ }
+ }
+ }
+}
+
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/DunServerProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/DunServerProfile.java
new file mode 100644
index 000000000000..e9a467812b8d
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/DunServerProfile.java
@@ -0,0 +1,168 @@
+/*
+*Copyright (c) 2013, 2015, The Linux Foundation. All rights reserved.
+*
+*Redistribution and use in source and binary forms, with or without
+*modification, are permitted provided that the following conditions are
+*met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of The Linux Foundation nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+*THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+*WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+*ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+*BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+*CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+*SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+*WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+*OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+*IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package com.android.settingslib.bluetooth;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothClass;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothDun;
+import android.bluetooth.BluetoothProfile;
+import android.content.Context;
+import android.util.Log;
+import java.util.HashMap;
+import java.util.List;
+
+import com.android.settingslib.R;
+
+/**
+ * DunServerProfile handles Bluetooth DUN server profile.
+ */
+public final class DunServerProfile implements LocalBluetoothProfile {
+ private static final String TAG = "DunServerProfile";
+ private static boolean V = true;
+
+ private BluetoothDun mService;
+ private boolean mIsProfileReady;
+
+ static final String NAME = "DUN Server";
+
+ // Order of this profile in device profiles list
+ private static final int ORDINAL = 11;
+
+ // These callbacks run on the main thread.
+ private final class DunServiceListener
+ implements BluetoothProfile.ServiceListener {
+
+ public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ if (V) Log.d(TAG,"Bluetooth service connected");
+ mService = (BluetoothDun) proxy;
+ mIsProfileReady = true;
+ }
+
+ public void onServiceDisconnected(int profile) {
+ if (V) Log.d(TAG,"Bluetooth service disconnected");
+ mIsProfileReady = false;
+ }
+ }
+
+ public boolean isProfileReady() {
+ return mIsProfileReady;
+ }
+
+ @Override
+ public int getProfileId() {
+ return BluetoothProfile.DUN;
+ }
+
+ DunServerProfile(Context context) {
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ adapter.getProfileProxy(context, new DunServiceListener(),
+ BluetoothProfile.DUN);
+ }
+
+ public boolean accessProfileEnabled() {
+ return true;
+ }
+
+ public boolean isAutoConnectable() {
+ return false;
+ }
+
+ public boolean connect(BluetoothDevice device) {
+ return false;
+ }
+
+ public boolean disconnect(BluetoothDevice device) {
+ if (mService == null) return false;
+ return mService.disconnect(device);
+ }
+
+ public int getConnectionStatus(BluetoothDevice device) {
+ if (mService == null) {
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+ return mService.getConnectionState(device);
+ }
+
+ public boolean isEnabled(BluetoothDevice device) {
+ return true;
+ }
+
+ public int getConnectionPolicy(BluetoothDevice device) {
+ return -1;
+ }
+
+ public boolean setEnabled(BluetoothDevice device, boolean enabled) {
+ // ignore: isEnabled is always true for DUN
+ return true;
+ }
+
+ public String toString() {
+ return NAME;
+ }
+
+ public int getOrdinal() {
+ return ORDINAL;
+ }
+
+ public int getNameResource(BluetoothDevice device) {
+ return R.string.bluetooth_profile_dun;
+ }
+
+ public int getSummaryResourceForDevice(BluetoothDevice device) {
+ int state = getConnectionStatus(device);
+ switch (state) {
+ case BluetoothProfile.STATE_DISCONNECTED:
+ return R.string.bluetooth_dun_profile_summary_use_for;
+
+ case BluetoothProfile.STATE_CONNECTED:
+ return R.string.bluetooth_dun_profile_summary_connected;
+ default:
+ return BluetoothUtils.getConnectionStateSummary(state);
+ }
+ }
+
+ public int getDrawableResource(BluetoothClass btClass) {
+ return com.android.internal.R.drawable.ic_bt_network_pan;
+ }
+
+ protected void finalize() {
+ if (V) Log.d(TAG, "finalize()");
+ if (mService != null) {
+ try {
+ BluetoothAdapter.getDefaultAdapter().closeProfileProxy
+ (BluetoothProfile.DUN, mService);
+ mService = null;
+ } catch (Throwable t) {
+ Log.w(TAG, "Error cleaning up DUN proxy", t);
+ }
+ }
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java
index 63cb38153d8d..0d745edb21be 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java
@@ -19,6 +19,7 @@ package com.android.settingslib.bluetooth;
import android.bluetooth.BluetoothA2dp;
import android.bluetooth.BluetoothA2dpSink;
import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDeviceGroup;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothHeadsetClient;
@@ -30,9 +31,11 @@ import android.bluetooth.BluetoothMapClient;
import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothPbap;
import android.bluetooth.BluetoothPbapClient;
+import android.bluetooth.BluetoothDun;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothSap;
import android.bluetooth.BluetoothUuid;
+import android.bluetooth.BluetoothVcp;
import android.content.Context;
import android.content.Intent;
import android.os.ParcelUuid;
@@ -43,12 +46,18 @@ import androidx.annotation.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.CollectionUtils;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
+import android.os.SystemProperties;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
/**
@@ -85,23 +94,30 @@ public class LocalBluetoothProfileManager {
private final Context mContext;
private final CachedBluetoothDeviceManager mDeviceManager;
- private final BluetoothEventManager mEventManager;
+ protected final BluetoothEventManager mEventManager;
private A2dpProfile mA2dpProfile;
private A2dpSinkProfile mA2dpSinkProfile;
+ private DeviceGroupClientProfile mGroupClientProfile;
private HeadsetProfile mHeadsetProfile;
private HfpClientProfile mHfpClientProfile;
private MapProfile mMapProfile;
private MapClientProfile mMapClientProfile;
private HidProfile mHidProfile;
+ private LocalBluetoothProfile mBCProfile;
private HidDeviceProfile mHidDeviceProfile;
private OppProfile mOppProfile;
private PanProfile mPanProfile;
private PbapClientProfile mPbapClientProfile;
private PbapServerProfile mPbapProfile;
+ private DunServerProfile mDunProfile;
private HearingAidProfile mHearingAidProfile;
private SapProfile mSapProfile;
+ private Object mBroadcastProfileObject;
+ private VcpProfile mVcpProfile;
+ private static final String BC_CONNECTION_STATE_CHANGED =
+ "android.bluetooth.bc.profile.action.CONNECTION_STATE_CHANGED";
/**
* Mapping from profile name, e.g. "HEADSET" to profile object.
*/
@@ -213,6 +229,23 @@ public class LocalBluetoothProfileManager {
addProfile(mPbapClientProfile, PbapClientProfile.NAME,
BluetoothPbapClient.ACTION_CONNECTION_STATE_CHANGED);
}
+ if (mBCProfile == null && supportedList.contains(BluetoothProfile.BC_PROFILE)) {
+ if (DEBUG) Log.d(TAG, "Adding local BC profile");
+ try {
+ Class<?> classBCProfile =
+ Class.forName("com.android.settingslib.bluetooth.BCProfile");
+ Constructor ctor;
+ ctor = classBCProfile.getDeclaredConstructor(new Class[] {Context.class,
+ CachedBluetoothDeviceManager.class,
+ LocalBluetoothProfileManager.class});
+ mBCProfile = (LocalBluetoothProfile)ctor.newInstance(mContext, mDeviceManager, this);
+ addProfile(mBCProfile, "BCProfile",
+ BC_CONNECTION_STATE_CHANGED);
+ } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
+ | InstantiationException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
if (mSapProfile == null && supportedList.contains(BluetoothProfile.SAP)) {
if (DEBUG) {
Log.d(TAG, "Adding local SAP profile");
@@ -220,6 +253,42 @@ public class LocalBluetoothProfileManager {
mSapProfile = new SapProfile(mContext, mDeviceManager, this);
addProfile(mSapProfile, SapProfile.NAME, BluetoothSap.ACTION_CONNECTION_STATE_CHANGED);
}
+ if (mBroadcastProfileObject == null && supportedList.contains(BluetoothProfile.BROADCAST)) {
+ if (DEBUG) {
+ Log.d(TAG, "Adding local Broadcast profile");
+ }
+ try {
+ //mBroadcastProfileObject = new BroadcastProfile(mContext);
+ Class<?> classBroadcastProfile =
+ Class.forName("com.android.settingslib.bluetooth.BroadcastProfile");
+ Constructor ctor;
+ ctor = classBroadcastProfile.getDeclaredConstructor(new Class[] {Context.class});
+ mBroadcastProfileObject = ctor.newInstance(mContext);
+ mProfileNameMap.put("Broadcast",
+ (LocalBluetoothProfile) mBroadcastProfileObject);
+ } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
+ | InstantiationException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ if (mDunProfile == null && supportedList.contains(BluetoothProfile.DUN)) {
+ if(DEBUG) Log.d(TAG, "Adding local DUN profile");
+ mDunProfile = new DunServerProfile(mContext);
+ addProfile(mDunProfile, DunServerProfile.NAME,
+ BluetoothDun.ACTION_CONNECTION_STATE_CHANGED);
+ }
+ if (mGroupClientProfile == null && supportedList.contains(BluetoothProfile.GROUP_CLIENT)) {
+ if (DEBUG) Log.d(TAG, "Adding local GROUP CLIENT profile");
+ mGroupClientProfile = new DeviceGroupClientProfile(mContext, mDeviceManager, this);
+ addProfile(mGroupClientProfile, mGroupClientProfile.NAME,
+ BluetoothDeviceGroup.ACTION_CONNECTION_STATE_CHANGED);
+ }
+ if (mVcpProfile == null && supportedList.contains(BluetoothProfile.VCP)) {
+ if(DEBUG) Log.d(TAG, "Adding local VCP profile");
+ mVcpProfile = new VcpProfile(mContext, mDeviceManager, this);
+ addProfile(mVcpProfile, VcpProfile.NAME,
+ BluetoothVcp.ACTION_CONNECTION_STATE_CHANGED);
+ }
mEventManager.registerProfileIntentReceiver();
}
@@ -269,6 +338,11 @@ public class LocalBluetoothProfileManager {
}
public void onReceive(Context context, Intent intent, BluetoothDevice device) {
+ if (device == null) {
+ Log.w(TAG, "StateChangedHandler receives state-change for invalid device");
+ return;
+ }
+
CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
if (cachedDevice == null) {
Log.w(TAG, "StateChangedHandler found new device: " + device);
@@ -445,6 +519,35 @@ public class LocalBluetoothProfileManager {
return mSapProfile;
}
+ private boolean isBASeeker(BluetoothDevice device) {
+ if (device == null) {
+ Log.e(TAG, "isBASeeker: device is null");
+ return false;
+ }
+ boolean ret = false;
+ Class<?> bcProfileClass = null;
+ String BC_PROFILE_CLASS = "com.android.settingslib.bluetooth.BCProfile";
+ Method baSeeker;
+ try {
+ bcProfileClass = Class.forName(BC_PROFILE_CLASS);
+ baSeeker = bcProfileClass.getDeclaredMethod("isBASeeker", BluetoothDevice.class);
+ ret = (boolean)baSeeker.invoke(null, device);
+ } catch (ClassNotFoundException | NoSuchMethodException
+ | IllegalAccessException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return ret;
+ }
+
+ public Object getBroadcastProfile() {
+ return mBroadcastProfileObject;
+ }
+
+ public LocalBluetoothProfile getBCProfile() {
+ Log.d(TAG, "getBCProfile returning: " + mBCProfile);
+ return mBCProfile;
+ }
+
@VisibleForTesting
HidProfile getHidProfile() {
return mHidProfile;
@@ -455,6 +558,14 @@ public class LocalBluetoothProfileManager {
return mHidDeviceProfile;
}
+ public DeviceGroupClientProfile getDeviceGroupClientProfile() {
+ return mGroupClientProfile;
+ }
+
+ public VcpProfile getVcpProfile() {
+ return mVcpProfile;
+ }
+
/**
* Fill in a list of LocalBluetoothProfile objects that are supported by
* the local device and the remote device.
@@ -484,7 +595,8 @@ public class LocalBluetoothProfileManager {
if ((ArrayUtils.contains(localUuids, BluetoothUuid.HSP_AG)
&& ArrayUtils.contains(uuids, BluetoothUuid.HSP))
|| (ArrayUtils.contains(localUuids, BluetoothUuid.HFP_AG)
- && ArrayUtils.contains(uuids, BluetoothUuid.HFP))) {
+ && ArrayUtils.contains(uuids, BluetoothUuid.HFP))
+ || (mHeadsetProfile.getConnectionStatus(device) == BluetoothProfile.STATE_CONNECTED)) {
profiles.add(mHeadsetProfile);
removedProfiles.remove(mHeadsetProfile);
}
@@ -497,11 +609,46 @@ public class LocalBluetoothProfileManager {
removedProfiles.remove(mHfpClientProfile);
}
- if (BluetoothUuid.containsAnyUuid(uuids, A2dpProfile.SINK_UUIDS) && mA2dpProfile != null) {
+ if ((mA2dpProfile != null)
+ && (BluetoothUuid.containsAnyUuid(uuids, A2dpProfile.SINK_UUIDS)
+ || (mA2dpProfile.getConnectionStatus(device) == BluetoothProfile.STATE_CONNECTED))) {
profiles.add(mA2dpProfile);
removedProfiles.remove(mA2dpProfile);
}
+ if (mHeadsetProfile != null) {
+ if (ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_VOICE_P_UUID)
+ || ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_VOICE_T_UUID)
+ || ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_HEARINGAID_UUID)
+ || (mHeadsetProfile.getConnectionStatus(device)
+ == BluetoothProfile.STATE_CONNECTED)) {
+ if (!profiles.contains(mHeadsetProfile)) {
+ profiles.add(mHeadsetProfile);
+ removedProfiles.remove(mHeadsetProfile);
+ if (DEBUG) Log.d(TAG, "Advance Audio Voice supported");
+ } else {
+ if (DEBUG) Log.d(TAG, "HeadsetProfile already added");
+ }
+ }
+ }
+
+ if ((mA2dpProfile != null)
+ && (ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_MEDIA_T_UUID)
+ || ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_HEARINGAID_UUID)
+ || ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_MEDIA_P_UUID)
+ || ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_MEDIA_G_UUID)
+ || ArrayUtils.contains(uuids, BluetoothUuid.ADVANCE_MEDIA_W_UUID)
+ || (mA2dpProfile.getConnectionStatus(device)
+ == BluetoothProfile.STATE_CONNECTED))) {
+ if (!profiles.contains(mA2dpProfile)) {
+ profiles.add(mA2dpProfile);
+ removedProfiles.remove(mA2dpProfile);
+ if (DEBUG) Log.d(TAG, "Advance Audio Media supported");
+ } else {
+ if (DEBUG) Log.d(TAG, "A2dpProfile already added");
+ }
+ }
+
if (BluetoothUuid.containsAnyUuid(uuids, A2dpSinkProfile.SRC_UUIDS)
&& mA2dpSinkProfile != null) {
profiles.add(mA2dpSinkProfile);
@@ -540,8 +687,8 @@ public class LocalBluetoothProfileManager {
mMapProfile.setEnabled(device, true);
}
- if ((mPbapProfile != null) &&
- (mPbapProfile.getConnectionStatus(device) == BluetoothProfile.STATE_CONNECTED)) {
+ if ((mPbapProfile != null)
+ && BluetoothUuid.containsAnyUuid(uuids, PbapServerProfile.PBAB_CLIENT_UUIDS) ) {
profiles.add(mPbapProfile);
removedProfiles.remove(mPbapProfile);
mPbapProfile.setEnabled(device, true);
@@ -569,6 +716,11 @@ public class LocalBluetoothProfileManager {
removedProfiles.remove(mSapProfile);
}
+ if (mBCProfile != null && isBASeeker(device)) {
+ profiles.add(mBCProfile);
+ removedProfiles.remove(mBCProfile);
+ if(DEBUG) Log.d(TAG, "BC profile added");
+ }
if (DEBUG) {
Log.d(TAG,"New Profiles" + profiles.toString());
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/VcpProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/VcpProfile.java
new file mode 100644
index 000000000000..1ed9f27b4e82
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/VcpProfile.java
@@ -0,0 +1,213 @@
+/******************************************************************************
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package com.android.settingslib.bluetooth;
+
+import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_UNKNOWN;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothClass;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothVcp;
+import android.bluetooth.BluetoothProfile;
+import android.content.Context;
+import android.util.Log;
+
+import com.android.settingslib.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class VcpProfile implements LocalBluetoothProfile {
+ private static final String TAG = "VcpProfile";
+ private static boolean V = true;
+
+ private Context mContext;
+
+ private BluetoothVcp mService;
+ private boolean mIsProfileReady;
+
+ private final CachedBluetoothDeviceManager mDeviceManager;
+
+ static final String NAME = "VCP";
+ private final LocalBluetoothProfileManager mProfileManager;
+ private final BluetoothAdapter mBluetoothAdapter;
+
+ // Order of this profile in device profiles list
+ private static final int ORDINAL = 1;
+
+ // These callbacks run on the main thread.
+ private final class VcpServiceListener
+ implements BluetoothProfile.ServiceListener {
+
+ public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ mService = (BluetoothVcp) proxy;
+ Log.w(TAG, "Bluetooth service Connected");
+ mIsProfileReady=true;
+ mProfileManager.callServiceConnectedListeners();
+ }
+
+ public void onServiceDisconnected(int profile) {
+ Log.w(TAG, "Bluetooth service Disconnected");
+ mIsProfileReady=false;
+ }
+ }
+
+ public boolean isProfileReady() {
+ return mIsProfileReady;
+ }
+
+ @Override
+ public int getProfileId() {
+ return BluetoothProfile.VCP;
+ }
+
+ VcpProfile(Context context, CachedBluetoothDeviceManager deviceManager,
+ LocalBluetoothProfileManager profileManager) {
+ mContext = context;
+ mDeviceManager = deviceManager;
+ mProfileManager = profileManager;
+ mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ mBluetoothAdapter.getProfileProxy(context,
+ new VcpServiceListener(), BluetoothProfile.VCP);
+ }
+
+ public boolean accessProfileEnabled() {
+ return false;
+ }
+
+ public boolean isAutoConnectable() {
+ return false;
+ }
+
+ public int getConnectionStatus(BluetoothDevice device) {
+ if (mService == null) {
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+ return mService.getConnectionState(device);
+ }
+
+ public int getConnectionMode(BluetoothDevice device) {
+ if (mService == null) {
+ return BluetoothProfile.STATE_DISCONNECTED;
+ }
+ return mService.getConnectionMode(device);
+ }
+
+ @Override
+ public boolean isEnabled(BluetoothDevice device) {
+ return false;
+ }
+
+ @Override
+ public int getConnectionPolicy(BluetoothDevice device) {
+ return CONNECTION_POLICY_UNKNOWN;
+ }
+
+ @Override
+ public boolean setEnabled(BluetoothDevice device, boolean enabled) {
+ return false;
+ }
+
+ public void setAbsoluteVolume(BluetoothDevice device, int volume) {
+ if (mService == null) {
+ return;
+ }
+ mService.setAbsoluteVolume(device, volume);
+ }
+
+ public int getAbsoluteVolume(BluetoothDevice device) {
+ if (mService == null) {
+ return -1;
+ }
+ return mService.getAbsoluteVolume(device);
+ }
+
+ public void setMute(BluetoothDevice device, boolean enableMute) {
+ if (mService == null) {
+ return;
+ }
+ mService.setMute(device, enableMute);
+ }
+
+ public boolean isMute(BluetoothDevice device) {
+ if (mService == null) {
+ return false;
+ }
+ return mService.isMute(device);
+ }
+
+ public boolean setActiveProfile(BluetoothDevice device, int audioType, int profile) {
+ if(mService != null) {
+ return mService.setActiveProfile(device, audioType, profile);
+ }
+ return false;
+ }
+
+ public int getActiveProfile(int audioType) {
+ if(mService != null) {
+ return mService.getActiveProfile(audioType);
+ }
+ return -1;
+ }
+
+ public String toString() {
+ return NAME;
+ }
+
+ public int getOrdinal() {
+ return ORDINAL;
+ }
+
+ public int getNameResource(BluetoothDevice device) {
+ return R.string.bluetooth_profile_vcp;
+ }
+
+ public int getSummaryResourceForDevice(BluetoothDevice device) {
+ return 0; // VCP profile not displayed in UI
+ }
+
+ public int getDrawableResource(BluetoothClass btClass) {
+ return 0; // no icon for VCP
+ }
+
+ protected void finalize() {
+ Log.d(TAG, "finalize()");
+ if (mService != null) {
+ try {
+ BluetoothAdapter.getDefaultAdapter().closeProfileProxy(BluetoothProfile.VCP,
+ mService);
+ mService = null;
+ }catch (Throwable t) {
+ Log.w(TAG, "Error cleaning up Vcp proxy", t);
+ }
+ }
+ }
+}
+
diff --git a/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java b/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java
index e5fd0ba5d9bc..d691f5a945de 100644..100755
--- a/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java
+++ b/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java
@@ -245,6 +245,11 @@ public class ZoneGetter {
}
private static String getCanonicalZoneId(TimeZone timeZone) {
+ // Canonicalize the zone ID for ICU. It will only return valid strings for zone IDs
+ // that match ICUs zone IDs (which are similar but not guaranteed the same as those
+ // in timezones.xml). timezones.xml and related files uses the IANA IDs. ICU IDs are
+ // stable and IANA IDs have changed over time so they have drifted.
+ // See http://bugs.icu-project.org/trac/ticket/13070 / http://b/36469833.
final String id = timeZone.getID();
final String canonicalId = android.icu.util.TimeZone.getCanonicalID(id);
if (canonicalId != null) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java b/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java
index ea5105bd9e0d..8f9232ef9ef8 100644
--- a/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java
+++ b/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java
@@ -93,8 +93,7 @@ public class SettingsInjector {
* {@link Message#what} value sent after the timeout waiting for a status message.
*/
private static final int WHAT_TIMEOUT = 3;
-
- private final Context mContext;
+ protected final Context mContext;
/**
* The settings that were injected
@@ -217,7 +216,7 @@ public class SettingsInjector {
*
* Duplicates some code from {@link android.content.pm.RegisteredServicesCache}.
*/
- private static InjectedSetting parseServiceInfo(ResolveInfo service, UserHandle userHandle,
+ protected InjectedSetting parseServiceInfo(ResolveInfo service, UserHandle userHandle,
PackageManager pm) throws XmlPullParserException, IOException {
ServiceInfo si = service.serviceInfo;
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
index 5e91a147318e..29bbe46c4f5e 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
@@ -18,6 +18,7 @@ package com.android.settingslib.mobile;
import android.content.Context;
import android.content.res.Resources;
import android.os.PersistableBundle;
+import android.os.SystemProperties;
import android.telephony.Annotation;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
@@ -204,6 +205,14 @@ public class MobileMappings {
public boolean hspaDataDistinguishable;
public boolean alwaysShowDataRatIcon = false;
+ public boolean showRsrpSignalLevelforLTE = false;
+ public boolean hideNoInternetState = false;
+ public boolean showVolteIcon = false;
+ public boolean alwaysShowNetworkTypeIcon = false;
+ public boolean enableRatIconEnhancement = false;
+ public boolean showVowifiIcon = false;
+ public boolean enableDdsRatIconEnhancement = false;
+
/**
* Reads the latest configs.
*/
@@ -233,6 +242,22 @@ public class MobileMappings {
config.hideLtePlus = b.getBoolean(
CarrierConfigManager.KEY_HIDE_LTE_PLUS_DATA_ICON_BOOL);
}
+
+ config.alwaysShowNetworkTypeIcon = res.getBoolean(R.bool.config_alwaysShowTypeIcon);
+ config.showRsrpSignalLevelforLTE =
+ res.getBoolean(R.bool.config_showRsrpSignalLevelforLTE);
+ config.hideNoInternetState = res.getBoolean(R.bool.config_hideNoInternetState);
+ config.showVolteIcon = res.getBoolean(R.bool.config_display_volte);
+ config.showVowifiIcon = res.getBoolean(R.bool.config_display_vowifi);
+ if ( config.alwaysShowNetworkTypeIcon ) {
+ config.hideLtePlus = false;
+ }
+
+ config.enableRatIconEnhancement =
+ SystemProperties.getBoolean("persist.sysui.rat_icon_enhancement", false);
+ config.enableDdsRatIconEnhancement =
+ SystemProperties.getBoolean("persist.sysui.dds_rat_icon_enhancement", false);
+
return config;
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
index 1a08366734bc..1fb7f078c5d0 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
@@ -26,6 +26,8 @@ import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.util.Log;
+import com.android.settingslib.Utils;
+
/**
* Tracks the mobile signal status for the SysUI and Settings.
*
@@ -36,6 +38,7 @@ import android.util.Log;
*/
public class MobileStatusTracker {
private static final String TAG = "MobileStatusTracker";
+
private final TelephonyManager mPhone;
private final SubscriptionInfo mSubscriptionInfo;
private final Callback mCallback;
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/TelephonyIcons.java b/packages/SettingsLib/src/com/android/settingslib/mobile/TelephonyIcons.java
index d4e58f7a2fc4..bb675bb10ccf 100644
--- a/packages/SettingsLib/src/com/android/settingslib/mobile/TelephonyIcons.java
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/TelephonyIcons.java
@@ -44,6 +44,11 @@ public class TelephonyIcons {
public static final int ICON_5G = R.drawable.ic_5g_mobiledata;
public static final int ICON_5G_PLUS = R.drawable.ic_5g_plus_mobiledata;
public static final int ICON_CWF = R.drawable.ic_carrier_wifi;
+ public static final int ICON_5G_SA = R.drawable.ic_5g_mobiledata;
+ public static final int ICON_5G_BASIC = R.drawable.ic_5g_mobiledata;
+ public static final int ICON_5G_UWB = R.drawable.ic_5g_uwb_mobiledata;
+ public static final int ICON_VOWIFI = R.drawable.ic_vowifi;
+ public static final int ICON_VOWIFI_CALLING = R.drawable.ic_vowifi_calling;
public static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup(
"CARRIER_NETWORK_CHANGE",
@@ -311,6 +316,78 @@ public class TelephonyIcons {
// When adding a new MobileIconGround, check if the dataContentDescription has to be filtered
// in QSCarrier#hasValidTypeContentDescription
+ //
+ public static final MobileIconGroup FIVE_G = new MobileIconGroup(
+ "5G",
+ null,
+ null,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+ 0, 0,
+ 0,
+ 0,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+ R.string.data_connection_5g,
+ TelephonyIcons.ICON_5G);
+
+ public static final MobileIconGroup FIVE_G_BASIC = new MobileIconGroup(
+ "5GBasic",
+ null,
+ null,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+ 0, 0,
+ 0,
+ 0,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+ R.string.data_connection_5g_basic,
+ TelephonyIcons.ICON_5G_BASIC);
+
+ public static final MobileIconGroup FIVE_G_UWB = new MobileIconGroup(
+ "5GUWB",
+ null,
+ null,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+ 0, 0,
+ 0,
+ 0,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+ R.string.data_connection_5g_uwb,
+ TelephonyIcons.ICON_5G_UWB);
+
+ public static final MobileIconGroup FIVE_G_SA = new MobileIconGroup(
+ "5GSA",
+ null,
+ null,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+ 0, 0,
+ 0,
+ 0,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+ R.string.data_connection_5g_sa,
+ TelephonyIcons.ICON_5G_SA);
+
+ public static final MobileIconGroup VOWIFI = new MobileIconGroup(
+ "VoWIFI",
+ null,
+ null,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+ 0, 0,
+ 0,
+ 0,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+ 0,
+ TelephonyIcons.ICON_VOWIFI);
+
+ public static final MobileIconGroup VOWIFI_CALLING = new MobileIconGroup(
+ "VoWIFICall",
+ null,
+ null,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
+ 0, 0,
+ 0,
+ 0,
+ AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
+ 0,
+ TelephonyIcons.ICON_VOWIFI_CALLING);
/** Mapping icon name(lower case) to the icon object. */
public static final Map<String, MobileIconGroup> ICON_NAME_TO_ICON;
@@ -332,6 +409,7 @@ public class TelephonyIcons {
ICON_NAME_TO_ICON.put("lte+", LTE_PLUS);
ICON_NAME_TO_ICON.put("5g", NR_5G);
ICON_NAME_TO_ICON.put("5g_plus", NR_5G_PLUS);
+ ICON_NAME_TO_ICON.put("5guwb", FIVE_G_UWB);
ICON_NAME_TO_ICON.put("datadisable", DATA_DISABLED);
ICON_NAME_TO_ICON.put("notdefaultdata", NOT_DEFAULT_DATA);
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java b/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java
index 43c05b8b64d6..4d0204fc83cb 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java
@@ -72,7 +72,10 @@ public class NetworkCycleDataForUidLoader extends
builder.setBackgroundUsage(totalUsage - totalForeground)
.setForegroundUsage(totalForeground);
}
- mData.add(builder.build());
+ NetworkCycleDataForUid mObject = builder.build();
+ if (mObject.getBackgroudUsage() >= 0) {
+ mData.add(mObject);
+ }
}
} catch (Exception e) {
Log.e(TAG, "Exception querying network detail.", e);
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
index 303ee3c9fca2..0c5cd1a11be6 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
@@ -126,6 +126,16 @@ public class AccessPoint implements Comparable<AccessPoint> {
*/
public static final int HIGHER_FREQ_60GHZ = 70200;
+ /**
+ * Lower bound on the 6.0 GHz (802.11ax) WLAN channels
+ */
+ public static final int LOWER_FREQ_6GHZ = 5935;
+
+ /**
+ * Upper bound on the 6.0 GHz (802.11ax) WLAN channels
+ */
+ public static final int HIGHER_FREQ_6GHZ = 7115;
+
/** The key which identifies this AccessPoint grouping. */
private String mKey;
@@ -224,7 +234,8 @@ public class AccessPoint implements Comparable<AccessPoint> {
public static final int SECURITY_SAE = 5;
public static final int SECURITY_EAP_SUITE_B = 6;
public static final int SECURITY_EAP_WPA3_ENTERPRISE = 7;
- public static final int SECURITY_MAX_VAL = 8; // Has to be the last
+ public static final int SECURITY_DPP = 8;
+ public static final int SECURITY_MAX_VAL = 9; // Has to be the last
private static final int PSK_UNKNOWN = 0;
private static final int PSK_WPA = 1;
@@ -258,6 +269,11 @@ public class AccessPoint implements Comparable<AccessPoint> {
private int mRssi = UNREACHABLE_RSSI;
+ private int mDeviceWifiStandard;
+ private int mWifiStandard = ScanResult.WIFI_STANDARD_LEGACY;
+ private boolean mHe8ssCapableAp;
+ private boolean mVhtMax8SpatialStreamsSupport;
+
private WifiInfo mInfo;
private NetworkInfo mNetworkInfo;
AccessPointListener mAccessPointListener;
@@ -358,6 +374,8 @@ public class AccessPoint implements Comparable<AccessPoint> {
// Calculate required fields
updateKey();
updateBestRssiInfo();
+ updateDeviceWifiGenerationInfo();
+ updateWifiGeneration();
}
/**
@@ -368,6 +386,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
mContext = context;
loadConfig(config);
updateKey();
+ updateDeviceWifiGenerationInfo();
}
/**
@@ -386,6 +405,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
mPasspointConfigurationVersion = PasspointConfigurationVersion.NO_OSU_PROVISIONED;
}
updateKey();
+ updateDeviceWifiGenerationInfo();
}
/**
@@ -399,6 +419,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
mConfig = config;
mPasspointUniqueId = config.getKey();
mFqdn = config.FQDN;
+ updateDeviceWifiGenerationInfo();
setScanResultsPasspoint(homeScans, roamingScans);
updateKey();
}
@@ -410,12 +431,14 @@ public class AccessPoint implements Comparable<AccessPoint> {
@NonNull Collection<ScanResult> results) {
mContext = context;
mOsuProvider = provider;
+ updateDeviceWifiGenerationInfo();
setScanResults(results);
updateKey();
}
AccessPoint(Context context, Collection<ScanResult> results) {
mContext = context;
+ updateDeviceWifiGenerationInfo();
setScanResults(results);
updateKey();
}
@@ -888,6 +911,22 @@ public class AccessPoint implements Comparable<AccessPoint> {
networkId = WifiConfiguration.INVALID_NETWORK_ID;
}
+ public boolean isSuiteBSupported() {
+ WifiManager wifiManager = mContext.getSystemService(WifiManager.class);
+ String capability = wifiManager.getCapabilities("key_mgmt");
+
+ if (!capability.contains("WPA-EAP-SUITE-B-192")) {
+ return false;
+ }
+
+ for (ScanResult result : mScanResults) {
+ if (result.capabilities.contains("EAP_SUITE_B_192")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public WifiInfo getInfo() {
return mInfo;
}
@@ -1047,6 +1086,9 @@ public class AccessPoint implements Comparable<AccessPoint> {
case SECURITY_WEP:
return concise ? context.getString(R.string.wifi_security_short_wep) :
context.getString(R.string.wifi_security_wep);
+ case SECURITY_DPP:
+ return concise ? context.getString(R.string.wifi_security_short_dpp) :
+ context.getString(R.string.wifi_security_dpp);
case SECURITY_SAE:
return concise ? context.getString(R.string.wifi_security_short_sae) :
context.getString(R.string.wifi_security_sae);
@@ -1461,6 +1503,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
mScanResults.addAll(scanResults);
}
updateBestRssiInfo();
+ updateWifiGeneration();
int newLevel = getLevel();
// If newLevel is 0, there will be no displayed Preference since the AP is unreachable
@@ -1528,6 +1571,11 @@ public class AccessPoint implements Comparable<AccessPoint> {
// are still seen, we will investigate further.
update(config); // Notifies the AccessPointListener of the change
}
+ if (getWifiStandard() != info.getWifiStandard() ||
+ isHe8ssCapableAp() != info.isHe8ssCapableAp() ||
+ isVhtMax8SpatialStreamsSupported() != info.isVhtMax8SpatialStreamsSupported()) {
+ updated = true;
+ }
if (mRssi != info.getRssi() && info.getRssi() != WifiInfo.INVALID_RSSI) {
mRssi = info.getRssi();
updated = true;
@@ -1541,6 +1589,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
updated = true;
mInfo = null;
mNetworkInfo = null;
+ updateWifiGeneration();
}
if (updated && mAccessPointListener != null) {
ThreadUtils.postOnMainThread(() -> {
@@ -1759,6 +1808,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
final boolean isEap = result.capabilities.contains("EAP");
final boolean isOwe = result.capabilities.contains("OWE");
final boolean isOweTransition = result.capabilities.contains("OWE_TRANSITION");
+ final boolean isDpp = result.capabilities.contains("DPP");
if (isSae && isPsk) {
final WifiManager wifiManager = (WifiManager)
@@ -1771,7 +1821,9 @@ public class AccessPoint implements Comparable<AccessPoint> {
return wifiManager.isEnhancedOpenSupported() ? SECURITY_OWE : SECURITY_NONE;
}
- if (isWep) {
+ if (isDpp) {
+ return SECURITY_DPP;
+ } else if (isWep) {
return SECURITY_WEP;
} else if (isSae) {
return SECURITY_SAE;
@@ -1801,6 +1853,9 @@ public class AccessPoint implements Comparable<AccessPoint> {
config.allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
return SECURITY_EAP;
}
+ if (config.allowedKeyManagement.get(KeyMgmt.DPP)) {
+ return SECURITY_DPP;
+ }
if (config.allowedKeyManagement.get(KeyMgmt.OWE)) {
return SECURITY_OWE;
}
@@ -1824,6 +1879,8 @@ public class AccessPoint implements Comparable<AccessPoint> {
return "PSK";
} else if (security == SECURITY_EAP) {
return "EAP";
+ } else if (security == SECURITY_DPP) {
+ return "DPP";
} else if (security == SECURITY_SAE) {
return "SAE";
} else if (security == SECURITY_EAP_SUITE_B) {
@@ -2063,4 +2120,68 @@ public class AccessPoint implements Comparable<AccessPoint> {
}
return false;
}
+
+ private void updateDeviceWifiGenerationInfo() {
+ final WifiManager wifiManager = getWifiManager();
+
+ if (wifiManager.isWifiStandardSupported(ScanResult.WIFI_STANDARD_11AX))
+ mDeviceWifiStandard = ScanResult.WIFI_STANDARD_11AX;
+ else if (wifiManager.isWifiStandardSupported(ScanResult.WIFI_STANDARD_11AC))
+ mDeviceWifiStandard = ScanResult.WIFI_STANDARD_11AC;
+ else if (wifiManager.isWifiStandardSupported(ScanResult.WIFI_STANDARD_11N))
+ mDeviceWifiStandard = ScanResult.WIFI_STANDARD_11N;
+ else
+ mDeviceWifiStandard = ScanResult.WIFI_STANDARD_LEGACY;
+
+ mVhtMax8SpatialStreamsSupport = wifiManager.isVht8ssCapableDevice();
+ }
+
+ /**
+ * Updates {@link #mWifiStandard, mHe8ssCapableAp}.
+ *
+ * <p>If the given connection is active, the existing values are valid.
+ * If the given AccessPoint is not connected, a value will be calculated from previous scan
+ * results, based on minimum capability for all BSSIDs and capability of device.
+ */
+ private void updateWifiGeneration() {
+ int currResultWifiStandard;
+ int minConnectionCapability = mDeviceWifiStandard;
+
+ // Capture minimum possible connection capability
+ mHe8ssCapableAp = true;
+ for (ScanResult result : mScanResults) {
+ currResultWifiStandard = result.getWifiStandard();
+
+ // Check if atleast one bssid present without HE and 8SS support
+ if (!result.capabilities.contains("WFA-HE-READY") && mHe8ssCapableAp)
+ mHe8ssCapableAp = false;
+
+ if (currResultWifiStandard < minConnectionCapability) {
+ minConnectionCapability = currResultWifiStandard;
+ }
+ }
+
+ mWifiStandard = minConnectionCapability;
+ }
+
+ public int getWifiStandard() {
+ if (this.isActive() && mInfo != null)
+ return mInfo.getWifiStandard();
+
+ return mWifiStandard;
+ }
+
+ public boolean isHe8ssCapableAp() {
+ if (this.isActive() && mInfo != null)
+ return mInfo.isHe8ssCapableAp();
+
+ return mHe8ssCapableAp;
+ }
+
+ public boolean isVhtMax8SpatialStreamsSupported() {
+ if (this.isActive() && mInfo != null)
+ return mInfo.isVhtMax8SpatialStreamsSupported();
+
+ return mVhtMax8SpatialStreamsSupport;
+ }
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java
index fd986e5d13fd..80dad68ed09d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java
@@ -74,6 +74,9 @@ public class AccessPointPreference extends Preference {
private AccessPoint mAccessPoint;
private Drawable mBadge;
private int mLevel;
+ private int mWifiStandard;
+ private boolean mHe8ssCapableAp;
+ private boolean mVhtMax8SpatialStreamsSupport;
private CharSequence mContentDescription;
private int mDefaultIconResId;
private int mWifiSpeed = Speed.NONE;
@@ -174,14 +177,14 @@ public class AccessPointPreference extends Preference {
notifyChanged();
}
- protected void updateIcon(int level, Context context) {
+ protected void updateIcon(int level, int standard, boolean isReady, Context context) {
if (level == -1) {
safeSetDefaultIcon();
return;
}
TronUtils.logWifiSettingsSpeed(context, mWifiSpeed);
- Drawable drawable = mIconInjector.getIcon(level);
+ Drawable drawable = mIconInjector.getIcon(level, standard, isReady);
if (!mForSavedNetworks && drawable != null) {
drawable.setTintList(Utils.getColorAttr(context, android.R.attr.colorControlNormal));
setIcon(drawable);
@@ -236,17 +239,40 @@ public class AccessPointPreference extends Preference {
final Context context = getContext();
int level = mAccessPoint.getLevel();
int wifiSpeed = mAccessPoint.getSpeed();
- if (level != mLevel || wifiSpeed != mWifiSpeed) {
+ int wifiStandard = mAccessPoint.getWifiStandard();
+ boolean vhtMax8SpatialStreamsSupport = mAccessPoint.isVhtMax8SpatialStreamsSupported();
+ boolean he8ssCapableAp = mAccessPoint.isHe8ssCapableAp();
+
+ if (level != mLevel ||
+ wifiSpeed != mWifiSpeed ||
+ wifiStandard != mWifiStandard ||
+ mVhtMax8SpatialStreamsSupport != vhtMax8SpatialStreamsSupport ||
+ mHe8ssCapableAp != he8ssCapableAp) {
mLevel = level;
mWifiSpeed = wifiSpeed;
- updateIcon(mLevel, context);
+ mWifiStandard = wifiStandard;
+ mVhtMax8SpatialStreamsSupport = vhtMax8SpatialStreamsSupport;
+ mHe8ssCapableAp = he8ssCapableAp;
+ updateIcon(mLevel, mWifiStandard, mVhtMax8SpatialStreamsSupport && mHe8ssCapableAp, context);
notifyChanged();
}
updateBadge(context);
- setSummary(mForSavedNetworks ? mAccessPoint.getSavedNetworkSummary()
- : mAccessPoint.getSettingsSummary());
+ String summary = mForSavedNetworks ? mAccessPoint.getSavedNetworkSummary()
+ : mAccessPoint.getSettingsSummary();
+
+ if (mAccessPoint.isPskSaeTransitionMode()) {
+ summary = "WPA3(SAE Transition Mode) " + summary;
+ } else if (mAccessPoint.isOweTransitionMode()) {
+ summary = "WPA3(OWE Transition Mode) " + summary;
+ } else if (mAccessPoint.getSecurity() == AccessPoint.SECURITY_SAE) {
+ summary = "WPA3(SAE) " + summary;
+ } else if (mAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE) {
+ summary = "WPA3(OWE) " + summary;
+ }
+
+ setSummary(summary);
mContentDescription = buildContentDescription(getContext(), this /* pref */, mAccessPoint);
}
@@ -333,5 +359,9 @@ public class AccessPointPreference extends Preference {
public Drawable getIcon(int level) {
return mContext.getDrawable(Utils.getWifiIconResource(level));
}
+
+ public Drawable getIcon(int level, int standard, boolean isReady) {
+ return mContext.getDrawable(Utils.getWifiIconResource(level, standard, isReady));
+ }
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiEntryPreference.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiEntryPreference.java
index 4dd3ff1f556c..28d19dccd9fa 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiEntryPreference.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiEntryPreference.java
@@ -64,6 +64,9 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
private final IconInjector mIconInjector;
private WifiEntry mWifiEntry;
private int mLevel = -1;
+ private int mWifiStandard;
+ private boolean mVhtMax8SpatialStreamsSupport;
+ private boolean mHe8ssCapableAp;
private boolean mShowX; // Shows the Wi-Fi signl icon of Pie+x when it's true.
private CharSequence mContentDescription;
private OnButtonClickListener mOnButtonClickListener;
@@ -137,15 +140,37 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
public void refresh() {
setTitle(mWifiEntry.getTitle());
final int level = mWifiEntry.getLevel();
+ final int standard = mWifiEntry.getWifiStandard();
+ final boolean vhtMax8SpatialStreamsSupport = mWifiEntry.isVhtMax8SpatialStreamsSupported();
+ final boolean he8ssCapableAp = mWifiEntry.isHe8ssCapableAp();
final boolean showX = mWifiEntry.shouldShowXLevelIcon();
- if (level != mLevel || showX != mShowX) {
+
+ if (level != mLevel || showX != mShowX || standard != mWifiStandard ||
+ he8ssCapableAp != mHe8ssCapableAp ||
+ vhtMax8SpatialStreamsSupport != mVhtMax8SpatialStreamsSupport) {
mLevel = level;
+ mWifiStandard = standard;
+ mHe8ssCapableAp = he8ssCapableAp;
+ mVhtMax8SpatialStreamsSupport = vhtMax8SpatialStreamsSupport;
mShowX = showX;
- updateIcon(mShowX, mLevel);
+ updateIcon(mShowX, mLevel, mWifiStandard, mHe8ssCapableAp && mVhtMax8SpatialStreamsSupport);
notifyChanged();
}
- setSummary(mWifiEntry.getSummary(false /* concise */));
+ String summary = mWifiEntry.getSummary(false /* concise */);
+
+ if (mWifiEntry.isPskSaeTransitionMode()) {
+ summary = "WPA3(SAE Transition Mode) " + summary;
+ } else if (mWifiEntry.isOweTransitionMode()) {
+ summary = "WPA3(OWE Transition Mode) " + summary;
+ } else if (mWifiEntry.getSecurity() == WifiEntry.SECURITY_SAE) {
+ summary = "WPA3(SAE) " + summary;
+ } else if (mWifiEntry.getSecurity() == WifiEntry.SECURITY_OWE) {
+ summary = "WPA3(OWE) " + summary;
+ }
+
+ setSummary(summary);
+
mContentDescription = buildContentDescription();
}
@@ -192,13 +217,13 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
return accent ? android.R.attr.colorAccent : android.R.attr.colorControlNormal;
}
- private void updateIcon(boolean showX, int level) {
+ private void updateIcon(boolean showX, int level, int standard, boolean isReady) {
if (level == -1) {
setIcon(null);
return;
}
- final Drawable drawable = mIconInjector.getIcon(showX, level);
+ final Drawable drawable = mIconInjector.getIcon(showX, level, standard, isReady);
if (drawable != null) {
drawable.setTint(Utils.getColorAttrDefaultColor(getContext(), getIconColorAttr()));
setIcon(drawable);
@@ -267,8 +292,8 @@ public class WifiEntryPreference extends Preference implements WifiEntry.WifiEnt
mContext = context;
}
- public Drawable getIcon(boolean showX, int level) {
- return mContext.getDrawable(WifiUtils.getInternetIconResource(level, showX));
+ public Drawable getIcon(boolean showX, int level, int standard, boolean isReady) {
+ return mContext.getDrawable(WifiUtils.getInternetIconResource(level, showX, standard, isReady));
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java
index 1343895ed93d..e999e0d8b757 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java
@@ -170,6 +170,9 @@ public class WifiStatusTracker {
public int rssi;
public int level;
public String statusLabel;
+ public int wifiStandard;
+ public boolean vhtMax8SpatialStreamsSupport;
+ public boolean he8ssCapableAp;
public WifiStatusTracker(Context context, WifiManager wifiManager,
NetworkScoreManager networkScoreManager, ConnectivityManager connectivityManager,
@@ -255,6 +258,10 @@ public class WifiStatusTracker {
subId = mWifiInfo.getSubscriptionId();
updateRssi(mWifiInfo.getRssi());
maybeRequestNetworkScore();
+ wifiStandard = mWifiInfo.getWifiStandard();
+ vhtMax8SpatialStreamsSupport = mWifiInfo.isVhtMax8SpatialStreamsSupported();
+ he8ssCapableAp = mWifiInfo.isHe8ssCapableAp();
+ maybeRequestNetworkScore();
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
index bf5ab1c9951a..a3b736c9ca29 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
@@ -879,6 +879,7 @@ public class WifiTracker implements LifecycleObserver, OnStart, OnStop, OnDestro
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
+ sVerboseLogging = mWifiManager.isVerboseLoggingEnabled();
if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(action)) {
updateWifiState(
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java
index 56454e975370..a04d038ed423 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java
@@ -72,6 +72,30 @@ public class WifiUtils {
R.drawable.ic_no_internet_wifi_signal_4
};
+ static final int[] WIFI_4_PIE = {
+ com.android.internal.R.drawable.ic_wifi_4_signal_0,
+ com.android.internal.R.drawable.ic_wifi_4_signal_1,
+ com.android.internal.R.drawable.ic_wifi_4_signal_2,
+ com.android.internal.R.drawable.ic_wifi_4_signal_3,
+ com.android.internal.R.drawable.ic_wifi_4_signal_4
+ };
+
+ static final int[] WIFI_5_PIE = {
+ com.android.internal.R.drawable.ic_wifi_5_signal_0,
+ com.android.internal.R.drawable.ic_wifi_5_signal_1,
+ com.android.internal.R.drawable.ic_wifi_5_signal_2,
+ com.android.internal.R.drawable.ic_wifi_5_signal_3,
+ com.android.internal.R.drawable.ic_wifi_5_signal_4
+ };
+
+ static final int[] WIFI_6_PIE = {
+ com.android.internal.R.drawable.ic_wifi_6_signal_0,
+ com.android.internal.R.drawable.ic_wifi_6_signal_1,
+ com.android.internal.R.drawable.ic_wifi_6_signal_2,
+ com.android.internal.R.drawable.ic_wifi_6_signal_3,
+ com.android.internal.R.drawable.ic_wifi_6_signal_4
+ };
+
public static String buildLoggingSummary(AccessPoint accessPoint, WifiConfiguration config) {
final StringBuilder summary = new StringBuilder();
final WifiInfo info = accessPoint.getInfo();
@@ -130,6 +154,7 @@ public class WifiUtils {
StringBuilder scans24GHz = new StringBuilder();
StringBuilder scans5GHz = new StringBuilder();
StringBuilder scans60GHz = new StringBuilder();
+ StringBuilder scans6GHz = new StringBuilder();
String bssid = null;
if (accessPoint.isActive() && info != null) {
@@ -150,10 +175,12 @@ public class WifiUtils {
visibility.append(String.format("rx=%.1f", info.getSuccessfulRxPacketsPerSecond()));
}
+ int maxRssi6 = INVALID_RSSI;
int maxRssi5 = INVALID_RSSI;
int maxRssi24 = INVALID_RSSI;
int maxRssi60 = INVALID_RSSI;
final int maxDisplayedScans = 4;
+ int num6 = 0; // number of scanned BSSID on 6GHz band
int num5 = 0; // number of scanned BSSID on 5GHz band
int num24 = 0; // number of scanned BSSID on 2.4Ghz band
int num60 = 0; // number of scanned BSSID on 60Ghz band
@@ -165,7 +192,19 @@ public class WifiUtils {
if (result == null) {
continue;
}
- if (result.frequency >= AccessPoint.LOWER_FREQ_5GHZ
+ if (result.frequency >= AccessPoint.LOWER_FREQ_6GHZ
+ && result.frequency <= AccessPoint.HIGHER_FREQ_6GHZ) {
+ num6++;
+
+ if (result.level > maxRssi6) {
+ maxRssi6 = result.level;
+ }
+ if (num6 <= maxDisplayedScans) {
+ scans6GHz.append(
+ verboseScanResultSummary(accessPoint, result, bssid,
+ nowMs));
+ }
+ } else if (result.frequency >= AccessPoint.LOWER_FREQ_5GHZ
&& result.frequency <= AccessPoint.HIGHER_FREQ_5GHZ) {
// Strictly speaking: [4915, 5825]
num5++;
@@ -230,6 +269,14 @@ public class WifiUtils {
}
visibility.append(scans60GHz.toString());
}
+ visibility.append(";");
+ if (num6 > 0) {
+ visibility.append("(").append(num6).append(")");
+ if (num6 > maxDisplayedScans) {
+ visibility.append("max=").append(maxRssi6).append(",");
+ }
+ visibility.append(scans6GHz.toString());
+ }
if (numBlockListed > 0) {
visibility.append("!").append(numBlockListed);
}
@@ -289,10 +336,35 @@ public class WifiUtils {
* @throws IllegalArgumentException if an invalid RSSI level is given.
*/
public static int getInternetIconResource(int level, boolean noInternet) {
+ return getInternetIconResource(level, noInternet, 0 /* standard */, false /* isReady */);
+ }
+
+ /**
+ * Returns the Internet icon resource for a given RSSI level.
+ *
+ * @param level The number of bars to show (0-4)
+ * @param noInternet True if a connected Wi-Fi network cannot access the Internet
+ * @throws IllegalArgumentException if an invalid RSSI level is given.
+ */
+ public static int getInternetIconResource(int level, boolean noInternet, int standard, boolean isReady) {
if (level < 0 || level >= WIFI_PIE.length) {
throw new IllegalArgumentException("No Wifi icon found for level: " + level);
}
- return noInternet ? NO_INTERNET_WIFI_PIE[level] : WIFI_PIE[level];
+ if (noInternet) return NO_INTERNET_WIFI_PIE[level];
+ switch (standard) {
+ case 4:
+ return WIFI_4_PIE[level];
+ case 5:
+ if (isReady) {
+ return WIFI_6_PIE[level];
+ } else {
+ return WIFI_5_PIE[level];
+ }
+ case 6:
+ return WIFI_6_PIE[level];
+ default:
+ return WIFI_PIE[level];
+ }
}
/**
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java
index 9afdd43ce73c..93058d602745 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java
@@ -130,7 +130,7 @@ public class A2dpProfileTest {
private static String KNOWN_CODEC_LABEL = "Use high quality audio: %1$s";
private static String UNKNOWN_CODEC_LABEL = "Use high quality audio";
private static String[] CODEC_NAMES =
- new String[]{"Default", "SBC", "AAC", "aptX", "aptX HD", "LDAC"};
+ new String[] { "Default", "SBC", "AAC", "aptX", "aptX HD", "LDAC", "aptX Adaptive", "aptX TWS+" };
/**
* Helper for setting up several tests of getHighQualityAudioOptionLabel
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/PowerAllowlistBackendTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/PowerAllowlistBackendTest.java
index 6caf7624e1bc..9de7f8c78f7a 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/PowerAllowlistBackendTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/PowerAllowlistBackendTest.java
@@ -65,6 +65,7 @@ public class PowerAllowlistBackendTest {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
doReturn(mContext).when(mContext).getApplicationContext();
+ doReturn(mDevicePolicyManager).when(mContext).getSystemService(DevicePolicyManager.class);
doReturn(new String[] {}).when(mDeviceIdleService).getFullPowerWhitelist();
doReturn(new String[] {}).when(mDeviceIdleService).getSystemPowerWhitelist();
doReturn(new String[] {}).when(mDeviceIdleService).getSystemPowerWhitelistExceptIdle();
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index 8e6e251ff3f2..2317add41c99 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -134,6 +134,8 @@
<bool name="def_dtmf_tones_enabled">true</bool>
<!-- Default for UI touch sounds enabled -->
<bool name="def_sound_effects_enabled">true</bool>
+ <!-- Default for connected mo call tones enabled -->
+ <bool name="def_call_connected_tones_enabled">false</bool>
<!-- Development settings -->
<bool name="def_stay_on_while_plugged_in">false</bool>
@@ -217,6 +219,9 @@
<!-- Default for Settings.Global.APPLY_RAMPING_RINGER -->
<bool name="def_apply_ramping_ringer">false</bool>
+ <!-- Default for Settings.Global.NTP_SERVER_2's property name -->
+ <string name="def_ntp_server_2" translatable="false">persist.vendor.ntp.svr_2</string>
+
<!-- Default for Settings.Secure.CHARGING_VIBRATION_ENABLED -->
<bool name="def_charging_vibration_enabled">true</bool>
@@ -259,4 +264,7 @@
<!-- Default for Settings.Secure.ONE_HANDED_MODE_ACTIVATED -->
<bool name="def_one_handed_mode_activated">false</bool>
+ <!-- Default for Settings.System.TIME_12_24 -->
+ <string name="def_time_format" translatable="false">12</string>
+
</resources>
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
index 462c3a5bba03..e1f4ea933b40 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
@@ -202,5 +202,6 @@ public class SystemSettingsValidators {
VALIDATORS.put(System.WIFI_STATIC_DNS2, LENIENT_IP_ADDRESS_VALIDATOR);
VALIDATORS.put(System.SHOW_BATTERY_PERCENT, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.NOTIFICATION_LIGHT_PULSE, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(System.CALL_CONNECTED_TONE_ENABLED, BOOLEAN_VALIDATOR);
}
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 268603fa8b0d..2a143267343a 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2253,6 +2253,9 @@ class DatabaseHelper extends SQLiteOpenHelper {
// Set default tty mode
loadSetting(stmt, Settings.System.TTY_MODE, 0);
+ // Set default time format
+ loadStringSetting(stmt, Settings.System.TIME_12_24, R.string.def_time_format);
+
loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS,
R.integer.def_screen_brightness);
@@ -2296,6 +2299,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
R.bool.def_sound_effects_enabled);
loadBooleanSetting(stmt, Settings.System.HAPTIC_FEEDBACK_ENABLED,
R.bool.def_haptic_feedback);
+ loadBooleanSetting(stmt, Settings.System.CALL_CONNECTED_TONE_ENABLED,
+ R.bool.def_call_connected_tones_enabled);
loadIntegerSetting(stmt, Settings.System.LOCKSCREEN_SOUNDS_ENABLED,
R.integer.def_lockscreen_sounds_enabled);
@@ -2592,6 +2597,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
defaultLidBehavior = 0;
}
loadSetting(stmt, Settings.Global.LID_BEHAVIOR, defaultLidBehavior);
+ loadStringSetting(stmt, Settings.Global.NTP_SERVER_2,
+ R.string.def_ntp_server_2);
/*
* IMPORTANT: Do not add any more upgrade steps here as the global,
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 4ac19386db0a..d68d3d339666 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -1126,6 +1126,9 @@ class SettingsProtoDumpUtil {
dumpSetting(s, p,
Settings.Global.NTP_TIMEOUT,
GlobalSettingsProto.Ntp.TIMEOUT_MS);
+ dumpSetting(s, p,
+ Settings.Global.NTP_SERVER_2,
+ GlobalSettingsProto.Ntp.SERVER_2);
p.end(ntpToken);
final long uasbToken = p.start(GlobalSettingsProto.USER_ABSENT_SMALL_BATTERY);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 4c9500cf909a..d8729b7f4112 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -4502,6 +4502,16 @@ public class SettingsProvider extends ContentProvider {
null, true, SettingsState.SYSTEM_PACKAGE_NAME);
}
+ // Update the settings for NTP_SERVER_2
+ final Setting currentSetting = globalSettings.getSettingLocked(
+ Global.NTP_SERVER_2);
+ if (currentSetting.isNull()) {
+ globalSettings.insertSettingLocked(
+ Global.NTP_SERVER_2,
+ getContext().getResources().getString(
+ R.string.def_ntp_server_2),
+ null, true, SettingsState.SYSTEM_PACKAGE_NAME);
+ }
currentVersion = 170;
}
diff --git a/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java b/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java
index 504e18a1488e..588097e285df 100644
--- a/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java
+++ b/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java
@@ -566,6 +566,10 @@ public final class RingtonePickerActivity extends AlertActivity implements
protected void onStop() {
super.onStop();
+ // must remove mHandler 's callback, or will result in one random issue:
+ // media playback occurs even though this activity has been destroyed.
+ mHandler.removeCallbacks(this);
+
if (!isChangingConfigurations()) {
stopAnyPlayingRingtone();
} else {
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index bca5071380de..7838d72218c9 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -121,6 +121,15 @@ android_library {
"lottie",
],
manifest: "AndroidManifest.xml",
+ defaults: [
+ "framework-wifi-vendor-hide-access-defaults",
+ ],
+ libs: [
+ "android.car",
+ "android.car.userlib",
+ "ims-common",
+ "extphonelib",
+ ],
kotlincflags: ["-Xjvm-default=enable"],
@@ -154,6 +163,9 @@ android_library {
manifest: "tests/AndroidManifest-base.xml",
additional_manifests: ["tests/AndroidManifest.xml"],
+ defaults: [
+ "framework-wifi-vendor-hide-access-defaults",
+ ],
resource_dirs: [
"tests/res",
"res-product",
@@ -212,6 +224,8 @@ android_library {
libs: [
"android.test.runner",
"android.test.base",
+ "ims-common",
+ "extphonelib",
],
kotlincflags: ["-Xjvm-default=enable"],
aaptflags: [
@@ -238,6 +252,14 @@ android_app {
proguard_flags_files: ["proguard.flags"],
},
+ libs: [
+ "android.car",
+ "android.car.userlib",
+ "ims-common",
+ "extphonelib",
+ ],
+ enforce_uses_libs: false,
+
kotlincflags: ["-Xjvm-default=enable"],
dxflags: ["--multi-dex"],
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 9a530af375d9..9f2aa32ec7e2 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -286,7 +286,10 @@
<uses-permission android:name="android.permission.ADD_TRUSTED_DISPLAY" />
<!-- Permission for Smartspace. -->
- <uses-permission android:name="android.permission.MANAGE_SMARTSPACE" />
+ <uses-permission android:name="android.permission.MANAGE_SMARTSPACE"/>
+
+ <!-- Permission to access ExtTelephony bound service -->
+ <uses-permission android:name="com.qualcomm.qti.permission.USE_EXT_TELEPHONY_SERVICE" />
<uses-permission android:name="android.permission.READ_PEOPLE_DATA" />
@@ -862,6 +865,6 @@
<action android:name="com.android.systemui.action.DISMISS_MEDIA_OUTPUT_DIALOG" />
</intent-filter>
</receiver>
-
+ <uses-library android:name="com.qti.extphone.extphonelib"/>
</application>
</manifest>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
index e42999416cfd..e4320706cc93 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
@@ -74,6 +74,10 @@
<item quantity="other">SIM 卡 PIN 码不正确,您还有 <xliff:g id="NUMBER_1">%d</xliff:g> 次尝试机会。</item>
<item quantity="one">SIM 卡 PIN 码不正确,您还有 <xliff:g id="NUMBER_0">%d</xliff:g> 次尝试机会。如果仍不正确,则需要联系运营商帮您解锁设备。</item>
</plurals>
+ <plurals name="kg_password_wrong_pin_code_multi_sim" formatted="false">
+ <item quantity="other">SIM 卡<xliff:g id="slotid">%d</xliff:g> PIN 码不正确,您还有 <xliff:g id="NUMBER_1">%d</xliff:g> 次尝试机会。</item>
+ <item quantity="one">SIM 卡<xliff:g id="slotid">%d</xliff:g> PIN 码不正确,您还有 <xliff:g id="NUMBER_0">%d</xliff:g> 次尝试机会。如果仍不正确,则需要联系运营商帮您解锁设备。</item>
+ </plurals>
<string name="kg_password_wrong_puk_code_dead" msgid="3698285357028468617">"SIM 卡无法使用,请与您的运营商联系。"</string>
<plurals name="kg_password_wrong_puk_code" formatted="false" msgid="3937306685604862886">
<item quantity="other">SIM 卡 PUK 码不正确,您还有 <xliff:g id="NUMBER_1">%d</xliff:g> 次尝试机会。如果仍不正确,SIM 卡将永远无法使用。</item>
@@ -98,6 +102,10 @@
<item quantity="other">请输入 SIM 卡 PIN 码,您还可以尝试 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
<item quantity="one">请输入 SIM 卡 PIN 码,您还可以尝试 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍不正确,则需要联系运营商帮您解锁设备。</item>
</plurals>
+ <plurals name="kg_password_default_pin_message_multi_sim" formatted="false">
+ <item quantity="other">请输入 SIM 卡<xliff:g id="slotid">%d</xliff:g> PIN 码,您还可以尝试 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
+ <item quantity="one">请输入 SIM 卡<xliff:g id="slotid">%d</xliff:g> PIN 码,您还可以尝试 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍不正确,则需要联系运营商帮您解锁设备。</item>
+ </plurals>
<plurals name="kg_password_default_puk_message" formatted="false" msgid="571308542462946935">
<item quantity="other">SIM 卡现已停用,请输入 PUK 码继续使用。您还可以尝试 <xliff:g id="_NUMBER_1">%d</xliff:g> 次。如果仍不正确,该 SIM 卡将永远无法使用。有关详情,请联系您的运营商。</item>
<item quantity="one">SIM 卡现已停用,请输入 PUK 码继续使用。您还可以尝试 <xliff:g id="_NUMBER_0">%d</xliff:g> 次。如果仍不正确,该 SIM 卡将永远无法使用。有关详情,请联系您的运营商。</item>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
index d870304c7d46..f1bafe89f1f7 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
@@ -74,6 +74,10 @@
<item quantity="other">SIM 卡的 PIN 碼不正確,您還有 <xliff:g id="NUMBER_1">%d</xliff:g> 次輸入機會。</item>
<item quantity="one">SIM 卡的 PIN 碼不正確,您還有 <xliff:g id="NUMBER_0">%d</xliff:g> 次輸入機會。如果仍然輸入錯誤,您必須聯絡流動網絡供應商為您的裝置解鎖。</item>
</plurals>
+ <plurals name="kg_password_wrong_pin_code_multi_sim" formatted="false">
+ <item quantity="other">SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN 碼不正確,您還有 <xliff:g id="NUMBER_1">%d</xliff:g> 次輸入機會。</item>
+ <item quantity="one">SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN 碼不正確,您還有 <xliff:g id="NUMBER_0">%d</xliff:g> 次輸入機會。如果仍然輸入錯誤,您必須聯絡流動網絡供應商為您的裝置解鎖。</item>
+ </plurals>
<string name="kg_password_wrong_puk_code_dead" msgid="3698285357028468617">"SIM 卡無法使用,請聯絡您的流動網絡供應商。"</string>
<plurals name="kg_password_wrong_puk_code" formatted="false" msgid="3937306685604862886">
<item quantity="other">SIM 卡的 PUK 碼不正確,您還有 <xliff:g id="NUMBER_1">%d</xliff:g> 次輸入機會。如果仍然輸入錯誤,SIM 卡將永久無法使用。</item>
@@ -98,6 +102,10 @@
<item quantity="other">輸入 SIM 卡的 PIN,您還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
<item quantity="one">輸入 SIM 卡的 PIN,您還可以再試 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍然輸入錯誤,您必須聯絡流動網絡供應商解鎖您的裝置。</item>
</plurals>
+ <plurals name="kg_password_default_pin_message_multi_sim" formatted="false">
+ <item quantity="other">輸入 SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN,您還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
+ <item quantity="one">輸入 SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN,您還可以再試 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍然輸入錯誤,您必須聯絡流動網絡供應商解鎖您的裝置。</item>
+ </plurals>
<plurals name="kg_password_default_puk_message" formatted="false" msgid="571308542462946935">
<item quantity="other">SIM 卡已停用。請輸入 PUK 碼以繼續進行。您還可以再試 <xliff:g id="_NUMBER_1">%d</xliff:g> 次。如果仍然輸入錯誤,SIM 卡將永久無法使用。詳情請與流動網絡供應商聯絡。</item>
<item quantity="one">SIM 卡已停用。請輸入 PUK 碼以繼續進行。您還可以再試 <xliff:g id="_NUMBER_0">%d</xliff:g> 次。如果仍然輸入錯誤,SIM 卡將永久無法使用。詳情請與流動網絡供應商聯絡。</item>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
index 99a00fd38ca0..dd20b5efd4ea 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
@@ -74,6 +74,10 @@
<item quantity="other">SIM 卡的 PIN 碼輸入錯誤,你還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
<item quantity="one">SIM 卡的 PIN 碼輸入錯誤,你還可以再試 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍然失敗,就必須請電信業者為裝置解鎖。</item>
</plurals>
+ <plurals name="kg_password_wrong_pin_code_multi_sim" formatted="false">
+ <item quantity="other">SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN 碼輸入錯誤,你還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
+ <item quantity="one">SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN 碼輸入錯誤,你還可以再試 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍然失敗,就必須請電信業者為裝置解鎖。</item>
+ </plurals>
<string name="kg_password_wrong_puk_code_dead" msgid="3698285357028468617">"SIM 卡無法使用,請與你的電信業者聯絡。"</string>
<plurals name="kg_password_wrong_puk_code" formatted="false" msgid="3937306685604862886">
<item quantity="other">SIM 卡的 PUK 碼輸入錯誤,你還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。如果仍然失敗,SIM 卡將永久無法使用。</item>
@@ -98,6 +102,10 @@
<item quantity="other">請輸入 SIM 卡的 PIN 碼,你還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
<item quantity="one">請輸入 SIM 卡的 PIN 碼,你還可以再試 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍然失敗,就必須請電信業者為裝置解鎖。</item>
</plurals>
+ <plurals name="kg_password_default_pin_message_multi_sim" formatted="false">
+ <item quantity="other">請輸入 SIM 卡<xliff:g id="slotid">%d</xliff:g>的 PIN 碼,你還可以再試 <xliff:g id="NUMBER_1">%d</xliff:g> 次。</item>
+ <item quantity="one">請輸入 SIM 卡的<xliff:g id="slotid">%d</xliff:g> PIN 碼,你還可以再試 <xliff:g id="NUMBER_0">%d</xliff:g> 次。如果仍然失敗,就必須請電信業者為裝置解鎖。</item>
+ </plurals>
<plurals name="kg_password_default_puk_message" formatted="false" msgid="571308542462946935">
<item quantity="other">SIM 卡現在已遭停用。請輸入 PUK 碼以繼續進行。你還可以再試 <xliff:g id="_NUMBER_1">%d</xliff:g> 次,如果仍然失敗,SIM 卡將永久無法使用。詳情請與電信業者聯絡。</item>
<item quantity="one">SIM 卡現在已遭停用。請輸入 PUK 碼以繼續進行。你還可以再試 <xliff:g id="_NUMBER_0">%d</xliff:g> 次,如果仍然失敗,SIM 卡將永久無法使用。詳情請與電信業者聯絡。</item>
diff --git a/packages/SystemUI/res-keyguard/values/strings.xml b/packages/SystemUI/res-keyguard/values/strings.xml
index 16010430df11..bebf9f398800 100644
--- a/packages/SystemUI/res-keyguard/values/strings.xml
+++ b/packages/SystemUI/res-keyguard/values/strings.xml
@@ -165,6 +165,10 @@
<item quantity="one">Incorrect SIM PIN code, you have <xliff:g id="number">%d</xliff:g> remaining attempt before you must contact your carrier to unlock your device.</item>
<item quantity="other">Incorrect SIM PIN code, you have <xliff:g id="number">%d</xliff:g> remaining attempts.</item>
</plurals>
+ <plurals name="kg_password_wrong_pin_code_multi_sim">
+ <item quantity="one">Incorrect SIM<xliff:g id="slotid">%d</xliff:g> PIN code, you have <xliff:g id="number">%d</xliff:g> remaining attempt before you must contact your carrier to unlock your device.</item>
+ <item quantity="other">Incorrect SIM<xliff:g id="slotid">%d</xliff:g> PIN code, you have <xliff:g id="number">%d</xliff:g> remaining attempts.</item>
+ </plurals>
<!-- Instructions telling the user that they have exhausted SIM PUK retries and the SIM is now unusable.
Displayed in a dialog box. -->
@@ -229,6 +233,10 @@ attempt before you must contact your carrier to unlock your device.</item>
<item quantity="other">Enter SIM PIN. You have <xliff:g id="number">%d</xliff:g> remaining
attempts.</item>
</plurals>
+ <plurals name="kg_password_default_pin_message_multi_sim">
+ <item quantity="one">Enter SIM<xliff:g id="slotid">%d</xliff:g> PIN, you have <xliff:g id="number">%d</xliff:g> remaining attempt before you must contact your carrier to unlock your device.</item>
+ <item quantity="other">Enter SIM<xliff:g id="slotid">%d</xliff:g> PIN, you have <xliff:g id="number">%d</xliff:g> remaining attempts.</item>
+ </plurals>
<!-- Instructions telling the user remaining times when enter SIM PUK view. -->
<plurals name="kg_password_default_puk_message">
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_1.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_1.xml
new file mode 100644
index 000000000000..7c7b7d76d119
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_1.xml
@@ -0,0 +1,27 @@
+<!--
+ Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M22,16.41L20.59,15l-2.09,2.09L16.41,15L15,16.41l2.09,2.09L15,20.59L16.41,22l2.09,-2.08L20.59,22L22,20.59l-2.08,-2.09L22,16.41z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,2.01C7.25,2.01 2.97,4.09 0,7.4L7.582,16.625C7.582,16.627 7.58,16.629 7.58,16.631L11.99,22L12,22L13,20.789L13,17.641L13,13.119C12.68,13.039 12.34,13 12,13C10.601,13 9.351,13.64 8.531,14.639L2.699,7.539C5.269,5.279 8.58,4.01 12,4.01C15.42,4.01 18.731,5.279 21.301,7.539L16.811,13L19.4,13L24,7.4C21.03,4.09 16.75,2.01 12,2.01z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_2.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_2.xml
new file mode 100644
index 000000000000..be95f8462d91
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_2.xml
@@ -0,0 +1,27 @@
+<!--
+ Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M22,16.41L20.59,15l-2.09,2.09L16.41,15L15,16.41l2.09,2.09L15,20.59L16.41,22l2.09,-2.08L20.59,22L22,20.59l-2.08,-2.09L22,16.41z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,2C7.25,2 2.97,4.081 0,7.391L12,22L13,20.779L13,17.631L13,13L16.801,13L18,13L19.391,13L24,7.391C21.03,4.081 16.75,2 12,2zM12,4C14.747,4 17.423,4.819 19.701,6.313C20.259,6.678 20.795,7.085 21.301,7.529L17.389,12.287C16.029,10.868 14.119,9.99 12,9.99C9.88,9.99 7.969,10.869 6.609,12.289L2.699,7.529C5.269,5.269 8.58,4 12,4z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_3.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_3.xml
new file mode 100644
index 000000000000..29cb864ed887
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_3.xml
@@ -0,0 +1,27 @@
+<!--
+ Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M22,16.41L20.59,15l-2.09,2.09L16.41,15L15,16.41l2.09,2.09L15,20.59L16.41,22l2.09,-2.08L20.59,22L22,20.59l-2.08,-2.09L22,16.41z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,2C7.25,2 2.97,4.081 0,7.391L3.301,11.41L12,22L13,20.779L13,17.631L13,13L16.801,13L19.391,13L20.699,11.41C20.699,11.409 20.698,11.409 20.697,11.408L24,7.391C21.03,4.081 16.75,2 12,2zM12,4C15.42,4 18.731,5.269 21.301,7.529L19.35,9.9C17.43,8.1 14.86,6.99 12,6.99C9.14,6.99 6.57,8.1 4.65,9.9C4.65,9.901 4.649,9.902 4.648,9.902L2.699,7.529C5.269,5.269 8.58,4 12,4z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_4.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_4.xml
new file mode 100644
index 000000000000..3b298c56a0ac
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_4.xml
@@ -0,0 +1,27 @@
+<!--
+ Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,2C7.25,2 2.97,4.08 0,7.39L12,22l1,-1.22V13h6.39L24,7.39C21.03,4.08 16.75,2 12,2z"/>
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M22,16.41L20.59,15l-2.09,2.09L16.41,15L15,16.41l2.09,2.09L15,20.59L16.41,22l2.09,-2.08L20.59,22L22,20.59l-2.08,-2.09L22,16.41z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_4_0.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_4_0.xml
new file mode 100644
index 000000000000..31159a67cf01
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_4_0.xml
@@ -0,0 +1,50 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="32dp"
+ android:height="29.5dp"
+ android:viewportWidth="30"
+ android:viewportHeight="24">
+ <group
+ android:translateX="0.8"
+ android:translateY="-0.9">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 2.3281583,14.028369 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.822012,1.822009 -1.830163,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.001793,0.38 1.381793,0 l 1.830155,-1.830164 1.830163,1.830163 c 0.38,0.39 1.001796,0.379999 1.381793,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 l -1.830163,-1.830164 1.830163,-1.830163 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.997718,-0.38 -1.377717,0 l -1.821926,1.822011 -1.82201,-1.822011 c -0.19,-0.19 -0.438859,-0.285326 -0.688859,-0.285326 z"
+ android:fillColor="#FFFFFFFF"/>
+ <!-- number 4-->
+ <path
+ android:pathData="m 26.892869,17.71889 h -1.056598 v 1.849791 H 24.330062 V 17.71889 h -3.602534 v -1.359946 l 3.344006,-5.871601 h 1.764737 v 5.884492 h 1.056598 z m -2.562807,-1.347055 v -2.971248 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"
+ android:fillColor="#FFFFFFFF"/>
+ <!-- light signal level 4-->
+ <path
+ android:pathData="M 12,3 C 6.44,3 2.3284239,5.360652 0.55842392,6.570652 c -0.51,0.35 -0.6082608,1.060761 -0.2282609,1.540761 L 3.4524458,12 h 6.6644022 v 8.298912 l 1.043478,1.300271 c 0.42,0.530001 1.228968,0.530001 1.658968,0 l 6.505435,-8.091032 a 4.0677967,4.4745761 0 0 1 -0.0041,-0.0856 4.0677967,4.4745761 0 0 1 3.64402,-4.44701 l 0.697013,-0.86413 c 0.39,-0.48 0.28989,-1.190761 -0.22011,-1.540761 C 21.671576,5.360652 17.55,3 12,3 Z"
+ android:fillColor="#4DFFFFFF"/>
+ </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_4_1.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_4_1.xml
new file mode 100644
index 000000000000..2c2318266543
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_4_1.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 4-->
+ <path
+ android:pathData="m 25.107866,17.646981 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.871601 h 1.764737 v 5.884492 h 1.056598 z m -2.562807,-1.347055 v -2.971248 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 1-->
+ <path
+ android:pathData="M 11.999999,2.002712 C 7.25,2.002712 2.969999,4.081299 -9.9999999e-7,7.391299 L 4.133152,12.425266 H 6.721467 L 2.698369,7.529886 c 2.569999,-2.26 5.881631,-3.529891 9.30163,-3.529891 3.42,0 6.731632,1.269891 9.30163,3.529891 l -5.836956,7.104619 c -0.820053,-0.997437 -2.066757,-1.634511 -3.464674,-1.634511 -0.175,0 -0.339745,0.03762 -0.509511,0.05707 v 5.17663 3.14674 l 0.509511,0.619563 4.418479,-5.368205 c -6.04e-4,-0.003 -0.0035,-0.0052 -0.0041,-0.0082 l 2.771739,-3.370924 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774457 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.010869,-1.230978 c -2.970002,-3.31005 -7.25,-5.388637 -12,-5.388637 z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_4_2.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_4_2.xml
new file mode 100644
index 000000000000..b1bec7d72fc1
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_4_2.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 4-->
+ <path
+ android:pathData="m 25.107866,17.646981 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.871601 h 1.764737 v 5.884492 h 1.056598 z m -2.562807,-1.347055 v -2.971248 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 2-->
+ <path
+ android:pathData="m 11.999999,2.002716 c -4.7500004,0 -9.03,2.078587 -12.00000007,5.388587 L 4.133151,12.42527 H 6.7214663 L 6.6114119,12.290759 h 4.8790761 v 5.942935 3.14674 L 11.94701,21.93478 12,22 19.186141,13.252719 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774457 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.01087,-1.230978 c -2.97,-3.31 -7.25,-5.388587 -12,-5.388587 z m 0,1.997282 c 3.42,0 6.731631,1.269891 9.30163,3.529892 l -3.908967,4.760869 c -0.01997,-0.02087 -0.03686,-0.04459 -0.05706,-0.06522 -1.359999,-1.42 -3.268587,-2.298914 -5.388587,-2.298914 -2.120001,0 -4.0285872,0.878914 -5.3885872,2.298914 L 2.6983684,7.52989 C 5.2683675,5.269889 8.5799987,3.999998 11.999999,3.999998 Z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_4_3.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_4_3.xml
new file mode 100644
index 000000000000..5925bd190349
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_4_3.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 4-->
+ <path
+ android:pathData="m 25.107866,17.646981 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.871601 h 1.764737 v 5.884492 h 1.056598 z m -2.562807,-1.347055 v -2.971248 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 3-->
+ <path
+ android:pathData="m 11.999999,1.868205 c -4.75,0 -9.030001,2.078587 -12.0000010434783,5.388587 L 3.301629,11.275813 4.13315,12.290759 h 2.588316 4.769022 v 5.808424 3.14674 l 0.509511,0.619563 7.129076,-8.677988 0.05706,-0.06929 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774456 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.01087,-1.230978 c -2.970003,-3.31 -7.250001,-5.388587 -12,-5.388587 z m 0,1.997283 c 3.42,0 6.731631,1.269891 9.30163,3.529891 L 19.349183,9.771737 C 17.427804,7.959487 14.85815,6.857335 11.999999,6.857335 c -2.8581,0 -5.427817,1.111503 -7.349186,2.914402 L 2.698368,7.395379 c 2.569999,-2.26 5.881631,-3.529891 9.301631,-3.529891 z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_4_4.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_4_4.xml
new file mode 100644
index 000000000000..eed48ddd0f45
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_4_4.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="26"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 4-->
+ <path
+ android:pathData="m 25.107866,17.646981 h -1.056598 v 1.849791 h -1.506209 v -1.849791 h -3.602534 v -1.359946 l 3.344006,-5.871601 h 1.764737 v 5.884492 h 1.056598 z m -2.562807,-1.347055 v -2.971248 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.203274 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 4-->
+ <path
+ android:pathData="M 12,2.001359 C 7.2500003,2.001359 2.9700004,4.0799457 3.45e-7,7.3899455 L 4.0230983,12.289402 h 7.4673907 v 9.089674 L 12,21.998641 19.263587,13.157609 A 3.4516399,3.5235489 0 0 1 19.129076,12.1875 3.4516399,3.5235489 0 0 1 22.577445,8.6657608 3.4516399,3.5235489 0 0 1 22.936141,8.6820598 L 24,7.3899455 C 21.03,4.0799457 16.75,2.001359 12,2.001359 Z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_5_0.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_5_0.xml
new file mode 100644
index 000000000000..e286ade500f9
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_5_0.xml
@@ -0,0 +1,50 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="32dp"
+ android:height="29.5dp"
+ android:viewportWidth="30"
+ android:viewportHeight="24">
+ <group
+ android:translateX="0.8"
+ android:translateY="-0.9">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 2.3281583,14.028369 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.822012,1.822009 -1.830163,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.001793,0.38 1.381793,0 l 1.830155,-1.830164 1.830163,1.830163 c 0.38,0.39 1.001796,0.379999 1.381793,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 l -1.830163,-1.830164 1.830163,-1.830163 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.997718,-0.38 -1.377717,0 l -1.821926,1.822011 -1.82201,-1.822011 c -0.19,-0.19 -0.438859,-0.285326 -0.688859,-0.285326 z"
+ android:fillColor="#FFFFFFFF"/>
+ <!-- number 5-->
+ <path
+ android:pathData="m 27.651626,16.765723 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"
+ android:fillColor="#FFFFFFFF"/>
+ <!-- light signal level 4-->
+ <path
+ android:pathData="M 12,3 C 6.44,3 2.3284239,5.360652 0.55842392,6.570652 c -0.51,0.35 -0.6082608,1.060761 -0.2282609,1.540761 L 3.4524458,12 h 6.6644022 v 8.298912 l 1.043478,1.300271 c 0.42,0.530001 1.228968,0.530001 1.658968,0 l 6.505435,-8.091032 a 4.0677967,4.4745761 0 0 1 -0.0041,-0.0856 4.0677967,4.4745761 0 0 1 3.64402,-4.44701 l 0.697013,-0.86413 c 0.39,-0.48 0.28989,-1.190761 -0.22011,-1.540761 C 21.671576,5.360652 17.55,3 12,3 Z"
+ android:fillColor="#4DFFFFFF"/>
+ </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_5_1.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_5_1.xml
new file mode 100644
index 000000000000..c29ef4376297
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_5_1.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 5-->
+ <path
+ android:pathData="m 26.712686,15.940325 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 1-->
+ <path
+ android:pathData="M 11.999999,2.002712 C 7.25,2.002712 2.969999,4.081299 -9.9999999e-7,7.391299 L 4.133152,12.425266 H 6.721467 L 2.698369,7.529886 c 2.569999,-2.26 5.881631,-3.529891 9.30163,-3.529891 3.42,0 6.731632,1.269891 9.30163,3.529891 l -5.836956,7.104619 c -0.820053,-0.997437 -2.066757,-1.634511 -3.464674,-1.634511 -0.175,0 -0.339745,0.03762 -0.509511,0.05707 v 5.17663 3.14674 l 0.509511,0.619563 4.418479,-5.368205 c -6.04e-4,-0.003 -0.0035,-0.0052 -0.0041,-0.0082 l 2.771739,-3.370924 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774457 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.010869,-1.230978 c -2.970002,-3.31005 -7.25,-5.388637 -12,-5.388637 z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_5_2.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_5_2.xml
new file mode 100644
index 000000000000..69fa60019fc5
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_5_2.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 5-->
+ <path
+ android:pathData="m 26.712686,15.940325 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 2-->
+ <path
+ android:pathData="m 11.999999,2.002716 c -4.7500004,0 -9.03,2.078587 -12.00000007,5.388587 L 4.133151,12.42527 H 6.7214663 L 6.6114119,12.290759 h 4.8790761 v 5.942935 3.14674 L 11.94701,21.93478 12,22 19.186141,13.252719 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774457 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.01087,-1.230978 c -2.97,-3.31 -7.25,-5.388587 -12,-5.388587 z m 0,1.997282 c 3.42,0 6.731631,1.269891 9.30163,3.529892 l -3.908967,4.760869 c -0.01997,-0.02087 -0.03686,-0.04459 -0.05706,-0.06522 -1.359999,-1.42 -3.268587,-2.298914 -5.388587,-2.298914 -2.120001,0 -4.0285872,0.878914 -5.3885872,2.298914 L 2.6983684,7.52989 C 5.2683675,5.269889 8.5799987,3.999998 11.999999,3.999998 Z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_5_3.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_5_3.xml
new file mode 100644
index 000000000000..f92fb8fba228
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_5_3.xml
@@ -0,0 +1,47 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 5-->
+ <path
+ android:pathData="m 26.712686,15.940325 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 3-->
+ <path
+ android:pathData="m 11.999999,1.868205 c -4.75,0 -9.030001,2.078587 -12.0000010434783,5.388587 L 3.301629,11.275813 4.13315,12.290759 h 2.588316 4.769022 v 5.808424 3.14674 l 0.509511,0.619563 7.129076,-8.677988 0.05706,-0.06929 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774456 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.01087,-1.230978 c -2.970003,-3.31 -7.250001,-5.388587 -12,-5.388587 z m 0,1.997283 c 3.42,0 6.731631,1.269891 9.30163,3.529891 L 19.349183,9.771737 C 17.427804,7.959487 14.85815,6.857335 11.999999,6.857335 c -2.8581,0 -5.427817,1.111503 -7.349186,2.914402 L 2.698368,7.395379 c 2.569999,-2.26 5.881631,-3.529891 9.301631,-3.529891 z"
+ android:fillColor="@android:color/white"/>
+</vector>
+
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_5_4.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_5_4.xml
new file mode 100644
index 000000000000..abb28708ca9f
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_5_4.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 5-->
+ <path
+ android:pathData="m 26.712686,15.940325 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 4-->
+ <path
+ android:pathData="M 12,2.001359 C 7.2500003,2.001359 2.9700004,4.0799457 3.45e-7,7.3899455 L 4.0230983,12.289402 h 7.4673907 v 9.089674 L 12,21.998641 19.263587,13.157609 A 3.4516399,3.5235489 0 0 1 19.129076,12.1875 3.4516399,3.5235489 0 0 1 22.577445,8.6657608 3.4516399,3.5235489 0 0 1 22.936141,8.6820598 L 24,7.3899455 C 21.03,4.0799457 16.75,2.001359 12,2.001359 Z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_6_0.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_6_0.xml
new file mode 100644
index 000000000000..280589cce7aa
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_6_0.xml
@@ -0,0 +1,50 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="32dp"
+ android:height="29.5dp"
+ android:viewportWidth="30"
+ android:viewportHeight="24">
+ <group
+ android:translateX="0.8"
+ android:translateY="-0.9">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 2.3281583,14.028369 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.822012,1.822009 -1.830163,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.001793,0.38 1.381793,0 l 1.830155,-1.830164 1.830163,1.830163 c 0.38,0.39 1.001796,0.379999 1.381793,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 l -1.830163,-1.830164 1.830163,-1.830163 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.997718,-0.38 -1.377717,0 l -1.821926,1.822011 -1.82201,-1.822011 c -0.19,-0.19 -0.438859,-0.285326 -0.688859,-0.285326 z"
+ android:fillColor="#FFFFFFFF"/>
+ <!-- number 6-->
+ <path
+ android:pathData="m 27.397427,16.704042 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.030264 v 0 q 0,-2.207557 0.875601,-3.323047 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 q -0.245556,-0.813927 -1.098541,-0.813927 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="#FFFFFFFF"/>
+ <!-- light signal level 4-->
+ <path
+ android:pathData="M 12,3 C 6.44,3 2.3284239,5.360652 0.55842392,6.570652 c -0.51,0.35 -0.6082608,1.060761 -0.2282609,1.540761 L 3.4524458,12 h 6.6644022 v 8.298912 l 1.043478,1.300271 c 0.42,0.530001 1.228968,0.530001 1.658968,0 l 6.505435,-8.091032 a 4.0677967,4.4745761 0 0 1 -0.0041,-0.0856 4.0677967,4.4745761 0 0 1 3.64402,-4.44701 l 0.697013,-0.86413 c 0.39,-0.48 0.28989,-1.190761 -0.22011,-1.540761 C 21.671576,5.360652 17.55,3 12,3 Z"
+ android:fillColor="#4DFFFFFF"/>
+ </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_6_1.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_6_1.xml
new file mode 100644
index 000000000000..74d5bb664661
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_6_1.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 6-->
+ <path
+ android:pathData="m 26.554082,16.242125 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.030264 v 0 q 0,-2.207557 0.875601,-3.323047 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 q -0.245556,-0.813927 -1.098541,-0.813927 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 1-->
+ <path
+ android:pathData="M 11.999999,2.002712 C 7.25,2.002712 2.969999,4.081299 -9.9999999e-7,7.391299 L 4.133152,12.425266 H 6.721467 L 2.698369,7.529886 c 2.569999,-2.26 5.881631,-3.529891 9.30163,-3.529891 3.42,0 6.731632,1.269891 9.30163,3.529891 l -5.836956,7.104619 c -0.820053,-0.997437 -2.066757,-1.634511 -3.464674,-1.634511 -0.175,0 -0.339745,0.03762 -0.509511,0.05707 v 5.17663 3.14674 l 0.509511,0.619563 4.418479,-5.368205 c -6.04e-4,-0.003 -0.0035,-0.0052 -0.0041,-0.0082 l 2.771739,-3.370924 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774457 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.010869,-1.230978 c -2.970002,-3.31005 -7.25,-5.388637 -12,-5.388637 z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_6_2.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_6_2.xml
new file mode 100644
index 000000000000..b583f2784a2c
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_6_2.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 6-->
+ <path
+ android:pathData="m 26.554082,16.242125 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.030264 v 0 q 0,-2.207557 0.875601,-3.323047 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 q -0.245556,-0.813927 -1.098541,-0.813927 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 2-->
+ <path
+ android:pathData="m 11.999999,2.002716 c -4.7500004,0 -9.03,2.078587 -12.00000007,5.388587 L 4.133151,12.42527 H 6.7214663 L 6.6114119,12.290759 h 4.8790761 v 5.942935 3.14674 L 11.94701,21.93478 12,22 19.186141,13.252719 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774457 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.01087,-1.230978 c -2.97,-3.31 -7.25,-5.388587 -12,-5.388587 z m 0,1.997282 c 3.42,0 6.731631,1.269891 9.30163,3.529892 l -3.908967,4.760869 c -0.01997,-0.02087 -0.03686,-0.04459 -0.05706,-0.06522 -1.359999,-1.42 -3.268587,-2.298914 -5.388587,-2.298914 -2.120001,0 -4.0285872,0.878914 -5.3885872,2.298914 L 2.6983684,7.52989 C 5.2683675,5.269889 8.5799987,3.999998 11.999999,3.999998 Z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_6_3.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_6_3.xml
new file mode 100644
index 000000000000..3a9db72ce1e4
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_6_3.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 6-->
+ <path
+ android:pathData="m 26.554082,16.242125 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.030264 v 0 q 0,-2.207557 0.875601,-3.323047 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 q -0.245556,-0.813927 -1.098541,-0.813927 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 3-->
+ <path
+ android:pathData="m 11.999999,1.868205 c -4.75,0 -9.030001,2.078587 -12.0000010434783,5.388587 L 3.301629,11.275813 4.13315,12.290759 h 2.588316 4.769022 v 5.808424 3.14674 l 0.509511,0.619563 7.129076,-8.677988 0.05706,-0.06929 a 3.762712,3.8644067 0 0 1 -0.08152,-0.774456 3.762712,3.8644067 0 0 1 3.762228,-3.86413 3.762712,3.8644067 0 0 1 0.122283,0.0082 l 1.01087,-1.230978 c -2.970003,-3.31 -7.250001,-5.388587 -12,-5.388587 z m 0,1.997283 c 3.42,0 6.731631,1.269891 9.30163,3.529891 L 19.349183,9.771737 C 17.427804,7.959487 14.85815,6.857335 11.999999,6.857335 c -2.8581,0 -5.427817,1.111503 -7.349186,2.914402 L 2.698368,7.395379 c 2.569999,-2.26 5.881631,-3.529891 9.301631,-3.529891 z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_6_4.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_6_4.xml
new file mode 100644
index 000000000000..50a4a8eeecd6
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_6_4.xml
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="28"
+ android:viewportHeight="24">
+ <!-- no Internet -->
+ <path
+ android:pathData="m 3.3972509,13.819005 c -0.25,0 -0.498859,0.09533 -0.688859,0.285326 l -0.01223,0.01223 c -0.38,0.38 -0.38,0.997718 0,1.377718 l 1.8220122,1.822009 -1.8301632,1.830163 c -0.38,0.38 -0.38,0.997717 0,1.377717 l 0.0082,0.01223 c 0.38,0.38 1.0017933,0.38 1.3817933,0 l 1.8301549,-1.830164 1.8301631,1.830163 c 0.38,0.39 1.0017959,0.379999 1.3817929,0 0.3800012,-0.38 0.3800012,-1.001794 0,-1.381793 L 7.2899522,17.32444 9.1201151,15.494277 c 0.3800012,-0.38 0.3777722,-0.999946 -0.01231,-1.389946 -0.379999,-0.38 -0.9977179,-0.38 -1.3777169,0 L 5.9081621,15.926342 4.0861522,14.104331 c -0.19,-0.19 -0.438859,-0.285326 -0.6888593,-0.285326 z"
+ android:fillColor="@android:color/white"/>
+ <!-- number 6-->
+ <path
+ android:pathData="m 26.554082,16.242125 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.030264 v 0 q 0,-2.207557 0.875601,-3.323047 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 q -0.245556,-0.813927 -1.098541,-0.813927 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="@android:color/white"/>
+ <!-- signal level 4-->
+ <path
+ android:pathData="M 12,2.001359 C 7.2500003,2.001359 2.9700004,4.0799457 3.45e-7,7.3899455 L 4.0230983,12.289402 h 7.4673907 v 9.089674 L 12,21.998641 19.263587,13.157609 A 3.4516399,3.5235489 0 0 1 19.129076,12.1875 3.4516399,3.5235489 0 0 1 22.577445,8.6657608 3.4516399,3.5235489 0 0 1 22.936141,8.6820598 L 24,7.3899455 C 21.03,4.0799457 16.75,2.001359 12,2.001359 Z"
+ android:fillColor="@android:color/white"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_volte.xml b/packages/SystemUI/res/drawable/ic_volte.xml
new file mode 100644
index 000000000000..e4c5d6df5bea
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_volte.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14dp"
+ android:height="17dp"
+ android:viewportWidth="14"
+ android:viewportHeight="17">
+
+ <path
+ android:pathData="M 1.2 4 H 13.7 V 13.2 H 1.2 V 4 Z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M1.9,12.6V4h0.8v3.5h3.2V4h0.8v8.6H5.9v-4H2.7v4H1.9z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M8,12.6V4h2.1c0.5,0,0.8,0,1.1,0.1c0.4,0.1,0.7,0.3,0.9,0.6c0.3,0.4,0.6,0.9,0.7,1.5s0.2,1.3,0.2,2c0,0.7-0.1,1.2-0.2,1.7c-0.1,0.5-0.2,0.9-0.4,1.3S12.2,11.8,12,12s-0.4,0.3-0.7,0.4s-0.6,0.1-1,0.1H8zM8.8,11.6h1.3c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.4-0.3,0.5-0.4c0.2-0.3,0.3-0.6,0.4-1.1c0.1-0.5,0.2-1,0.2-1.7c0-0.9-0.1-1.6-0.3-2.1c-0.2-0.5-0.5-0.8-0.8-1C11,5.1,10.6,5,10.1,5H8.8V11.6z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M 2 9 L 1 9 L 1 9 L 2 9 Z" />
+</vector> \ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/ic_volte_no_voice.xml b/packages/SystemUI/res/drawable/ic_volte_no_voice.xml
new file mode 100644
index 000000000000..490b624927f0
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_volte_no_voice.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14dp"
+ android:height="17dp"
+ android:viewportWidth="14"
+ android:viewportHeight="17">
+
+ <path
+ android:pathData="M 1.2 4 H 13.7 V 13.2 H 1.2 V 4 Z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M1.9,12.6V4h0.8v3.5h3.2V4h0.8v8.6H5.9v-4H2.7v4H1.9z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M8,12.6V4h2.1c0.5,0,0.8,0,1.1,0.1c0.4,0.1,0.7,0.3,0.9,0.6c0.3,0.4,0.6,0.9,0.7,1.5s0.2,1.3,0.2,2c0,0.7-0.1,1.2-0.2,1.7c-0.1,0.5-0.2,0.9-0.4,1.3S12.2,11.8,12,12s-0.4,0.3-0.7,0.4s-0.6,0.1-1,0.1H8zM8.8,11.6h1.3c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.4-0.3,0.5-0.4c0.2-0.3,0.3-0.6,0.4-1.1c0.1-0.5,0.2-1,0.2-1.7c0-0.9-0.1-1.6-0.3-2.1c-0.2-0.5-0.5-0.8-0.8-1C11,5.1,10.6,5,10.1,5H8.8V11.6z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M 2 9 L 1 9 L 1 9 L 2 9 Z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M 0.5 9 H 13.5 V 10 H 0.5 V 9 Z" />
+</vector> \ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/ic_wifi_4_hotspot.xml b/packages/SystemUI/res/drawable/ic_wifi_4_hotspot.xml
new file mode 100644
index 000000000000..2895467b407e
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_wifi_4_hotspot.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="54dp"
+ android:height="48dp"
+ android:viewportWidth="27.0"
+ android:viewportHeight="24.0">
+ <group
+ android:translateY="-0.32">
+ <path
+ android:pathData="m 11.951087,3.004076 c -0.36936,0.00196 -0.743424,0.022092 -1.120924,0.065217 -4.6200001,0.52 -8.3498914,4.3292391 -8.7798913,8.95924 a 9.966,9.966 0 0 0 4.0190217,9.012227 c 0.48,0.350001 1.1592392,0.200223 1.4592392,-0.309782 0.2499999,-0.43 0.1432065,-0.99212 -0.2567935,-1.29212 -2.28,-1.689999 -3.6530436,-4.549728 -3.1630435,-7.699728 0.54,-3.4999999 3.462337,-6.2907066 6.9823374,-6.6807066 3.778225,-0.4311254 7.072769,1.8079636 8.335598,5.0625006 A 7.7288137,8.3389834 0 0 1 20.910326,8.4864129 C 19.25166,5.2212048 15.864479,2.9832791 11.951087,3.004076 Z M 11.820652,7.0067935 A 6,6 0 0 0 11.25,7.0516305 C 8.6299999,7.3716306 6.4692934,9.4592936 6.0692934,12.069294 c -0.32,2.139999 0.489837,4.112662 1.919837,5.392662 0.48,0.43 1.2411412,0.327663 1.5611413,-0.232337 0.24,-0.42 0.1398908,-0.939511 -0.2201088,-1.25951 A 3.99,3.99 0 0 1 8.1114131,12.028533 3.954,3.954 0 0 1 11.009511,9.1182064 4.0069999,4.0069999 0 0 1 15.998642,12.998641 c 0,1.18 -0.508805,2.233315 -1.328805,2.963315 -0.36,0.33 -0.468261,0.847663 -0.228261,1.267663 0.31,0.54 1.04,0.69125 1.5,0.28125 A 5.97,5.97 0 0 0 18,12.998641 6,6 0 0 0 11.820652,7.0067935 Z m 0.179347,3.9945655 c -1.1,0 -2.0013592,0.897282 -2.0013592,1.997282 0,1.1 0.9013592,2.001359 2.0013592,2.001359 1.1,0 2.001359,-0.901359 2.001359,-2.001359 0,-1.1 -0.901359,-1.997282 -2.001359,-1.997282 z m 6.342393,6.843749 c -0.462479,0.60136 -1.002053,1.142421 -1.614131,1.59375 -0.4,0.3 -0.506793,0.85212 -0.256793,1.29212 0.3,0.519999 0.979239,0.659783 1.459239,0.309782 a 9.96,9.96 0 0 0 1.353261,-1.210597 7.7288137,8.3389834 0 0 1 -0.941576,-1.985055 z"
+ android:fillColor="#FFFFFFFF"/>
+ <path
+ android:pathData="m 25.46914,17.155238 h -1.056598 v 2.015506 H 22.906333 V 17.155238 H 19.303799 V 15.67346 l 3.344006,-6.3976129 h 1.764737 v 6.4116589 h 1.056598 z m -2.562807,-1.467732 v -3.23743 q 0,-0.379223 0.01967,-0.821649 0.01968,-0.442424 0.03092,-0.568836 v 0 q -0.146131,0.39327 -0.528296,1.137673 v 0 l -1.83781,3.490242 z"
+ android:fillColor="#FFFFFFFF"/>
+ </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_wifi_5_hotspot.xml b/packages/SystemUI/res/drawable/ic_wifi_5_hotspot.xml
new file mode 100644
index 000000000000..b51ccc5d9742
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_wifi_5_hotspot.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="54dp"
+ android:height="48dp"
+ android:viewportWidth="27.0"
+ android:viewportHeight="24.0">
+ <group
+ android:translateY="-0.32">
+ <path
+ android:pathData="m 11.951087,3.004076 c -0.36936,0.00196 -0.743424,0.022092 -1.120924,0.065217 -4.6200001,0.52 -8.3498914,4.3292391 -8.7798913,8.95924 a 9.966,9.966 0 0 0 4.0190217,9.012227 c 0.48,0.350001 1.1592392,0.200223 1.4592392,-0.309782 0.2499999,-0.43 0.1432065,-0.99212 -0.2567935,-1.29212 -2.28,-1.689999 -3.6530436,-4.549728 -3.1630435,-7.699728 0.54,-3.4999999 3.462337,-6.2907066 6.9823374,-6.6807066 3.778225,-0.4311254 7.072769,1.8079636 8.335598,5.0625006 A 7.7288137,8.3389834 0 0 1 20.910326,8.4864129 C 19.25166,5.2212048 15.864479,2.9832791 11.951087,3.004076 Z M 11.820652,7.0067935 A 6,6 0 0 0 11.25,7.0516305 C 8.6299999,7.3716306 6.4692934,9.4592936 6.0692934,12.069294 c -0.32,2.139999 0.489837,4.112662 1.919837,5.392662 0.48,0.43 1.2411412,0.327663 1.5611413,-0.232337 0.24,-0.42 0.1398908,-0.939511 -0.2201088,-1.25951 A 3.99,3.99 0 0 1 8.1114131,12.028533 3.954,3.954 0 0 1 11.009511,9.1182064 4.0069999,4.0069999 0 0 1 15.998642,12.998641 c 0,1.18 -0.508805,2.233315 -1.328805,2.963315 -0.36,0.33 -0.468261,0.847663 -0.228261,1.267663 0.31,0.54 1.04,0.69125 1.5,0.28125 A 5.97,5.97 0 0 0 18,12.998641 6,6 0 0 0 11.820652,7.0067935 Z m 0.179347,3.9945655 c -1.1,0 -2.0013592,0.897282 -2.0013592,1.997282 0,1.1 0.9013592,2.001359 2.0013592,2.001359 1.1,0 2.001359,-0.901359 2.001359,-2.001359 0,-1.1 -0.901359,-1.997282 -2.001359,-1.997282 z m 6.342393,6.843749 c -0.462479,0.60136 -1.002053,1.142421 -1.614131,1.59375 -0.4,0.3 -0.506793,0.85212 -0.256793,1.29212 0.3,0.519999 0.979239,0.659783 1.459239,0.309782 a 9.96,9.96 0 0 0 1.353261,-1.210597 7.7288137,8.3389834 0 0 1 -0.941576,-1.985055 z"
+ android:fillColor="#FFFFFFFF"/>
+ <path
+ android:pathData="m 25.626571,16.562335 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.08008 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.55373 v 0 h -1.66729 l 0.29817,-4.825391 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.166251 q 0.62067,-0.54764 1.55167,-0.54764 v 0 q 1.22308,0 1.95632,0.76062 0.73324,0.76062 0.73324,2.06889 z"
+ android:fillColor="#FFFFFFFF"/>
+ </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_wifi_6_hotspot.xml b/packages/SystemUI/res/drawable/ic_wifi_6_hotspot.xml
new file mode 100644
index 000000000000..9a77cfa35b72
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_wifi_6_hotspot.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="54dp"
+ android:height="48dp"
+ android:viewportWidth="27.0"
+ android:viewportHeight="24.0">
+ <group
+ android:translateY="-0.32">
+ <path
+ android:pathData="m 11.951087,3.004076 c -0.36936,0.00196 -0.743424,0.022092 -1.120924,0.065217 -4.6200001,0.52 -8.3498914,4.3292391 -8.7798913,8.95924 a 9.966,9.966 0 0 0 4.0190217,9.012227 c 0.48,0.350001 1.1592392,0.200223 1.4592392,-0.309782 0.2499999,-0.43 0.1432065,-0.99212 -0.2567935,-1.29212 -2.28,-1.689999 -3.6530436,-4.549728 -3.1630435,-7.699728 0.54,-3.4999999 3.462337,-6.2907066 6.9823374,-6.6807066 3.778225,-0.4311254 7.072769,1.8079636 8.335598,5.0625006 A 7.7288137,8.3389834 0 0 1 20.910326,8.4864129 C 19.25166,5.2212048 15.864479,2.9832791 11.951087,3.004076 Z M 11.820652,7.0067935 A 6,6 0 0 0 11.25,7.0516305 C 8.6299999,7.3716306 6.4692934,9.4592936 6.0692934,12.069294 c -0.32,2.139999 0.489837,4.112662 1.919837,5.392662 0.48,0.43 1.2411412,0.327663 1.5611413,-0.232337 0.24,-0.42 0.1398908,-0.939511 -0.2201088,-1.25951 A 3.99,3.99 0 0 1 8.1114131,12.028533 3.954,3.954 0 0 1 11.009511,9.1182064 4.0069999,4.0069999 0 0 1 15.998642,12.998641 c 0,1.18 -0.508805,2.233315 -1.328805,2.963315 -0.36,0.33 -0.468261,0.847663 -0.228261,1.267663 0.31,0.54 1.04,0.69125 1.5,0.28125 A 5.97,5.97 0 0 0 18,12.998641 6,6 0 0 0 11.820652,7.0067935 Z m 0.179347,3.9945655 c -1.1,0 -2.0013592,0.897282 -2.0013592,1.997282 0,1.1 0.9013592,2.001359 2.0013592,2.001359 1.1,0 2.001359,-0.901359 2.001359,-2.001359 0,-1.1 -0.901359,-1.997282 -2.001359,-1.997282 z m 6.342393,6.843749 c -0.462479,0.60136 -1.002053,1.142421 -1.614131,1.59375 -0.4,0.3 -0.506793,0.85212 -0.256793,1.29212 0.3,0.519999 0.979239,0.659783 1.459239,0.309782 a 9.96,9.96 0 0 0 1.353261,-1.210597 7.7288137,8.3389834 0 0 1 -0.941576,-1.985055 z"
+ android:fillColor="#FFFFFFFF"/>
+ <path
+ android:pathData="m 26.031315,16.070676 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.030264 v 0 q 0,-2.207557 0.875601,-3.323047 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 Q 23.827772,11.69655 22.974787,11.69655 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.702671 0.71082,1.908922 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0745 -0.358642,-0.37183 -0.985456,-0.37183 v 0 q -0.600966,0 -0.962838,0.348408 -0.361873,0.348407 -0.361873,0.922255 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="#FFFFFFFF"/>
+ </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_4_hotspot.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_4_hotspot.xml
new file mode 100644
index 000000000000..d9cfadd312a9
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_wifi_4_hotspot.xml
@@ -0,0 +1,48 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:width="22.0dp"
+ android:height="18.0dp"
+ android:viewportWidth="22.0"
+ android:viewportHeight="18.0">
+ <group
+ android:translateX="0.5"
+ android:translateY="0.5" >
+ <path
+ android:pathData="m 9.2771788,1.842391 c -0.5341993,-0.05549 -1.0854891,-0.0556 -1.6467391,0.0081 -3.4399999,0.39 -6.2098912,3.2184785 -6.5298912,6.6684783 -0.26000004,2.6099997 0.8777717,5.1510867 2.9877717,6.7010867 0.36,0.26 0.8623912,0.151739 1.0923913,-0.228261 0.1899999,-0.32 0.098424,-0.741957 -0.1915761,-0.961957 -1.7,-1.259997 -2.7078261,-3.380975 -2.3478261,-5.7309751 C 3.0413094,5.698863 5.2101681,3.620113 7.8301679,3.3301128 10.338407,3.0436568 12.553222,4.3446002 13.675277,6.3423412 A 7.0169487,8.1355924 0 0 1 14.478266,4.8097325 C 13.262879,3.1798315 11.402845,2.063138 9.2771788,1.842341 Z M 8.4986462,4.9605977 c -0.18,0 -0.3498912,0.00854 -0.5298912,0.028533 -1.86,0.23 -3.3884784,1.7125 -3.6684783,3.5624999 -0.2300001,1.5200004 0.351413,2.9092944 1.361413,3.8192934 0.34,0.3 0.8764674,0.228804 1.0964673,-0.171195 0.1699993,-0.3 0.1010337,-0.668587 -0.1589677,-0.888586 C 5.8191898,10.611142 5.4791354,9.5390216 5.7391354,8.5190215 c 0.25,-1.0199998 1.0425001,-1.8084238 2.0624999,-2.0584238 1.5200001,-0.38 3.0583697,0.5384239 3.4483697,2.0584238 0.06,0.2300002 0.08967,0.462935 0.08967,0.6929351 0,0.8400004 -0.361577,1.5791854 -0.941577,2.0991854 -0.25,0.23 -0.328968,0.600814 -0.158968,0.900814 0.22,0.38 0.739783,0.489729 1.059783,0.199729 0.92,-0.81 1.451087,-1.979728 1.451087,-3.1997284 0,-2.3500003 -1.901359,-4.2513589 -4.2513588,-4.2513589 z m 0,2.8288044 c -0.78,0 -1.4184783,0.6425543 -1.4184783,1.4225545 0,0.78 0.6384783,1.4184784 1.4184783,1.4184784 0.78,0 1.4225543,-0.6384784 1.4225543,-1.4184784 0,-0.7800002 -0.6425543,-1.4225545 -1.4225543,-1.4225545 z m 4.9361418,4.7160329 c -0.387159,0.579128 -0.84606,1.109077 -1.40625,1.524456 -0.3,0.22 -0.3775,0.631957 -0.1875,0.961957 0.22,0.39 0.728315,0.488261 1.088315,0.228261 0.438174,-0.322866 0.826135,-0.698796 1.177989,-1.100544 a 7.0169487,8.1355924 0 0 1 -0.672554,-1.61413 z"
+ android:fillColor="#FFFFFFFF"/>
+ <path
+ android:pathData="M 20.617078,11.488485 H 19.56048 v 1.849791 H 18.054271 V 11.488485 H 14.451737 V 10.128539 L 17.795743,4.2569388 H 19.56048 V 10.14143 h 1.056598 z M 18.054271,10.14143 V 7.1701828 q 0,-0.348044 0.01967,-0.754093 0.01968,-0.406048 0.03092,-0.522067 v 0 q -0.146131,0.360936 -0.528296,1.044134 v 0 l -1.83781,3.2032732 z"
+ android:fillColor="#FFFFFFFF"/>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_5_hotspot.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_5_hotspot.xml
new file mode 100644
index 000000000000..aeb7aa49ce83
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_wifi_5_hotspot.xml
@@ -0,0 +1,48 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:width="22.0dp"
+ android:height="18.0dp"
+ android:viewportWidth="22.0"
+ android:viewportHeight="18.0">
+ <group
+ android:translateX="0.5"
+ android:translateY="0.5" >
+ <path
+ android:pathData="m 9.2771788,1.842391 c -0.5341993,-0.05549 -1.0854891,-0.0556 -1.6467391,0.0081 -3.4399999,0.39 -6.2098912,3.2184785 -6.5298912,6.6684783 -0.26000004,2.6099997 0.8777717,5.1510867 2.9877717,6.7010867 0.36,0.26 0.8623912,0.151739 1.0923913,-0.228261 0.1899999,-0.32 0.098424,-0.741957 -0.1915761,-0.961957 -1.7,-1.259997 -2.7078261,-3.380975 -2.3478261,-5.7309751 C 3.0413094,5.698863 5.2101681,3.620113 7.8301679,3.3301128 10.338407,3.0436568 12.553222,4.3446002 13.675277,6.3423412 A 7.0169487,8.1355924 0 0 1 14.478266,4.8097325 C 13.262879,3.1798315 11.402845,2.063138 9.2771788,1.842341 Z M 8.4986462,4.9605977 c -0.18,0 -0.3498912,0.00854 -0.5298912,0.028533 -1.86,0.23 -3.3884784,1.7125 -3.6684783,3.5624999 -0.2300001,1.5200004 0.351413,2.9092944 1.361413,3.8192934 0.34,0.3 0.8764674,0.228804 1.0964673,-0.171195 0.1699993,-0.3 0.1010337,-0.668587 -0.1589677,-0.888586 C 5.8191898,10.611142 5.4791354,9.5390216 5.7391354,8.5190215 c 0.25,-1.0199998 1.0425001,-1.8084238 2.0624999,-2.0584238 1.5200001,-0.38 3.0583697,0.5384239 3.4483697,2.0584238 0.06,0.2300002 0.08967,0.462935 0.08967,0.6929351 0,0.8400004 -0.361577,1.5791854 -0.941577,2.0991854 -0.25,0.23 -0.328968,0.600814 -0.158968,0.900814 0.22,0.38 0.739783,0.489729 1.059783,0.199729 0.92,-0.81 1.451087,-1.979728 1.451087,-3.1997284 0,-2.3500003 -1.901359,-4.2513589 -4.2513588,-4.2513589 z m 0,2.8288044 c -0.78,0 -1.4184783,0.6425543 -1.4184783,1.4225545 0,0.78 0.6384783,1.4184784 1.4184783,1.4184784 0.78,0 1.4225543,-0.6384784 1.4225543,-1.4184784 0,-0.7800002 -0.6425543,-1.4225545 -1.4225543,-1.4225545 z m 4.9361418,4.7160329 c -0.387159,0.579128 -0.84606,1.109077 -1.40625,1.524456 -0.3,0.22 -0.3775,0.631957 -0.1875,0.961957 0.22,0.39 0.728315,0.488261 1.088315,0.228261 0.438174,-0.322866 0.826135,-0.698796 1.177989,-1.100544 a 7.0169487,8.1355924 0 0 1 -0.672554,-1.61413 z"
+ android:fillColor="#FFFFFFFF"/>
+ <path
+ android:pathData="m 21.045878,10.964692 v 0 q 0,1.36304 -0.84885,2.1693 -0.84886,0.80626 -2.32751,0.80626 v 0 q -1.29001,0 -2.06585,-0.58112 -0.77583,-0.58112 -0.95838,-1.6825 v 0 l 1.70988,-0.13995 q 0.13387,0.54765 0.47462,0.79713 0.34076,0.24949 0.85799,0.24949 v 0 q 0.63892,0 1.01923,-0.4077 0.38031,-0.40769 0.38031,-1.1744 v 0 q 0,-0.67543 -0.35901,-1.0800798 -0.35902,-0.40465 -1.00402,-0.40465 v 0 q -0.71195,0 -1.16223,0.5537298 v 0 h -1.66729 l 0.29817,-4.8253905 h 5.15397 v 1.27176 h -3.6023 l -0.13996,2.1662507 q 0.62067,-0.5476397 1.55167,-0.5476397 v 0 q 1.22308,0 1.95632,0.7606197 0.73324,0.76062 0.73324,2.0688898 z"
+ android:fillColor="#FFFFFFFF"/>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_wifi_6_hotspot.xml b/packages/SystemUI/res/drawable/stat_sys_wifi_6_hotspot.xml
new file mode 100644
index 000000000000..9b5e28e01f7b
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_wifi_6_hotspot.xml
@@ -0,0 +1,48 @@
+<!--
+ Copyright (c) 2019, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:width="22.0dp"
+ android:height="18.0dp"
+ android:viewportWidth="22.0"
+ android:viewportHeight="18.0">
+ <group
+ android:translateX="0.5"
+ android:translateY="0.5" >
+ <path
+ android:pathData="m 9.2771788,1.842391 c -0.5341993,-0.05549 -1.0854891,-0.0556 -1.6467391,0.0081 -3.4399999,0.39 -6.2098912,3.2184785 -6.5298912,6.6684783 -0.26000004,2.6099997 0.8777717,5.1510867 2.9877717,6.7010867 0.36,0.26 0.8623912,0.151739 1.0923913,-0.228261 0.1899999,-0.32 0.098424,-0.741957 -0.1915761,-0.961957 -1.7,-1.259997 -2.7078261,-3.380975 -2.3478261,-5.7309751 C 3.0413094,5.698863 5.2101681,3.620113 7.8301679,3.3301128 10.338407,3.0436568 12.553222,4.3446002 13.675277,6.3423412 A 7.0169487,8.1355924 0 0 1 14.478266,4.8097325 C 13.262879,3.1798315 11.402845,2.063138 9.2771788,1.842341 Z M 8.4986462,4.9605977 c -0.18,0 -0.3498912,0.00854 -0.5298912,0.028533 -1.86,0.23 -3.3884784,1.7125 -3.6684783,3.5624999 -0.2300001,1.5200004 0.351413,2.9092944 1.361413,3.8192934 0.34,0.3 0.8764674,0.228804 1.0964673,-0.171195 0.1699993,-0.3 0.1010337,-0.668587 -0.1589677,-0.888586 C 5.8191898,10.611142 5.4791354,9.5390216 5.7391354,8.5190215 c 0.25,-1.0199998 1.0425001,-1.8084238 2.0624999,-2.0584238 1.5200001,-0.38 3.0583697,0.5384239 3.4483697,2.0584238 0.06,0.2300002 0.08967,0.462935 0.08967,0.6929351 0,0.8400004 -0.361577,1.5791854 -0.941577,2.0991854 -0.25,0.23 -0.328968,0.600814 -0.158968,0.900814 0.22,0.38 0.739783,0.489729 1.059783,0.199729 0.92,-0.81 1.451087,-1.979728 1.451087,-3.1997284 0,-2.3500003 -1.901359,-4.2513589 -4.2513588,-4.2513589 z m 0,2.8288044 c -0.78,0 -1.4184783,0.6425543 -1.4184783,1.4225545 0,0.78 0.6384783,1.4184784 1.4184783,1.4184784 0.78,0 1.4225543,-0.6384784 1.4225543,-1.4184784 0,-0.7800002 -0.6425543,-1.4225545 -1.4225543,-1.4225545 z m 4.9361418,4.7160329 c -0.387159,0.579128 -0.84606,1.109077 -1.40625,1.524456 -0.3,0.22 -0.3775,0.631957 -0.1875,0.961957 0.22,0.39 0.728315,0.488261 1.088315,0.228261 0.438174,-0.322866 0.826135,-0.698796 1.177989,-1.100544 a 7.0169487,8.1355924 0 0 1 -0.672554,-1.61413 z"
+ android:fillColor="#FFFFFFFF"/>
+ <path
+ android:pathData="m 21.149959,10.98593 v 0 q 0,1.31751 -0.814213,2.067022 -0.814212,0.749513 -2.248777,0.749513 v 0 q -1.609039,0 -2.471717,-1.0218 -0.862677,-1.021801 -0.862677,-3.0302636 v 0 q 0,-2.2075569 0.875601,-3.3230469 0.875602,-1.11549 2.504027,-1.11549 v 0 q 1.156698,0 1.825516,0.462592 0.668817,0.462591 0.946684,1.434619 v 0 l -1.712431,0.216656 q -0.245556,-0.813927 -1.098541,-0.813927 v 0 q -0.730207,0 -1.147005,0.661682 -0.4168,0.661682 -0.4168,2.008467 v 0 q 0.29079,-0.439168 0.807751,-0.673393 0.51696,-0.234223 1.169623,-0.234223 v 0 q 1.221318,0 1.932139,0.702671 0.71082,0.7026709 0.71082,1.9089215 z m -1.822285,0.04685 v 0 q 0,-0.70267 -0.358641,-1.0744998 -0.358642,-0.3718297 -0.985456,-0.3718297 v 0 q -0.600966,0 -0.962838,0.3484077 -0.361873,0.3484068 -0.361873,0.9222548 v 0 q 0,0.720242 0.378028,1.191617 0.378026,0.471375 0.991917,0.471375 v 0 q 0.61389,0 0.956377,-0.395255 0.342486,-0.395254 0.342486,-1.09207 z"
+ android:fillColor="#FFFFFFFF"/>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
index 759670e01e71..ebb01f6028d2 100644..100755
--- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml
+++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
@@ -59,6 +59,15 @@
</LinearLayout>
+ <include layout="@layout/keyguard_emergency_carrier_area"
+ android:id="@+id/keyguard_selector_fade_container"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="60dp"
+ android:orientation="vertical"
+ android:layout_gravity="bottom|center_horizontal"
+ android:gravity="center_horizontal" />
+
<com.android.systemui.statusbar.KeyguardAffordanceView
android:id="@+id/camera_button"
android:layout_height="@dimen/keyguard_affordance_height"
diff --git a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
index c3fc66952395..419fe4fc2d67 100644
--- a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
+++ b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
@@ -273,4 +273,4 @@
android:text="@string/controls_media_dismiss_button"
/>
</FrameLayout>
-</com.android.systemui.util.animation.TransitionLayout> \ No newline at end of file
+</com.android.systemui.util.animation.TransitionLayout>
diff --git a/packages/SystemUI/res/layout/mobile_signal_group.xml b/packages/SystemUI/res/layout/mobile_signal_group.xml
index 5552020f22cb..43e9c6e3792a 100644
--- a/packages/SystemUI/res/layout/mobile_signal_group.xml
+++ b/packages/SystemUI/res/layout/mobile_signal_group.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
+/*
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+*/
+/*
**
** Copyright 2011, The Android Open Source Project
**
@@ -62,7 +67,7 @@
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical">
+ >
<com.android.systemui.statusbar.AnimatedImageView
android:id="@+id/mobile_signal"
android:layout_height="@dimen/qs_header_mobile_icon_size"
diff --git a/packages/SystemUI/res/layout/status_bar_mobile_signal_group.xml b/packages/SystemUI/res/layout/status_bar_mobile_signal_group.xml
index 10d49b38ae75..0a3fe394c9b8 100644
--- a/packages/SystemUI/res/layout/status_bar_mobile_signal_group.xml
+++ b/packages/SystemUI/res/layout/status_bar_mobile_signal_group.xml
@@ -22,15 +22,19 @@
android:id="@+id/mobile_combo"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:gravity="center_vertical" >
-
+ android:gravity="center_vertical">
<com.android.keyguard.AlphaOptimizedLinearLayout
android:id="@+id/mobile_group"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal" >
-
+ <ImageView
+ android:id="@+id/mobile_volte"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:visibility="gone"
+ android:paddingEnd="2dp"/>
<FrameLayout
android:id="@+id/inout_container"
android:layout_height="17dp"
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index e00b9410a8a7..cc33cde8527b 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -359,7 +359,7 @@
<bool name="config_enableNotificationShadeDrag">true</bool>
<!-- Whether to show activity indicators in the status bar -->
- <bool name="config_showActivity">false</bool>
+ <bool name="config_showActivity">true</bool>
<!-- Whether or not the button to clear all notifications will be shown. -->
<bool name="config_enableNotificationsClearAll">true</bool>
@@ -390,6 +390,7 @@
the other notifications need to be manually expanded by the user. -->
<bool name="config_alwaysExpandNonGroupedNotifications">false</bool>
+
<!-- Whether or not an expandable notification can be manually expanded or collapsed by the
user. Grouped notifications are still expandable even if this value is false. -->
<bool name="config_enableNonGroupedNotificationExpand">true</bool>
@@ -431,6 +432,9 @@
<item>120</item>
</integer-array>
+
+
+
<!-- Smart replies in notifications: Whether smart replies in notifications are enabled. -->
<bool name="config_smart_replies_in_notifications_enabled">true</bool>
diff --git a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java
index 997c5275a2fa..85645adf72e2 100644
--- a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java
+++ b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java
@@ -16,6 +16,8 @@
package com.android.keyguard;
+import android.telephony.TelephonyManager;
+
import com.android.systemui.util.ViewController;
import javax.inject.Inject;
diff --git a/packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java b/packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java
index 907943a9203d..f90f93797ee8 100644
--- a/packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java
+++ b/packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java
@@ -37,6 +37,8 @@ import com.android.systemui.R;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.keyguard.WakefulnessLifecycle;
+import com.android.systemui.statusbar.policy.FiveGServiceClient;
+import com.android.systemui.statusbar.policy.FiveGServiceClient.FiveGServiceState;
import com.android.systemui.telephony.TelephonyListenerManager;
import java.util.List;
@@ -88,6 +90,7 @@ public class CarrierTextManager {
if (callback != null) callback.startedGoingToSleep();
}
};
+ private FiveGServiceClient mFiveGServiceClient;
@VisibleForTesting
protected final KeyguardUpdateMonitorCallback mCallback = new KeyguardUpdateMonitorCallback() {
@@ -299,11 +302,15 @@ public class CarrierTextManager {
protected void updateCarrierText() {
boolean allSimsMissing = true;
boolean anySimReadyAndInService = false;
+ boolean missingSimsWithSubs = false;
+ boolean showCustomizeName = getContext().getResources().getBoolean(
+ com.android.systemui.R.bool.config_show_customize_carrier_name);
CharSequence displayText = null;
List<SubscriptionInfo> subs = getSubscriptionInfo();
final int numSubs = subs.size();
final int[] subsIds = new int[numSubs];
+ if (DEBUG) Log.d(TAG, "updateCarrierText(): " + numSubs);
// This array will contain in position i, the index of subscription in slot ID i.
// -1 if no subscription in that slot
final int[] subOrderBySlot = new int[mSimSlotsNumber];
@@ -320,6 +327,9 @@ public class CarrierTextManager {
subOrderBySlot[subs.get(i).getSimSlotIndex()] = i;
int simState = mKeyguardUpdateMonitor.getSimState(subId);
CharSequence carrierName = subs.get(i).getCarrierName();
+ if ( showCustomizeName ) {
+ carrierName = getCustomizeCarrierName(carrierName, subs.get(i));
+ }
CharSequence carrierTextForSimState = getCarrierTextForSimState(simState, carrierName);
if (DEBUG) {
Log.d(TAG, "Handling (subId=" + subId + "): " + simState + " " + carrierName);
@@ -732,4 +742,119 @@ public class CarrierTextManager {
*/
default void finishedWakingUp() {};
}
+
+ private String getCustomizeCarrierName(CharSequence originCarrierName,
+ SubscriptionInfo sub) {
+ StringBuilder newCarrierName = new StringBuilder();
+ int networkType = getNetworkType(sub.getSubscriptionId());
+ String networkClass = networkTypeToString(networkType);
+
+ String fiveGNetworkClass = get5GNetworkClass(sub, networkType);
+ if ( fiveGNetworkClass != null ) {
+ networkClass = fiveGNetworkClass;
+ }
+
+ if (!TextUtils.isEmpty(originCarrierName)) {
+ String[] names = originCarrierName.toString().split(mSeparator.toString(), 2);
+ for (int j = 0; j < names.length; j++) {
+ names[j] = getLocalString(
+ names[j], com.android.systemui.R.array.origin_carrier_names,
+ com.android.systemui.R.array.locale_carrier_names);
+ if (!TextUtils.isEmpty(names[j])) {
+ if (!TextUtils.isEmpty(networkClass)) {
+ names[j] = new StringBuilder().append(names[j]).append(" ")
+ .append(networkClass).toString();
+ }
+ if (j > 0 && names[j].equals(names[j - 1])) {
+ continue;
+ }
+ if (j > 0) {
+ newCarrierName.append(mSeparator);
+ }
+ newCarrierName.append(names[j]);
+ }
+ }
+ }
+ return newCarrierName.toString();
+ }
+
+ /**
+ * parse the string to current language.
+ *
+ * @param originalString original string
+ * @param originNamesId the id of the original string array.
+ * @param localNamesId the id of the local string keys.
+ * @return local language string
+ */
+ private String getLocalString(String originalString,
+ int originNamesId, int localNamesId) {
+ String[] origNames = getContext().getResources().getStringArray(originNamesId);
+ String[] localNames = getContext().getResources().getStringArray(localNamesId);
+ for (int i = 0; i < origNames.length; i++) {
+ if (origNames[i].equalsIgnoreCase(originalString)) {
+ return localNames[i];
+ }
+ }
+ return originalString;
+ }
+
+ private int getNetworkType(int subId) {
+ int networkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ ServiceState ss = mKeyguardUpdateMonitor.mServiceStates.get(subId);
+ if (ss != null && (ss.getDataRegState() == ServiceState.STATE_IN_SERVICE
+ || ss.getVoiceRegState() == ServiceState.STATE_IN_SERVICE)) {
+ networkType = ss.getDataNetworkType();
+ if (networkType == TelephonyManager.NETWORK_TYPE_UNKNOWN) {
+ networkType = ss.getVoiceNetworkType();
+ }
+ }
+ return networkType;
+ }
+
+ private String networkTypeToString(int networkType) {
+ int classId = com.android.systemui.R.string.config_rat_unknown;
+ long mask = TelephonyManager.getBitMaskForNetworkType(networkType);
+ if ((mask & TelephonyManager.NETWORK_CLASS_BITMASK_2G) != 0) {
+ classId = com.android.systemui.R.string.config_rat_2g;
+ } else if ((mask & TelephonyManager.NETWORK_CLASS_BITMASK_3G) != 0) {
+ classId = com.android.systemui.R.string.config_rat_3g;
+ } else if ((mask & TelephonyManager.NETWORK_CLASS_BITMASK_4G) != 0) {
+ classId = com.android.systemui.R.string.config_rat_4g;
+ }
+ return getContext().getResources().getString(classId);
+ }
+
+
+ private String get5GNetworkClass(SubscriptionInfo sub, int networkType) {
+ if ( networkType == TelephonyManager.NETWORK_TYPE_NR ) {
+ return mContext.getResources().getString(R.string.data_connection_5g);
+ }
+
+ int slotIndex = sub.getSimSlotIndex();
+ int subId = sub.getSubscriptionId();
+
+ if ( mFiveGServiceClient == null ) {
+ mFiveGServiceClient = FiveGServiceClient.getInstance(mContext);
+ mFiveGServiceClient.registerCallback(mCallback);
+ }
+ FiveGServiceState fiveGServiceState =
+ mFiveGServiceClient.getCurrentServiceState(slotIndex);
+ if ( fiveGServiceState.isNrIconTypeValid() && isDataRegisteredOnLte(subId)) {
+ return mContext.getResources().getString(R.string.data_connection_5g);
+ }
+
+ return null;
+ }
+
+ private boolean isDataRegisteredOnLte(int subId) {
+ TelephonyManager telephonyManager = (TelephonyManager)
+ mContext.getSystemService(Context.TELEPHONY_SERVICE);
+ int dataType = telephonyManager.getDataNetworkType(subId);
+ if ( dataType == TelephonyManager.NETWORK_TYPE_LTE ||
+ dataType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
+ return true;
+ }else{
+ return false;
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java b/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java
index c4b02f62f291..ef76e9304c1c 100644
--- a/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java
+++ b/packages/SystemUI/src/com/android/keyguard/EmergencyButton.java
@@ -17,6 +17,7 @@
package com.android.keyguard;
import android.content.Context;
+import com.android.systemui.Dependency;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@@ -26,6 +27,9 @@ import android.widget.Button;
import com.android.internal.util.EmergencyAffordanceManager;
import com.android.internal.widget.LockPatternUtils;
import com.android.settingslib.Utils;
+import com.android.systemui.R;
+
+import java.util.List;
/**
* This class implements a smart emergency button that updates itself based
@@ -107,7 +111,8 @@ public class EmergencyButton extends Button {
return super.performLongClick();
}
- void updateEmergencyCallButton(boolean isInCall, boolean isVoiceCapable, boolean simLocked) {
+ public void updateEmergencyCallButton(boolean isInCall, boolean isVoiceCapable,
+ boolean simLocked, boolean isEmergencyCapable) {
boolean visible = false;
if (isVoiceCapable) {
// Emergency calling requires voice capability.
@@ -118,8 +123,13 @@ public class EmergencyButton extends Button {
// Some countries can't handle emergency calls while SIM is locked.
visible = mEnableEmergencyCallWhileSimLocked;
} else {
- // Only show if there is a secure screen (pin/pattern/SIM pin/SIM puk);
- visible = mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
+ // Show if there is a secure screen (pin/pattern/SIM pin/SIM puk) or config set
+ visible = mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser()) ||
+ mContext.getResources().getBoolean(R.bool.config_showEmergencyButton);
+ }
+
+ if (mContext.getResources().getBoolean(R.bool.kg_hide_emgcy_btn_when_oos)) {
+ visible = visible && isEmergencyCapable;
}
}
}
@@ -137,4 +147,5 @@ public class EmergencyButton extends Button {
setVisibility(View.GONE);
}
}
+
}
diff --git a/packages/SystemUI/src/com/android/keyguard/EmergencyButtonController.java b/packages/SystemUI/src/com/android/keyguard/EmergencyButtonController.java
index e7215b8ebe49..1d6dce9b1af8 100644
--- a/packages/SystemUI/src/com/android/keyguard/EmergencyButtonController.java
+++ b/packages/SystemUI/src/com/android/keyguard/EmergencyButtonController.java
@@ -26,6 +26,9 @@ import android.os.PowerManager;
import android.os.SystemClock;
import android.os.UserHandle;
import android.telecom.TelecomManager;
+import android.telephony.CellInfo;
+import android.telephony.ServiceState;
+import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
@@ -34,12 +37,14 @@ import androidx.annotation.Nullable;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.keyguard.dagger.KeyguardBouncerScope;
+import com.android.systemui.R;
import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.util.EmergencyDialerConstants;
import com.android.systemui.util.ViewController;
+import java.util.List;
import javax.inject.Inject;
/** View Controller for {@link com.android.keyguard.EmergencyButton}. */
@@ -56,17 +61,28 @@ public class EmergencyButtonController extends ViewController<EmergencyButton> {
private final MetricsLogger mMetricsLogger;
private EmergencyButtonCallback mEmergencyButtonCallback;
+ private boolean mIsCellAvailable;
+ private ServiceState mServiceState;
private final KeyguardUpdateMonitorCallback mInfoCallback =
new KeyguardUpdateMonitorCallback() {
@Override
public void onSimStateChanged(int subId, int slotId, int simState) {
updateEmergencyCallButton();
+ requestCellInfoUpdate();
}
@Override
public void onPhoneStateChanged(int phoneState) {
updateEmergencyCallButton();
+ requestCellInfoUpdate();
+ }
+
+ @Override
+ public void onServiceStateChanged(int subId, ServiceState state) {
+ mServiceState = state;
+ updateEmergencyCallButton();
+ requestCellInfoUpdate();
}
};
@@ -117,7 +133,8 @@ public class EmergencyButtonController extends ViewController<EmergencyButton> {
mView.updateEmergencyCallButton(
mTelecomManager != null && mTelecomManager.isInCall(),
mTelephonyManager.isVoiceCapable(),
- mKeyguardUpdateMonitor.isSimPinVoiceSecure());
+ mKeyguardUpdateMonitor.isSimPinVoiceSecure(),
+ isEmergencyCapable());
}
}
@@ -159,6 +176,40 @@ public class EmergencyButtonController extends ViewController<EmergencyButton> {
}
}
+ private void requestCellInfoUpdate(){
+ if(!getContext().getResources().getBoolean(R.bool.kg_hide_emgcy_btn_when_oos)) {
+ return;
+ }
+ TelephonyManager tmWithoutSim = mTelephonyManager
+ .createForSubscriptionId(SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+ try {
+ tmWithoutSim.requestCellInfoUpdate(getContext().getMainExecutor(),
+ new TelephonyManager.CellInfoCallback() {
+ @Override
+ public void onCellInfo(List<CellInfo> cellInfo) {
+ if (KeyguardConstants.DEBUG_SIM_STATES) {
+ Log.d(LOG_TAG, "requestCellInfoUpdate.onCellInfo cellInfoList.size="
+ + (cellInfo == null ? 0 : cellInfo.size()));
+ }
+ if (cellInfo == null || cellInfo.isEmpty()) {
+ mIsCellAvailable = false;
+ } else {
+ mIsCellAvailable = true;
+ }
+ updateEmergencyCallButton();
+ }
+ });
+ } catch (Exception exception) {
+ Log.e(LOG_TAG, "Fail to call TelephonyManager.requestCellInfoUpdate ", exception);
+ }
+ }
+
+ private boolean isEmergencyCapable() {
+ return (!mKeyguardUpdateMonitor.isOOS()
+ || mIsCellAvailable
+ || (mServiceState !=null && mServiceState.isEmergencyOnly()));
+ }
+
/** */
public interface EmergencyButtonCallback {
/** */
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
index cc6df45c598f..ff5f66485676 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -66,6 +66,7 @@ public abstract class KeyguardAbsKeyInputView extends KeyguardInputView {
return R.string.kg_wrong_password;
}
+
protected abstract void resetPasswordText(boolean animate, boolean announce);
protected abstract LockscreenCredential getEnteredCredential();
protected abstract void setPasswordEntryEnabled(boolean enabled);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index 1c4559eb0364..6bb88646e918 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -169,6 +169,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
void onPasswordChecked(int userId, boolean matched, int timeoutMs, boolean isValidPassword) {
boolean dismissKeyguard = KeyguardUpdateMonitor.getCurrentUser() == userId;
if (matched) {
+ mLockPatternUtils.sanitizePassword();
getKeyguardSecurityCallback().reportUnlockAttempt(userId, true, 0);
if (dismissKeyguard) {
mDismissing = true;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardConstants.java b/packages/SystemUI/src/com/android/keyguard/KeyguardConstants.java
index b2658c9f9bdb..b2658c9f9bdb 100644..100755
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardConstants.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardConstants.java
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index 94e07b713915..3ff7c637b365 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -164,6 +164,7 @@ public class KeyguardPatternViewController
boolean isValidPattern) {
boolean dismissKeyguard = KeyguardUpdateMonitor.getCurrentUser() == userId;
if (matched) {
+ mLockPatternUtils.sanitizePassword();
getKeyguardSecurityCallback().reportUnlockAttempt(userId, true, 0);
if (dismissKeyguard) {
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java
index 69328cd5d344..12935c342a2d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityModel.java
@@ -23,6 +23,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import com.android.internal.widget.LockPatternUtils;
+import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
@@ -66,9 +67,8 @@ public class KeyguardSecurityModel {
return SecurityMode.SimPuk;
}
- if (SubscriptionManager.isValidSubscriptionId(
- mKeyguardUpdateMonitor.getNextSubIdForState(
- TelephonyManager.SIM_STATE_PIN_REQUIRED))) {
+ int subId = mKeyguardUpdateMonitor.getUnlockedSubIdForState(TelephonyManager.SIM_STATE_PIN_REQUIRED);
+ if (SubscriptionManager.isValidSubscriptionId((subId))){
return SecurityMode.SimPin;
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
index c0f9ce794628..bd26320fd5e5 100644..100755
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
@@ -29,6 +29,7 @@ import com.android.systemui.R;
public class KeyguardSimPinView extends KeyguardPinBasedInputView {
public static final String TAG = "KeyguardSimPinView";
+
public KeyguardSimPinView(Context context) {
this(context, null);
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
index e04bfdc3868d..fadb19f7ce0c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
@@ -58,18 +58,24 @@ public class KeyguardSimPinViewController
private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private AlertDialog mRemainingAttemptsDialog;
private ImageView mSimImageView;
+ private int mSlotId;
KeyguardUpdateMonitorCallback mUpdateMonitorCallback = new KeyguardUpdateMonitorCallback() {
@Override
public void onSimStateChanged(int subId, int slotId, int simState) {
- if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
- if (simState == TelephonyManager.SIM_STATE_READY) {
+ if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",slotId=" + slotId
+ + ",simState=" + simState + ")");
+
+ if ((simState == TelephonyManager.SIM_STATE_READY)
+ || (simState == TelephonyManager.SIM_STATE_LOADED)) {
mRemainingAttempts = -1;
resetState();
} else {
resetState();
}
}
+
+
};
protected KeyguardSimPinViewController(KeyguardSimPinView view,
@@ -96,7 +102,7 @@ public class KeyguardSimPinViewController
@Override
void resetState() {
super.resetState();
- if (DEBUG) Log.v(TAG, "Resetting state");
+ if (DEBUG) Log.v(TAG, "Resetting state mShowDefaultMessage="+mShowDefaultMessage);
handleSubInfoChangeIfNeeded();
mMessageAreaController.setMessage("");
if (mShowDefaultMessage) {
@@ -115,7 +121,6 @@ public class KeyguardSimPinViewController
public void onResume(int reason) {
super.onResume(reason);
mKeyguardUpdateMonitor.registerCallback(mUpdateMonitorCallback);
- mView.resetState();
}
@Override
@@ -128,6 +133,8 @@ public class KeyguardSimPinViewController
mSimUnlockProgressDialog.dismiss();
mSimUnlockProgressDialog = null;
}
+
+ mMessageAreaController.setMessage("");
}
@Override
@@ -235,10 +242,18 @@ public class KeyguardSimPinViewController
displayMessage = mView.getResources().getString(
R.string.kg_password_wrong_pin_code_pukked);
} else if (attemptsRemaining > 0) {
- msgId = isDefault ? R.plurals.kg_password_default_pin_message :
- R.plurals.kg_password_wrong_pin_code;
- displayMessage = mView.getResources()
- .getQuantityString(msgId, attemptsRemaining, attemptsRemaining);
+ int count = TelephonyManager.getDefault().getSimCount();
+ if ( count > 1 ) {
+ msgId = isDefault ? R.plurals.kg_password_default_pin_message_multi_sim :
+ R.plurals.kg_password_wrong_pin_code_multi_sim;
+ displayMessage = mView.getContext().getResources()
+ .getQuantityString(msgId, attemptsRemaining, mSlotId, attemptsRemaining);
+ }else {
+ msgId = isDefault ? R.plurals.kg_password_default_pin_message :
+ R.plurals.kg_password_wrong_pin_code;
+ displayMessage = mView.getContext().getResources()
+ .getQuantityString(msgId, attemptsRemaining, attemptsRemaining);
+ }
} else {
msgId = isDefault ? R.string.kg_sim_pin_instructions : R.string.kg_password_pin_failed;
displayMessage = mView.getResources().getString(msgId);
@@ -260,6 +275,7 @@ public class KeyguardSimPinViewController
return;
}
+ mSlotId = SubscriptionManager.getSlotIndex(mSubId) + 1;
// Sending empty PIN here to query the number of remaining PIN attempts
new CheckSimPin("", mSubId) {
void onSimCheckResponse(final PinResult result) {
@@ -336,11 +352,17 @@ public class KeyguardSimPinViewController
private void handleSubInfoChangeIfNeeded() {
int subId = mKeyguardUpdateMonitor
- .getNextSubIdForState(TelephonyManager.SIM_STATE_PIN_REQUIRED);
- if (subId != mSubId && SubscriptionManager.isValidSubscriptionId(subId)) {
- mSubId = subId;
+ .getUnlockedSubIdForState(TelephonyManager.SIM_STATE_PIN_REQUIRED);
+ if (SubscriptionManager.isValidSubscriptionId(subId)) {
+ if (DEBUG) Log.v(TAG, "handleSubInfoChangeIfNeeded mSubId="+mSubId+" subId="+ subId);
mShowDefaultMessage = true;
- mRemainingAttempts = -1;
+ if(subId != mSubId){
+ mSubId = subId;
+ mRemainingAttempts = -1;
+ }
+ }else{
+ //false by default and keep false except in PIN lock state
+ mShowDefaultMessage = false;
}
}
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
index 0d72c93e9041..a1adcd32c6db 100644..100755
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
@@ -17,11 +17,15 @@
package com.android.keyguard;
import android.content.Context;
+import android.telephony.SubscriptionInfo;
import android.util.AttributeSet;
import android.util.Log;
+import com.android.systemui.Dependency;
import com.android.systemui.R;
+import java.util.HashMap;
+import java.util.Map;
/**
* Displays a PIN pad for entering a PUK (Pin Unlock Kode) provided by a carrier.
@@ -29,6 +33,7 @@ import com.android.systemui.R;
public class KeyguardSimPukView extends KeyguardPinBasedInputView {
private static final boolean DEBUG = KeyguardConstants.DEBUG;
public static final String TAG = "KeyguardSimPukView";
+ private Map<String, String> mWrongPukCodeMessageMap = new HashMap<>(4);
public KeyguardSimPukView(Context context) {
this(context, null);
@@ -36,6 +41,35 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
public KeyguardSimPukView(Context context, AttributeSet attrs) {
super(context, attrs);
+ updateWrongPukMessageMap(context);
+ }
+
+ void updateWrongPukMessageMap(Context context) {
+ String[] customizationConfigs = context.getResources().
+ getStringArray(R.array.kg_wrong_puk_code_message_list);
+ if ( customizationConfigs.length == 0 ){
+ Log.d(TAG, "There is no customization PUK prompt");
+ return;
+ }
+ for(String config : customizationConfigs ) {
+ String[] kv = config.trim().split(":");
+ if ( kv.length != 2) {
+ Log.e(TAG, "invalid key value config " + config);
+ continue;
+ }
+ mWrongPukCodeMessageMap.put(kv[0], kv[1]);
+ }
+ }
+
+ private String getMessageTextForWrongPukCode(int subId) {
+ String message = null;
+ SubscriptionInfo info = Dependency.get(KeyguardUpdateMonitor.class)
+ .getSubscriptionInfoForSubId(subId);
+ if ( info != null ) {
+ String mccMNC = info.getMccString()+info.getMncString();
+ message = mWrongPukCodeMessageMap.get(mccMNC);
+ }
+ return message;
}
@Override
@@ -45,11 +79,16 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
}
String getPukPasswordErrorMessage(
- int attemptsRemaining, boolean isDefault, boolean isEsimLocked) {
+ int attemptsRemaining, boolean isDefault, boolean isEsimLocked, int subId) {
String displayMessage;
if (attemptsRemaining == 0) {
- displayMessage = getContext().getString(R.string.kg_password_wrong_puk_code_dead);
+ String message = getMessageTextForWrongPukCode(subId);
+ if ( message == null ) {
+ displayMessage = getContext().getString(R.string.kg_password_wrong_puk_code_dead);
+ }else {
+ displayMessage = message;
+ }
} else if (attemptsRemaining > 0) {
int msgId = isDefault ? R.plurals.kg_password_default_puk_message :
R.plurals.kg_password_wrong_puk_code;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
index 07309224608e..ff680a56efe7 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java
@@ -178,7 +178,7 @@ public class KeyguardSimPukViewController
if (mRemainingAttempts >= 0) {
mMessageAreaController.setMessage(mView.getPukPasswordErrorMessage(
mRemainingAttempts, true,
- KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId)));
+ KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId), mSubId));
return;
}
@@ -221,7 +221,7 @@ public class KeyguardSimPukViewController
mMessageAreaController.setMessage(
mView.getPukPasswordErrorMessage(
result.getAttemptsRemaining(), true,
- KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId)));
+ KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId), mSubId));
}
}
}
@@ -281,7 +281,7 @@ public class KeyguardSimPukViewController
// show message
mMessageAreaController.setMessage(mView.getPukPasswordErrorMessage(
result.getAttemptsRemaining(), false,
- KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId)));
+ KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId), mSubId));
if (result.getAttemptsRemaining() <= 2) {
// this is getting critical - show dialog
getPukRemainingAttemptsDialog(
@@ -292,7 +292,7 @@ public class KeyguardSimPukViewController
mView.getPukPasswordErrorMessage(
result.getAttemptsRemaining(), false,
KeyguardEsimArea.isEsimLocked(
- mView.getContext(), mSubId)));
+ mView.getContext(), mSubId), mSubId));
}
} else {
mMessageAreaController.setMessage(mView.getResources().getString(
@@ -341,13 +341,15 @@ public class KeyguardSimPukViewController
mSubId = subId;
mShowDefaultMessage = true;
mRemainingAttempts = -1;
+ }else{
+ mShowDefaultMessage = false;
}
}
private Dialog getPukRemainingAttemptsDialog(int remaining) {
String msg = mView.getPukPasswordErrorMessage(remaining, false,
- KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId));
+ KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId), mSubId);
if (mRemainingAttemptsDialog == null) {
AlertDialog.Builder builder = new AlertDialog.Builder(mView.getContext());
builder.setMessage(msg);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 42f0fccd61b0..b54d11d1f811 100644..100755
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -111,6 +111,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.telephony.TelephonyListenerManager;
import com.android.systemui.util.Assert;
import com.android.systemui.util.RingerModeTracker;
+import com.android.systemui.keyguard.KeyguardViewMediator;
import com.google.android.collect.Lists;
@@ -119,12 +120,9 @@ import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
import java.util.TimeZone;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -487,41 +485,21 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
List<SubscriptionInfo> subscriptionInfos = getSubscriptionInfo(true /* forceReload */);
// Hack level over 9000: Because the subscription id is not yet valid when we see the
- // first update in handleSimStateChange, we need to force refresh all SIM states
+ // first update in handleSimStateChange, we need to force refresh all all SIM states
// so the subscription id for them is consistent.
ArrayList<SubscriptionInfo> changedSubscriptions = new ArrayList<>();
- Set<Integer> activeSubIds = new HashSet<>();
for (int i = 0; i < subscriptionInfos.size(); i++) {
SubscriptionInfo info = subscriptionInfos.get(i);
- activeSubIds.add(info.getSubscriptionId());
boolean changed = refreshSimState(info.getSubscriptionId(), info.getSimSlotIndex());
if (changed) {
changedSubscriptions.add(info);
}
}
-
- // It is possible for active subscriptions to become invalid (-1), and these will not be
- // present in the subscriptionInfo list
- Iterator<Map.Entry<Integer, SimData>> iter = mSimDatas.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry<Integer, SimData> simData = iter.next();
- if (!activeSubIds.contains(simData.getKey())) {
- Log.i(TAG, "Previously active sub id " + simData.getKey() + " is now invalid, "
- + "will remove");
- iter.remove();
-
- SimData data = simData.getValue();
- for (int j = 0; j < mCallbacks.size(); j++) {
- KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
- if (cb != null) {
- cb.onSimStateChanged(data.subId, data.slotId, data.simState);
- }
- }
- }
- }
-
for (int i = 0; i < changedSubscriptions.size(); i++) {
- SimData data = mSimDatas.get(changedSubscriptions.get(i).getSubscriptionId());
+ SimData data = mSimDatas.get(changedSubscriptions.get(i).getSimSlotIndex());
+ if (data == null) {
+ continue;
+ }
for (int j = 0; j < mCallbacks.size(); j++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
if (cb != null) {
@@ -1625,11 +1603,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
state = TelephonyManager.SIM_STATE_NETWORK_LOCKED;
} else if (Intent.SIM_STATE_CARD_IO_ERROR.equals(stateExtra)) {
state = TelephonyManager.SIM_STATE_CARD_IO_ERROR;
- } else if (Intent.SIM_STATE_LOADED.equals(stateExtra)
- || Intent.SIM_STATE_IMSI.equals(stateExtra)) {
+ } else if (Intent.SIM_STATE_IMSI.equals(stateExtra)) {
// This is required because telephony doesn't return to "READY" after
// these state transitions. See bug 7197471.
state = TelephonyManager.SIM_STATE_READY;
+ } else if (Intent.SIM_STATE_LOADED.equals(stateExtra)) {
+ state = TelephonyManager.SIM_STATE_LOADED;
} else {
state = TelephonyManager.SIM_STATE_UNKNOWN;
}
@@ -2873,11 +2852,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
}
}
- SimData data = mSimDatas.get(subId);
+ SimData data = mSimDatas.get(slotId);
final boolean changed;
if (data == null) {
data = new SimData(state, slotId, subId);
- mSimDatas.put(subId, data);
+ mSimDatas.put(slotId, data);
changed = true; // no data yet; force update
} else {
changed = (data.simState != state || data.subId != subId || data.slotId != slotId);
@@ -2907,6 +2886,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
Log.w(TAG, "invalid subId in handleServiceStateChange()");
+ for (int j = 0; j < mCallbacks.size(); j++) {
+ KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
+ if (cb != null) {
+ cb.onServiceStateChanged(subId, serviceState);
+ }
+ }
return;
} else {
updateTelephonyCapable(true);
@@ -2914,7 +2899,17 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
mServiceStates.put(subId, serviceState);
- callbacksRefreshCarrierInfo();
+ // The upstream method (callbacksRefreshCarrierInfo) does not subId or
+ // serviceState as input. Thus onServiceStateChanged cannot be called
+ // from that new method. For now, re-use the same logic as before here
+ // instead of a call to callbacksRefreshCarrierInfo.
+ for (int j = 0; j < mCallbacks.size(); j++) {
+ KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
+ if (cb != null) {
+ cb.onRefreshCarrierInfo();
+ cb.onServiceStateChanged(subId, serviceState);
+ }
+ }
}
public boolean isKeyguardVisible() {
@@ -3248,18 +3243,20 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
}
public int getSimState(int subId) {
- if (mSimDatas.containsKey(subId)) {
- return mSimDatas.get(subId).simState;
+ int slotId = SubscriptionManager.getSlotIndex(subId);
+ if (mSimDatas.containsKey(slotId)) {
+ return mSimDatas.get(slotId).simState;
} else {
return TelephonyManager.SIM_STATE_UNKNOWN;
}
}
private int getSlotId(int subId) {
- if (!mSimDatas.containsKey(subId)) {
- refreshSimState(subId, SubscriptionManager.getSlotIndex(subId));
+ int slotId = SubscriptionManager.getSlotIndex(subId);
+ if (!mSimDatas.containsKey(slotId)) {
+ refreshSimState(subId, slotId);
}
- return mSimDatas.get(subId).slotId;
+ return mSimDatas.get(slotId).slotId;
}
private final TaskStackChangeListener
@@ -3288,15 +3285,16 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
(TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
int state = (tele != null) ?
tele.getSimState(slotId) : TelephonyManager.SIM_STATE_UNKNOWN;
- SimData data = mSimDatas.get(subId);
+ SimData data = mSimDatas.get(slotId);
final boolean changed;
if (data == null) {
data = new SimData(state, slotId, subId);
- mSimDatas.put(subId, data);
+ mSimDatas.put(slotId, data);
changed = true; // no data yet; force update
} else {
- changed = data.simState != state;
+ changed = (data.simState != state) || (data.slotId != slotId);
data.simState = state;
+ data.slotId = slotId;
}
return changed;
}
@@ -3394,6 +3392,28 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
return resultId;
}
+
+ /**
+ * Find the Unlocked SubscriptionId for a SIM in the given state,
+ * @param state
+ * @return subid or {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID} if none found
+ */
+ public int getUnlockedSubIdForState(int state) {
+ List<SubscriptionInfo> list = getSubscriptionInfo(false /* forceReload */);
+ int resultId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+ for (int i = 0; i < list.size(); i++) {
+ final SubscriptionInfo info = list.get(i);
+ final int id = info.getSubscriptionId();
+ int slotId = SubscriptionManager.getSlotIndex(id);
+ if (state == getSimState(id) && (KeyguardViewMediator.getUnlockTrackSimState(slotId)
+ != TelephonyManager.SIM_STATE_READY)) {
+ resultId = id;
+ break;
+ }
+ }
+ return resultId;
+ }
+
public SubscriptionInfo getSubscriptionInfoForSubId(int subId) {
List<SubscriptionInfo> list = getSubscriptionInfo(false /* forceReload */);
for (int i = 0; i < list.size(); i++) {
@@ -3464,6 +3484,34 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
mHandler.removeCallbacksAndMessages(null);
}
+ public boolean isOOS() {
+ boolean ret = true;
+ int phoneCount = mTelephonyManager.getActiveModemCount();
+ for (int phoneId = 0; phoneId < phoneCount; phoneId++) {
+ int[] subId = mSubscriptionManager.getSubscriptionIds(phoneId);
+ if (subId != null && subId.length >= 1) {
+ if (DEBUG) Log.d(TAG, "slot id:" + phoneId + " subId:" + subId[0]);
+ ServiceState state = mServiceStates.get(subId[0]);
+ if (state != null) {
+ if (state.isEmergencyOnly()) {
+ ret = false;
+ } else if ((state.getVoiceRegState() != ServiceState.STATE_OUT_OF_SERVICE)
+ && (state.getVoiceRegState() != ServiceState.STATE_POWER_OFF)) {
+ ret = false;
+ }
+ if (DEBUG) {
+ Log.d(TAG, "is emergency: " + state.isEmergencyOnly()
+ + "voice state: " + state.getVoiceRegState());
+ }
+ } else {
+ if (DEBUG) Log.d(TAG, "state is NULL");
+ }
+ }
+ }
+
+ return ret;
+ }
+
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("KeyguardUpdateMonitor state:");
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
index 8170a81a09e6..c742f62f81ba 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
@@ -20,6 +20,7 @@ import android.graphics.Bitmap;
import android.hardware.biometrics.BiometricSourceType;
import android.media.AudioManager;
import android.os.SystemClock;
+import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.view.WindowManagerPolicyConstants;
@@ -151,6 +152,13 @@ public class KeyguardUpdateMonitorCallback {
public void onSimStateChanged(int subId, int slotId, int simState) { }
/**
+ * Called when the sevice state changes.
+ * @param subId
+ * @param serviceState
+ */
+ public void onServiceStateChanged(int subId, ServiceState state) { }
+
+ /**
* Called when the user's info changed.
*/
public void onUserInfoChanged(int userId) { }
diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
index e566ccb49e3b..759adc22862a 100644
--- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
+++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
@@ -118,6 +118,10 @@ public class ScreenDecorations extends SystemUI implements Tunable {
SystemProperties.getBoolean("debug.disable_screen_decorations", false);
private static final boolean DEBUG_SCREENSHOT_ROUNDED_CORNERS =
SystemProperties.getBoolean("debug.screenshot_rounded_corners", false);
+
+ private static int mDisableRoundedCorner =
+ SystemProperties.getInt("vendor.display.disable_rounded_corner", 0);
+
private static final boolean VERBOSE = false;
private static final boolean DEBUG_COLOR = DEBUG_SCREENSHOT_ROUNDED_CORNERS;
@@ -712,8 +716,11 @@ public class ScreenDecorations extends SystemUI implements Tunable {
// upgrading all of the configs to contain (width, height) pairs. Instead assume that a
// device configured using the single integer config value is okay with drawing the corners
// as a square
- final int newRoundedDefault = RoundedCorners.getRoundedCornerRadius(
+ int newRoundedDefault = RoundedCorners.getRoundedCornerRadius(
mContext.getResources(), mDisplayUniqueId);
+ if (mDisableRoundedCorner == 1) {
+ newRoundedDefault = 0;
+ }
final int newRoundedDefaultTop = RoundedCorners.getRoundedCornerTopRadius(
mContext.getResources(), mDisplayUniqueId);
final int newRoundedDefaultBottom = RoundedCorners.getRoundedCornerBottomRadius(
@@ -926,6 +933,10 @@ public class ScreenDecorations extends SystemUI implements Tunable {
}
static boolean shouldDrawCutout(Context context) {
+ if (mDisableRoundedCorner == 1) {
+ return false;
+ }
+
return DisplayCutout.getFillBuiltInDisplayCutout(
context.getResources(), context.getDisplay().getUniqueId());
}
diff --git a/packages/SystemUI/src/com/android/systemui/assist/ui/DisplayUtils.java b/packages/SystemUI/src/com/android/systemui/assist/ui/DisplayUtils.java
index 33e6ca49ddd5..e228c3b42ebd 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/ui/DisplayUtils.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/ui/DisplayUtils.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Surface;
+import android.os.SystemProperties;
/**
* Utility class for determining screen and corner dimensions.
@@ -117,6 +118,11 @@ public class DisplayUtils {
private static int getCornerRadiusDefault(Context context) {
int radius = 0;
+ int disableRoundedCorner = SystemProperties.getInt("vendor.display.disable_rounded_corner",
+ 0);
+ if (disableRoundedCorner == 1) {
+ return radius;
+ }
int resourceId = context.getResources().getIdentifier("config_rounded_mask_size",
"dimen", "com.android.systemui");
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 250c16c81eac..f81706d35748 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -220,12 +220,14 @@ public class UdfpsController implements DozeReceiver {
}
void onAcquiredGood() {
+ Log.d(TAG, "onAcquiredGood");
if (mEnrollHelper != null) {
mEnrollHelper.animateIfLastStep();
}
}
void onEnrollmentHelp() {
+ Log.d(TAG, "onEnrollmentHelp");
if (mEnrollHelper != null) {
mEnrollHelper.onEnrollmentHelp();
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollHelper.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollHelper.java
index d5c763d3b6e2..6687beaabbab 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsEnrollHelper.java
@@ -135,9 +135,11 @@ public class UdfpsEnrollHelper {
}
void onEnrollmentProgress(int remaining) {
- if (mTotalSteps == -1) {
- mTotalSteps = remaining;
- }
+ Log.d(TAG, "onEnrollmentProgress: remaining = " + remaining
+ + ", mRemainingSteps = " + mRemainingSteps
+ + ", mTotalSteps = " + mTotalSteps
+ + ", mLocationsEnrolled = " + mLocationsEnrolled
+ + ", mCenterTouchCount = " + mCenterTouchCount);
if (remaining != mRemainingSteps) {
mLocationsEnrolled++;
@@ -221,6 +223,7 @@ public class UdfpsEnrollHelper {
}
void animateIfLastStep() {
+ Log.d(TAG, "animateIfLastStep: mRemainingSteps = " + mRemainingSteps);
if (mListener == null) {
Log.e(TAG, "animateIfLastStep, null listener");
return;
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
index 6d31ef0e7701..30e5aed2f8d8 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
@@ -241,18 +241,20 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
if (mGhbmView != null && surface == null) {
Log.e(TAG, "doIlluminate | surface must be non-null for GHBM");
}
- mHbmProvider.enableHbm(mHbmType, surface, () -> {
- if (mGhbmView != null) {
- mGhbmView.drawIlluminationDot(mSensorRect);
- }
- if (onIlluminatedRunnable != null) {
- // No framework API can reliably tell when a frame reaches the panel. A timeout
- // is the safest solution.
- postDelayed(onIlluminatedRunnable, mOnIlluminatedDelayMs);
- } else {
- Log.w(TAG, "doIlluminate | onIlluminatedRunnable is null");
- }
- });
+ if (mHbmProvider != null) {
+ mHbmProvider.enableHbm(mHbmType, surface, () -> {
+ if (mGhbmView != null) {
+ mGhbmView.drawIlluminationDot(mSensorRect);
+ }
+ if (onIlluminatedRunnable != null) {
+ // No framework API can reliably tell when a frame reaches the panel. A timeout
+ // is the safest solution.
+ postDelayed(onIlluminatedRunnable, mOnIlluminatedDelayMs);
+ } else {
+ Log.w(TAG, "doIlluminate | onIlluminatedRunnable is null");
+ }
+ });
+ }
}
@Override
@@ -265,6 +267,8 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
mGhbmView.setGhbmIlluminationListener(null);
mGhbmView.setVisibility(View.INVISIBLE);
}
- mHbmProvider.disableHbm(null /* onHbmDisabled */);
+ if (mHbmProvider != null) {
+ mHbmProvider.disableHbm(null /* onHbmDisabled */);
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index b7916f9f09e1..f30e2832c1aa 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -99,6 +99,7 @@ import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.KeyguardViewController;
import com.android.keyguard.ViewMediatorCallback;
+import com.android.systemui.Dependency;
import com.android.systemui.Dumpable;
import com.android.systemui.SystemUI;
import com.android.systemui.animation.Interpolators;
@@ -331,6 +332,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
* Index is the slotId - in case of multiple SIM cards.
*/
private final SparseIntArray mLastSimStates = new SparseIntArray();
+ private static SparseIntArray mUnlockTrackSimStates = new SparseIntArray();
+ private static final int STATE_INVALID = -1;
/**
* Indicates if a SIM card had the SIM PIN enabled during the initialization, before
@@ -406,12 +409,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
private boolean mPendingLock;
/**
- * When starting to go away, flag a need to show the PIN lock so the keyguard can be brought
- * back.
- */
- private boolean mPendingPinLock = false;
-
- /**
* Whether a power button gesture (such as double tap for camera) has been detected. This is
* delivered directly from {@link KeyguardService}, immediately upon the gesture being detected.
* This is used in {@link #onStartedWakingUp} to decide whether to execute the pending lock, or
@@ -484,19 +481,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() {
@Override
- public void onKeyguardVisibilityChanged(boolean showing) {
- synchronized (KeyguardViewMediator.this) {
- if (!showing && mPendingPinLock) {
- Log.i(TAG, "PIN lock requested, starting keyguard");
-
- // Bring the keyguard back in order to show the PIN lock
- mPendingPinLock = false;
- doKeyguardLocked(null);
- }
- }
- }
-
- @Override
public void onUserSwitching(int userId) {
if (DEBUG) Log.d(TAG, String.format("onUserSwitching %d", userId));
// Note that the mLockPatternUtils user has already been updated from setCurrentUser.
@@ -576,6 +560,29 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
lastSimStateWasLocked = (lastState == TelephonyManager.SIM_STATE_PIN_REQUIRED
|| lastState == TelephonyManager.SIM_STATE_PUK_REQUIRED);
mLastSimStates.append(slotId, simState);
+
+ int trackState = mUnlockTrackSimStates.get(slotId, STATE_INVALID);
+ //update the mUnlockTrackSimStates
+ if(simState == TelephonyManager.SIM_STATE_READY){
+ if(trackState == TelephonyManager.SIM_STATE_LOADED){
+ if (DEBUG) Log.e(TAG, "skip the redundant SIM_STATE_READY state");
+ return;
+ }else{
+ mUnlockTrackSimStates.put(slotId, simState);
+ }
+ }else{
+ if(simState != TelephonyManager.SIM_STATE_PIN_REQUIRED) {
+ mUnlockTrackSimStates.put(slotId, simState);
+ }
+ }
+
+ //check the SIM_STATE_PIN_REQUIRED
+ if(trackState == TelephonyManager.SIM_STATE_READY){
+ if(simState == TelephonyManager.SIM_STATE_PIN_REQUIRED) {
+ if (DEBUG) Log.e(TAG, "skip the unnecessary SIM_STATE_PIN_REQUIRED state");
+ return;
+ }
+ }
}
switch (simState) {
@@ -616,7 +623,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
+ "showing; need to show keyguard so user can enter sim pin");
doKeyguardLocked(null);
} else {
- mPendingPinLock = true;
resetStateLocked();
}
}
@@ -758,9 +764,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
@Override
public void onBouncerVisiblityChanged(boolean shown) {
synchronized (KeyguardViewMediator.this) {
- if (shown) {
- mPendingPinLock = false;
- }
adjustStatusBarLocked(shown, false);
}
}
@@ -1446,6 +1449,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
Trace.endSection();
}
+ public static int getUnlockTrackSimState(int slotId) {
+ return mUnlockTrackSimStates.get(slotId);
+ }
public boolean isHiding() {
return mHiding;
}
@@ -1470,7 +1476,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,
if (mOccluded != isOccluded) {
mOccluded = isOccluded;
mUpdateMonitor.setKeyguardOccluded(isOccluded);
- mKeyguardViewControllerLazy.get().setOccluded(isOccluded, animate
+ mKeyguardViewControllerLazy.get().setOccluded(isOccluded,
+ (Dependency.get(KeyguardUpdateMonitor.class).isSimPinSecure()?false:animate)
&& mDeviceInteractive);
adjustStatusBarLocked();
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
index 22cd6f86b165..79193564e21f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
@@ -49,6 +49,8 @@ import com.android.systemui.qs.QSHost;
import com.android.systemui.qs.logging.QSLogger;
import com.android.systemui.qs.tileimpl.QSTileImpl;
+import com.qti.extphone.ExtTelephonyManager;
+
import javax.inject.Inject;
import dagger.Lazy;
@@ -102,6 +104,10 @@ public class AirplaneModeTile extends QSTileImpl<BooleanState> {
mActivityStarter.postStartActivityDismissingKeyguard(
new Intent(TelephonyManager.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS), 0);
return;
+ } else if(!airplaneModeEnabled && TelephonyProperties.in_scbm().orElse(false)) {
+ mActivityStarter.postStartActivityDismissingKeyguard(
+ new Intent(ExtTelephonyManager.ACTION_SHOW_NOTICE_SCM_BLOCK_OTHERS), 0);
+ return;
}
setEnabled(!airplaneModeEnabled);
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
index b83dc52240b3..2cacf3cf9df0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
@@ -25,6 +25,7 @@ import android.content.Intent;
import android.media.MediaRouter.RouteInfo;
import android.os.Handler;
import android.os.Looper;
+import android.os.SystemProperties;
import android.provider.Settings;
import android.service.quicksettings.Tile;
import android.util.Log;
@@ -81,6 +82,7 @@ public class CastTile extends QSTileImpl<BooleanState> {
private Dialog mDialog;
private boolean mWifiConnected;
private boolean mHotspotConnected;
+ private static final String WFD_ENABLE = "persist.debug.wfd.enable";
@Inject
public CastTile(
@@ -298,14 +300,20 @@ public class CastTile extends QSTileImpl<BooleanState> {
@Override
public void setWifiIndicators(@NonNull WifiIndicators indicators) {
// statusIcon.visible has the connected status information
- boolean enabledAndConnected = indicators.enabled
- && (indicators.qsIcon == null ? false : indicators.qsIcon.visible);
- if (enabledAndConnected != mWifiConnected) {
- mWifiConnected = enabledAndConnected;
- // Hotspot is not connected, so changes here should update
- if (!mHotspotConnected) {
+ if(SystemProperties.getBoolean(WFD_ENABLE, false)) {
+ if(indicators.enabled != mWifiConnected) {
+ mWifiConnected = indicators.enabled;
refreshState();
}
+ } else {
+ boolean enabledAndConnected = indicators.enabled && indicators.qsIcon.visible;
+ if (enabledAndConnected != mWifiConnected) {
+ mWifiConnected = enabledAndConnected;
+ // Hotspot is not connected, so changes here should update
+ if (!mHotspotConnected) {
+ refreshState();
+ }
+ }
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index e5601f29af0b..1dde8d1480ba 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -300,6 +300,7 @@ public class CellularTile extends QSTileImpl<SignalState> {
@Override
public void setMobileDataEnabled(boolean enabled) {
mDetailAdapter.setMobileDataEnabled(enabled);
+ refreshState(mInfo);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index 87edc2cf8bac..db1df77a5803 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -16,7 +16,10 @@
package com.android.systemui.qs.tiles;
+import android.content.Context;
import android.content.Intent;
+import android.net.wifi.ScanResult;
+import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.Looper;
import android.os.UserManager;
@@ -49,12 +52,16 @@ import javax.inject.Inject;
public class HotspotTile extends QSTileImpl<BooleanState> {
private final Icon mEnabledStatic = ResourceIcon.get(R.drawable.ic_hotspot);
+ private final Icon mWifi4EnabledStatic = ResourceIcon.get(R.drawable.ic_wifi_4_hotspot);
+ private final Icon mWifi5EnabledStatic = ResourceIcon.get(R.drawable.ic_wifi_5_hotspot);
+ private final Icon mWifi6EnabledStatic = ResourceIcon.get(R.drawable.ic_wifi_6_hotspot);
private final HotspotController mHotspotController;
private final DataSaverController mDataSaverController;
private final HotspotAndDataSaverCallbacks mCallbacks = new HotspotAndDataSaverCallbacks();
private boolean mListening;
+ private WifiManager mWifiManager;
@Inject
public HotspotTile(
@@ -75,6 +82,7 @@ public class HotspotTile extends QSTileImpl<BooleanState> {
mDataSaverController = dataSaverController;
mHotspotController.observe(this, mCallbacks);
mDataSaverController.observe(this, mCallbacks);
+ mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
}
@Override
@@ -154,6 +162,15 @@ public class HotspotTile extends QSTileImpl<BooleanState> {
if (state.isTransient) {
state.icon = ResourceIcon.get(
com.android.internal.R.drawable.ic_hotspot_transient_animation);
+ } else if (state.value) {
+ int standard = mWifiManager.getSoftApWifiStandard();
+ if (standard == ScanResult.WIFI_STANDARD_11AX) {
+ state.icon = mWifi6EnabledStatic;
+ } else if (standard == ScanResult.WIFI_STANDARD_11AC) {
+ state.icon = mWifi5EnabledStatic;
+ } else if (standard == ScanResult.WIFI_STANDARD_11N) {
+ state.icon = mWifi4EnabledStatic;
+ }
}
state.expandedAccessibilityClassName = Switch.class.getName();
state.contentDescription = state.label;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java
index ef4d1ac14a2c..1e84b40d1544 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java
@@ -379,7 +379,8 @@ public class InternetDialog extends SystemUIDialog implements
}
if (!mInternetDialogController.hasActiveSubId()
- && (!mWifiManager.isWifiEnabled() || !isCarrierNetworkActive)) {
+ && (!mWifiManager.isWifiEnabled() || !isCarrierNetworkActive)
+ || mInternetDialogController.isInCallOnNonDds()) {
mMobileNetworkLayout.setVisibility(View.GONE);
} else {
mMobileNetworkLayout.setVisibility(View.VISIBLE);
@@ -687,6 +688,11 @@ public class InternetDialog extends SystemUIDialog implements
}
@Override
+ public void onNonDdsCallStateChanged() {
+ mHandler.post(() -> updateDialog(true /* shouldUpdateMobileNetwork */));
+ }
+
+ @Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (mAlertDialog != null && !mAlertDialog.isShowing()) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java
index 0d064af9c17d..57e70b009d6a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java
@@ -91,6 +91,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.HashMap;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicReference;
@@ -156,6 +157,10 @@ public class InternetDialogController implements AccessPointController.AccessPoi
private LocationController mLocationController;
private DialogLaunchAnimator mDialogLaunchAnimator;
private boolean mHasWifiEntries;
+ private int mActiveDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+ private int mVoiceCallState = TelephonyManager.CALL_STATE_IDLE;
+ private HashMap<TelephonyManager, NonDdsTelephonyCallback> mNonDdsCallbacks =
+ new HashMap<>();
@VisibleForTesting
static final float TOAST_PARAMS_HORIZONTAL_WEIGHT = 1.0f;
@@ -256,6 +261,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi
mSubscriptionManager.addOnSubscriptionsChangedListener(mExecutor,
mOnSubscriptionsChangedListener);
mDefaultDataSubId = getDefaultDataSubscriptionId();
+ mActiveDataSubId = mDefaultDataSubId;
if (DEBUG) {
Log.d(TAG, "Init, SubId: " + mDefaultDataSubId);
}
@@ -263,6 +269,19 @@ public class InternetDialogController implements AccessPointController.AccessPoi
mTelephonyManager = mTelephonyManager.createForSubscriptionId(mDefaultDataSubId);
mInternetTelephonyCallback = new InternetTelephonyCallback();
mTelephonyManager.registerTelephonyCallback(mExecutor, mInternetTelephonyCallback);
+ final List<SubscriptionInfo> subscriptions =
+ mSubscriptionManager.getActiveSubscriptionInfoList();
+ if (subscriptions != null) {
+ NonDdsTelephonyCallback nonDdscallback = new NonDdsTelephonyCallback();
+ for (SubscriptionInfo info : subscriptions) {
+ if (mDefaultDataSubId != info.getSubscriptionId()) {
+ TelephonyManager tm =
+ mTelephonyManager.createForSubscriptionId(info.getSubscriptionId());
+ tm.registerTelephonyCallback(mExecutor, nonDdscallback);
+ mNonDdsCallbacks.put(tm, nonDdscallback);
+ }
+ }
+ }
// Listen the connectivity changes
mConnectivityManager.registerDefaultNetworkCallback(mConnectivityManagerNetworkCallback);
mCanConfigWifi = canConfigWifi;
@@ -281,6 +300,11 @@ public class InternetDialogController implements AccessPointController.AccessPoi
mKeyguardUpdateMonitor.removeCallback(mKeyguardUpdateCallback);
mConnectivityManager.unregisterNetworkCallback(mConnectivityManagerNetworkCallback);
mConnectedWifiInternetMonitor.unregisterCallback();
+ for (Map.Entry<TelephonyManager, NonDdsTelephonyCallback> entry
+ : mNonDdsCallbacks.entrySet()) {
+ entry.getKey().unregisterTelephonyCallback(entry.getValue());
+ }
+ mNonDdsCallbacks.clear();
}
@VisibleForTesting
@@ -784,6 +808,11 @@ public class InternetDialogController implements AccessPointController.AccessPoi
return !mKeyguardStateController.isUnlocked();
}
+ public boolean isInCallOnNonDds() {
+ return mDefaultDataSubId != mActiveDataSubId
+ && mVoiceCallState != TelephonyManager.CALL_STATE_IDLE;
+ }
+
boolean activeNetworkIsCellular() {
if (mConnectivityManager == null) {
if (DEBUG) {
@@ -914,7 +943,8 @@ public class InternetDialogController implements AccessPointController.AccessPoi
TelephonyCallback.DisplayInfoListener,
TelephonyCallback.ServiceStateListener,
TelephonyCallback.SignalStrengthsListener,
- TelephonyCallback.UserMobileDataStateListener {
+ TelephonyCallback.UserMobileDataStateListener,
+ TelephonyCallback.ActiveDataSubscriptionIdListener {
@Override
public void onServiceStateChanged(@NonNull ServiceState serviceState) {
@@ -941,6 +971,12 @@ public class InternetDialogController implements AccessPointController.AccessPoi
public void onUserMobileDataStateChanged(boolean enabled) {
mCallback.onUserMobileDataStateChanged(enabled);
}
+
+ @Override
+ public void onActiveDataSubscriptionIdChanged(int subId) {
+ mActiveDataSubId = subId;
+ mCallback.onNonDdsCallStateChanged();
+ }
}
private class InternetOnSubscriptionChangedListener
@@ -977,6 +1013,15 @@ public class InternetDialogController implements AccessPointController.AccessPoi
}
}
+ private class NonDdsTelephonyCallback extends TelephonyCallback implements
+ TelephonyCallback.CallStateListener {
+ @Override
+ public void onCallStateChanged(int state) {
+ mVoiceCallState = state;
+ mCallback.onNonDdsCallStateChanged();
+ }
+ }
+
/**
* Helper class for monitoring the Internet access of the connected WifiEntry.
*/
@@ -1102,6 +1147,8 @@ public class InternetDialogController implements AccessPointController.AccessPoi
void onAccessPointsChanged(@Nullable List<WifiEntry> wifiEntries,
@Nullable WifiEntry connectedEntry, boolean hasMoreWifiEntries);
+
+ void onNonDdsCallStateChanged();
}
void makeOverlayToast(int stringId) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
index 68dcdd9ff49f..13cfddd2b0bb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
@@ -26,6 +26,7 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -60,6 +61,7 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
private DualToneHandler mDualToneHandler;
private boolean mForceHidden;
private boolean mProviderModel;
+ private ImageView mVolte;
/**
* Designated constructor
@@ -121,6 +123,7 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
mIn = findViewById(R.id.mobile_in);
mOut = findViewById(R.id.mobile_out);
mInoutContainer = findViewById(R.id.inout_container);
+ mVolte = findViewById(R.id.mobile_volte);
mMobileDrawable = new SignalDrawable(getContext());
mMobile.setImageDrawable(mMobileDrawable);
@@ -164,7 +167,12 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
} else {
mMobileGroup.setVisibility(View.VISIBLE);
}
- mMobileDrawable.setLevel(mState.strengthId);
+ if (mState.strengthId >= 0) {
+ mMobile.setVisibility(View.VISIBLE);
+ mMobileDrawable.setLevel(mState.strengthId);
+ }else {
+ mMobile.setVisibility(View.GONE);
+ }
if (mState.typeId > 0) {
mMobileType.setContentDescription(mState.typeContentDescription);
mMobileType.setImageResource(mState.typeId);
@@ -179,6 +187,12 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
mOut.setVisibility(mState.activityOut ? View.VISIBLE : View.GONE);
mInoutContainer.setVisibility((mState.activityIn || mState.activityOut)
? View.VISIBLE : View.GONE);
+ if (mState.volteId > 0 ) {
+ mVolte.setImageResource(mState.volteId);
+ mVolte.setVisibility(View.VISIBLE);
+ }else {
+ mVolte.setVisibility(View.GONE);
+ }
}
private boolean updateState(MobileIconState state) {
@@ -186,12 +200,15 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
setContentDescription(state.contentDescription);
int newVisibility = state.visible && !mForceHidden ? View.VISIBLE : View.GONE;
- if (newVisibility != mMobileGroup.getVisibility()) {
+ if (newVisibility != mMobileGroup.getVisibility() && STATE_ICON == mVisibleState) {
mMobileGroup.setVisibility(newVisibility);
needsLayout = true;
}
- if (mState.strengthId != state.strengthId) {
+ if (state.strengthId >= 0) {
mMobileDrawable.setLevel(state.strengthId);
+ mMobile.setVisibility(View.VISIBLE);
+ }else {
+ mMobile.setVisibility(View.GONE);
}
if (mState.typeId != state.typeId) {
needsLayout |= state.typeId == 0 || mState.typeId == 0;
@@ -212,6 +229,15 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
mInoutContainer.setVisibility((state.activityIn || state.activityOut)
? View.VISIBLE : View.GONE);
+ if (mState.volteId != state.volteId) {
+ if (state.volteId != 0) {
+ mVolte.setImageResource(state.volteId);
+ mVolte.setVisibility(View.VISIBLE);
+ } else {
+ mVolte.setVisibility(View.GONE);
+ }
+ }
+
needsLayout |= state.roaming != mState.roaming
|| state.activityIn != mState.activityIn
|| state.activityOut != mState.activityOut
@@ -230,6 +256,7 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
mIn.setImageTintList(color);
mOut.setImageTintList(color);
mMobileType.setImageTintList(color);
+ mVolte.setImageTintList(color);
mMobileRoaming.setImageTintList(color);
mDotView.setDecorColor(tint);
mDotView.setIconColor(tint, false);
@@ -251,6 +278,7 @@ public class StatusBarMobileView extends FrameLayout implements DarkReceiver,
mIn.setImageTintList(list);
mOut.setImageTintList(list);
mMobileType.setImageTintList(list);
+ mVolte.setImageTintList(list);
mMobileRoaming.setImageTintList(list);
mDotView.setDecorColor(color);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java
index 9ae7ea2bdded..6d6a5fb29594 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java
@@ -18,9 +18,14 @@ package com.android.systemui.statusbar.connectivity;
import static com.android.settingslib.mobile.MobileMappings.getDefaultIcons;
import static com.android.settingslib.mobile.MobileMappings.getIconKey;
import static com.android.settingslib.mobile.MobileMappings.mapIconSets;
+import static com.android.settingslib.mobile.MobileMappings.toDisplayIconKey;
+import static com.android.settingslib.mobile.MobileMappings.toIconKey;
+import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.res.Resources;
import android.database.ContentObserver;
import android.net.NetworkCapabilities;
import android.os.Handler;
@@ -29,10 +34,15 @@ import android.provider.Settings.Global;
import android.telephony.AccessNetworkConstants;
import android.telephony.CellSignalStrength;
import android.telephony.CellSignalStrengthCdma;
+import android.telephony.CellSignalStrengthNr;
+import android.telephony.ims.ImsMmTelManager;
+import android.telephony.ims.ImsReasonInfo;
+import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.telephony.ims.ImsException;
import android.telephony.ims.ImsMmTelManager;
@@ -43,7 +53,12 @@ import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
+import com.android.ims.ImsManager;
+import com.android.ims.FeatureConnector;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.telephony.PhoneConstants;
+import com.android.internal.telephony.PhoneConstants.DataState;
+import com.android.internal.telephony.TelephonyIntents;
import com.android.settingslib.AccessibilityContentDescriptions;
import com.android.settingslib.SignalIcon.MobileIconGroup;
import com.android.settingslib.graph.SignalDrawable;
@@ -54,6 +69,9 @@ import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.mobile.TelephonyIcons;
import com.android.settingslib.net.SignalStrengthUtil;
import com.android.systemui.R;
+import com.android.systemui.statusbar.policy.FiveGServiceClient;
+import com.android.systemui.statusbar.policy.FiveGServiceClient.FiveGServiceState;
+import com.android.systemui.statusbar.policy.FiveGServiceClient.IFiveGStateListener;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.util.CarrierConfigTracker;
@@ -87,6 +105,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
final SubscriptionInfo mSubscriptionInfo;
private Map<String, MobileIconGroup> mNetworkToIconLookup;
+ private DataState mMMSDataState = DataState.DISCONNECTED;
private int mLastLevel;
private MobileIconGroup mDefaultIcons;
private Config mConfig;
@@ -103,6 +122,19 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
// Where to copy the next state into.
private int mMobileStatusHistoryIndex;
+ private int mCallState = TelephonyManager.CALL_STATE_IDLE;
+
+ /****************************SideCar****************************/
+ @VisibleForTesting
+ FiveGStateListener mFiveGStateListener;
+ @VisibleForTesting
+ FiveGServiceState mFiveGState;
+ private FiveGServiceClient mClient;
+ /**********************************************************/
+
+ private ImsManager mImsManager;
+ private FeatureConnector<ImsManager> mFeatureConnector;
+
private final MobileStatusTracker.Callback mMobileCallback =
new MobileStatusTracker.Callback() {
private String mLastStatus;
@@ -202,6 +234,8 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mPhone = phone;
mDefaults = defaults;
mSubscriptionInfo = info;
+ mFiveGStateListener = new FiveGStateListener();
+ mFiveGState = new FiveGServiceState();
mNetworkNameSeparator = getTextIfExists(
R.string.status_bar_network_name_separator).toString();
mNetworkNameDefault = getTextIfExists(
@@ -217,6 +251,26 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mLastState.networkNameData = mCurrentState.networkNameData = networkName;
mLastState.enabled = mCurrentState.enabled = hasMobileData;
mLastState.iconGroup = mCurrentState.iconGroup = mDefaultIcons;
+
+ int phoneId = mSubscriptionInfo.getSimSlotIndex();
+ mFeatureConnector = ImsManager.getConnector(
+ mContext, phoneId, "?",
+ new FeatureConnector.Listener<ImsManager> () {
+ @Override
+ public void connectionReady(ImsManager manager) throws com.android.ims.ImsException {
+ Log.d(mTag, "ImsManager: connection ready.");
+ mImsManager = manager;
+ setListeners();
+ }
+
+ @Override
+ public void connectionUnavailable(int reason) {
+ Log.d(mTag, "ImsManager: connection unavailable.");
+ removeListeners();
+ }
+ }, mContext.getMainExecutor());
+
+
mObserver = new ContentObserver(new Handler(receiverLooper)) {
@Override
public void onChange(boolean selfChange) {
@@ -272,6 +326,14 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mContext.getContentResolver().registerContentObserver(Global.getUriFor(
Global.MOBILE_DATA + mSubscriptionInfo.getSubscriptionId()),
true, mObserver);
+ mContext.getContentResolver().registerContentObserver(Global.getUriFor(Global.DATA_ROAMING),
+ true, mObserver);
+ mContext.getContentResolver().registerContentObserver(Global.getUriFor(
+ Global.DATA_ROAMING + mSubscriptionInfo.getSubscriptionId()),
+ true, mObserver);
+ mContext.registerReceiver(mVolteSwitchObserver,
+ new IntentFilter("org.codeaurora.intent.action.ACTION_ENHANCE_4G_SWITCH"));
+ mFeatureConnector.connect();
if (mProviderModelBehavior) {
mReceiverHandler.post(mTryRegisterIms);
}
@@ -307,6 +369,8 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mMobileStatusTracker.setListening(false);
mContext.getContentResolver().unregisterContentObserver(mObserver);
mImsMmTelManager.unregisterImsRegistrationCallback(mRegistrationCallback);
+ mContext.unregisterReceiver(mVolteSwitchObserver);
+ mFeatureConnector.disconnect();
}
private void updateInflateSignalStrength() {
@@ -330,12 +394,16 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
if (mInflateSignalStrengths) {
level++;
}
+
boolean dataDisabled = mCurrentState.userSetup
&& (mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED
|| (mCurrentState.iconGroup == TelephonyIcons.NOT_DEFAULT_DATA
&& mCurrentState.defaultDataOff));
boolean noInternet = mCurrentState.inetCondition == 0;
boolean cutOut = dataDisabled || noInternet;
+ if (mConfig.hideNoInternetState) {
+ cutOut = false;
+ }
return SignalDrawable.getState(level, getNumLevels(), cutOut);
} else if (mCurrentState.enabled) {
return SignalDrawable.getEmptyState(getNumLevels());
@@ -349,6 +417,70 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
return getCurrentIconId();
}
+ private boolean isVolteSwitchOn() {
+ return mImsManager != null && mImsManager.isEnhanced4gLteModeSettingEnabledByUser();
+ }
+
+ private int getVolteResId() {
+ int resId = 0;
+ int voiceNetTye = mCurrentState.getVoiceNetworkType();
+ if ( (mCurrentState.voiceCapable || mCurrentState.videoCapable)
+ && mCurrentState.imsRegistered ) {
+ resId = R.drawable.ic_volte;
+ }else if ( (mCurrentState.telephonyDisplayInfo.getNetworkType() == TelephonyManager.NETWORK_TYPE_LTE
+ || mCurrentState.telephonyDisplayInfo.getNetworkType() == TelephonyManager.NETWORK_TYPE_LTE_CA)
+ && voiceNetTye == TelephonyManager.NETWORK_TYPE_UNKNOWN) {
+ resId = R.drawable.ic_volte_no_voice;
+ }
+ return resId;
+ }
+
+ private void setListeners() {
+ if (mImsManager == null) {
+ Log.e(mTag, "setListeners mImsManager is null");
+ return;
+ }
+
+ try {
+ mImsManager.addCapabilitiesCallback(mCapabilityCallback, mContext.getMainExecutor());
+ mImsManager.addRegistrationCallback(mImsRegistrationCallback, mContext.getMainExecutor());
+ Log.d(mTag, "addCapabilitiesCallback " + mCapabilityCallback + " into " + mImsManager);
+ Log.d(mTag, "addRegistrationCallback " + mImsRegistrationCallback
+ + " into " + mImsManager);
+ } catch (com.android.ims.ImsException e) {
+ Log.d(mTag, "unable to addCapabilitiesCallback callback.");
+ }
+ queryImsState();
+ }
+
+ private void queryImsState() {
+ TelephonyManager tm = mPhone.createForSubscriptionId(mSubscriptionInfo.getSubscriptionId());
+ mCurrentState.voiceCapable = tm.isVolteAvailable();
+ mCurrentState.videoCapable = tm.isVideoTelephonyAvailable();
+ mCurrentState.imsRegistered = mPhone.isImsRegistered(mSubscriptionInfo.getSubscriptionId());
+ if (DEBUG) {
+ Log.d(mTag, "queryImsState tm=" + tm + " phone=" + mPhone
+ + " voiceCapable=" + mCurrentState.voiceCapable
+ + " videoCapable=" + mCurrentState.videoCapable
+ + " imsResitered=" + mCurrentState.imsRegistered);
+ }
+ notifyListenersIfNecessary();
+ }
+
+ private void removeListeners() {
+ if (mImsManager == null) {
+ Log.e(mTag, "removeListeners mImsManager is null");
+ return;
+ }
+
+ mImsManager.removeCapabilitiesCallback(mCapabilityCallback);
+ mImsManager.removeRegistrationListener(mImsRegistrationCallback);
+ Log.d(mTag, "removeCapabilitiesCallback " + mCapabilityCallback
+ + " from " + mImsManager);
+ Log.d(mTag, "removeRegistrationCallback " + mImsRegistrationCallback
+ + " from " + mImsManager);
+ }
+
@Override
public void notifyListeners(SignalCallback callback) {
// If the device is on carrier merged WiFi, we should let WifiSignalController to control
@@ -373,6 +505,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
final QsInfo qsInfo = getQsInfo(contentDescription, icons.dataType);
final SbInfo sbInfo = getSbInfo(contentDescription, icons.dataType);
+ int volteIcon = mConfig.showVolteIcon && isVolteSwitchOn() ? getVolteResId() : 0;
MobileDataIndicators mobileDataIndicators = new MobileDataIndicators(
sbInfo.icon,
qsInfo.icon,
@@ -380,6 +513,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
qsInfo.ratTypeIcon,
mCurrentState.hasActivityIn(),
mCurrentState.hasActivityOut(),
+ volteIcon,
dataContentDescription,
dataContentDescriptionHtml,
qsInfo.description,
@@ -426,12 +560,12 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
boolean showDataIconStatusBar = (mCurrentState.dataConnected || dataDisabled)
&& (mCurrentState.dataSim && mCurrentState.isDefault);
typeIcon =
- (showDataIconStatusBar || mConfig.alwaysShowDataRatIcon) ? dataTypeIcon : 0;
+ (showDataIconStatusBar || mConfig.alwaysShowDataRatIcon
+ || mConfig.alwaysShowNetworkTypeIcon) ? dataTypeIcon : 0;
showDataIconStatusBar |= mCurrentState.roaming;
statusIcon = new IconState(
showDataIconStatusBar && !mCurrentState.airplaneMode,
getCurrentIconId(), contentDescription);
-
showTriangle = showDataIconStatusBar && !mCurrentState.airplaneMode;
} else {
statusIcon = new IconState(
@@ -439,12 +573,27 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
getCurrentIconId(), contentDescription);
boolean showDataIconInStatusBar =
- (mCurrentState.dataConnected && mCurrentState.isDefault) || dataDisabled;
+ (mCurrentState.dataConnected && mCurrentState.isDefault
+ || mConfig.alwaysShowNetworkTypeIcon) || dataDisabled;
typeIcon =
(showDataIconInStatusBar || mConfig.alwaysShowDataRatIcon) ? dataTypeIcon : 0;
showTriangle = mCurrentState.enabled && !mCurrentState.airplaneMode;
}
+ if ( mConfig.enableRatIconEnhancement ) {
+ typeIcon = getEnhancementDataRatIcon();
+ }else if ( mConfig.enableDdsRatIconEnhancement ) {
+ typeIcon = getEnhancementDdsRatIcon();
+ }
+
+ MobileIconGroup vowifiIconGroup = getVowifiIconGroup();
+ if (mConfig.showVowifiIcon && vowifiIconGroup != null) {
+ typeIcon = vowifiIconGroup.dataType;
+ statusIcon = new IconState(true,
+ ((mCurrentState.enabled && !mCurrentState.airplaneMode) ? statusIcon.icon : -1),
+ statusIcon.contentDescription);
+ }
+
return new SbInfo(showTriangle, typeIcon, statusIcon);
}
@@ -490,6 +639,16 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
} else if (action.equals(TelephonyManager.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED)) {
updateDataSim();
notifyListenersIfNecessary();
+ }else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
+ String apnType = intent.getStringExtra(PhoneConstants.DATA_APN_TYPE_KEY);
+ String state = intent.getStringExtra(PhoneConstants.STATE_KEY);
+ if ("mms".equals(apnType)) {
+ if (DEBUG) {
+ Log.d(mTag, "handleBroadcast MMS connection state=" + state);
+ }
+ mMMSDataState = DataState.valueOf(state);
+ updateTelephony();
+ }
}
}
@@ -729,6 +888,27 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mCurrentState.connected = mCurrentState.isInService();
if (mCurrentState.connected) {
mCurrentState.level = getSignalLevel(mCurrentState.signalStrength);
+ if (mConfig.showRsrpSignalLevelforLTE) {
+ if (DEBUG) {
+ Log.d(mTag, "updateTelephony CS:" + mCurrentState.getVoiceNetworkType()
+ + "/" + TelephonyManager.getNetworkTypeName(
+ mCurrentState.getVoiceNetworkType())
+ + ", PS:" + mCurrentState.getDataNetworkType()
+ + "/"+ TelephonyManager.getNetworkTypeName(
+ mCurrentState.getDataNetworkType()));
+ }
+ int dataType = mCurrentState.getDataNetworkType();
+ if (dataType == TelephonyManager.NETWORK_TYPE_LTE ||
+ dataType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
+ mCurrentState.level = getAlternateLteLevel(mCurrentState.signalStrength);
+ } else if (dataType == TelephonyManager.NETWORK_TYPE_UNKNOWN) {
+ int voiceType = mCurrentState.getVoiceNetworkType();
+ if (voiceType == TelephonyManager.NETWORK_TYPE_LTE ||
+ voiceType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
+ mCurrentState.level = getAlternateLteLevel(mCurrentState.signalStrength);
+ }
+ }
+ }
}
String iconKey = getIconKey(mCurrentState.telephonyDisplayInfo);
@@ -737,7 +917,17 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
} else {
mCurrentState.iconGroup = mDefaultIcons;
}
- mCurrentState.dataConnected = mCurrentState.isDataConnected();
+
+ //Modem has centralized logic to display 5G icon based on carrier requirements
+ //For 5G icon display, only query NrIconType reported by modem
+ if ( mFiveGState.isNrIconTypeValid() ) {
+ mCurrentState.iconGroup = mFiveGState.getIconGroup();
+ }else {
+ mCurrentState.iconGroup = getNetworkTypeIconGroup();
+ }
+
+ mCurrentState.dataConnected = (mCurrentState.isDataConnected()
+ || mMMSDataState == DataState.CONNECTED);
mCurrentState.roaming = isRoaming();
if (isCarrierNetworkChangeActive()) {
@@ -765,6 +955,19 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mCurrentState.networkNameData = mCurrentState.getOperatorAlphaShort();
}
+
+ if ( mConfig.alwaysShowNetworkTypeIcon ) {
+ if(!mCurrentState.connected) {
+ mCurrentState.iconGroup = TelephonyIcons.UNKNOWN;
+ }else if (mFiveGState.isNrIconTypeValid()) {
+ mCurrentState.iconGroup = mFiveGState.getIconGroup();
+ }else {
+ mCurrentState.iconGroup = getNetworkTypeIconGroup();
+ }
+ }
+ mCurrentState.mobileDataEnabled = mPhone.isDataEnabled();
+ mCurrentState.roamingDataEnabled = mPhone.isDataRoamingEnabled();
+
notifyListenersIfNecessary();
}
@@ -789,6 +992,76 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
return !mPhone.isDataConnectionAllowed();
}
+ private boolean isDataNetworkTypeAvailable() {
+ boolean isAvailable = true;
+ if ( mCurrentState.telephonyDisplayInfo.getNetworkType() == TelephonyManager.NETWORK_TYPE_UNKNOWN ) {
+ isAvailable = false;
+ }else {
+ int dataType = getDataNetworkType();
+ int voiceType = getVoiceNetworkType();
+ if ((dataType == TelephonyManager.NETWORK_TYPE_EVDO_A
+ || dataType == TelephonyManager.NETWORK_TYPE_EVDO_B
+ || dataType == TelephonyManager.NETWORK_TYPE_EHRPD
+ || dataType == TelephonyManager.NETWORK_TYPE_LTE
+ || dataType == TelephonyManager.NETWORK_TYPE_LTE_CA)
+ && (voiceType == TelephonyManager.NETWORK_TYPE_GSM
+ || voiceType == TelephonyManager.NETWORK_TYPE_1xRTT
+ || voiceType == TelephonyManager.NETWORK_TYPE_CDMA)
+ && ( !isCallIdle() )) {
+ isAvailable = false;
+ }
+ }
+
+ return isAvailable;
+ }
+
+ private boolean isCallIdle() {
+ return mCallState == TelephonyManager.CALL_STATE_IDLE;
+ }
+
+ private int getVoiceNetworkType() {
+ // TODO(b/214591923)
+ //return mServiceState != null ?
+ // mServiceState.getVoiceNetworkType() : TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ return TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ }
+
+ private int getDataNetworkType() {
+ // TODO(b/214591923)
+ //return mServiceState != null ?
+ // mServiceState.getDataNetworkType() : TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ return TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ }
+
+ private int getAlternateLteLevel(SignalStrength signalStrength) {
+ if (signalStrength == null) {
+ Log.e(mTag, "getAlternateLteLevel signalStrength is null");
+ return 0;
+ }
+
+ int lteRsrp = signalStrength.getLteDbm();
+ if ( lteRsrp == SignalStrength.INVALID ) {
+ int signalStrengthLevel = signalStrength.getLevel();
+ if (DEBUG) {
+ Log.d(mTag, "getAlternateLteLevel lteRsrp:INVALID "
+ + " signalStrengthLevel = " + signalStrengthLevel);
+ }
+ return signalStrengthLevel;
+ }
+
+ int rsrpLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+ if (lteRsrp > -44) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+ else if (lteRsrp >= -97) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_GREAT;
+ else if (lteRsrp >= -105) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_GOOD;
+ else if (lteRsrp >= -113) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_MODERATE;
+ else if (lteRsrp >= -120) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_POOR;
+ else if (lteRsrp >= -140) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+ if (DEBUG) {
+ Log.d(mTag, "getAlternateLteLevel lteRsrp:" + lteRsrp + " rsrpLevel = " + rsrpLevel);
+ }
+ return rsrpLevel;
+ }
+
@VisibleForTesting
void setActivity(int activity) {
mCurrentState.activityIn = activity == TelephonyManager.DATA_ACTIVITY_INOUT
@@ -808,6 +1081,79 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
mImsType = imsType;
}
+ public void registerFiveGStateListener(FiveGServiceClient client) {
+ int phoneId = mSubscriptionInfo.getSimSlotIndex();
+ client.registerListener(phoneId, mFiveGStateListener);
+ mClient = client;
+ }
+
+ public void unregisterFiveGStateListener(FiveGServiceClient client) {
+ int phoneId = mSubscriptionInfo.getSimSlotIndex();
+ client.unregisterListener(phoneId);
+ }
+
+ private MobileIconGroup getNetworkTypeIconGroup() {
+ MobileIconGroup iconGroup = mDefaultIcons;
+ int overrideNetworkType = mCurrentState.telephonyDisplayInfo.getOverrideNetworkType();
+ String iconKey = null;
+ if (overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE
+ || overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE
+ || overrideNetworkType == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA ){
+ int networkType = mCurrentState.telephonyDisplayInfo.getNetworkType();
+ if (networkType == TelephonyManager.NETWORK_TYPE_UNKNOWN) {
+ networkType = mCurrentState.getVoiceNetworkType();
+ }
+ iconKey = toIconKey(networkType);
+ } else{
+ iconKey = toDisplayIconKey(overrideNetworkType);
+ }
+
+ return mNetworkToIconLookup.getOrDefault(iconKey, mDefaultIcons);
+ }
+
+ private boolean showDataRatIcon() {
+ boolean result = false;
+ if ( mCurrentState.mobileDataEnabled ) {
+ if(mCurrentState.roamingDataEnabled || !mCurrentState.roaming) {
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ private int getEnhancementDataRatIcon() {
+ return showDataRatIcon() && mCurrentState.connected ? getRatIconGroup().dataType : 0;
+ }
+
+ private int getEnhancementDdsRatIcon() {
+ return mCurrentState.dataSim && mCurrentState.connected ? getRatIconGroup().dataType : 0;
+ }
+
+ private MobileIconGroup getRatIconGroup() {
+ MobileIconGroup iconGroup = mDefaultIcons;
+ if ( mFiveGState.isNrIconTypeValid() ) {
+ iconGroup = mFiveGState.getIconGroup();
+ }else {
+ iconGroup = getNetworkTypeIconGroup();
+ }
+ return iconGroup;
+ }
+
+ private boolean isVowifiAvailable() {
+ return mCurrentState.voiceCapable && mCurrentState.imsRegistered
+ && mCurrentState.getDataNetworkType() == TelephonyManager.NETWORK_TYPE_IWLAN;
+ }
+
+ private MobileIconGroup getVowifiIconGroup() {
+ if ( isVowifiAvailable() && !isCallIdle() ) {
+ return TelephonyIcons.VOWIFI_CALLING;
+ }else if (isVowifiAvailable()) {
+ return TelephonyIcons.VOWIFI;
+ }else {
+ return null;
+ }
+ }
+
@Override
public void dump(PrintWriter pw) {
super.dump(pw);
@@ -816,6 +1162,14 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
pw.println(" mProviderModelBehavior=" + mProviderModelBehavior + ",");
pw.println(" mInflateSignalStrengths=" + mInflateSignalStrengths + ",");
pw.println(" isDataDisabled=" + isDataDisabled() + ",");
+ pw.println(" mConfig.enableRatIconEnhancement=" + mConfig.enableRatIconEnhancement + ",");
+ pw.println(" mConfig.enableDdsRatIconEnhancement="
+ + mConfig.enableDdsRatIconEnhancement + ",");
+ pw.println(" mConfig.alwaysShowNetworkTypeIcon="
+ + mConfig.alwaysShowNetworkTypeIcon + ",");
+ pw.println(" mConfig.showVowifiIcon=" + mConfig.showVowifiIcon + ",");
+ pw.println(" mConfig.showVolteIcon=" + mConfig.showVolteIcon + ",");
+ pw.println(" isVolteSwitchOn=" + isVolteSwitchOn() + ",");
pw.println(" mNetworkToIconLookup=" + mNetworkToIconLookup + ",");
pw.println(" MobileStatusHistory");
int size = 0;
@@ -831,8 +1185,67 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
+ (mMobileStatusHistoryIndex + STATUS_HISTORY_SIZE - i) + "): "
+ mMobileStatusHistory[i & (STATUS_HISTORY_SIZE - 1)]);
}
+ pw.println(" mFiveGState=" + mFiveGState + ",");
+ }
+
+ class FiveGStateListener implements IFiveGStateListener{
+
+ public void onStateChanged(FiveGServiceState state) {
+ if (DEBUG) {
+ Log.d(mTag, "onStateChanged: state=" + state);
+ }
+ mFiveGState = state;
+ updateTelephony();
+ notifyListeners();
+ }
}
+ private ImsMmTelManager.CapabilityCallback mCapabilityCallback = new ImsMmTelManager.CapabilityCallback() {
+ @Override
+ public void onCapabilitiesStatusChanged(MmTelFeature.MmTelCapabilities config) {
+ mCurrentState.voiceCapable =
+ config.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VOICE);
+ mCurrentState.videoCapable =
+ config.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VIDEO);
+ Log.d(mTag, "onCapabilitiesStatusChanged isVoiceCapable=" + mCurrentState.voiceCapable
+ + " isVideoCapable=" + mCurrentState.videoCapable);
+ notifyListenersIfNecessary();
+ }
+ };
+
+ private final ImsMmTelManager.RegistrationCallback mImsRegistrationCallback =
+ new ImsMmTelManager.RegistrationCallback() {
+ @Override
+ public void onRegistered(int imsTransportType) {
+ Log.d(mTag, "onRegistered imsTransportType=" + imsTransportType);
+ mCurrentState.imsRegistered = true;
+ notifyListenersIfNecessary();
+ }
+
+ @Override
+ public void onRegistering(int imsTransportType) {
+ Log.d(mTag, "onRegistering imsTransportType=" + imsTransportType);
+ mCurrentState.imsRegistered = false;
+ notifyListenersIfNecessary();
+ }
+
+ @Override
+ public void onUnregistered(ImsReasonInfo info) {
+ Log.d(mTag, "onDeregistered imsReasonInfo=" + info);
+ mCurrentState.imsRegistered = false;
+ notifyListenersIfNecessary();
+ }
+ };
+
+ private final BroadcastReceiver mVolteSwitchObserver = new BroadcastReceiver() {
+ public void onReceive(Context context, Intent intent) {
+ Log.d(mTag, "action=" + intent.getAction());
+ if ( mConfig.showVolteIcon ) {
+ notifyListeners();
+ }
+ }
+ };
+
/** Box for QS icon info */
private static final class QsInfo {
final int ratTypeIcon;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileState.kt b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileState.kt
index 8a3b00662900..548a3fc4d02b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileState.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileState.kt
@@ -41,7 +41,12 @@ internal class MobileState(
@JvmField var roaming: Boolean = false,
@JvmField var dataState: Int = TelephonyManager.DATA_DISCONNECTED,
// Tracks the on/off state of the defaultDataSubscription
- @JvmField var defaultDataOff: Boolean = false
+ @JvmField var defaultDataOff: Boolean = false,
+ @JvmField var imsRegistered: Boolean = false,
+ @JvmField var voiceCapable: Boolean = false,
+ @JvmField var videoCapable: Boolean = false,
+ @JvmField var mobileDataEnabled: Boolean = false,
+ @JvmField var roamingDataEnabled: Boolean = false
) : ConnectivityState() {
@JvmField var telephonyDisplayInfo = TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
@@ -86,6 +91,11 @@ internal class MobileState(
roaming = o.roaming
dataState = o.dataState
defaultDataOff = o.defaultDataOff
+ imsRegistered = o.imsRegistered
+ voiceCapable = o.voiceCapable
+ videoCapable = o.videoCapable
+ mobileDataEnabled = o.mobileDataEnabled
+ roamingDataEnabled = o.roamingDataEnabled
telephonyDisplayInfo = o.telephonyDisplayInfo
serviceState = o.serviceState
@@ -125,6 +135,14 @@ internal class MobileState(
return serviceState != null && serviceState!!.roaming
}
+ fun getVoiceNetworkType(): Int {
+ return serviceState?.getVoiceNetworkType() ?: TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ }
+
+ fun getDataNetworkType(): Int {
+ return serviceState?.getDataNetworkType() ?: TelephonyManager.NETWORK_TYPE_UNKNOWN;
+ }
+
fun setFromMobileStatus(mobileStatus: MobileStatus) {
activityIn = mobileStatus.activityIn
activityOut = mobileStatus.activityOut
@@ -151,6 +169,11 @@ internal class MobileState(
builder.append("userSetup=$userSetup,")
builder.append("dataState=$dataState,")
builder.append("defaultDataOff=$defaultDataOff,")
+ builder.append("imsRegistered=$imsRegistered,")
+ builder.append("voiceCapable=$voiceCapable,")
+ builder.append("videoCapable=$videoCapable,")
+ builder.append("mobileDataEnabled=$mobileDataEnabled,")
+ builder.append("roamingDataEnabled=$roamingDataEnabled,")
// Computed properties
builder.append("showQuickSettingsRatIcon=${showQuickSettingsRatIcon()},")
@@ -181,6 +204,11 @@ internal class MobileState(
if (roaming != other.roaming) return false
if (dataState != other.dataState) return false
if (defaultDataOff != other.defaultDataOff) return false
+ if (imsRegistered != other.imsRegistered) return false
+ if (voiceCapable != other.voiceCapable) return false
+ if (videoCapable != other.videoCapable) return false
+ if (mobileDataEnabled != other.mobileDataEnabled) return false
+ if (roamingDataEnabled != other.roamingDataEnabled) return false
if (telephonyDisplayInfo != other.telephonyDisplayInfo) return false
if (serviceState != other.serviceState) return false
if (signalStrength != other.signalStrength) return false
@@ -202,6 +230,11 @@ internal class MobileState(
result = 31 * result + roaming.hashCode()
result = 31 * result + dataState
result = 31 * result + defaultDataOff.hashCode()
+ result = 31 * result + imsRegistered.hashCode()
+ result = 31 * result + voiceCapable.hashCode()
+ result = 31 * result + videoCapable.hashCode()
+ result = 31 * result + mobileDataEnabled.hashCode()
+ result = 31 * result + roamingDataEnabled.hashCode()
result = 31 * result + telephonyDisplayInfo.hashCode()
result = 31 * result + (serviceState?.hashCode() ?: 0)
result = 31 * result + (signalStrength?.hashCode() ?: 0)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java
index 631a1ca3dcec..35701534ae2a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java
@@ -40,6 +40,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
+import android.os.SystemProperties;
import android.provider.Settings;
import android.telephony.CarrierConfigManager;
import android.telephony.CellSignalStrength;
@@ -58,6 +59,7 @@ import androidx.annotation.NonNull;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.telephony.TelephonyIntents;
import com.android.settingslib.Utils;
import com.android.settingslib.mobile.MobileMappings.Config;
import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
@@ -82,6 +84,7 @@ import com.android.systemui.statusbar.policy.DataSaverControllerImpl;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener;
import com.android.systemui.statusbar.policy.EncryptionHelper;
+import com.android.systemui.statusbar.policy.FiveGServiceClient;
import com.android.systemui.telephony.TelephonyListenerManager;
import com.android.systemui.util.CarrierConfigTracker;
@@ -202,6 +205,9 @@ public class NetworkControllerImpl extends BroadcastReceiver
private InternetDialogFactory mInternetDialogFactory;
private Handler mMainHandler;
+ @VisibleForTesting
+ FiveGServiceClient mFiveGServiceClient;
+
private ConfigurationController.ConfigurationListener mConfigurationListener =
new ConfigurationController.ConfigurationListener() {
@Override
@@ -361,6 +367,8 @@ public class NetworkControllerImpl extends BroadcastReceiver
mWifiManager.registerScanResultsCallback(mReceiverHandler::post, scanResultsCallback);
}
+ mFiveGServiceClient = FiveGServiceClient.getInstance(context);
+
NetworkCallback callback =
new NetworkCallback(NetworkCallback.FLAG_INCLUDE_LOCATION_INFO){
private Network mLastNetwork;
@@ -476,6 +484,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
for (int i = 0; i < mMobileSignalControllers.size(); i++) {
MobileSignalController mobileSignalController = mMobileSignalControllers.valueAt(i);
mobileSignalController.registerListener();
+ mobileSignalController.registerFiveGStateListener(mFiveGServiceClient);
}
if (mSubscriptionListener == null) {
mSubscriptionListener = new SubListener(mBgLooper);
@@ -497,6 +506,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
if (InternetDialogUtil.isProviderModelEnabled(mContext)) {
filter.addAction(Settings.Panel.ACTION_INTERNET_CONNECTIVITY);
}
+ filter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
mBroadcastDispatcher.registerReceiverWithHandler(this, filter, mReceiverHandler);
mListening = true;
@@ -530,11 +540,17 @@ public class NetworkControllerImpl extends BroadcastReceiver
for (int i = 0; i < mMobileSignalControllers.size(); i++) {
MobileSignalController mobileSignalController = mMobileSignalControllers.valueAt(i);
mobileSignalController.unregisterListener();
+ mobileSignalController.unregisterFiveGStateListener(mFiveGServiceClient);
}
mSubscriptionManager.removeOnSubscriptionsChangedListener(mSubscriptionListener);
mBroadcastDispatcher.unregisterReceiver(this);
}
+ @VisibleForTesting
+ public FiveGServiceClient getFiveGServiceClient() {
+ return mFiveGServiceClient;
+ }
+
public int getConnectedWifiLevel() {
return mWifiSignalController.getState().level;
}
@@ -968,6 +984,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
}
if (mListening) {
controller.registerListener();
+ controller.registerFiveGStateListener(mFiveGServiceClient);
}
}
}
@@ -978,6 +995,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
mDefaultSignalController = null;
}
cachedControllers.get(key).unregisterListener();
+ cachedControllers.get(key).unregisterFiveGStateListener(mFiveGServiceClient);
}
}
mCallbackHandler.setSubs(subscriptions);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/SignalCallback.kt b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/SignalCallback.kt
index 599beecb0e00..eb974219050e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/SignalCallback.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/SignalCallback.kt
@@ -146,6 +146,7 @@ data class MobileDataIndicators(
@JvmField val qsType: Int,
@JvmField val activityIn: Boolean,
@JvmField val activityOut: Boolean,
+ @JvmField val volteIcon: Int,
@JvmField val typeContentDescription: CharSequence?,
@JvmField val typeContentDescriptionHtml: CharSequence?,
@JvmField val qsDescription: CharSequence?,
@@ -161,6 +162,7 @@ data class MobileDataIndicators(
.append(",qsType=").append(qsType)
.append(",activityIn=").append(activityIn)
.append(",activityOut=").append(activityOut)
+ .append(",volteIcon=").append(volteIcon)
.append(",typeContentDescription=").append(typeContentDescription)
.append(",typeContentDescriptionHtml=").append(typeContentDescriptionHtml)
.append(",description=").append(qsDescription)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiIcons.java
index 3c449ad270ef..4705c494f8e3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiIcons.java
@@ -39,6 +39,54 @@ public class WifiIcons {
R.drawable.ic_no_internet_wifi_signal_4
};
+ static final int[] WIFI_4_FULL_ICONS = {
+ com.android.internal.R.drawable.ic_wifi_4_signal_0,
+ com.android.internal.R.drawable.ic_wifi_4_signal_1,
+ com.android.internal.R.drawable.ic_wifi_4_signal_2,
+ com.android.internal.R.drawable.ic_wifi_4_signal_3,
+ com.android.internal.R.drawable.ic_wifi_4_signal_4
+ };
+
+ private static final int[] WIFI_4_NO_INTERNET_ICONS = {
+ R.drawable.ic_qs_wifi_4_0,
+ R.drawable.ic_qs_wifi_4_1,
+ R.drawable.ic_qs_wifi_4_2,
+ R.drawable.ic_qs_wifi_4_3,
+ R.drawable.ic_qs_wifi_4_4
+ };
+
+ static final int[] WIFI_5_FULL_ICONS = {
+ com.android.internal.R.drawable.ic_wifi_5_signal_0,
+ com.android.internal.R.drawable.ic_wifi_5_signal_1,
+ com.android.internal.R.drawable.ic_wifi_5_signal_2,
+ com.android.internal.R.drawable.ic_wifi_5_signal_3,
+ com.android.internal.R.drawable.ic_wifi_5_signal_4
+ };
+
+ private static final int[] WIFI_5_NO_INTERNET_ICONS = {
+ R.drawable.ic_qs_wifi_5_0,
+ R.drawable.ic_qs_wifi_5_1,
+ R.drawable.ic_qs_wifi_5_2,
+ R.drawable.ic_qs_wifi_5_3,
+ R.drawable.ic_qs_wifi_5_4
+ };
+
+ static final int[] WIFI_6_FULL_ICONS = {
+ com.android.internal.R.drawable.ic_wifi_6_signal_0,
+ com.android.internal.R.drawable.ic_wifi_6_signal_1,
+ com.android.internal.R.drawable.ic_wifi_6_signal_2,
+ com.android.internal.R.drawable.ic_wifi_6_signal_3,
+ com.android.internal.R.drawable.ic_wifi_6_signal_4
+ };
+
+ private static final int[] WIFI_6_NO_INTERNET_ICONS = {
+ R.drawable.ic_qs_wifi_6_0,
+ R.drawable.ic_qs_wifi_6_1,
+ R.drawable.ic_qs_wifi_6_2,
+ R.drawable.ic_qs_wifi_6_3,
+ R.drawable.ic_qs_wifi_6_4
+ };
+
public static final int[][] QS_WIFI_SIGNAL_STRENGTH = {
WIFI_NO_INTERNET_ICONS,
WIFI_FULL_ICONS
@@ -46,6 +94,27 @@ public class WifiIcons {
static final int[][] WIFI_SIGNAL_STRENGTH = QS_WIFI_SIGNAL_STRENGTH;
+ public static final int[][] QS_WIFI_4_SIGNAL_STRENGTH = {
+ WIFI_4_NO_INTERNET_ICONS,
+ WIFI_4_FULL_ICONS
+ };
+
+ static final int[][] WIFI_4_SIGNAL_STRENGTH = QS_WIFI_4_SIGNAL_STRENGTH;
+
+ public static final int[][] QS_WIFI_5_SIGNAL_STRENGTH = {
+ WIFI_5_NO_INTERNET_ICONS,
+ WIFI_5_FULL_ICONS
+ };
+
+ static final int[][] WIFI_5_SIGNAL_STRENGTH = QS_WIFI_5_SIGNAL_STRENGTH;
+
+ public static final int[][] QS_WIFI_6_SIGNAL_STRENGTH = {
+ WIFI_6_NO_INTERNET_ICONS,
+ WIFI_6_FULL_ICONS
+ };
+
+ static final int[][] WIFI_6_SIGNAL_STRENGTH = QS_WIFI_6_SIGNAL_STRENGTH;
+
public static final int QS_WIFI_DISABLED = com.android.internal.R.drawable.ic_wifi_signal_0;
public static final int QS_WIFI_NO_NETWORK = com.android.internal.R.drawable.ic_wifi_signal_0;
static final int WIFI_NO_NETWORK = QS_WIFI_NO_NETWORK;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiSignalController.java
index ff9d919dda13..993a3a902d3d 100644..100755
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiSignalController.java
@@ -28,6 +28,7 @@ import android.net.wifi.WifiManager;
import android.text.Html;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.settingslib.AccessibilityContentDescriptions;
import com.android.settingslib.SignalIcon.IconGroup;
import com.android.settingslib.SignalIcon.MobileIconGroup;
import com.android.settingslib.graph.SignalDrawable;
@@ -47,6 +48,11 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
private final WifiManager mWifiManager;
private final boolean mProviderModelSetting;
+ private final IconGroup mDefaultWifiIconGroup;
+ private final IconGroup mWifi4IconGroup;
+ private final IconGroup mWifi5IconGroup;
+ private final IconGroup mWifi6IconGroup;
+
public WifiSignalController(
Context context,
boolean hasMobileDataFeature,
@@ -67,8 +73,58 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
wifiManager.registerTrafficStateCallback(context.getMainExecutor(),
new WifiTrafficStateCallback());
}
- mCurrentState.iconGroup = mLastState.iconGroup = mUnmergedWifiIconGroup;
+
+ mDefaultWifiIconGroup = new IconGroup(
+ "Wi-Fi Icons",
+ WifiIcons.WIFI_SIGNAL_STRENGTH,
+ WifiIcons.QS_WIFI_SIGNAL_STRENGTH,
+ AccessibilityContentDescriptions.WIFI_CONNECTION_STRENGTH,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ AccessibilityContentDescriptions.WIFI_NO_CONNECTION
+ );
+
+ mWifi4IconGroup = new IconGroup(
+ "Wi-Fi 4 Icons",
+ WifiIcons.WIFI_4_SIGNAL_STRENGTH,
+ WifiIcons.QS_WIFI_4_SIGNAL_STRENGTH,
+ AccessibilityContentDescriptions.WIFI_CONNECTION_STRENGTH,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ AccessibilityContentDescriptions.WIFI_NO_CONNECTION
+ );
+
+ mWifi5IconGroup = new IconGroup(
+ "Wi-Fi 5 Icons",
+ WifiIcons.WIFI_5_SIGNAL_STRENGTH,
+ WifiIcons.QS_WIFI_5_SIGNAL_STRENGTH,
+ AccessibilityContentDescriptions.WIFI_CONNECTION_STRENGTH,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ AccessibilityContentDescriptions.WIFI_NO_CONNECTION
+ );
+
+ mWifi6IconGroup = new IconGroup(
+ "Wi-Fi 6 Icons",
+ WifiIcons.WIFI_6_SIGNAL_STRENGTH,
+ WifiIcons.QS_WIFI_6_SIGNAL_STRENGTH,
+ AccessibilityContentDescriptions.WIFI_CONNECTION_STRENGTH,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ WifiIcons.WIFI_NO_NETWORK,
+ WifiIcons.QS_WIFI_NO_NETWORK,
+ AccessibilityContentDescriptions.WIFI_NO_CONNECTION
+ );
+
+ mCurrentState.iconGroup = mLastState.iconGroup = mDefaultWifiIconGroup;
mProviderModelSetting = featureFlags.isProviderModelSettingEnabled();
+
}
@Override
@@ -154,6 +210,8 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
new IconState(sbVisible, getCurrentIconIdForCarrierWifi(), contentDescription);
int typeIcon = sbVisible ? icons.dataType : 0;
int qsTypeIcon = 0;
+ // TODO(b/178561525) Populate volteIcon value as necessary
+ int volteIcon = 0;
IconState qsIcon = null;
if (sbVisible) {
qsTypeIcon = icons.dataType;
@@ -164,7 +222,7 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
mNetworkController.getNetworkNameForCarrierWiFi(mCurrentState.subId);
MobileDataIndicators mobileDataIndicators = new MobileDataIndicators(
statusIcon, qsIcon, typeIcon, qsTypeIcon,
- mCurrentState.activityIn, mCurrentState.activityOut, dataContentDescription,
+ mCurrentState.activityIn, mCurrentState.activityOut, volteIcon, dataContentDescription,
dataContentDescriptionHtml, description,
mCurrentState.subId, /* roaming= */ false, /* showTriangle= */ true
);
@@ -190,6 +248,19 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
return getCurrentIconIdForCarrierWifi();
}
+
+ private void updateIconGroup() {
+ if (mCurrentState.wifiStandard == 4) {
+ mCurrentState.iconGroup = mWifi4IconGroup;
+ } else if (mCurrentState.wifiStandard == 5) {
+ mCurrentState.iconGroup = mCurrentState.isReady ? mWifi6IconGroup : mWifi5IconGroup;
+ } else if (mCurrentState.wifiStandard == 6) {
+ mCurrentState.iconGroup = mWifi6IconGroup;
+ } else {
+ mCurrentState.iconGroup = mDefaultWifiIconGroup;
+ }
+
+ }
/**
* Fetches wifi initial state replacing the initial sticky broadcast.
*/
@@ -224,9 +295,10 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
mCurrentState.statusLabel = mWifiTracker.statusLabel;
mCurrentState.isCarrierMerged = mWifiTracker.isCarrierMerged;
mCurrentState.subId = mWifiTracker.subId;
- mCurrentState.iconGroup =
- mCurrentState.isCarrierMerged ? mCarrierMergedWifiIconGroup
- : mUnmergedWifiIconGroup;
+ mCurrentState.wifiStandard = mWifiTracker.wifiStandard;
+ mCurrentState.isReady = (mWifiTracker.vhtMax8SpatialStreamsSupport
+ && mWifiTracker.he8ssCapableAp);
+ updateIconGroup();
}
void notifyWifiLevelChangeIfNecessary(int level) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiState.kt b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiState.kt
index ac15f78191f6..6df8d001d2bc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiState.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/WifiState.kt
@@ -24,7 +24,10 @@ internal class WifiState(
@JvmField var isDefault: Boolean = false,
@JvmField var statusLabel: String? = null,
@JvmField var isCarrierMerged: Boolean = false,
- @JvmField var subId: Int = 0
+ @JvmField var subId: Int = 0,
+ @JvmField var wifiStandard: Int = 0,
+ @JvmField var isReady: Boolean = false
+
) : ConnectivityState() {
public override fun copyFrom(s: ConnectivityState) {
@@ -36,11 +39,15 @@ internal class WifiState(
statusLabel = state.statusLabel
isCarrierMerged = state.isCarrierMerged
subId = state.subId
+ wifiStandard = state.wifiStandard
+ isReady = state.isReady
}
override fun toString(builder: StringBuilder) {
super.toString(builder)
builder.append(",ssid=").append(ssid)
+ .append(",wifiStandard=").append(wifiStandard)
+ .append(",isReady=").append(isReady)
.append(",isTransient=").append(isTransient)
.append(",isDefault=").append(isDefault)
.append(",statusLabel=").append(statusLabel)
@@ -56,6 +63,8 @@ internal class WifiState(
other as WifiState
if (ssid != other.ssid) return false
+ if (wifiStandard != other.wifiStandard) return false
+ if (isReady != other.isReady) return false
if (isTransient != other.isTransient) return false
if (isDefault != other.isDefault) return false
if (statusLabel != other.statusLabel) return false
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java
index c75cd782c3e2..7459fe69ae3a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java
@@ -27,6 +27,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
*/
public class NotificationMediaTemplateViewWrapper extends NotificationTemplateViewWrapper {
+ private static final long PROGRESS_UPDATE_INTERVAL = 1000; // 1s
private View mActions;
protected NotificationMediaTemplateViewWrapper(Context ctx, View view,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
index a88a3b6392c2..1c688975fef5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
@@ -196,6 +196,8 @@ public final class DozeServiceHost implements DozeHost {
updateDozing();
mDozeLog.traceDozing(mStatusBarStateController.isDozing());
mStatusBar.updateIsKeyguard();
+ }else{
+ mDozingRequested = true;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index aeef8cd433ab..1330f87f244e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -75,6 +75,7 @@ import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.EmergencyCarrierArea;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.settingslib.Utils;
@@ -136,6 +137,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
private static final int DOZE_ANIMATION_STAGGER_DELAY = 48;
private static final int DOZE_ANIMATION_ELEMENT_DURATION = 250;
+ private EmergencyCarrierArea mEmergencyCarrierArea;
+
// TODO(b/179494051): May no longer be needed
private final boolean mShowLeftAffordance;
private final boolean mShowCameraAffordance;
@@ -302,6 +305,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
super.onFinishInflate();
mPreviewInflater = new PreviewInflater(mContext, new LockPatternUtils(mContext),
new ActivityIntentHelper(mContext));
+ mEmergencyCarrierArea = (EmergencyCarrierArea) findViewById(R.id.keyguard_selector_fade_container);
mOverlayContainer = findViewById(R.id.overlay_container);
mRightAffordanceView = findViewById(R.id.camera_button);
mLeftAffordanceView = findViewById(R.id.left_button);
@@ -915,8 +919,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
if (dozing) {
mOverlayContainer.setVisibility(INVISIBLE);
+ mEmergencyCarrierArea.setVisibility(INVISIBLE);
} else {
mOverlayContainer.setVisibility(VISIBLE);
+ mEmergencyCarrierArea.setVisibility(VISIBLE);
if (animate) {
startFinishDozeAnimation();
}
@@ -952,6 +958,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
mIndicationArea.setAlpha(alpha);
mWalletButton.setAlpha(alpha);
mControlsButton.setAlpha(alpha);
+ mEmergencyCarrierArea.setAlpha(alpha);
}
private class DefaultLeftButton implements IntentButton {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index cc4f901668ab..cc4f901668ab 100644..100755
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 7432fa98051d..5f596f8afb7e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -98,6 +98,8 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.internal.policy.SystemBarUtils;
import com.android.internal.util.LatencyTracker;
+import com.android.keyguard.EmergencyButton;
+import com.android.keyguard.EmergencyButtonController;
import com.android.keyguard.KeyguardStatusView;
import com.android.keyguard.KeyguardStatusViewController;
import com.android.keyguard.KeyguardUnfoldTransition;
@@ -331,6 +333,9 @@ public class NotificationPanelViewController extends PanelViewController {
private float mQuickQsOffsetHeight;
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
+ private final EmergencyButtonController.Factory mEmergencyButtonControllerFactory;
+ private EmergencyButtonController mEmergencyButtonController;
+
private int mTrackingPointer;
private VelocityTracker mQsVelocityTracker;
private boolean mQsTracking;
@@ -713,7 +718,8 @@ public class NotificationPanelViewController extends PanelViewController {
NotificationRemoteInputManager remoteInputManager,
Optional<SysUIUnfoldComponent> unfoldComponent,
ControlsComponent controlsComponent,
- FeatureFlags featureFlags) {
+ FeatureFlags featureFlags,
+ EmergencyButtonController.Factory emergencyButtonControllerFactory) {
super(view,
falsingManager,
dozeLog,
@@ -751,6 +757,7 @@ public class NotificationPanelViewController extends PanelViewController {
mContentResolver = contentResolver;
mKeyguardQsUserSwitchComponentFactory = keyguardQsUserSwitchComponentFactory;
mKeyguardUserSwitcherComponentFactory = keyguardUserSwitcherComponentFactory;
+ mEmergencyButtonControllerFactory = emergencyButtonControllerFactory;
mQSDetailDisplayer = qsDetailDisplayer;
mFragmentService = fragmentService;
mSettingsChangeObserver = new SettingsChangeObserver(handler);
@@ -1178,6 +1185,10 @@ public class NotificationPanelViewController extends PanelViewController {
mKeyguardBottomArea.setFalsingManager(mFalsingManager);
mKeyguardBottomArea.initWallet(mQuickAccessWalletController);
mKeyguardBottomArea.initControls(mControlsComponent);
+ EmergencyButton emergencyButton =
+ mKeyguardBottomArea.findViewById(R.id.emergency_call_button);
+ mEmergencyButtonController = mEmergencyButtonControllerFactory.create(emergencyButton);
+ mEmergencyButtonController.init();
}
private void updateMaxDisplayedNotifications(boolean recompute) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
index 040820e90790..956ac31b3627 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
@@ -62,6 +62,7 @@ import com.android.systemui.statusbar.notification.stack.AmbientState;
import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent;
import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
+import android.util.BoostFramework;
import com.android.wm.shell.animation.FlingAnimationUtils;
import java.io.FileDescriptor;
@@ -148,6 +149,11 @@ public abstract class PanelViewController {
private final VibratorHelper mVibratorHelper;
/**
+ * For PanelView fling perflock call
+ */
+ private BoostFramework mPerf = null;
+
+ /**
* Whether an instant expand request is currently pending and we are just waiting for layout.
*/
private boolean mInstantExpanding;
@@ -277,6 +283,8 @@ public abstract class PanelViewController {
mVibratorHelper = vibratorHelper;
mVibrateOnOpening = mResources.getBoolean(R.bool.config_vibrateOnIconAnimation);
mStatusBarTouchableRegionManager = statusBarTouchableRegionManager;
+
+ mPerf = new BoostFramework();
}
protected void loadDimens() {
@@ -629,6 +637,10 @@ public abstract class PanelViewController {
animator.setDuration(mFixedDuration);
}
}
+ if (mPerf != null) {
+ String currentPackage = mView.getContext().getPackageName();
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_SCROLL_BOOST, currentPackage, -1, BoostFramework.Scroll.PANEL_VIEW);
+ }
animator.addListener(new AnimatorListenerAdapter() {
private boolean mCancelled;
@@ -639,11 +651,17 @@ public abstract class PanelViewController {
@Override
public void onAnimationCancel(Animator animation) {
+ if (mPerf != null) {
+ mPerf.perfLockRelease();
+ }
mCancelled = true;
}
@Override
public void onAnimationEnd(Animator animation) {
+ if (mPerf != null) {
+ mPerf.perfLockRelease();
+ }
if (shouldSpringBack && !mCancelled) {
// After the shade is flinged open to an overscrolled state, spring back
// the shade by reducing section padding to 0.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index d19ed28bd823..b3917d03b189 100644..100755
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -29,6 +29,8 @@ import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.media.AudioManager;
+import android.net.wifi.ScanResult;
+import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -281,11 +283,6 @@ public class PhoneStatusBarPolicy
mIconController.setIcon(mSlotCast, R.drawable.stat_sys_cast, null);
mIconController.setIconVisibility(mSlotCast, false);
- // hotspot
- mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_hotspot,
- mResources.getString(R.string.accessibility_status_bar_hotspot));
- mIconController.setIconVisibility(mSlotHotspot, mHotspot.isHotspotEnabled());
-
// managed profile
mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status,
mResources.getString(R.string.accessibility_managed_profile));
@@ -561,6 +558,11 @@ public class PhoneStatusBarPolicy
public void onHotspotChanged(boolean enabled, int numDevices) {
mIconController.setIconVisibility(mSlotHotspot, enabled);
}
+ @Override
+ public void onHotspotChanged(boolean enabled, int numDevices, int standard) {
+ updateHotspotIcon(standard);
+ mIconController.setIconVisibility(mSlotHotspot, enabled);
+ }
};
private final CastController.Callback mCastCallback = new CastController.Callback() {
@@ -789,4 +791,20 @@ public class PhoneStatusBarPolicy
if (DEBUG) Log.d(TAG, "screenrecord: hiding icon");
mHandler.post(() -> mIconController.setIconVisibility(mSlotScreenRecord, false));
}
+
+ private void updateHotspotIcon(int standard) {
+ if (standard == ScanResult.WIFI_STANDARD_11AX) {
+ mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_wifi_6_hotspot,
+ mResources.getString(R.string.accessibility_status_bar_hotspot));
+ } else if (standard == ScanResult.WIFI_STANDARD_11AC) {
+ mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_wifi_5_hotspot,
+ mResources.getString(R.string.accessibility_status_bar_hotspot));
+ } else if (standard == ScanResult.WIFI_STANDARD_11N) {
+ mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_wifi_4_hotspot,
+ mResources.getString(R.string.accessibility_status_bar_hotspot));
+ } else {
+ mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_hotspot,
+ mResources.getString(R.string.accessibility_status_bar_hotspot));
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index a6fb317cdfc8..50f5b216bfd6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -3638,6 +3638,7 @@ public class StatusBar extends SystemUI implements
@Override
public void onScreenTurnedOff() {
+ mDozeServiceHost.updateDozing();
mFalsingCollector.onScreenOff();
mScrimController.onScreenTurnedOff();
updateIsKeyguard();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index fe96a5b9979f..f31e7264841d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -1079,12 +1079,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
*/
protected boolean getLastNavBarVisible() {
boolean keyguardShowing = mLastShowing && !mLastOccluded;
- boolean hideWhileDozing = mLastDozing && mLastBiometricMode != MODE_WAKE_AND_UNLOCK_PULSING;
- boolean keyguardWithGestureNav = (keyguardShowing && !mLastDozing
- || mLastPulsing && !mLastIsDocked) && mLastGesturalNav;
- return (!keyguardShowing && !hideWhileDozing || mLastBouncerShowing
- || mLastRemoteInputActive || keyguardWithGestureNav
- || mLastGlobalActionsVisible);
+ boolean hideWhileDozing = mLastDozing && mLastBiometricMode != MODE_WAKE_AND_UNLOCK_PULSING;
+ boolean keyguardWithGestureNav = (keyguardShowing && !mLastDozing
+ || mLastPulsing && !mLastIsDocked) && mLastGesturalNav;
+ return (!keyguardShowing && !hideWhileDozing || mLastBouncerShowing
+ || mLastRemoteInputActive || keyguardWithGestureNav
+ || mLastGlobalActionsVisible);
}
public boolean shouldDismissOnMenuPressed() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
index 360cb571c926..67850bc5fe04 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
@@ -274,6 +274,7 @@ public class StatusBarSignalPolicy implements SignalCallback,
state.roaming = indicators.roaming;
state.activityIn = indicators.activityIn && mActivityEnabled;
state.activityOut = indicators.activityOut && mActivityEnabled;
+ state.volteId = indicators.volteIcon;
if (DEBUG) {
Log.d(TAG, "MobileIconStates: "
@@ -607,6 +608,7 @@ public class StatusBarSignalPolicy implements SignalCallback,
public boolean roaming;
public boolean needsLeadingPadding;
public CharSequence typeContentDescription;
+ public int volteId;
private MobileIconState(int subId) {
super();
@@ -628,7 +630,8 @@ public class StatusBarSignalPolicy implements SignalCallback,
&& showTriangle == that.showTriangle
&& roaming == that.roaming
&& needsLeadingPadding == that.needsLeadingPadding
- && Objects.equals(typeContentDescription, that.typeContentDescription);
+ && Objects.equals(typeContentDescription, that.typeContentDescription)
+ && volteId == that.volteId;
}
@Override
@@ -654,6 +657,7 @@ public class StatusBarSignalPolicy implements SignalCallback,
other.roaming = roaming;
other.needsLeadingPadding = needsLeadingPadding;
other.typeContentDescription = typeContentDescription;
+ other.volteId = volteId;
}
private static List<MobileIconState> copyStates(List<MobileIconState> inStates) {
@@ -670,7 +674,8 @@ public class StatusBarSignalPolicy implements SignalCallback,
@Override public String toString() {
return "MobileIconState(subId=" + subId + ", strengthId=" + strengthId
+ ", showTriangle=" + showTriangle + ", roaming=" + roaming
- + ", typeId=" + typeId + ", visible=" + visible + ")";
+ + ", typeId=" + typeId + ", volteId=" + volteId
+ + ", visible=" + visible + ")";
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FiveGServiceClient.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FiveGServiceClient.java
new file mode 100644
index 000000000000..dea282befd64
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FiveGServiceClient.java
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.ServiceConnection;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.DeadObjectException;
+import android.os.RemoteException;
+import android.util.Log;
+import android.util.SparseArray;
+
+import com.google.android.collect.Lists;
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.lang.Exception;
+import java.util.ArrayList;
+import java.lang.ref.WeakReference;
+
+import com.android.keyguard.KeyguardUpdateMonitorCallback;
+import com.android.settingslib.mobile.TelephonyIcons;
+import com.android.settingslib.SignalIcon.MobileIconGroup;
+import com.android.systemui.R;
+
+import com.qti.extphone.Client;
+import com.qti.extphone.ExtTelephonyManager;
+import com.qti.extphone.IExtPhoneCallback;
+import com.qti.extphone.ExtPhoneCallbackBase;
+import com.qti.extphone.NrIconType;
+import com.qti.extphone.Status;
+import com.qti.extphone.ServiceCallback;
+import com.qti.extphone.Token;
+
+public class FiveGServiceClient {
+ private static final String TAG = "FiveGServiceClient";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG)||true;
+ private static final int MESSAGE_REBIND = 1024;
+ private static final int MESSAGE_REINIT = MESSAGE_REBIND+1;
+ private static final int MESSAGE_NOTIFIY_MONITOR_CALLBACK = MESSAGE_REBIND+2;
+ private static final int MAX_RETRY = 4;
+ private static final int DELAY_MILLISECOND = 3000;
+ private static final int DELAY_INCREMENT = 2000;
+
+ private static FiveGServiceClient sInstance;
+ private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>>
+ mKeyguardUpdateMonitorCallbacks = Lists.newArrayList();
+ @VisibleForTesting
+ final SparseArray<IFiveGStateListener> mStatesListeners = new SparseArray<>();
+ private final SparseArray<FiveGServiceState> mCurrentServiceStates = new SparseArray<>();
+ private final SparseArray<FiveGServiceState> mLastServiceStates = new SparseArray<>();
+
+ private Context mContext;
+ private boolean mServiceConnected;
+ private String mPackageName;
+ private Client mClient;
+ private int mInitRetryTimes = 0;
+ private ExtTelephonyManager mExtTelephonyManager;
+ private boolean mIsConnectInProgress = false;
+
+ public static class FiveGServiceState{
+ private int mNrIconType;
+ private MobileIconGroup mIconGroup;
+
+ public FiveGServiceState(){
+ mNrIconType = NrIconType.INVALID;
+ mIconGroup = TelephonyIcons.UNKNOWN;
+ }
+
+ public boolean isNrIconTypeValid() {
+ return mNrIconType != NrIconType.INVALID && mNrIconType != NrIconType.TYPE_NONE;
+ }
+
+ @VisibleForTesting
+ public MobileIconGroup getIconGroup() {
+ return mIconGroup;
+ }
+
+ @VisibleForTesting
+ int getNrIconType() {
+ return mNrIconType;
+ }
+
+ public void copyFrom(FiveGServiceState state) {
+ this.mIconGroup = state.mIconGroup;
+ this.mNrIconType = state.mNrIconType;
+ }
+
+ public boolean equals(FiveGServiceState state) {
+ return this.mIconGroup == state.mIconGroup
+ && this.mNrIconType == state.mNrIconType;
+ }
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("mNrIconType=").append(mNrIconType).append(", ").
+ append("mIconGroup=").append(mIconGroup);
+
+ return builder.toString();
+ }
+ }
+
+ public FiveGServiceClient(Context context) {
+ mContext = context;
+ mPackageName = mContext.getPackageName();
+ if (mExtTelephonyManager == null) {
+ mExtTelephonyManager = ExtTelephonyManager.getInstance(mContext);
+ }
+ }
+
+ public static FiveGServiceClient getInstance(Context context) {
+ if ( sInstance == null ) {
+ sInstance = new FiveGServiceClient(context);
+ }
+
+ return sInstance;
+ }
+
+ public void registerCallback(KeyguardUpdateMonitorCallback callback) {
+ mKeyguardUpdateMonitorCallbacks.add(
+ new WeakReference<KeyguardUpdateMonitorCallback>(callback));
+ }
+
+ public void registerListener(int phoneId, IFiveGStateListener listener) {
+ Log.d(TAG, "registerListener phoneId=" + phoneId);
+ resetState(phoneId);
+ mStatesListeners.put(phoneId, listener);
+ if ( !isServiceConnected() ) {
+ connectService();
+ }else{
+ initFiveGServiceState(phoneId);
+ }
+ }
+
+ private void resetState(int phoneId) {
+ Log.d(TAG, "resetState phoneId=" + phoneId);
+ FiveGServiceState currentState = getCurrentServiceState(phoneId);
+ currentState.mNrIconType = NrIconType.INVALID;
+ currentState.mIconGroup = TelephonyIcons.UNKNOWN;
+
+ FiveGServiceState lastState = getLastServiceState(phoneId);
+ lastState.mNrIconType = NrIconType.INVALID;
+ lastState.mIconGroup = TelephonyIcons.UNKNOWN;
+ }
+
+ public void unregisterListener(int phoneId) {
+ Log.d(TAG, "unregisterListener phoneId=" + phoneId);
+ mStatesListeners.remove(phoneId);
+ mCurrentServiceStates.remove(phoneId);
+ mLastServiceStates.remove(phoneId);
+ }
+
+ public boolean isServiceConnected() {
+ return mServiceConnected;
+ }
+
+ private void connectService() {
+ if (!isServiceConnected() && !mIsConnectInProgress) {
+ mIsConnectInProgress = true;
+ Log.d(TAG, "Connect to ExtTelephony bound service...");
+ mExtTelephonyManager.connectService(mServiceCallback);
+ }
+ }
+
+ private ServiceCallback mServiceCallback = new ServiceCallback() {
+ @Override
+ public void onConnected() {
+ Log.d(TAG, "ExtTelephony Service connected");
+ mServiceConnected = true;
+ mIsConnectInProgress = false;
+ mClient = mExtTelephonyManager.registerCallback(mPackageName, mCallback);
+ initFiveGServiceState();
+ Log.d(TAG, "Client = " + mClient);
+ }
+ @Override
+ public void onDisconnected() {
+ Log.d(TAG, "ExtTelephony Service disconnected...");
+ if (mServiceConnected) {
+ mExtTelephonyManager.unRegisterCallback(mCallback);
+ }
+ mServiceConnected = false;
+ mClient = null;
+ mIsConnectInProgress = false;
+ mHandler.sendEmptyMessageDelayed(MESSAGE_REBIND,
+ DELAY_MILLISECOND + DELAY_INCREMENT);
+ }
+ };
+
+ @VisibleForTesting
+ public FiveGServiceState getCurrentServiceState(int phoneId) {
+ return getServiceState(phoneId, mCurrentServiceStates);
+ }
+
+ private FiveGServiceState getLastServiceState(int phoneId) {
+ return getServiceState(phoneId, mLastServiceStates);
+ }
+
+ private static FiveGServiceState getServiceState(int key,
+ SparseArray<FiveGServiceState> array) {
+ FiveGServiceState state = array.get(key);
+ if ( state == null ) {
+ state = new FiveGServiceState();
+ array.put(key, state);
+ }
+ return state;
+ }
+
+ private void notifyListenersIfNecessary(int phoneId) {
+ FiveGServiceState currentState = getCurrentServiceState(phoneId);
+ FiveGServiceState lastState = getLastServiceState(phoneId);
+ if ( !currentState.equals(lastState) ) {
+
+ if ( DEBUG ) {
+ Log.d(TAG, "phoneId(" + phoneId + ") Change in state from " + lastState + " \n"+
+ "\tto " + currentState);
+
+ }
+
+ lastState.copyFrom(currentState);
+ IFiveGStateListener listener = mStatesListeners.get(phoneId);
+ if (listener != null) {
+ listener.onStateChanged(currentState);
+ }
+
+ mHandler.sendEmptyMessage(MESSAGE_NOTIFIY_MONITOR_CALLBACK);
+
+ }
+ }
+
+ private void initFiveGServiceState() {
+ Log.d(TAG, "initFiveGServiceState size=" + mStatesListeners.size());
+ for( int i=0; i < mStatesListeners.size(); ++i ) {
+ int phoneId = mStatesListeners.keyAt(i);
+ initFiveGServiceState(phoneId);
+ }
+ }
+
+ private void initFiveGServiceState(int phoneId) {
+ Log.d(TAG, "mServiceConnected=" + mServiceConnected + " mClient=" + mClient);
+ if ( mServiceConnected && mClient != null) {
+ Log.d(TAG, "query 5G service state for phoneId " + phoneId);
+ try {
+ Token token = mExtTelephonyManager.queryNrIconType(phoneId, mClient);
+ Log.d(TAG, "queryNrIconType result:" + token);
+ } catch (Exception e) {
+ Log.d(TAG, "initFiveGServiceState: Exception = " + e);
+ if ( mInitRetryTimes < MAX_RETRY && !mHandler.hasMessages(MESSAGE_REINIT) ) {
+ mHandler.sendEmptyMessageDelayed(MESSAGE_REINIT,
+ DELAY_MILLISECOND + mInitRetryTimes*DELAY_INCREMENT);
+ mInitRetryTimes +=1;
+ }
+ }
+ }
+ }
+
+ @VisibleForTesting
+ void update5GIcon(FiveGServiceState state,int phoneId) {
+ state.mIconGroup = getNrIconGroup(state.mNrIconType, phoneId);
+ }
+
+ private MobileIconGroup getNrIconGroup(int nrIconType , int phoneId) {
+ MobileIconGroup iconGroup = TelephonyIcons.UNKNOWN;
+ switch (nrIconType){
+ case NrIconType.TYPE_5G_BASIC:
+ iconGroup = TelephonyIcons.FIVE_G_BASIC;
+ break;
+ case NrIconType.TYPE_5G_UWB:
+ iconGroup = TelephonyIcons.FIVE_G_UWB;
+ break;
+ }
+ return iconGroup;
+ }
+
+ private void notifyMonitorCallback() {
+ for (int i = 0; i < mKeyguardUpdateMonitorCallbacks.size(); i++) {
+ KeyguardUpdateMonitorCallback cb = mKeyguardUpdateMonitorCallbacks.get(i).get();
+ if (cb != null) {
+ cb.onRefreshCarrierInfo();
+ }
+ }
+ }
+
+ private Handler mHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ int what = msg.what;
+ switch ( msg.what ) {
+ case MESSAGE_REBIND:
+ connectService();
+ break;
+
+ case MESSAGE_REINIT:
+ initFiveGServiceState();
+ break;
+
+ case MESSAGE_NOTIFIY_MONITOR_CALLBACK:
+ notifyMonitorCallback();
+ break;
+ }
+
+ }
+ };
+
+
+ @VisibleForTesting
+ protected IExtPhoneCallback mCallback = new ExtPhoneCallbackBase() {
+ @Override
+ public void onNrIconType(int slotId, Token token, Status status, NrIconType
+ nrIconType) throws RemoteException {
+ Log.d(TAG,
+ "onNrIconType: slotId = " + slotId + " token = " + token + " " + "status"
+ + status + " NrIconType = " + nrIconType);
+ if (status.get() == Status.SUCCESS) {
+ FiveGServiceState state = getCurrentServiceState(slotId);
+ state.mNrIconType = nrIconType.get();
+ update5GIcon(state, slotId);
+ notifyListenersIfNecessary(slotId);
+ }
+ }
+ };
+
+ public interface IFiveGStateListener {
+ public void onStateChanged(FiveGServiceState state);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotController.java
index 8231f8b3a09b..e44e6d2d050a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotController.java
@@ -30,6 +30,10 @@ public interface HotspotController extends CallbackController<Callback>, Dumpabl
interface Callback {
void onHotspotChanged(boolean enabled, int numDevices);
+ default void onHotspotChanged(boolean enabled, int numDevices,
+ int standard) {
+ onHotspotChanged(enabled, numDevices);
+ }
default void onHotspotAvailabilityChanged(boolean available) {}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
index f364e49bb757..f6b8b22d9d44 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
@@ -23,6 +23,7 @@ import android.content.Context;
import android.net.ConnectivityManager;
import android.net.TetheringManager;
import android.net.TetheringManager.TetheringRequest;
+import android.net.wifi.ScanResult;
import android.net.wifi.WifiClient;
import android.net.wifi.WifiManager;
import android.os.Handler;
@@ -163,7 +164,8 @@ public class HotspotControllerImpl implements HotspotController, WifiManager.Sof
// on the Main Handler. In order to always update the callback on added, we
// make this call when adding callbacks after the first.
mMainHandler.post(() ->
- callback.onHotspotChanged(isHotspotEnabled(), mNumConnectedDevices));
+ callback.onHotspotChanged(isHotspotEnabled(), mNumConnectedDevices,
+ getHotspotWifiStandard()));
}
}
}
@@ -186,6 +188,13 @@ public class HotspotControllerImpl implements HotspotController, WifiManager.Sof
return mHotspotState == WifiManager.WIFI_AP_STATE_ENABLED;
}
+ public int getHotspotWifiStandard() {
+ if (mWifiManager != null) {
+ return mWifiManager.getSoftApWifiStandard();
+ }
+ return ScanResult.WIFI_STANDARD_LEGACY;
+ }
+
@Override
public boolean isHotspotTransient() {
return mWaitingForTerminalState || (mHotspotState == WifiManager.WIFI_AP_STATE_ENABLING);
@@ -232,7 +241,8 @@ public class HotspotControllerImpl implements HotspotController, WifiManager.Sof
list = new ArrayList<>(mCallbacks);
}
for (Callback callback : list) {
- callback.onHotspotChanged(isHotspotEnabled(), mNumConnectedDevices);
+ callback.onHotspotChanged(isHotspotEnabled(), mNumConnectedDevices,
+ getHotspotWifiStandard());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
new file mode 100644
index 000000000000..be2bf0750d92
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.Context;
+import android.content.Intent;
+import android.telephony.SubscriptionInfo;
+
+import com.android.settingslib.net.DataUsageController;
+import com.android.systemui.demomode.DemoMode;
+import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
+import com.android.wifitrackerlib.MergedCarrierEntry;
+import com.android.wifitrackerlib.WifiEntry;
+
+import java.util.List;
+
+public interface NetworkController extends CallbackController<SignalCallback>, DemoMode {
+
+ boolean hasMobileDataFeature();
+ void setWifiEnabled(boolean enabled);
+ AccessPointController getAccessPointController();
+ DataUsageController getMobileDataController();
+ DataSaverController getDataSaverController();
+ String getMobileDataNetworkName();
+ boolean isMobileDataNetworkInService();
+ int getNumberSubscriptions();
+
+ boolean hasVoiceCallingFeature();
+
+ void addEmergencyListener(EmergencyListener listener);
+ void removeEmergencyListener(EmergencyListener listener);
+ boolean hasEmergencyCryptKeeperText();
+
+ boolean isRadioOn();
+
+ /**
+ * Wrapper class for all the WiFi signals used for WiFi indicators.
+ */
+ final class WifiIndicators {
+ public boolean enabled;
+ public IconState statusIcon;
+ public IconState qsIcon;
+ public boolean activityIn;
+ public boolean activityOut;
+ public String description;
+ public boolean isTransient;
+ public String statusLabel;
+
+ public WifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
+ boolean activityIn, boolean activityOut, String description,
+ boolean isTransient, String statusLabel) {
+ this.enabled = enabled;
+ this.statusIcon = statusIcon;
+ this.qsIcon = qsIcon;
+ this.activityIn = activityIn;
+ this.activityOut = activityOut;
+ this.description = description;
+ this.isTransient = isTransient;
+ this.statusLabel = statusLabel;
+ }
+
+ @Override
+ public String toString() {
+ return new StringBuilder("WifiIndicators[")
+ .append("enabled=").append(enabled)
+ .append(",statusIcon=").append(statusIcon == null ? "" : statusIcon.toString())
+ .append(",qsIcon=").append(qsIcon == null ? "" : qsIcon.toString())
+ .append(",activityIn=").append(activityIn)
+ .append(",activityOut=").append(activityOut)
+ .append(",description=").append(description)
+ .append(",isTransient=").append(isTransient)
+ .append(",statusLabel=").append(statusLabel)
+ .append(']').toString();
+ }
+ }
+
+ /**
+ * Wrapper class for all the mobile signals used for mobile data indicators.
+ */
+ final class MobileDataIndicators {
+ public IconState statusIcon;
+ public IconState qsIcon;
+ public int statusType;
+ public int qsType;
+ public boolean activityIn;
+ public boolean activityOut;
+ public int volteIcon;
+ public CharSequence typeContentDescription;
+ public CharSequence typeContentDescriptionHtml;
+ public CharSequence description;
+ public boolean isWide;
+ public int subId;
+ public boolean roaming;
+ public boolean showTriangle;
+
+ public MobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
+ int qsType, boolean activityIn, boolean activityOut, int volteIcon,
+ CharSequence typeContentDescription, CharSequence typeContentDescriptionHtml,
+ CharSequence description, boolean isWide, int subId, boolean roaming,
+ boolean showTriangle) {
+ this.statusIcon = statusIcon;
+ this.qsIcon = qsIcon;
+ this.statusType = statusType;
+ this.qsType = qsType;
+ this.activityIn = activityIn;
+ this.activityOut = activityOut;
+ this.volteIcon = volteIcon;
+ this.typeContentDescription = typeContentDescription;
+ this.typeContentDescriptionHtml = typeContentDescriptionHtml;
+ this.description = description;
+ this.isWide = isWide;
+ this.subId = subId;
+ this.roaming = roaming;
+ this.showTriangle = showTriangle;
+ }
+
+ @Override
+ public String toString() {
+ return new StringBuilder("MobileDataIndicators[")
+ .append("statusIcon=").append(statusIcon == null ? "" : statusIcon.toString())
+ .append(",qsIcon=").append(qsIcon == null ? "" : qsIcon.toString())
+ .append(",statusType=").append(statusType)
+ .append(",qsType=").append(qsType)
+ .append(",activityIn=").append(activityIn)
+ .append(",activityOut=").append(activityOut)
+ .append(",volteIcon=").append(volteIcon)
+ .append(",typeContentDescription=").append(typeContentDescription)
+ .append(",typeContentDescriptionHtml=").append(typeContentDescriptionHtml)
+ .append(",description=").append(description)
+ .append(",isWide=").append(isWide)
+ .append(",subId=").append(subId)
+ .append(",roaming=").append(roaming)
+ .append(",showTriangle=").append(showTriangle)
+ .append(']').toString();
+ }
+ }
+
+ public interface SignalCallback {
+ /**
+ * Callback for listeners to be able to update the state of any UI tracking connectivity of
+ * WiFi networks.
+ */
+ default void setWifiIndicators(WifiIndicators wifiIndicators) {}
+
+ /**
+ * Callback for listeners to be able to update the state of any UI tracking connectivity
+ * of Mobile networks.
+ */
+ default void setMobileDataIndicators(MobileDataIndicators mobileDataIndicators) {}
+
+ default void setSubs(List<SubscriptionInfo> subs) {}
+
+ default void setNoSims(boolean show, boolean simDetected) {}
+
+ default void setEthernetIndicators(IconState icon) {}
+
+ default void setIsAirplaneMode(IconState icon) {}
+
+ default void setMobileDataEnabled(boolean enabled) {}
+
+ /**
+ * Callback for listeners to be able to update the connectivity status
+ * @param noDefaultNetwork whether there is any default network.
+ * @param noValidatedNetwork whether there is any validated network.
+ * @param noNetworksAvailable whether there is any WiFi networks available.
+ */
+ default void setConnectivityStatus(boolean noDefaultNetwork, boolean noValidatedNetwork,
+ boolean noNetworksAvailable) {}
+
+ /**
+ * Callback for listeners to be able to update the call indicator
+ * @param statusIcon the icon for the call indicator
+ * @param subId subscription ID for which to update the UI
+ */
+ default void setCallIndicator(IconState statusIcon, int subId) {}
+ }
+
+ public interface EmergencyListener {
+ void setEmergencyCallsOnly(boolean emergencyOnly);
+ }
+
+ public static class IconState {
+ public final boolean visible;
+ public final int icon;
+ public final String contentDescription;
+
+ public IconState(boolean visible, int icon, String contentDescription) {
+ this.visible = visible;
+ this.icon = icon;
+ this.contentDescription = contentDescription;
+ }
+
+ public IconState(boolean visible, int icon, int contentDescription,
+ Context context) {
+ this(visible, icon, context.getString(contentDescription));
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ return builder.append("[visible=").append(visible).append(',')
+ .append("icon=").append(icon).append(',')
+ .append("contentDescription=").append(contentDescription).append(']')
+ .toString();
+ }
+ }
+
+ /**
+ * Tracks changes in access points. Allows listening for changes, scanning for new APs,
+ * and connecting to new ones.
+ */
+ public interface AccessPointController {
+ void addAccessPointCallback(AccessPointCallback callback);
+ void removeAccessPointCallback(AccessPointCallback callback);
+ void scanForAccessPoints();
+ MergedCarrierEntry getMergedCarrierEntry();
+ int getIcon(WifiEntry ap);
+ boolean connect(WifiEntry ap);
+ boolean canConfigWifi();
+ boolean canConfigMobileData();
+
+ public interface AccessPointCallback {
+ void onAccessPointsChanged(List<WifiEntry> accessPoints);
+ void onSettingsActivityTriggered(Intent settingsIntent);
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/util/sensors/AsyncSensorManager.java b/packages/SystemUI/src/com/android/systemui/util/sensors/AsyncSensorManager.java
index 48759824f5ef..747efc806838 100644..100755
--- a/packages/SystemUI/src/com/android/systemui/util/sensors/AsyncSensorManager.java
+++ b/packages/SystemUI/src/com/android/systemui/util/sensors/AsyncSensorManager.java
@@ -86,7 +86,14 @@ public class AsyncSensorManager extends SensorManager
protected boolean registerListenerImpl(SensorEventListener listener,
Sensor sensor, int delayUs, Handler handler, int maxReportLatencyUs,
int reservedFlags) {
+ if ( sensor == null ) {
+ Log.e(TAG, "sensor cannot be null \n" + Log.getStackTraceString(new Throwable()));
+ return false;
+ }
mExecutor.execute(() -> {
+ if ( sensor == null ) {
+ Log.e(TAG, "sensor cannot be null");
+ }
if (!mInner.registerListener(listener, sensor, delayUs, maxReportLatencyUs, handler)) {
Log.e(TAG, "Registering " + listener + " for " + sensor + " failed.");
}
@@ -135,6 +142,9 @@ public class AsyncSensorManager extends SensorManager
throw new IllegalArgumentException("sensor cannot be null");
}
mExecutor.execute(() -> {
+ if ( sensor == null ) {
+ Log.e(TAG, "sensor cannot be null");
+ }
if (!mInner.requestTriggerSensor(listener, sensor)) {
Log.e(TAG, "Requesting " + listener + " for " + sensor + " failed.");
}
diff --git a/packages/SystemUI/tests/Android.mk b/packages/SystemUI/tests/Android.mk
index ff5165d4e7cf..75d350c1d02a 100644
--- a/packages/SystemUI/tests/Android.mk
+++ b/packages/SystemUI/tests/Android.mk
@@ -42,6 +42,10 @@ LOCAL_JAVA_LIBRARIES := \
android.test.runner \
telephony-common \
android.test.base \
+ android.car \
+ android.car.userlib \
+ telephony-ext \
+ ims-common
LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui
diff --git a/packages/SystemUI/tests/AndroidManifest.xml b/packages/SystemUI/tests/AndroidManifest.xml
index 2c9c98032245..df670cf16477 100644
--- a/packages/SystemUI/tests/AndroidManifest.xml
+++ b/packages/SystemUI/tests/AndroidManifest.xml
@@ -52,6 +52,7 @@
<uses-permission android:name="android.permission.NETWORK_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REGISTER_WINDOW_MANAGER_LISTENERS" />
+ <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<application android:debuggable="true" android:largeHeap="true">
<uses-library android:name="android.test.runner" />
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
index 70792cfee301..c15649a25031 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
@@ -772,28 +772,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
}
@Test
- public void testActiveSubscriptionBecomesInactive() {
- List<SubscriptionInfo> list = new ArrayList<>();
- list.add(TEST_SUBSCRIPTION);
- when(mSubscriptionManager.getCompleteActiveSubscriptionInfoList()).thenReturn(list);
- mKeyguardUpdateMonitor.mPhoneStateListener.onActiveDataSubscriptionIdChanged(
- TEST_SUBSCRIPTION.getSubscriptionId());
- mTestableLooper.processAllMessages();
- assertThat(mKeyguardUpdateMonitor.mSimDatas.get(TEST_SUBSCRIPTION.getSubscriptionId()))
- .isNotNull();
-
- when(mSubscriptionManager.getCompleteActiveSubscriptionInfoList()).thenReturn(null);
- mKeyguardUpdateMonitor.mPhoneStateListener.onActiveDataSubscriptionIdChanged(
- SubscriptionManager.INVALID_SUBSCRIPTION_ID);
- mTestableLooper.processAllMessages();
-
- assertThat(mKeyguardUpdateMonitor.mSimDatas.get(TEST_SUBSCRIPTION.getSubscriptionId()))
- .isNull();
- assertThat(mKeyguardUpdateMonitor.mSimDatas.get(
- SubscriptionManager.INVALID_SUBSCRIPTION_ID)).isNull();
- }
-
- @Test
public void testIsUserUnlocked() {
// mUserManager will report the user as unlocked on @Before
assertThat(mKeyguardUpdateMonitor.isUserUnlocked(KeyguardUpdateMonitor.getCurrentUser()))
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/carrier/QSCarrierGroupControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/carrier/QSCarrierGroupControllerTest.java
index bd794d6813ec..0b4477bb8a42 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/carrier/QSCarrierGroupControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/carrier/QSCarrierGroupControllerTest.java
@@ -234,7 +234,7 @@ public class QSCarrierGroupControllerTest extends LeakCheckedTest {
MobileDataIndicators indicators = new MobileDataIndicators(
mock(IconState.class),
mock(IconState.class),
- 0, 0, true, true, "", "", "", 0, true, true);
+ 0, 0, true, true, 0, "", "", "", 0, true, true);
mSignalCallback.setMobileDataIndicators(indicators);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/CallbackHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/CallbackHandlerTest.java
index 2d29c80a15ac..7d8ff11e4dad 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/CallbackHandlerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/CallbackHandlerTest.java
@@ -119,7 +119,7 @@ public class CallbackHandlerTest extends SysuiTestCase {
int subId = 5;
boolean roaming = true;
MobileDataIndicators indicators = new MobileDataIndicators(
- status, qs, type, qsType, in, out, typeDescription,
+ status, qs, type, qsType, in, out, 0, typeDescription,
typeDescriptionHtml, description, subId, roaming, true);
mHandler.setMobileDataIndicators(indicators);
waitForCallbacks();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
index 3fc60373e2a4..df39f889bbcb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
@@ -71,6 +71,7 @@ import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.internal.util.CollectionUtils;
import com.android.internal.util.LatencyTracker;
+import com.android.keyguard.EmergencyButtonController;
import com.android.keyguard.KeyguardClockSwitch;
import com.android.keyguard.KeyguardClockSwitchController;
import com.android.keyguard.KeyguardStatusView;
@@ -293,6 +294,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
@Mock
private QuickAccessWalletController mQuickAccessWalletController;
@Mock
+ private EmergencyButtonController.Factory mEmergencyButtonControllerFactory;
+ @Mock
private NotificationRemoteInputManager mNotificationRemoteInputManager;
@Mock
private RecordingController mRecordingController;
@@ -458,7 +461,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
mNotificationRemoteInputManager,
mSysUIUnfoldComponent,
mControlsComponent,
- mFeatureFlags);
+ mFeatureFlags,
+ mEmergencyButtonControllerFactory);
mNotificationPanelViewController.initDependencies(
mStatusBar,
() -> {},
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FiveGServiceClientTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FiveGServiceClientTest.java
new file mode 100644
index 000000000000..7300cd44f6cc
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FiveGServiceClientTest.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.os.RemoteException;
+import android.util.Log;
+import android.test.suitebuilder.annotation.SmallTest;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper.RunWithLooper;
+
+import com.qti.extphone.IExtPhoneCallback;
+import com.qti.extphone.NrIconType;
+import com.qti.extphone.Status;
+import com.qti.extphone.Token;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static junit.framework.Assert.assertEquals;
+
+import com.android.settingslib.mobile.TelephonyIcons;
+import com.android.systemui.statusbar.connectivity.NetworkControllerBaseTest;
+import com.android.systemui.statusbar.policy.FiveGServiceClient;
+import com.android.systemui.statusbar.policy.FiveGServiceClient.FiveGServiceState;
+
+@SmallTest
+@RunWith(AndroidTestingRunner.class)
+@RunWithLooper
+public class FiveGServiceClientTest extends NetworkControllerBaseTest {
+ private final static String TAG = "FiveGServiceClientTest";
+ private FiveGServiceClient mFiveGServiceClient;
+ protected IExtPhoneCallback mCallback;
+
+ Token mToken;
+ Status mSuccessStatus;
+ Status mFailStatus;
+ private int mPhoneId;
+
+ @Before
+ public void setupCallback() {
+ mPhoneId = 0;
+ mToken = new Token(0);
+ mSuccessStatus = new Status(Status.SUCCESS);
+ mFailStatus = new Status(Status.FAILURE);
+ mFiveGServiceClient = mNetworkController.getFiveGServiceClient();
+ mCallback = mFiveGServiceClient.mCallback;
+
+ }
+
+ @Test
+ public void testNrIconType() {
+ //Success status case
+ NrIconType nrIconType = new NrIconType(NrIconType.TYPE_5G_BASIC);
+ updateNrIconType(mPhoneId, mToken, mSuccessStatus, nrIconType);
+ FiveGServiceState fiveGState = mFiveGServiceClient.getCurrentServiceState(mPhoneId);
+ assertEquals(fiveGState.getNrIconType(), NrIconType.TYPE_5G_BASIC);
+
+ //Failure status case
+ nrIconType = new NrIconType(NrIconType.TYPE_NONE);
+ updateNrIconType(mPhoneId, mToken, mSuccessStatus, nrIconType);
+ fiveGState = mFiveGServiceClient.getCurrentServiceState(mPhoneId);
+ assertEquals(fiveGState.getNrIconType(), NrIconType.TYPE_5G_BASIC);
+ }
+
+ @Test
+ public void test5GBasicIcon() {
+ /**
+ * Verify that 5G Basic icon is shown when
+ * NrIconType is TYPE_5G_BASIC
+ */
+ NrIconType nrIconType = new NrIconType(NrIconType.TYPE_5G_BASIC);
+ updateNrIconType(mPhoneId, mToken, mSuccessStatus, nrIconType);
+ verifyIcon(TelephonyIcons.ICON_5G_BASIC);
+
+ /**
+ * Verify that 5G Basic icon is not shown when
+ * NrIconType is TYPE_NONE
+ */
+ nrIconType = new NrIconType(NrIconType.TYPE_NONE);
+ updateNrIconType(mPhoneId, mToken, mSuccessStatus, nrIconType);
+ verifyIcon(0);
+ }
+
+ @Test
+ public void test5GUWBIcon() {
+ /**
+ * Verify that 5G UWB icon is shown when
+ * NrIconType is TYPE_5G_UWB
+ */
+ NrIconType nrIconType = new NrIconType(NrIconType.TYPE_5G_UWB);
+ updateNrIconType(mPhoneId, mToken, mSuccessStatus, nrIconType);
+ verifyIcon(TelephonyIcons.ICON_5G_UWB);
+
+ /**
+ * Verify that 5G UWB icon is not shown when
+ * NrIconType is TYPE_NONE
+ */
+ nrIconType = new NrIconType(NrIconType.TYPE_NONE);
+ updateNrIconType(mPhoneId, mToken, mSuccessStatus, nrIconType);
+ verifyIcon(0);
+ }
+
+ public void updateNrIconType(int phoneId, Token token, Status status, NrIconType nrIconType) {
+ Log.d(TAG, "Sending NrIconType");
+ try {
+ mCallback.onNrIconType(phoneId, token, status, nrIconType);
+ } catch ( RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void verifyIcon(int resIcon) {
+ FiveGServiceState fiveGState = mFiveGServiceClient.getCurrentServiceState(mPhoneId);
+ int dataType = fiveGState.getIconGroup().dataType;
+ assertEquals(dataType, resIcon);
+ }
+
+}
diff --git a/packages/Tethering/src/com/android/networkstack/tethering/Tethering.java b/packages/Tethering/src/com/android/networkstack/tethering/Tethering.java
new file mode 100644
index 000000000000..58d8cdb6f2f3
--- /dev/null
+++ b/packages/Tethering/src/com/android/networkstack/tethering/Tethering.java
@@ -0,0 +1,2429 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.tethering;
+
+import static android.Manifest.permission.NETWORK_SETTINGS;
+import static android.Manifest.permission.NETWORK_STACK;
+import static android.content.pm.PackageManager.GET_ACTIVITIES;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.hardware.usb.UsbManager.USB_CONFIGURED;
+import static android.hardware.usb.UsbManager.USB_CONNECTED;
+import static android.hardware.usb.UsbManager.USB_FUNCTION_NCM;
+import static android.hardware.usb.UsbManager.USB_FUNCTION_RNDIS;
+import static android.net.ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED;
+import static android.net.ConnectivityManager.CONNECTIVITY_ACTION;
+import static android.net.ConnectivityManager.EXTRA_NETWORK_INFO;
+import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
+import static android.net.TetheringManager.ACTION_TETHER_STATE_CHANGED;
+import static android.net.TetheringManager.EXTRA_ACTIVE_LOCAL_ONLY;
+import static android.net.TetheringManager.EXTRA_ACTIVE_TETHER;
+import static android.net.TetheringManager.EXTRA_AVAILABLE_TETHER;
+import static android.net.TetheringManager.EXTRA_ERRORED_TETHER;
+import static android.net.TetheringManager.TETHERING_BLUETOOTH;
+import static android.net.TetheringManager.TETHERING_ETHERNET;
+import static android.net.TetheringManager.TETHERING_INVALID;
+import static android.net.TetheringManager.TETHERING_NCM;
+import static android.net.TetheringManager.TETHERING_USB;
+import static android.net.TetheringManager.TETHERING_WIFI;
+import static android.net.TetheringManager.TETHERING_WIFI_P2P;
+import static android.net.TetheringManager.TETHERING_WIGIG;
+import static android.net.TetheringManager.TETHER_ERROR_INTERNAL_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_NO_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_SERVICE_UNAVAIL;
+import static android.net.TetheringManager.TETHER_ERROR_UNAVAIL_IFACE;
+import static android.net.TetheringManager.TETHER_ERROR_UNKNOWN_IFACE;
+import static android.net.TetheringManager.TETHER_ERROR_UNKNOWN_TYPE;
+import static android.net.TetheringManager.TETHER_HARDWARE_OFFLOAD_FAILED;
+import static android.net.TetheringManager.TETHER_HARDWARE_OFFLOAD_STARTED;
+import static android.net.TetheringManager.TETHER_HARDWARE_OFFLOAD_STOPPED;
+import static android.net.util.TetheringMessageBase.BASE_MAIN_SM;
+import static android.net.wifi.WifiManager.EXTRA_WIFI_AP_INTERFACE_NAME;
+import static android.net.wifi.WifiManager.EXTRA_WIFI_AP_MODE;
+import static android.net.wifi.WifiManager.EXTRA_WIFI_AP_STATE;
+import static android.net.wifi.WifiManager.IFACE_IP_MODE_CONFIGURATION_ERROR;
+import static android.net.wifi.WifiManager.IFACE_IP_MODE_LOCAL_ONLY;
+import static android.net.wifi.WifiManager.IFACE_IP_MODE_TETHERED;
+import static android.net.wifi.WifiManager.IFACE_IP_MODE_UNSPECIFIED;
+import static android.net.wifi.WifiManager.WIFI_AP_STATE_DISABLED;
+import static android.telephony.CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED;
+import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
+import static com.android.networkstack.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE;
+
+import android.app.usage.NetworkStatsManager;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothPan;
+import android.bluetooth.BluetoothProfile;
+import android.bluetooth.BluetoothProfile.ServiceListener;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.PackageManager;
+import android.hardware.usb.UsbManager;
+import android.net.ConnectivityManager;
+import android.net.EthernetManager;
+import android.net.IIntResultListener;
+import android.net.INetd;
+import android.net.ITetheringEventCallback;
+import android.net.IpPrefix;
+import android.net.LinkAddress;
+import android.net.LinkProperties;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkInfo;
+import android.net.TetherStatesParcel;
+import android.net.TetheredClient;
+import android.net.TetheringCallbackStartedParcel;
+import android.net.TetheringConfigurationParcel;
+import android.net.TetheringRequestParcel;
+import android.net.ip.IpServer;
+import android.net.shared.NetdUtils;
+import android.net.util.BaseNetdUnsolicitedEventListener;
+import android.net.util.InterfaceSet;
+import android.net.util.PrefixUtils;
+import android.net.util.SharedLog;
+import android.net.util.TetheringUtils;
+import android.net.util.VersionedBroadcastListener;
+import android.net.wifi.WifiClient;
+import android.net.wifi.WifiManager;
+import android.net.wifi.p2p.WifiP2pGroup;
+import android.net.wifi.p2p.WifiP2pInfo;
+import android.net.wifi.p2p.WifiP2pManager;
+import android.os.Binder;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.RemoteCallbackList;
+import android.os.RemoteException;
+import android.os.ResultReceiver;
+import android.os.ServiceSpecificException;
+import android.os.SystemProperties;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.provider.Settings;
+import android.telephony.PhoneStateListener;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
+import android.util.ArrayMap;
+import android.util.Log;
+import android.util.SparseArray;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.IndentingPrintWriter;
+import com.android.internal.util.MessageUtils;
+import com.android.internal.util.State;
+import com.android.internal.util.StateMachine;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Executor;
+import java.util.concurrent.RejectedExecutionException;
+
+/**
+ *
+ * This class holds much of the business logic to allow Android devices
+ * to act as IP gateways via USB, BT, and WiFi interfaces.
+ */
+public class Tethering {
+
+ private static final String TAG = Tethering.class.getSimpleName();
+ private static final boolean DBG = false;
+ private static final boolean VDBG = false;
+
+ private static final Class[] sMessageClasses = {
+ Tethering.class, TetherMainSM.class, IpServer.class
+ };
+ private static final SparseArray<String> sMagicDecoderRing =
+ MessageUtils.findMessageNames(sMessageClasses);
+ // Keep in sync with NETID_UNSET in system/netd/include/netid_client.h
+ private static final int NETID_UNSET = 0;
+
+ private static class TetherState {
+ public final IpServer ipServer;
+ public int lastState;
+ public int lastError;
+
+ TetherState(IpServer ipServer) {
+ this.ipServer = ipServer;
+ // Assume all state machines start out available and with no errors.
+ lastState = IpServer.STATE_AVAILABLE;
+ lastError = TETHER_ERROR_NO_ERROR;
+ }
+
+ public boolean isCurrentlyServing() {
+ switch (lastState) {
+ case IpServer.STATE_TETHERED:
+ case IpServer.STATE_LOCAL_ONLY:
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Cookie added when registering {@link android.net.TetheringManager.TetheringEventCallback}.
+ */
+ private static class CallbackCookie {
+ public final boolean hasListClientsPermission;
+
+ private CallbackCookie(boolean hasListClientsPermission) {
+ this.hasListClientsPermission = hasListClientsPermission;
+ }
+ }
+
+ private final SharedLog mLog = new SharedLog(TAG);
+ private final RemoteCallbackList<ITetheringEventCallback> mTetheringEventCallbacks =
+ new RemoteCallbackList<>();
+ // Currently active tethering requests per tethering type. Only one of each type can be
+ // requested at a time. After a tethering type is requested, the map keeps tethering parameters
+ // to be used after the interface comes up asynchronously.
+ private final SparseArray<TetheringRequestParcel> mActiveTetheringRequests =
+ new SparseArray<>();
+
+ // used to synchronize public access to members
+ // TODO(b/153621704): remove mPublicSync to make Tethering lock free
+ private final Object mPublicSync;
+ private final Context mContext;
+ private final ArrayMap<String, TetherState> mTetherStates;
+ private final BroadcastReceiver mStateReceiver;
+ private final Looper mLooper;
+ private final StateMachine mTetherMainSM;
+ private final OffloadController mOffloadController;
+ private final UpstreamNetworkMonitor mUpstreamNetworkMonitor;
+ // TODO: Figure out how to merge this and other downstream-tracking objects
+ // into a single coherent structure.
+ // Use LinkedHashSet for predictable ordering order for ConnectedClientsTracker.
+ private final LinkedHashSet<IpServer> mForwardedDownstreams;
+ private final VersionedBroadcastListener mCarrierConfigChange;
+ private final TetheringDependencies mDeps;
+ private final EntitlementManager mEntitlementMgr;
+ private final Handler mHandler;
+ private final INetd mNetd;
+ private final NetdCallback mNetdCallback;
+ private final UserRestrictionActionListener mTetheringRestriction;
+ private final ActiveDataSubIdListener mActiveDataSubIdListener;
+ private final ConnectedClientsTracker mConnectedClientsTracker;
+ private final TetheringThreadExecutor mExecutor;
+ private final TetheringNotificationUpdater mNotificationUpdater;
+ private final UserManager mUserManager;
+ private final BpfCoordinator mBpfCoordinator;
+ private final PrivateAddressCoordinator mPrivateAddressCoordinator;
+ private int mActiveDataSubId = INVALID_SUBSCRIPTION_ID;
+ // All the usage of mTetheringEventCallback should run in the same thread.
+ private ITetheringEventCallback mTetheringEventCallback = null;
+
+ private volatile TetheringConfiguration mConfig;
+ private InterfaceSet mCurrentUpstreamIfaceSet;
+
+ private boolean mRndisEnabled; // track the RNDIS function enabled state
+ // True iff. WiFi tethering should be started when soft AP is ready.
+ private boolean mWifiTetherRequested;
+ private Network mTetherUpstream;
+ private TetherStatesParcel mTetherStatesParcel;
+ private boolean mDataSaverEnabled = false;
+ private String mWifiP2pTetherInterface = null;
+ private int mOffloadStatus = TETHER_HARDWARE_OFFLOAD_STOPPED;
+
+ @GuardedBy("mPublicSync")
+ private EthernetManager.TetheredInterfaceRequest mEthernetIfaceRequest;
+ @GuardedBy("mPublicSync")
+ private String mConfiguredEthernetIface;
+ @GuardedBy("mPublicSync")
+ private EthernetCallback mEthernetCallback;
+
+ public Tethering(TetheringDependencies deps) {
+ mLog.mark("Tethering.constructed");
+ mDeps = deps;
+ mContext = mDeps.getContext();
+ mNetd = mDeps.getINetd(mContext);
+ mLooper = mDeps.getTetheringLooper();
+ mNotificationUpdater = mDeps.getNotificationUpdater(mContext, mLooper);
+
+ mPublicSync = new Object();
+
+ mTetherStates = new ArrayMap<>();
+ mConnectedClientsTracker = new ConnectedClientsTracker();
+
+ mTetherMainSM = new TetherMainSM("TetherMain", mLooper, deps);
+ mTetherMainSM.start();
+
+ mHandler = mTetherMainSM.getHandler();
+ mOffloadController = mDeps.getOffloadController(mHandler, mLog,
+ new OffloadController.Dependencies() {
+
+ @Override
+ public TetheringConfiguration getTetherConfig() {
+ return mConfig;
+ }
+ });
+ mUpstreamNetworkMonitor = mDeps.getUpstreamNetworkMonitor(mContext, mTetherMainSM, mLog,
+ TetherMainSM.EVENT_UPSTREAM_CALLBACK);
+ mForwardedDownstreams = new LinkedHashSet<>();
+
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(ACTION_CARRIER_CONFIG_CHANGED);
+ // EntitlementManager will send EVENT_UPSTREAM_PERMISSION_CHANGED when cellular upstream
+ // permission is changed according to entitlement check result.
+ mEntitlementMgr = mDeps.getEntitlementManager(mContext, mHandler, mLog,
+ () -> mTetherMainSM.sendMessage(
+ TetherMainSM.EVENT_UPSTREAM_PERMISSION_CHANGED));
+ mEntitlementMgr.setOnUiEntitlementFailedListener((int downstream) -> {
+ mLog.log("OBSERVED UiEnitlementFailed");
+ stopTethering(downstream);
+ });
+ mEntitlementMgr.setTetheringConfigurationFetcher(() -> {
+ return mConfig;
+ });
+
+ mCarrierConfigChange = new VersionedBroadcastListener(
+ "CarrierConfigChangeListener", mContext, mHandler, filter,
+ (Intent ignored) -> {
+ mLog.log("OBSERVED carrier config change");
+ updateConfiguration();
+ mEntitlementMgr.reevaluateSimCardProvisioning(mConfig);
+ });
+
+ mStateReceiver = new StateReceiver();
+
+ mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
+ mTetheringRestriction = new UserRestrictionActionListener(
+ mUserManager, this, mNotificationUpdater);
+ mExecutor = new TetheringThreadExecutor(mHandler);
+ mActiveDataSubIdListener = new ActiveDataSubIdListener(mExecutor);
+ mNetdCallback = new NetdCallback();
+
+ // Load tethering configuration.
+ updateConfiguration();
+ // It is OK for the configuration to be passed to the PrivateAddressCoordinator at
+ // construction time because the only part of the configuration it uses is
+ // shouldEnableWifiP2pDedicatedIp(), and currently do not support changing that.
+ mPrivateAddressCoordinator = mDeps.getPrivateAddressCoordinator(mContext, mConfig);
+
+ // Must be initialized after tethering configuration is loaded because BpfCoordinator
+ // constructor needs to use the configuration.
+ mBpfCoordinator = mDeps.getBpfCoordinator(
+ new BpfCoordinator.Dependencies() {
+ @NonNull
+ public Handler getHandler() {
+ return mHandler;
+ }
+
+ @NonNull
+ public INetd getNetd() {
+ return mNetd;
+ }
+
+ @NonNull
+ public NetworkStatsManager getNetworkStatsManager() {
+ return mContext.getSystemService(NetworkStatsManager.class);
+ }
+
+ @NonNull
+ public SharedLog getSharedLog() {
+ return mLog;
+ }
+
+ @Nullable
+ public TetheringConfiguration getTetherConfig() {
+ return mConfig;
+ }
+ });
+
+ startStateMachineUpdaters();
+ }
+
+ /**
+ * Start to register callbacks.
+ * Call this function when tethering is ready to handle callback events.
+ */
+ private void startStateMachineUpdaters() {
+ try {
+ mNetd.registerUnsolicitedEventListener(mNetdCallback);
+ } catch (RemoteException e) {
+ mLog.e("Unable to register netd UnsolicitedEventListener");
+ }
+ mCarrierConfigChange.startListening();
+ mContext.getSystemService(TelephonyManager.class).listen(mActiveDataSubIdListener,
+ PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE);
+
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(UsbManager.ACTION_USB_STATE);
+ filter.addAction(CONNECTIVITY_ACTION);
+ filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION);
+ filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
+ filter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION);
+ filter.addAction(UserManager.ACTION_USER_RESTRICTIONS_CHANGED);
+ filter.addAction(ACTION_RESTRICT_BACKGROUND_CHANGED);
+ mContext.registerReceiver(mStateReceiver, filter, null, mHandler);
+
+ final IntentFilter noUpstreamFilter = new IntentFilter();
+ noUpstreamFilter.addAction(TetheringNotificationUpdater.ACTION_DISABLE_TETHERING);
+ mContext.registerReceiver(
+ mStateReceiver, noUpstreamFilter, PERMISSION_MAINLINE_NETWORK_STACK, mHandler);
+
+ final WifiManager wifiManager = getWifiManager();
+ if (wifiManager != null) {
+ wifiManager.registerSoftApCallback(mExecutor, new TetheringSoftApCallback());
+ }
+
+ startTrackDefaultNetwork();
+ }
+
+ private class TetheringThreadExecutor implements Executor {
+ private final Handler mTetherHandler;
+ TetheringThreadExecutor(Handler handler) {
+ mTetherHandler = handler;
+ }
+ @Override
+ public void execute(Runnable command) {
+ if (!mTetherHandler.post(command)) {
+ throw new RejectedExecutionException(mTetherHandler + " is shutting down");
+ }
+ }
+ }
+
+ private class ActiveDataSubIdListener extends PhoneStateListener {
+ ActiveDataSubIdListener(Executor executor) {
+ super(executor);
+ }
+
+ @Override
+ public void onActiveDataSubscriptionIdChanged(int subId) {
+ mLog.log("OBSERVED active data subscription change, from " + mActiveDataSubId
+ + " to " + subId);
+ if (subId == mActiveDataSubId) return;
+
+ mActiveDataSubId = subId;
+ updateConfiguration();
+ mNotificationUpdater.onActiveDataSubscriptionIdChanged(subId);
+ // To avoid launching unexpected provisioning checks, ignore re-provisioning
+ // when no CarrierConfig loaded yet. Assume reevaluateSimCardProvisioning()
+ // will be triggered again when CarrierConfig is loaded.
+ if (mEntitlementMgr.getCarrierConfig(mConfig) != null) {
+ mEntitlementMgr.reevaluateSimCardProvisioning(mConfig);
+ } else {
+ mLog.log("IGNORED reevaluate provisioning, no carrier config loaded");
+ }
+ }
+ }
+
+ private WifiManager getWifiManager() {
+ return (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
+ }
+
+ // NOTE: This is always invoked on the mLooper thread.
+ private void updateConfiguration() {
+ mConfig = mDeps.generateTetheringConfiguration(mContext, mLog, mActiveDataSubId);
+ mUpstreamNetworkMonitor.updateMobileRequiresDun(mConfig.isDunRequired);
+ reportConfigurationChanged(mConfig.toStableParcelable());
+ }
+
+ private void maybeDunSettingChanged() {
+ final boolean isDunRequired = TetheringConfiguration.checkDunRequired(mContext);
+ if (isDunRequired == mConfig.isDunRequired) return;
+ updateConfiguration();
+ }
+
+ private class NetdCallback extends BaseNetdUnsolicitedEventListener {
+ @Override
+ public void onInterfaceChanged(String ifName, boolean up) {
+ mHandler.post(() -> interfaceStatusChanged(ifName, up));
+ }
+
+ @Override
+ public void onInterfaceLinkStateChanged(String ifName, boolean up) {
+ mHandler.post(() -> interfaceLinkStateChanged(ifName, up));
+ }
+
+ @Override
+ public void onInterfaceAdded(String ifName) {
+ mHandler.post(() -> interfaceAdded(ifName));
+ }
+
+ @Override
+ public void onInterfaceRemoved(String ifName) {
+ mHandler.post(() -> interfaceRemoved(ifName));
+ }
+ }
+
+ private class TetheringSoftApCallback implements WifiManager.SoftApCallback {
+ // TODO: Remove onStateChanged override when this method has default on
+ // WifiManager#SoftApCallback interface.
+ // Wifi listener for state change of the soft AP
+ @Override
+ public void onStateChanged(final int state, final int failureReason) {
+ // Nothing
+ }
+
+ // Called by wifi when the number of soft AP clients changed.
+ @Override
+ public void onConnectedClientsChanged(final List<WifiClient> clients) {
+ updateConnectedClients(clients);
+ }
+ }
+
+ void interfaceStatusChanged(String iface, boolean up) {
+ // Never called directly: only called from interfaceLinkStateChanged.
+ // See NetlinkHandler.cpp: notifyInterfaceChanged.
+ if (VDBG) Log.d(TAG, "interfaceStatusChanged " + iface + ", " + up);
+ synchronized (mPublicSync) {
+ if (up) {
+ maybeTrackNewInterfaceLocked(iface);
+ } else {
+ if (ifaceNameToType(iface) == TETHERING_WIGIG) {
+ stopTrackingInterfaceLocked(iface);
+ } else {
+ // Ignore usb0 down after enabling RNDIS.
+ // We will handle disconnect in interfaceRemoved.
+ // Similarly, ignore interface down for WiFi. We monitor WiFi AP status
+ // through the WifiManager.WIFI_AP_STATE_CHANGED_ACTION intent.
+ if (VDBG) Log.d(TAG, "ignore interface down for " + iface);
+ }
+ }
+ }
+ }
+
+ void interfaceLinkStateChanged(String iface, boolean up) {
+ interfaceStatusChanged(iface, up);
+ }
+
+ private int ifaceNameToType(String iface) {
+ final TetheringConfiguration cfg = mConfig;
+
+ if (cfg.isWifi(iface)) {
+ return TETHERING_WIFI;
+ } else if (cfg.isWigig(iface)) {
+ return TETHERING_WIGIG;
+ } else if (cfg.isWifiP2p(iface)) {
+ return TETHERING_WIFI_P2P;
+ } else if (cfg.isUsb(iface)) {
+ return TETHERING_USB;
+ } else if (cfg.isBluetooth(iface)) {
+ return TETHERING_BLUETOOTH;
+ } else if (cfg.isNcm(iface)) {
+ return TETHERING_NCM;
+ }
+ return TETHERING_INVALID;
+ }
+
+ void interfaceAdded(String iface) {
+ if (VDBG) Log.d(TAG, "interfaceAdded " + iface);
+ synchronized (mPublicSync) {
+ maybeTrackNewInterfaceLocked(iface);
+ }
+ }
+
+ void interfaceRemoved(String iface) {
+ if (VDBG) Log.d(TAG, "interfaceRemoved " + iface);
+ synchronized (mPublicSync) {
+ stopTrackingInterfaceLocked(iface);
+ }
+ }
+
+ void startTethering(final TetheringRequestParcel request, final IIntResultListener listener) {
+ mHandler.post(() -> {
+ final TetheringRequestParcel unfinishedRequest = mActiveTetheringRequests.get(
+ request.tetheringType);
+ // If tethering is already enabled with a different request,
+ // disable before re-enabling.
+ if (unfinishedRequest != null
+ && !TetheringUtils.isTetheringRequestEquals(unfinishedRequest, request)) {
+ enableTetheringInternal(request.tetheringType, false /* disabled */, null);
+ mEntitlementMgr.stopProvisioningIfNeeded(request.tetheringType);
+ }
+ mActiveTetheringRequests.put(request.tetheringType, request);
+
+ if (request.exemptFromEntitlementCheck) {
+ mEntitlementMgr.setExemptedDownstreamType(request.tetheringType);
+ } else {
+ mEntitlementMgr.startProvisioningIfNeeded(request.tetheringType,
+ request.showProvisioningUi);
+ }
+ enableTetheringInternal(request.tetheringType, true /* enabled */, listener);
+ });
+ }
+
+ void stopTethering(int type) {
+ mHandler.post(() -> {
+ mActiveTetheringRequests.remove(type);
+
+ enableTetheringInternal(type, false /* disabled */, null);
+ mEntitlementMgr.stopProvisioningIfNeeded(type);
+ });
+ }
+
+ /**
+ * Enables or disables tethering for the given type. If provisioning is required, it will
+ * schedule provisioning rechecks for the specified interface.
+ */
+ private void enableTetheringInternal(int type, boolean enable,
+ final IIntResultListener listener) {
+ int result = TETHER_ERROR_NO_ERROR;
+ switch (type) {
+ case TETHERING_WIFI:
+ result = setWifiTethering(enable);
+ break;
+ case TETHERING_USB:
+ result = setUsbTethering(enable);
+ break;
+ case TETHERING_BLUETOOTH:
+ setBluetoothTethering(enable, listener);
+ break;
+ case TETHERING_NCM:
+ result = setNcmTethering(enable);
+ break;
+ case TETHERING_ETHERNET:
+ result = setEthernetTethering(enable);
+ break;
+ default:
+ Log.w(TAG, "Invalid tether type.");
+ result = TETHER_ERROR_UNKNOWN_TYPE;
+ }
+
+ // The result of Bluetooth tethering will be sent by #setBluetoothTethering.
+ if (type != TETHERING_BLUETOOTH) {
+ sendTetherResult(listener, result, type);
+ }
+ }
+
+ private void sendTetherResult(final IIntResultListener listener, final int result,
+ final int type) {
+ if (listener != null) {
+ try {
+ listener.onResult(result);
+ } catch (RemoteException e) { }
+ }
+
+ // If changing tethering fail, remove corresponding request
+ // no matter who trigger the start/stop.
+ if (result != TETHER_ERROR_NO_ERROR) mActiveTetheringRequests.remove(type);
+ }
+
+ private int setWifiTethering(final boolean enable) {
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ synchronized (mPublicSync) {
+ final WifiManager mgr = getWifiManager();
+ if (mgr == null) {
+ mLog.e("setWifiTethering: failed to get WifiManager!");
+ return TETHER_ERROR_SERVICE_UNAVAIL;
+ }
+ if ((enable && mgr.startTetheredHotspot(null /* use existing softap config */))
+ || (!enable && mgr.stopSoftAp())) {
+ mWifiTetherRequested = enable;
+ return TETHER_ERROR_NO_ERROR;
+ }
+ }
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+
+ return TETHER_ERROR_INTERNAL_ERROR;
+ }
+
+ private void setBluetoothTethering(final boolean enable, final IIntResultListener listener) {
+ final BluetoothAdapter adapter = mDeps.getBluetoothAdapter();
+ if (adapter == null || !adapter.isEnabled()) {
+ Log.w(TAG, "Tried to enable bluetooth tethering with null or disabled adapter. null: "
+ + (adapter == null));
+ sendTetherResult(listener, TETHER_ERROR_SERVICE_UNAVAIL, TETHERING_BLUETOOTH);
+ return;
+ }
+
+ adapter.getProfileProxy(mContext, new ServiceListener() {
+ @Override
+ public void onServiceDisconnected(int profile) { }
+
+ @Override
+ public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ // Clear identify is fine because caller already pass tethering permission at
+ // ConnectivityService#startTethering()(or stopTethering) before the control comes
+ // here. Bluetooth will check tethering permission again that there is
+ // Context#getOpPackageName() under BluetoothPan#setBluetoothTethering() to get
+ // caller's package name for permission check.
+ // Calling BluetoothPan#setBluetoothTethering() here means the package name always
+ // be system server. If calling identity is not cleared, that package's uid might
+ // not match calling uid and end up in permission denied.
+ final long identityToken = Binder.clearCallingIdentity();
+ try {
+ ((BluetoothPan) proxy).setBluetoothTethering(enable);
+ } finally {
+ Binder.restoreCallingIdentity(identityToken);
+ }
+ // TODO: Enabling bluetooth tethering can fail asynchronously here.
+ // We should figure out a way to bubble up that failure instead of sending success.
+ final int result = (((BluetoothPan) proxy).isTetheringOn() == enable)
+ ? TETHER_ERROR_NO_ERROR
+ : TETHER_ERROR_INTERNAL_ERROR;
+ sendTetherResult(listener, result, TETHERING_BLUETOOTH);
+ adapter.closeProfileProxy(BluetoothProfile.PAN, proxy);
+ }
+ }, BluetoothProfile.PAN);
+ }
+
+ private int setEthernetTethering(final boolean enable) {
+ final EthernetManager em = (EthernetManager) mContext.getSystemService(
+ Context.ETHERNET_SERVICE);
+ synchronized (mPublicSync) {
+ if (enable) {
+ if (mEthernetCallback != null) {
+ Log.d(TAG, "Ethernet tethering already started");
+ return TETHER_ERROR_NO_ERROR;
+ }
+
+ mEthernetCallback = new EthernetCallback();
+ mEthernetIfaceRequest = em.requestTetheredInterface(mExecutor, mEthernetCallback);
+ } else {
+ stopEthernetTetheringLocked();
+ }
+ }
+ return TETHER_ERROR_NO_ERROR;
+ }
+
+ private void stopEthernetTetheringLocked() {
+ if (mConfiguredEthernetIface != null) {
+ stopTrackingInterfaceLocked(mConfiguredEthernetIface);
+ mConfiguredEthernetIface = null;
+ }
+ if (mEthernetCallback != null) {
+ mEthernetIfaceRequest.release();
+ mEthernetCallback = null;
+ mEthernetIfaceRequest = null;
+ }
+ }
+
+ private class EthernetCallback implements EthernetManager.TetheredInterfaceCallback {
+ @Override
+ public void onAvailable(String iface) {
+ synchronized (mPublicSync) {
+ if (this != mEthernetCallback) {
+ // Ethernet callback arrived after Ethernet tethering stopped. Ignore.
+ return;
+ }
+ maybeTrackNewInterfaceLocked(iface, TETHERING_ETHERNET);
+ changeInterfaceState(iface, IpServer.STATE_TETHERED);
+ mConfiguredEthernetIface = iface;
+ }
+ }
+
+ @Override
+ public void onUnavailable() {
+ synchronized (mPublicSync) {
+ if (this != mEthernetCallback) {
+ // onAvailable called after stopping Ethernet tethering.
+ return;
+ }
+ stopEthernetTetheringLocked();
+ }
+ }
+ }
+
+ int tether(String iface) {
+ return tether(iface, IpServer.STATE_TETHERED);
+ }
+
+ private int tether(String iface, int requestedState) {
+ if (DBG) Log.d(TAG, "Tethering " + iface);
+ synchronized (mPublicSync) {
+ TetherState tetherState = mTetherStates.get(iface);
+ if (tetherState == null) {
+ Log.e(TAG, "Tried to Tether an unknown iface: " + iface + ", ignoring");
+ return TETHER_ERROR_UNKNOWN_IFACE;
+ }
+ // Ignore the error status of the interface. If the interface is available,
+ // the errors are referring to past tethering attempts anyway.
+ if (tetherState.lastState != IpServer.STATE_AVAILABLE) {
+ Log.e(TAG, "Tried to Tether an unavailable iface: " + iface + ", ignoring");
+ return TETHER_ERROR_UNAVAIL_IFACE;
+ }
+ // NOTE: If a CMD_TETHER_REQUESTED message is already in the TISM's queue but not yet
+ // processed, this will be a no-op and it will not return an error.
+ //
+ // This code cannot race with untether() because they both synchronize on mPublicSync.
+ // TODO: reexamine the threading and messaging model to totally remove mPublicSync.
+ final int type = tetherState.ipServer.interfaceType();
+ final TetheringRequestParcel request = mActiveTetheringRequests.get(type, null);
+ if (request != null) {
+ mActiveTetheringRequests.delete(type);
+ }
+ tetherState.ipServer.sendMessage(IpServer.CMD_TETHER_REQUESTED, requestedState, 0,
+ request);
+ return TETHER_ERROR_NO_ERROR;
+ }
+ }
+
+ int untether(String iface) {
+ if (DBG) Log.d(TAG, "Untethering " + iface);
+ synchronized (mPublicSync) {
+ TetherState tetherState = mTetherStates.get(iface);
+ if (tetherState == null) {
+ Log.e(TAG, "Tried to Untether an unknown iface :" + iface + ", ignoring");
+ return TETHER_ERROR_UNKNOWN_IFACE;
+ }
+ if (!tetherState.isCurrentlyServing()) {
+ Log.e(TAG, "Tried to untether an inactive iface :" + iface + ", ignoring");
+ return TETHER_ERROR_UNAVAIL_IFACE;
+ }
+ tetherState.ipServer.sendMessage(IpServer.CMD_TETHER_UNREQUESTED);
+ return TETHER_ERROR_NO_ERROR;
+ }
+ }
+
+ void untetherAll() {
+ stopTethering(TETHERING_WIFI);
+ stopTethering(TETHERING_WIFI_P2P);
+ stopTethering(TETHERING_USB);
+ stopTethering(TETHERING_BLUETOOTH);
+ stopTethering(TETHERING_ETHERNET);
+ }
+
+ int getLastTetherError(String iface) {
+ synchronized (mPublicSync) {
+ TetherState tetherState = mTetherStates.get(iface);
+ if (tetherState == null) {
+ Log.e(TAG, "Tried to getLastTetherError on an unknown iface :" + iface
+ + ", ignoring");
+ return TETHER_ERROR_UNKNOWN_IFACE;
+ }
+ return tetherState.lastError;
+ }
+ }
+
+ private boolean isProvisioningNeededButUnavailable() {
+ return isTetherProvisioningRequired() && !doesEntitlementPackageExist();
+ }
+
+ boolean isTetherProvisioningRequired() {
+ final TetheringConfiguration cfg = mConfig;
+ return mEntitlementMgr.isTetherProvisioningRequired(cfg);
+ }
+
+ private boolean doesEntitlementPackageExist() {
+ // provisioningApp must contain package and class name.
+ if (mConfig.provisioningApp.length != 2) {
+ return false;
+ }
+
+ final PackageManager pm = mContext.getPackageManager();
+ try {
+ pm.getPackageInfo(mConfig.provisioningApp[0], GET_ACTIVITIES);
+ } catch (PackageManager.NameNotFoundException e) {
+ return false;
+ }
+ return true;
+ }
+
+ // TODO: Figure out how to update for local hotspot mode interfaces.
+ private void sendTetherStateChangedBroadcast() {
+ if (!isTetheringSupported()) return;
+
+ final ArrayList<String> availableList = new ArrayList<>();
+ final ArrayList<String> tetherList = new ArrayList<>();
+ final ArrayList<String> localOnlyList = new ArrayList<>();
+ final ArrayList<String> erroredList = new ArrayList<>();
+ final ArrayList<Integer> lastErrorList = new ArrayList<>();
+
+ final TetheringConfiguration cfg = mConfig;
+ mTetherStatesParcel = new TetherStatesParcel();
+
+ int downstreamTypesMask = DOWNSTREAM_NONE;
+ synchronized (mPublicSync) {
+ for (int i = 0; i < mTetherStates.size(); i++) {
+ TetherState tetherState = mTetherStates.valueAt(i);
+ String iface = mTetherStates.keyAt(i);
+ if (tetherState.lastError != TETHER_ERROR_NO_ERROR) {
+ erroredList.add(iface);
+ lastErrorList.add(tetherState.lastError);
+ } else if (tetherState.lastState == IpServer.STATE_AVAILABLE) {
+ availableList.add(iface);
+ } else if (tetherState.lastState == IpServer.STATE_LOCAL_ONLY) {
+ localOnlyList.add(iface);
+ } else if (tetherState.lastState == IpServer.STATE_TETHERED) {
+ if (cfg.isUsb(iface)) {
+ downstreamTypesMask |= (1 << TETHERING_USB);
+ } else if (cfg.isWifi(iface)) {
+ downstreamTypesMask |= (1 << TETHERING_WIFI);
+ } else if (cfg.isBluetooth(iface)) {
+ downstreamTypesMask |= (1 << TETHERING_BLUETOOTH);
+ }
+ tetherList.add(iface);
+ }
+ }
+ }
+
+ mTetherStatesParcel.availableList = availableList.toArray(new String[0]);
+ mTetherStatesParcel.tetheredList = tetherList.toArray(new String[0]);
+ mTetherStatesParcel.localOnlyList = localOnlyList.toArray(new String[0]);
+ mTetherStatesParcel.erroredIfaceList = erroredList.toArray(new String[0]);
+ mTetherStatesParcel.lastErrorList = new int[lastErrorList.size()];
+ Iterator<Integer> iterator = lastErrorList.iterator();
+ for (int i = 0; i < lastErrorList.size(); i++) {
+ mTetherStatesParcel.lastErrorList[i] = iterator.next().intValue();
+ }
+ reportTetherStateChanged(mTetherStatesParcel);
+
+ final Intent bcast = new Intent(ACTION_TETHER_STATE_CHANGED);
+ bcast.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
+ bcast.putStringArrayListExtra(EXTRA_AVAILABLE_TETHER, availableList);
+ bcast.putStringArrayListExtra(EXTRA_ACTIVE_LOCAL_ONLY, localOnlyList);
+ bcast.putStringArrayListExtra(EXTRA_ACTIVE_TETHER, tetherList);
+ bcast.putStringArrayListExtra(EXTRA_ERRORED_TETHER, erroredList);
+ mContext.sendStickyBroadcastAsUser(bcast, UserHandle.ALL);
+ if (DBG) {
+ Log.d(TAG, String.format(
+ "sendTetherStateChangedBroadcast %s=[%s] %s=[%s] %s=[%s] %s=[%s]",
+ "avail", TextUtils.join(",", availableList),
+ "local_only", TextUtils.join(",", localOnlyList),
+ "tether", TextUtils.join(",", tetherList),
+ "error", TextUtils.join(",", erroredList)));
+ }
+
+ mNotificationUpdater.onDownstreamChanged(downstreamTypesMask);
+ }
+
+ private class StateReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context content, Intent intent) {
+ final String action = intent.getAction();
+ if (action == null) return;
+
+ if (action.equals(UsbManager.ACTION_USB_STATE)) {
+ handleUsbAction(intent);
+ } else if (action.equals(CONNECTIVITY_ACTION)) {
+ handleConnectivityAction(intent);
+ } else if (action.equals(WifiManager.WIFI_AP_STATE_CHANGED_ACTION)) {
+ handleWifiApAction(intent);
+ } else if (action.equals(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION)) {
+ handleWifiP2pAction(intent);
+ } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
+ mLog.log("OBSERVED configuration changed");
+ updateConfiguration();
+ } else if (action.equals(UserManager.ACTION_USER_RESTRICTIONS_CHANGED)) {
+ mLog.log("OBSERVED user restrictions changed");
+ handleUserRestrictionAction();
+ } else if (action.equals(ACTION_RESTRICT_BACKGROUND_CHANGED)) {
+ mLog.log("OBSERVED data saver changed");
+ handleDataSaverChanged();
+ } else if (action.equals(TetheringNotificationUpdater.ACTION_DISABLE_TETHERING)) {
+ untetherAll();
+ }
+ }
+
+ private void handleConnectivityAction(Intent intent) {
+ final NetworkInfo networkInfo =
+ (NetworkInfo) intent.getParcelableExtra(EXTRA_NETWORK_INFO);
+ if (networkInfo == null
+ || networkInfo.getDetailedState() == NetworkInfo.DetailedState.FAILED) {
+ return;
+ }
+
+ if (VDBG) Log.d(TAG, "Tethering got CONNECTIVITY_ACTION: " + networkInfo.toString());
+ mTetherMainSM.sendMessage(TetherMainSM.CMD_UPSTREAM_CHANGED);
+ }
+
+ private void handleUsbAction(Intent intent) {
+ final boolean usbConnected = intent.getBooleanExtra(USB_CONNECTED, false);
+ final boolean usbConfigured = intent.getBooleanExtra(USB_CONFIGURED, false);
+ final boolean rndisEnabled = intent.getBooleanExtra(USB_FUNCTION_RNDIS, false);
+ final boolean ncmEnabled = intent.getBooleanExtra(USB_FUNCTION_NCM, false);
+
+ mLog.log(String.format("USB bcast connected:%s configured:%s rndis:%s",
+ usbConnected, usbConfigured, rndisEnabled));
+
+ // There are three types of ACTION_USB_STATE:
+ //
+ // - DISCONNECTED (USB_CONNECTED and USB_CONFIGURED are 0)
+ // Meaning: USB connection has ended either because of
+ // software reset or hard unplug.
+ //
+ // - CONNECTED (USB_CONNECTED is 1, USB_CONFIGURED is 0)
+ // Meaning: the first stage of USB protocol handshake has
+ // occurred but it is not complete.
+ //
+ // - CONFIGURED (USB_CONNECTED and USB_CONFIGURED are 1)
+ // Meaning: the USB handshake is completely done and all the
+ // functions are ready to use.
+ //
+ // For more explanation, see b/62552150 .
+ synchronized (Tethering.this.mPublicSync) {
+ if (!usbConnected && mRndisEnabled) {
+ // Turn off tethering if it was enabled and there is a disconnect.
+ tetherMatchingInterfaces(IpServer.STATE_AVAILABLE, TETHERING_USB);
+ mEntitlementMgr.stopProvisioningIfNeeded(TETHERING_USB);
+ } else if (usbConfigured && rndisEnabled) {
+ // Tether if rndis is enabled and usb is configured.
+ tetherMatchingInterfaces(IpServer.STATE_TETHERED, TETHERING_USB);
+ } else if (usbConnected && ncmEnabled) {
+ tetherMatchingInterfaces(IpServer.STATE_LOCAL_ONLY, TETHERING_NCM);
+ }
+ mRndisEnabled = usbConfigured && rndisEnabled;
+ }
+ }
+
+ private void handleWifiApAction(Intent intent) {
+ final int curState = intent.getIntExtra(EXTRA_WIFI_AP_STATE, WIFI_AP_STATE_DISABLED);
+ final String ifname = intent.getStringExtra(EXTRA_WIFI_AP_INTERFACE_NAME);
+ final int ipmode = intent.getIntExtra(EXTRA_WIFI_AP_MODE, IFACE_IP_MODE_UNSPECIFIED);
+
+ synchronized (Tethering.this.mPublicSync) {
+ switch (curState) {
+ case WifiManager.WIFI_AP_STATE_ENABLING:
+ // We can see this state on the way to both enabled and failure states.
+ break;
+ case WifiManager.WIFI_AP_STATE_ENABLED:
+ enableWifiIpServingLocked(ifname, ipmode);
+ break;
+ case WifiManager.WIFI_AP_STATE_DISABLING:
+ // We can see this state on the way to disabled.
+ break;
+ case WifiManager.WIFI_AP_STATE_DISABLED:
+ case WifiManager.WIFI_AP_STATE_FAILED:
+ default:
+ disableWifiIpServingLocked(ifname, curState);
+ break;
+ }
+ }
+ }
+
+ private boolean isGroupOwner(WifiP2pGroup group) {
+ return group != null && group.isGroupOwner()
+ && !TextUtils.isEmpty(group.getInterface());
+ }
+
+ private void handleWifiP2pAction(Intent intent) {
+ if (mConfig.isWifiP2pLegacyTetheringMode()) return;
+
+ final WifiP2pInfo p2pInfo =
+ (WifiP2pInfo) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_INFO);
+ final WifiP2pGroup group =
+ (WifiP2pGroup) intent.getParcelableExtra(WifiP2pManager.EXTRA_WIFI_P2P_GROUP);
+
+ if (VDBG) {
+ Log.d(TAG, "WifiP2pAction: P2pInfo: " + p2pInfo + " Group: " + group);
+ }
+
+ synchronized (Tethering.this.mPublicSync) {
+ // if no group is formed, bring it down if needed.
+ if (p2pInfo == null || !p2pInfo.groupFormed) {
+ disableWifiP2pIpServingLockedIfNeeded(mWifiP2pTetherInterface);
+ mWifiP2pTetherInterface = null;
+ return;
+ }
+
+ // If there is a group but the device is not the owner, bail out.
+ if (!isGroupOwner(group)) return;
+
+ // If already serving from the correct interface, nothing to do.
+ if (group.getInterface().equals(mWifiP2pTetherInterface)) return;
+
+ // If already serving from another interface, turn it down first.
+ if (!TextUtils.isEmpty(mWifiP2pTetherInterface)) {
+ mLog.w("P2P tethered interface " + mWifiP2pTetherInterface
+ + "is different from current interface "
+ + group.getInterface() + ", re-tether it");
+ disableWifiP2pIpServingLockedIfNeeded(mWifiP2pTetherInterface);
+ }
+
+ // Finally bring up serving on the new interface
+ mWifiP2pTetherInterface = group.getInterface();
+ enableWifiIpServingLocked(mWifiP2pTetherInterface, IFACE_IP_MODE_LOCAL_ONLY);
+ }
+ }
+
+ private void handleUserRestrictionAction() {
+ mTetheringRestriction.onUserRestrictionsChanged();
+ }
+
+ private void handleDataSaverChanged() {
+ final ConnectivityManager connMgr = (ConnectivityManager) mContext.getSystemService(
+ Context.CONNECTIVITY_SERVICE);
+ final boolean isDataSaverEnabled = connMgr.getRestrictBackgroundStatus()
+ != ConnectivityManager.RESTRICT_BACKGROUND_STATUS_DISABLED;
+
+ if (mDataSaverEnabled == isDataSaverEnabled) return;
+
+ mDataSaverEnabled = isDataSaverEnabled;
+ if (mDataSaverEnabled) {
+ untetherAll();
+ }
+ }
+ }
+
+ @VisibleForTesting
+ boolean isTetheringActive() {
+ return mActiveTetheringRequests.size() > 0;
+ }
+
+ @VisibleForTesting
+ protected static class UserRestrictionActionListener {
+ private final UserManager mUserMgr;
+ private final Tethering mWrapper;
+ private final TetheringNotificationUpdater mNotificationUpdater;
+ public boolean mDisallowTethering;
+
+ public UserRestrictionActionListener(@NonNull UserManager um, @NonNull Tethering wrapper,
+ @NonNull TetheringNotificationUpdater updater) {
+ mUserMgr = um;
+ mWrapper = wrapper;
+ mNotificationUpdater = updater;
+ mDisallowTethering = false;
+ }
+
+ public void onUserRestrictionsChanged() {
+ // getUserRestrictions gets restriction for this process' user, which is the primary
+ // user. This is fine because DISALLOW_CONFIG_TETHERING can only be set on the primary
+ // user. See UserManager.DISALLOW_CONFIG_TETHERING.
+ final Bundle restrictions = mUserMgr.getUserRestrictions();
+ final boolean newlyDisallowed =
+ restrictions.getBoolean(UserManager.DISALLOW_CONFIG_TETHERING);
+ final boolean prevDisallowed = mDisallowTethering;
+ mDisallowTethering = newlyDisallowed;
+
+ final boolean tetheringDisallowedChanged = (newlyDisallowed != prevDisallowed);
+ if (!tetheringDisallowedChanged) {
+ return;
+ }
+
+ if (!newlyDisallowed) {
+ // Clear the restricted notification when user is allowed to have tethering
+ // function.
+ mNotificationUpdater.tetheringRestrictionLifted();
+ return;
+ }
+
+ if (mWrapper.isTetheringActive()) {
+ // Restricted notification is shown when tethering function is disallowed on
+ // user's device.
+ mNotificationUpdater.notifyTetheringDisabledByRestriction();
+
+ // Untether from all downstreams since tethering is disallowed.
+ mWrapper.untetherAll();
+ }
+ // TODO(b/148139325): send tetheringSupported on restriction change
+ }
+ }
+
+ private void disableWifiIpServingLockedCommon(int tetheringType, String ifname, int apState) {
+ mLog.log("Canceling WiFi tethering request -"
+ + " type=" + tetheringType
+ + " interface=" + ifname
+ + " state=" + apState);
+
+ if (!TextUtils.isEmpty(ifname)) {
+ final TetherState ts = mTetherStates.get(ifname);
+ if (ts != null) {
+ ts.ipServer.unwanted();
+ return;
+ }
+ }
+
+ for (int i = 0; i < mTetherStates.size(); i++) {
+ final IpServer ipServer = mTetherStates.valueAt(i).ipServer;
+ if (ipServer.interfaceType() == tetheringType) {
+ ipServer.unwanted();
+ return;
+ }
+ }
+
+ mLog.log("Error disabling Wi-Fi IP serving; "
+ + (TextUtils.isEmpty(ifname) ? "no interface name specified"
+ : "specified interface: " + ifname));
+ }
+
+ private void disableWifiIpServingLocked(String ifname, int apState) {
+ // Regardless of whether we requested this transition, the AP has gone
+ // down. Don't try to tether again unless we're requested to do so.
+ // TODO: Remove this altogether, once Wi-Fi reliably gives us an
+ // interface name with every broadcast.
+ mWifiTetherRequested = false;
+
+ disableWifiIpServingLockedCommon(TETHERING_WIFI, ifname, apState);
+ }
+
+ private void disableWifiP2pIpServingLockedIfNeeded(String ifname) {
+ if (TextUtils.isEmpty(ifname)) return;
+
+ disableWifiIpServingLockedCommon(TETHERING_WIFI_P2P, ifname, /* fake */ 0);
+ }
+
+ private void enableWifiIpServingLocked(String ifname, int wifiIpMode) {
+ // Map wifiIpMode values to IpServer.Callback serving states, inferring
+ // from mWifiTetherRequested as a final "best guess".
+ final int ipServingMode;
+ switch (wifiIpMode) {
+ case IFACE_IP_MODE_TETHERED:
+ ipServingMode = IpServer.STATE_TETHERED;
+ break;
+ case IFACE_IP_MODE_LOCAL_ONLY:
+ ipServingMode = IpServer.STATE_LOCAL_ONLY;
+ break;
+ default:
+ mLog.e("Cannot enable IP serving in unknown WiFi mode: " + wifiIpMode);
+ return;
+ }
+
+ if (!TextUtils.isEmpty(ifname)) {
+ final int interfaceType =
+ (ifaceNameToType(ifname) == TETHERING_WIGIG ? TETHERING_WIGIG : TETHERING_WIFI);
+ maybeTrackNewInterfaceLocked(ifname, interfaceType);
+ changeInterfaceState(ifname, ipServingMode);
+ } else {
+ mLog.e(String.format(
+ "Cannot enable IP serving in mode %s on missing interface name",
+ ipServingMode));
+ }
+ }
+
+ // TODO: Consider renaming to something more accurate in its description.
+ // This method:
+ // - allows requesting either tethering or local hotspot serving states
+ // - handles both enabling and disabling serving states
+ // - only tethers the first matching interface in listInterfaces()
+ // order of a given type
+ private void tetherMatchingInterfaces(int requestedState, int interfaceType) {
+ if (VDBG) {
+ Log.d(TAG, "tetherMatchingInterfaces(" + requestedState + ", " + interfaceType + ")");
+ }
+
+ String[] ifaces = null;
+ try {
+ ifaces = mNetd.interfaceGetList();
+ } catch (RemoteException | ServiceSpecificException e) {
+ Log.e(TAG, "Error listing Interfaces", e);
+ return;
+ }
+ String chosenIface = null;
+ if (ifaces != null) {
+ for (String iface : ifaces) {
+ if (ifaceNameToType(iface) == interfaceType) {
+ chosenIface = iface;
+ break;
+ }
+ }
+ }
+ if (chosenIface == null) {
+ Log.e(TAG, "could not find iface of type " + interfaceType);
+ return;
+ }
+
+ changeInterfaceState(chosenIface, requestedState);
+ }
+
+ private void changeInterfaceState(String ifname, int requestedState) {
+ final int result;
+ switch (requestedState) {
+ case IpServer.STATE_UNAVAILABLE:
+ case IpServer.STATE_AVAILABLE:
+ result = untether(ifname);
+ break;
+ case IpServer.STATE_TETHERED:
+ case IpServer.STATE_LOCAL_ONLY:
+ result = tether(ifname, requestedState);
+ break;
+ default:
+ Log.wtf(TAG, "Unknown interface state: " + requestedState);
+ return;
+ }
+ if (result != TETHER_ERROR_NO_ERROR) {
+ Log.e(TAG, "unable start or stop tethering on iface " + ifname);
+ return;
+ }
+ }
+
+ TetheringConfiguration getTetheringConfiguration() {
+ return mConfig;
+ }
+
+ boolean hasTetherableConfiguration() {
+ final TetheringConfiguration cfg = mConfig;
+ final boolean hasDownstreamConfiguration =
+ (cfg.tetherableUsbRegexs.length != 0)
+ || (cfg.tetherableWifiRegexs.length != 0)
+ || (cfg.tetherableBluetoothRegexs.length != 0);
+ final boolean hasUpstreamConfiguration = !cfg.preferredUpstreamIfaceTypes.isEmpty()
+ || cfg.chooseUpstreamAutomatically;
+
+ return hasDownstreamConfiguration && hasUpstreamConfiguration;
+ }
+
+ // TODO - update callers to use getTetheringConfiguration(),
+ // which has only final members.
+ String[] getTetherableUsbRegexs() {
+ return copy(mConfig.tetherableUsbRegexs);
+ }
+
+ String[] getTetherableWifiRegexs() {
+ return copy(mConfig.tetherableWifiRegexs);
+ }
+
+ String[] getTetherableBluetoothRegexs() {
+ return copy(mConfig.tetherableBluetoothRegexs);
+ }
+
+ int setUsbTethering(boolean enable) {
+ if (VDBG) Log.d(TAG, "setUsbTethering(" + enable + ")");
+ UsbManager usbManager = (UsbManager) mContext.getSystemService(Context.USB_SERVICE);
+ if (usbManager == null) {
+ mLog.e("setUsbTethering: failed to get UsbManager!");
+ return TETHER_ERROR_SERVICE_UNAVAIL;
+ }
+
+ synchronized (mPublicSync) {
+ usbManager.setCurrentFunctions(enable ? UsbManager.FUNCTION_RNDIS
+ : UsbManager.FUNCTION_NONE);
+ }
+ return TETHER_ERROR_NO_ERROR;
+ }
+
+ private int setNcmTethering(boolean enable) {
+ if (VDBG) Log.d(TAG, "setNcmTethering(" + enable + ")");
+ UsbManager usbManager = (UsbManager) mContext.getSystemService(Context.USB_SERVICE);
+ synchronized (mPublicSync) {
+ usbManager.setCurrentFunctions(enable ? UsbManager.FUNCTION_NCM
+ : UsbManager.FUNCTION_NONE);
+ }
+ return TETHER_ERROR_NO_ERROR;
+ }
+
+ // TODO review API - figure out how to delete these entirely.
+ String[] getTetheredIfaces() {
+ ArrayList<String> list = new ArrayList<String>();
+ synchronized (mPublicSync) {
+ for (int i = 0; i < mTetherStates.size(); i++) {
+ TetherState tetherState = mTetherStates.valueAt(i);
+ if (tetherState.lastState == IpServer.STATE_TETHERED) {
+ list.add(mTetherStates.keyAt(i));
+ }
+ }
+ }
+ return list.toArray(new String[list.size()]);
+ }
+
+ String[] getTetherableIfaces() {
+ ArrayList<String> list = new ArrayList<String>();
+ synchronized (mPublicSync) {
+ for (int i = 0; i < mTetherStates.size(); i++) {
+ TetherState tetherState = mTetherStates.valueAt(i);
+ if (tetherState.lastState == IpServer.STATE_AVAILABLE) {
+ list.add(mTetherStates.keyAt(i));
+ }
+ }
+ }
+ return list.toArray(new String[list.size()]);
+ }
+
+ String[] getTetheredDhcpRanges() {
+ // TODO: this is only valid for the old DHCP server. Latest search suggests it is only used
+ // by WifiP2pServiceImpl to start dnsmasq: remove/deprecate after migrating callers.
+ return mConfig.legacyDhcpRanges;
+ }
+
+ String[] getErroredIfaces() {
+ ArrayList<String> list = new ArrayList<String>();
+ synchronized (mPublicSync) {
+ for (int i = 0; i < mTetherStates.size(); i++) {
+ TetherState tetherState = mTetherStates.valueAt(i);
+ if (tetherState.lastError != TETHER_ERROR_NO_ERROR) {
+ list.add(mTetherStates.keyAt(i));
+ }
+ }
+ }
+ return list.toArray(new String[list.size()]);
+ }
+
+ private void logMessage(State state, int what) {
+ mLog.log(state.getName() + " got " + sMagicDecoderRing.get(what, Integer.toString(what)));
+ }
+
+ private boolean upstreamWanted() {
+ if (!mForwardedDownstreams.isEmpty()) return true;
+
+ synchronized (mPublicSync) {
+ return mWifiTetherRequested;
+ }
+ }
+
+ // Needed because the canonical source of upstream truth is just the
+ // upstream interface set, |mCurrentUpstreamIfaceSet|.
+ private boolean pertainsToCurrentUpstream(UpstreamNetworkState ns) {
+ if (ns != null && ns.linkProperties != null && mCurrentUpstreamIfaceSet != null) {
+ for (String ifname : ns.linkProperties.getAllInterfaceNames()) {
+ if (mCurrentUpstreamIfaceSet.ifnames.contains(ifname)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ class TetherMainSM extends StateMachine {
+ // an interface SM has requested Tethering/Local Hotspot
+ static final int EVENT_IFACE_SERVING_STATE_ACTIVE = BASE_MAIN_SM + 1;
+ // an interface SM has unrequested Tethering/Local Hotspot
+ static final int EVENT_IFACE_SERVING_STATE_INACTIVE = BASE_MAIN_SM + 2;
+ // upstream connection change - do the right thing
+ static final int CMD_UPSTREAM_CHANGED = BASE_MAIN_SM + 3;
+ // we don't have a valid upstream conn, check again after a delay
+ static final int CMD_RETRY_UPSTREAM = BASE_MAIN_SM + 4;
+ // Events from NetworkCallbacks that we process on the main state
+ // machine thread on behalf of the UpstreamNetworkMonitor.
+ static final int EVENT_UPSTREAM_CALLBACK = BASE_MAIN_SM + 5;
+ // we treated the error and want now to clear it
+ static final int CMD_CLEAR_ERROR = BASE_MAIN_SM + 6;
+ static final int EVENT_IFACE_UPDATE_LINKPROPERTIES = BASE_MAIN_SM + 7;
+ // Events from EntitlementManager to choose upstream again.
+ static final int EVENT_UPSTREAM_PERMISSION_CHANGED = BASE_MAIN_SM + 8;
+ private final State mInitialState;
+ private final State mTetherModeAliveState;
+
+ private final State mSetIpForwardingEnabledErrorState;
+ private final State mSetIpForwardingDisabledErrorState;
+ private final State mStartTetheringErrorState;
+ private final State mStopTetheringErrorState;
+ private final State mSetDnsForwardersErrorState;
+
+ // This list is a little subtle. It contains all the interfaces that currently are
+ // requesting tethering, regardless of whether these interfaces are still members of
+ // mTetherStates. This allows us to maintain the following predicates:
+ //
+ // 1) mTetherStates contains the set of all currently existing, tetherable, link state up
+ // interfaces.
+ // 2) mNotifyList contains all state machines that may have outstanding tethering state
+ // that needs to be torn down.
+ //
+ // Because we excise interfaces immediately from mTetherStates, we must maintain mNotifyList
+ // so that the garbage collector does not clean up the state machine before it has a chance
+ // to tear itself down.
+ private final ArrayList<IpServer> mNotifyList;
+ private final IPv6TetheringCoordinator mIPv6TetheringCoordinator;
+ private final OffloadWrapper mOffload;
+
+ private static final int UPSTREAM_SETTLE_TIME_MS = 10000;
+
+ TetherMainSM(String name, Looper looper, TetheringDependencies deps) {
+ super(name, looper);
+
+ mInitialState = new InitialState();
+ mTetherModeAliveState = new TetherModeAliveState();
+ mSetIpForwardingEnabledErrorState = new SetIpForwardingEnabledErrorState();
+ mSetIpForwardingDisabledErrorState = new SetIpForwardingDisabledErrorState();
+ mStartTetheringErrorState = new StartTetheringErrorState();
+ mStopTetheringErrorState = new StopTetheringErrorState();
+ mSetDnsForwardersErrorState = new SetDnsForwardersErrorState();
+
+ addState(mInitialState);
+ addState(mTetherModeAliveState);
+ addState(mSetIpForwardingEnabledErrorState);
+ addState(mSetIpForwardingDisabledErrorState);
+ addState(mStartTetheringErrorState);
+ addState(mStopTetheringErrorState);
+ addState(mSetDnsForwardersErrorState);
+
+ mNotifyList = new ArrayList<>();
+ mIPv6TetheringCoordinator = deps.getIPv6TetheringCoordinator(mNotifyList, mLog);
+ mOffload = new OffloadWrapper();
+
+ setInitialState(mInitialState);
+ }
+
+ class InitialState extends State {
+ @Override
+ public boolean processMessage(Message message) {
+ logMessage(this, message.what);
+ switch (message.what) {
+ case EVENT_IFACE_SERVING_STATE_ACTIVE: {
+ final IpServer who = (IpServer) message.obj;
+ if (VDBG) Log.d(TAG, "Tether Mode requested by " + who);
+ handleInterfaceServingStateActive(message.arg1, who);
+ transitionTo(mTetherModeAliveState);
+ break;
+ }
+ case EVENT_IFACE_SERVING_STATE_INACTIVE: {
+ final IpServer who = (IpServer) message.obj;
+ if (VDBG) Log.d(TAG, "Tether Mode unrequested by " + who);
+ handleInterfaceServingStateInactive(who);
+ break;
+ }
+ case EVENT_IFACE_UPDATE_LINKPROPERTIES:
+ // Silently ignore these for now.
+ break;
+ default:
+ return NOT_HANDLED;
+ }
+ return HANDLED;
+ }
+ }
+
+ protected boolean turnOnMainTetherSettings() {
+ final TetheringConfiguration cfg = mConfig;
+ try {
+ mNetd.ipfwdEnableForwarding(TAG);
+ } catch (RemoteException | ServiceSpecificException e) {
+ mLog.e(e);
+ transitionTo(mSetIpForwardingEnabledErrorState);
+ return false;
+ }
+
+ // TODO: Randomize DHCPv4 ranges, especially in hotspot mode.
+ // Legacy DHCP server is disabled if passed an empty ranges array
+ final String[] dhcpRanges = cfg.enableLegacyDhcpServer
+ ? cfg.legacyDhcpRanges : new String[0];
+ try {
+ NetdUtils.tetherStart(mNetd, true /** usingLegacyDnsProxy */, dhcpRanges);
+ } catch (RemoteException | ServiceSpecificException e) {
+ try {
+ // Stop and retry.
+ mNetd.tetherStop();
+ NetdUtils.tetherStart(mNetd, true /** usingLegacyDnsProxy */, dhcpRanges);
+ } catch (RemoteException | ServiceSpecificException ee) {
+ mLog.e(ee);
+ transitionTo(mStartTetheringErrorState);
+ return false;
+ }
+ }
+ mLog.log("SET main tether settings: ON");
+ return true;
+ }
+
+ protected boolean turnOffMainTetherSettings() {
+ try {
+ mNetd.tetherStop();
+ } catch (RemoteException | ServiceSpecificException e) {
+ mLog.e(e);
+ transitionTo(mStopTetheringErrorState);
+ return false;
+ }
+ try {
+ mNetd.ipfwdDisableForwarding(TAG);
+ } catch (RemoteException | ServiceSpecificException e) {
+ mLog.e(e);
+ transitionTo(mSetIpForwardingDisabledErrorState);
+ return false;
+ }
+ transitionTo(mInitialState);
+ mLog.log("SET main tether settings: OFF");
+ return true;
+ }
+
+ protected void chooseUpstreamType(boolean tryCell) {
+ // We rebuild configuration on ACTION_CONFIGURATION_CHANGED, but we
+ // do not currently know how to watch for changes in DUN settings.
+ maybeDunSettingChanged();
+
+ final TetheringConfiguration config = mConfig;
+ final UpstreamNetworkState ns = (config.chooseUpstreamAutomatically)
+ ? mUpstreamNetworkMonitor.getCurrentPreferredUpstream()
+ : mUpstreamNetworkMonitor.selectPreferredUpstreamType(
+ config.preferredUpstreamIfaceTypes);
+ if (ns == null) {
+ if (tryCell) {
+ mUpstreamNetworkMonitor.registerMobileNetworkRequest();
+ // We think mobile should be coming up; don't set a retry.
+ } else {
+ sendMessageDelayed(CMD_RETRY_UPSTREAM, UPSTREAM_SETTLE_TIME_MS);
+ }
+ }
+ setUpstreamNetwork(ns);
+ final Network newUpstream = (ns != null) ? ns.network : null;
+ if (mTetherUpstream != newUpstream) {
+ mTetherUpstream = newUpstream;
+ mUpstreamNetworkMonitor.setCurrentUpstream(mTetherUpstream);
+ reportUpstreamChanged(ns);
+ }
+ }
+
+ protected void setUpstreamNetwork(UpstreamNetworkState ns) {
+ InterfaceSet ifaces = null;
+ if (ns != null) {
+ // Find the interface with the default IPv4 route. It may be the
+ // interface described by linkProperties, or one of the interfaces
+ // stacked on top of it.
+ mLog.i("Looking for default routes on: " + ns.linkProperties);
+ ifaces = TetheringInterfaceUtils.getTetheringInterfaces(ns);
+ mLog.i("Found upstream interface(s): " + ifaces);
+ }
+
+ if (ifaces != null) {
+ setDnsForwarders(ns.network, ns.linkProperties);
+ }
+ notifyDownstreamsOfNewUpstreamIface(ifaces);
+ if (ns != null && pertainsToCurrentUpstream(ns)) {
+ // If we already have UpstreamNetworkState for this network update it immediately.
+ handleNewUpstreamNetworkState(ns);
+ } else if (mCurrentUpstreamIfaceSet == null) {
+ // There are no available upstream networks.
+ handleNewUpstreamNetworkState(null);
+ }
+ }
+
+ protected void setDnsForwarders(final Network network, final LinkProperties lp) {
+ // TODO: Set v4 and/or v6 DNS per available connectivity.
+ final Collection<InetAddress> dnses = lp.getDnsServers();
+ // TODO: Properly support the absence of DNS servers.
+ final String[] dnsServers;
+ if (dnses != null && !dnses.isEmpty()) {
+ dnsServers = new String[dnses.size()];
+ int i = 0;
+ for (InetAddress dns : dnses) {
+ dnsServers[i++] = dns.getHostAddress();
+ }
+ } else {
+ dnsServers = mConfig.defaultIPv4DNS;
+ }
+ final int netId = (network != null) ? network.getNetId() : NETID_UNSET;
+ try {
+ mNetd.tetherDnsSet(netId, dnsServers);
+ mLog.log(String.format(
+ "SET DNS forwarders: network=%s dnsServers=%s",
+ network, Arrays.toString(dnsServers)));
+ } catch (RemoteException | ServiceSpecificException e) {
+ // TODO: Investigate how this can fail and what exactly
+ // happens if/when such failures occur.
+ mLog.e("setting DNS forwarders failed, " + e);
+ transitionTo(mSetDnsForwardersErrorState);
+ }
+ }
+
+ protected void notifyDownstreamsOfNewUpstreamIface(InterfaceSet ifaces) {
+ mCurrentUpstreamIfaceSet = ifaces;
+ for (IpServer ipServer : mNotifyList) {
+ ipServer.sendMessage(IpServer.CMD_TETHER_CONNECTION_CHANGED, ifaces);
+ }
+ }
+
+ protected void handleNewUpstreamNetworkState(UpstreamNetworkState ns) {
+ mIPv6TetheringCoordinator.updateUpstreamNetworkState(ns);
+ mOffload.updateUpstreamNetworkState(ns);
+ }
+
+ private void handleInterfaceServingStateActive(int mode, IpServer who) {
+ if (mNotifyList.indexOf(who) < 0) {
+ mNotifyList.add(who);
+ mIPv6TetheringCoordinator.addActiveDownstream(who, mode);
+ }
+
+ if (mode == IpServer.STATE_TETHERED) {
+ // No need to notify OffloadController just yet as there are no
+ // "offload-able" prefixes to pass along. This will handled
+ // when the TISM informs Tethering of its LinkProperties.
+ mForwardedDownstreams.add(who);
+ } else {
+ mOffload.excludeDownstreamInterface(who.interfaceName());
+ mForwardedDownstreams.remove(who);
+ }
+
+ // If this is a Wi-Fi interface, notify WifiManager of the active serving state.
+ if (who.interfaceType() == TETHERING_WIFI) {
+ final WifiManager mgr = getWifiManager();
+ final String iface = who.interfaceName();
+ switch (mode) {
+ case IpServer.STATE_TETHERED:
+ mgr.updateInterfaceIpState(iface, IFACE_IP_MODE_TETHERED);
+ break;
+ case IpServer.STATE_LOCAL_ONLY:
+ mgr.updateInterfaceIpState(iface, IFACE_IP_MODE_LOCAL_ONLY);
+ break;
+ default:
+ Log.wtf(TAG, "Unknown active serving mode: " + mode);
+ break;
+ }
+ }
+ }
+
+ private void handleInterfaceServingStateInactive(IpServer who) {
+ mNotifyList.remove(who);
+ mIPv6TetheringCoordinator.removeActiveDownstream(who);
+ mOffload.excludeDownstreamInterface(who.interfaceName());
+ mForwardedDownstreams.remove(who);
+ updateConnectedClients(null /* wifiClients */);
+
+ // If this is a Wi-Fi interface, tell WifiManager of any errors
+ // or the inactive serving state.
+ if (who.interfaceType() == TETHERING_WIFI) {
+ if (who.lastError() != TETHER_ERROR_NO_ERROR) {
+ getWifiManager().updateInterfaceIpState(
+ who.interfaceName(), IFACE_IP_MODE_CONFIGURATION_ERROR);
+ } else {
+ getWifiManager().updateInterfaceIpState(
+ who.interfaceName(), IFACE_IP_MODE_UNSPECIFIED);
+ }
+ }
+ }
+
+ @VisibleForTesting
+ void handleUpstreamNetworkMonitorCallback(int arg1, Object o) {
+ if (arg1 == UpstreamNetworkMonitor.NOTIFY_LOCAL_PREFIXES) {
+ mOffload.sendOffloadExemptPrefixes((Set<IpPrefix>) o);
+ return;
+ }
+
+ final UpstreamNetworkState ns = (UpstreamNetworkState) o;
+ switch (arg1) {
+ case UpstreamNetworkMonitor.EVENT_ON_LINKPROPERTIES:
+ mPrivateAddressCoordinator.updateUpstreamPrefix(ns);
+ break;
+ case UpstreamNetworkMonitor.EVENT_ON_LOST:
+ mPrivateAddressCoordinator.removeUpstreamPrefix(ns.network);
+ break;
+ }
+
+ if (ns == null || !pertainsToCurrentUpstream(ns)) {
+ // TODO: In future, this is where upstream evaluation and selection
+ // could be handled for notifications which include sufficient data.
+ // For example, after CONNECTIVITY_ACTION listening is removed, here
+ // is where we could observe a Wi-Fi network becoming available and
+ // passing validation.
+ if (mCurrentUpstreamIfaceSet == null) {
+ // If we have no upstream interface, try to run through upstream
+ // selection again. If, for example, IPv4 connectivity has shown up
+ // after IPv6 (e.g., 464xlat became available) we want the chance to
+ // notice and act accordingly.
+ chooseUpstreamType(false);
+ }
+ return;
+ }
+
+ switch (arg1) {
+ case UpstreamNetworkMonitor.EVENT_ON_CAPABILITIES:
+ if (ns.network.equals(mTetherUpstream)) {
+ mNotificationUpdater.onUpstreamCapabilitiesChanged(ns.networkCapabilities);
+ }
+ handleNewUpstreamNetworkState(ns);
+ break;
+ case UpstreamNetworkMonitor.EVENT_ON_LINKPROPERTIES:
+ chooseUpstreamType(false);
+ break;
+ case UpstreamNetworkMonitor.EVENT_ON_LOST:
+ // TODO: Re-evaluate possible upstreams. Currently upstream
+ // reevaluation is triggered via received CONNECTIVITY_ACTION
+ // broadcasts that result in being passed a
+ // TetherMainSM.CMD_UPSTREAM_CHANGED.
+ handleNewUpstreamNetworkState(null);
+ break;
+ default:
+ mLog.e("Unknown arg1 value: " + arg1);
+ break;
+ }
+ }
+
+ class TetherModeAliveState extends State {
+ boolean mUpstreamWanted = false;
+ boolean mTryCell = true;
+
+ @Override
+ public void enter() {
+ // If turning on main tether settings fails, we have already
+ // transitioned to an error state; exit early.
+ if (!turnOnMainTetherSettings()) {
+ return;
+ }
+
+ mPrivateAddressCoordinator.maybeRemoveDeprecatedUpstreams();
+ mUpstreamNetworkMonitor.startObserveAllNetworks();
+
+ // TODO: De-duplicate with updateUpstreamWanted() below.
+ if (upstreamWanted()) {
+ mUpstreamWanted = true;
+ mOffload.start();
+ chooseUpstreamType(true);
+ mTryCell = false;
+ }
+
+ // TODO: Check the upstream interface if it is managed by BPF offload.
+ mBpfCoordinator.startPolling();
+ }
+
+ @Override
+ public void exit() {
+ mOffload.stop();
+ mUpstreamNetworkMonitor.stop();
+ notifyDownstreamsOfNewUpstreamIface(null);
+ handleNewUpstreamNetworkState(null);
+ if (mTetherUpstream != null) {
+ mTetherUpstream = null;
+ reportUpstreamChanged(null);
+ }
+ mBpfCoordinator.stopPolling();
+ }
+
+ private boolean updateUpstreamWanted() {
+ final boolean previousUpstreamWanted = mUpstreamWanted;
+ mUpstreamWanted = upstreamWanted();
+ if (mUpstreamWanted != previousUpstreamWanted) {
+ if (mUpstreamWanted) {
+ mOffload.start();
+ } else {
+ mOffload.stop();
+ }
+ }
+ return previousUpstreamWanted;
+ }
+
+ @Override
+ public boolean processMessage(Message message) {
+ logMessage(this, message.what);
+ boolean retValue = true;
+ switch (message.what) {
+ case EVENT_IFACE_SERVING_STATE_ACTIVE: {
+ IpServer who = (IpServer) message.obj;
+ if (VDBG) Log.d(TAG, "Tether Mode requested by " + who);
+ handleInterfaceServingStateActive(message.arg1, who);
+ who.sendMessage(IpServer.CMD_TETHER_CONNECTION_CHANGED,
+ mCurrentUpstreamIfaceSet);
+ // If there has been a change and an upstream is now
+ // desired, kick off the selection process.
+ final boolean previousUpstreamWanted = updateUpstreamWanted();
+ if (!previousUpstreamWanted && mUpstreamWanted) {
+ chooseUpstreamType(true);
+ }
+ break;
+ }
+ case EVENT_IFACE_SERVING_STATE_INACTIVE: {
+ IpServer who = (IpServer) message.obj;
+ if (VDBG) Log.d(TAG, "Tether Mode unrequested by " + who);
+ handleInterfaceServingStateInactive(who);
+
+ if (mNotifyList.isEmpty()) {
+ // This transitions us out of TetherModeAliveState,
+ // either to InitialState or an error state.
+ turnOffMainTetherSettings();
+ break;
+ }
+
+ if (DBG) {
+ Log.d(TAG, "TetherModeAlive still has " + mNotifyList.size()
+ + " live requests:");
+ for (IpServer o : mNotifyList) {
+ Log.d(TAG, " " + o);
+ }
+ }
+ // If there has been a change and an upstream is no
+ // longer desired, release any mobile requests.
+ final boolean previousUpstreamWanted = updateUpstreamWanted();
+ if (previousUpstreamWanted && !mUpstreamWanted) {
+ mUpstreamNetworkMonitor.releaseMobileNetworkRequest();
+ }
+ break;
+ }
+ case EVENT_IFACE_UPDATE_LINKPROPERTIES: {
+ final LinkProperties newLp = (LinkProperties) message.obj;
+ if (message.arg1 == IpServer.STATE_TETHERED) {
+ mOffload.updateDownstreamLinkProperties(newLp);
+ } else {
+ mOffload.excludeDownstreamInterface(newLp.getInterfaceName());
+ }
+ break;
+ }
+ case EVENT_UPSTREAM_PERMISSION_CHANGED:
+ case CMD_UPSTREAM_CHANGED:
+ updateUpstreamWanted();
+ if (!mUpstreamWanted) break;
+
+ // Need to try DUN immediately if Wi-Fi goes down.
+ chooseUpstreamType(true);
+ mTryCell = false;
+ break;
+ case CMD_RETRY_UPSTREAM:
+ updateUpstreamWanted();
+ if (!mUpstreamWanted) break;
+
+ chooseUpstreamType(mTryCell);
+ mTryCell = !mTryCell;
+ break;
+ case EVENT_UPSTREAM_CALLBACK: {
+ updateUpstreamWanted();
+ if (mUpstreamWanted) {
+ handleUpstreamNetworkMonitorCallback(message.arg1, message.obj);
+ }
+ break;
+ }
+ default:
+ retValue = false;
+ break;
+ }
+ return retValue;
+ }
+ }
+
+ class ErrorState extends State {
+ private int mErrorNotification;
+
+ @Override
+ public boolean processMessage(Message message) {
+ boolean retValue = true;
+ switch (message.what) {
+ case EVENT_IFACE_SERVING_STATE_ACTIVE:
+ IpServer who = (IpServer) message.obj;
+ who.sendMessage(mErrorNotification);
+ break;
+ case CMD_CLEAR_ERROR:
+ mErrorNotification = TETHER_ERROR_NO_ERROR;
+ transitionTo(mInitialState);
+ break;
+ default:
+ retValue = false;
+ }
+ return retValue;
+ }
+
+ void notify(int msgType) {
+ mErrorNotification = msgType;
+ for (IpServer ipServer : mNotifyList) {
+ ipServer.sendMessage(msgType);
+ }
+ }
+
+ }
+
+ class SetIpForwardingEnabledErrorState extends ErrorState {
+ @Override
+ public void enter() {
+ Log.e(TAG, "Error in setIpForwardingEnabled");
+ notify(IpServer.CMD_IP_FORWARDING_ENABLE_ERROR);
+ }
+ }
+
+ class SetIpForwardingDisabledErrorState extends ErrorState {
+ @Override
+ public void enter() {
+ Log.e(TAG, "Error in setIpForwardingDisabled");
+ notify(IpServer.CMD_IP_FORWARDING_DISABLE_ERROR);
+ }
+ }
+
+ class StartTetheringErrorState extends ErrorState {
+ @Override
+ public void enter() {
+ Log.e(TAG, "Error in startTethering");
+ notify(IpServer.CMD_START_TETHERING_ERROR);
+ try {
+ mNetd.ipfwdDisableForwarding(TAG);
+ } catch (RemoteException | ServiceSpecificException e) { }
+ }
+ }
+
+ class StopTetheringErrorState extends ErrorState {
+ @Override
+ public void enter() {
+ Log.e(TAG, "Error in stopTethering");
+ notify(IpServer.CMD_STOP_TETHERING_ERROR);
+ try {
+ mNetd.ipfwdDisableForwarding(TAG);
+ } catch (RemoteException | ServiceSpecificException e) { }
+ }
+ }
+
+ class SetDnsForwardersErrorState extends ErrorState {
+ @Override
+ public void enter() {
+ Log.e(TAG, "Error in setDnsForwarders");
+ notify(IpServer.CMD_SET_DNS_FORWARDERS_ERROR);
+ try {
+ mNetd.tetherStop();
+ } catch (RemoteException | ServiceSpecificException e) { }
+ try {
+ mNetd.ipfwdDisableForwarding(TAG);
+ } catch (RemoteException | ServiceSpecificException e) { }
+ }
+ }
+
+ // A wrapper class to handle multiple situations where several calls to
+ // the OffloadController need to happen together.
+ //
+ // TODO: This suggests that the interface between OffloadController and
+ // Tethering is in need of improvement. Refactor these calls into the
+ // OffloadController implementation.
+ class OffloadWrapper {
+ public void start() {
+ final int status = mOffloadController.start() ? TETHER_HARDWARE_OFFLOAD_STARTED
+ : TETHER_HARDWARE_OFFLOAD_FAILED;
+ updateOffloadStatus(status);
+ sendOffloadExemptPrefixes();
+ }
+
+ public void stop() {
+ mOffloadController.stop();
+ updateOffloadStatus(TETHER_HARDWARE_OFFLOAD_STOPPED);
+ }
+
+ public void updateUpstreamNetworkState(UpstreamNetworkState ns) {
+ mOffloadController.setUpstreamLinkProperties(
+ (ns != null) ? ns.linkProperties : null);
+ }
+
+ public void updateDownstreamLinkProperties(LinkProperties newLp) {
+ // Update the list of offload-exempt prefixes before adding
+ // new prefixes on downstream interfaces to the offload HAL.
+ sendOffloadExemptPrefixes();
+ mOffloadController.notifyDownstreamLinkProperties(newLp);
+ }
+
+ public void excludeDownstreamInterface(String ifname) {
+ // This and other interfaces may be in local-only hotspot mode;
+ // resend all local prefixes to the OffloadController.
+ sendOffloadExemptPrefixes();
+ mOffloadController.removeDownstreamInterface(ifname);
+ }
+
+ public void sendOffloadExemptPrefixes() {
+ sendOffloadExemptPrefixes(mUpstreamNetworkMonitor.getLocalPrefixes());
+ }
+
+ public void sendOffloadExemptPrefixes(final Set<IpPrefix> localPrefixes) {
+ // Add in well-known minimum set.
+ PrefixUtils.addNonForwardablePrefixes(localPrefixes);
+ // Add tragically hardcoded prefixes.
+ localPrefixes.add(PrefixUtils.DEFAULT_WIFI_P2P_PREFIX);
+
+ // Maybe add prefixes or addresses for downstreams, depending on
+ // the IP serving mode of each.
+ for (IpServer ipServer : mNotifyList) {
+ final LinkProperties lp = ipServer.linkProperties();
+
+ switch (ipServer.servingMode()) {
+ case IpServer.STATE_UNAVAILABLE:
+ case IpServer.STATE_AVAILABLE:
+ // No usable LinkProperties in these states.
+ continue;
+ case IpServer.STATE_TETHERED:
+ // Only add IPv4 /32 and IPv6 /128 prefixes. The
+ // directly-connected prefixes will be sent as
+ // downstream "offload-able" prefixes.
+ for (LinkAddress addr : lp.getAllLinkAddresses()) {
+ final InetAddress ip = addr.getAddress();
+ if (ip.isLinkLocalAddress()) continue;
+ localPrefixes.add(PrefixUtils.ipAddressAsPrefix(ip));
+ }
+ break;
+ case IpServer.STATE_LOCAL_ONLY:
+ // Add prefixes covering all local IPs.
+ localPrefixes.addAll(PrefixUtils.localPrefixesFrom(lp));
+ break;
+ }
+ }
+
+ mOffloadController.setLocalPrefixes(localPrefixes);
+ }
+
+ private void updateOffloadStatus(final int newStatus) {
+ if (newStatus == mOffloadStatus) return;
+
+ mOffloadStatus = newStatus;
+ reportOffloadStatusChanged(mOffloadStatus);
+ }
+ }
+ }
+
+ private void startTrackDefaultNetwork() {
+ mUpstreamNetworkMonitor.startTrackDefaultNetwork(mDeps.getDefaultNetworkRequest(),
+ mEntitlementMgr);
+ }
+
+ /** Get the latest value of the tethering entitlement check. */
+ void requestLatestTetheringEntitlementResult(int type, ResultReceiver receiver,
+ boolean showEntitlementUi) {
+ if (receiver == null) return;
+
+ mHandler.post(() -> {
+ mEntitlementMgr.requestLatestTetheringEntitlementResult(type, receiver,
+ showEntitlementUi);
+ });
+ }
+
+ /** Register tethering event callback */
+ void registerTetheringEventCallback(ITetheringEventCallback callback) {
+ final boolean hasListPermission =
+ hasCallingPermission(NETWORK_SETTINGS)
+ || hasCallingPermission(PERMISSION_MAINLINE_NETWORK_STACK)
+ || hasCallingPermission(NETWORK_STACK);
+ mHandler.post(() -> {
+ mTetheringEventCallbacks.register(callback, new CallbackCookie(hasListPermission));
+ final TetheringCallbackStartedParcel parcel = new TetheringCallbackStartedParcel();
+ parcel.tetheringSupported = isTetheringSupported();
+ parcel.upstreamNetwork = mTetherUpstream;
+ parcel.config = mConfig.toStableParcelable();
+ parcel.states =
+ mTetherStatesParcel != null ? mTetherStatesParcel : emptyTetherStatesParcel();
+ parcel.tetheredClients = hasListPermission
+ ? mConnectedClientsTracker.getLastTetheredClients()
+ : Collections.emptyList();
+ parcel.offloadStatus = mOffloadStatus;
+ try {
+ callback.onCallbackStarted(parcel);
+ } catch (RemoteException e) {
+ // Not really very much to do here.
+ }
+ });
+ }
+
+ private TetherStatesParcel emptyTetherStatesParcel() {
+ final TetherStatesParcel parcel = new TetherStatesParcel();
+ parcel.availableList = new String[0];
+ parcel.tetheredList = new String[0];
+ parcel.localOnlyList = new String[0];
+ parcel.erroredIfaceList = new String[0];
+ parcel.lastErrorList = new int[0];
+
+ return parcel;
+ }
+
+ private boolean hasCallingPermission(@NonNull String permission) {
+ return mContext.checkCallingOrSelfPermission(permission) == PERMISSION_GRANTED;
+ }
+
+ /** Unregister tethering event callback */
+ void unregisterTetheringEventCallback(ITetheringEventCallback callback) {
+ mHandler.post(() -> {
+ mTetheringEventCallbacks.unregister(callback);
+ });
+ }
+
+ private void reportUpstreamChanged(UpstreamNetworkState ns) {
+ final int length = mTetheringEventCallbacks.beginBroadcast();
+ final Network network = (ns != null) ? ns.network : null;
+ final NetworkCapabilities capabilities = (ns != null) ? ns.networkCapabilities : null;
+ try {
+ for (int i = 0; i < length; i++) {
+ try {
+ mTetheringEventCallbacks.getBroadcastItem(i).onUpstreamChanged(network);
+ } catch (RemoteException e) {
+ // Not really very much to do here.
+ }
+ }
+ } finally {
+ mTetheringEventCallbacks.finishBroadcast();
+ }
+ // Need to notify capabilities change after upstream network changed because new network's
+ // capabilities should be checked every time.
+ mNotificationUpdater.onUpstreamCapabilitiesChanged(capabilities);
+ }
+
+ private void reportConfigurationChanged(TetheringConfigurationParcel config) {
+ final int length = mTetheringEventCallbacks.beginBroadcast();
+ try {
+ for (int i = 0; i < length; i++) {
+ try {
+ mTetheringEventCallbacks.getBroadcastItem(i).onConfigurationChanged(config);
+ // TODO(b/148139325): send tetheringSupported on configuration change
+ } catch (RemoteException e) {
+ // Not really very much to do here.
+ }
+ }
+ } finally {
+ mTetheringEventCallbacks.finishBroadcast();
+ }
+ }
+
+ private void reportTetherStateChanged(TetherStatesParcel states) {
+ final int length = mTetheringEventCallbacks.beginBroadcast();
+ try {
+ for (int i = 0; i < length; i++) {
+ try {
+ mTetheringEventCallbacks.getBroadcastItem(i).onTetherStatesChanged(states);
+ } catch (RemoteException e) {
+ // Not really very much to do here.
+ }
+ }
+ } finally {
+ mTetheringEventCallbacks.finishBroadcast();
+ }
+ }
+
+ private void reportTetherClientsChanged(List<TetheredClient> clients) {
+ final int length = mTetheringEventCallbacks.beginBroadcast();
+ try {
+ for (int i = 0; i < length; i++) {
+ try {
+ final CallbackCookie cookie =
+ (CallbackCookie) mTetheringEventCallbacks.getBroadcastCookie(i);
+ if (!cookie.hasListClientsPermission) continue;
+ mTetheringEventCallbacks.getBroadcastItem(i).onTetherClientsChanged(clients);
+ } catch (RemoteException e) {
+ // Not really very much to do here.
+ }
+ }
+ } finally {
+ mTetheringEventCallbacks.finishBroadcast();
+ }
+ }
+
+ private void reportOffloadStatusChanged(final int status) {
+ final int length = mTetheringEventCallbacks.beginBroadcast();
+ try {
+ for (int i = 0; i < length; i++) {
+ try {
+ mTetheringEventCallbacks.getBroadcastItem(i).onOffloadStatusChanged(status);
+ } catch (RemoteException e) {
+ // Not really very much to do here.
+ }
+ }
+ } finally {
+ mTetheringEventCallbacks.finishBroadcast();
+ }
+ }
+
+ // if ro.tether.denied = true we default to no tethering
+ // gservices could set the secure setting to 1 though to enable it on a build where it
+ // had previously been turned off.
+ boolean isTetheringSupported() {
+ final int defaultVal = mDeps.isTetheringDenied() ? 0 : 1;
+ final boolean tetherSupported = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.TETHER_SUPPORTED, defaultVal) != 0;
+ final boolean tetherEnabledInSettings = tetherSupported
+ && !mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING);
+
+ return tetherEnabledInSettings && hasTetherableConfiguration()
+ && !isProvisioningNeededButUnavailable();
+ }
+
+ void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter writer, @Nullable String[] args) {
+ // Binder.java closes the resource for us.
+ @SuppressWarnings("resource")
+ final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
+ if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
+ != PERMISSION_GRANTED) {
+ pw.println("Permission Denial: can't dump.");
+ return;
+ }
+
+ pw.println("Tethering:");
+ pw.increaseIndent();
+
+ pw.println("Configuration:");
+ pw.increaseIndent();
+ final TetheringConfiguration cfg = mConfig;
+ cfg.dump(pw);
+ pw.decreaseIndent();
+
+ pw.println("Entitlement:");
+ pw.increaseIndent();
+ mEntitlementMgr.dump(pw);
+ pw.decreaseIndent();
+
+ synchronized (mPublicSync) {
+ pw.println("Tether state:");
+ pw.increaseIndent();
+ for (int i = 0; i < mTetherStates.size(); i++) {
+ final String iface = mTetherStates.keyAt(i);
+ final TetherState tetherState = mTetherStates.valueAt(i);
+ pw.print(iface + " - ");
+
+ switch (tetherState.lastState) {
+ case IpServer.STATE_UNAVAILABLE:
+ pw.print("UnavailableState");
+ break;
+ case IpServer.STATE_AVAILABLE:
+ pw.print("AvailableState");
+ break;
+ case IpServer.STATE_TETHERED:
+ pw.print("TetheredState");
+ break;
+ case IpServer.STATE_LOCAL_ONLY:
+ pw.print("LocalHotspotState");
+ break;
+ default:
+ pw.print("UnknownState");
+ break;
+ }
+ pw.println(" - lastError = " + tetherState.lastError);
+ }
+ pw.println("Upstream wanted: " + upstreamWanted());
+ pw.println("Current upstream interface(s): " + mCurrentUpstreamIfaceSet);
+ pw.decreaseIndent();
+ }
+
+ pw.println("Hardware offload:");
+ pw.increaseIndent();
+ mOffloadController.dump(pw);
+ pw.decreaseIndent();
+
+ pw.println("BPF offload:");
+ pw.increaseIndent();
+ mBpfCoordinator.dump(pw);
+ pw.decreaseIndent();
+
+ pw.println("Private address coordinator:");
+ pw.increaseIndent();
+ mPrivateAddressCoordinator.dump(pw);
+ pw.decreaseIndent();
+
+ pw.println("Log:");
+ pw.increaseIndent();
+ if (argsContain(args, "--short")) {
+ pw.println("<log removed for brevity>");
+ } else {
+ mLog.dump(fd, pw, args);
+ }
+ pw.decreaseIndent();
+
+ pw.decreaseIndent();
+ }
+
+ private static boolean argsContain(String[] args, String target) {
+ for (String arg : args) {
+ if (target.equals(arg)) return true;
+ }
+ return false;
+ }
+
+ private void updateConnectedClients(final List<WifiClient> wifiClients) {
+ if (mConnectedClientsTracker.updateConnectedClients(mForwardedDownstreams, wifiClients)) {
+ reportTetherClientsChanged(mConnectedClientsTracker.getLastTetheredClients());
+ }
+ }
+
+ private IpServer.Callback makeControlCallback() {
+ return new IpServer.Callback() {
+ @Override
+ public void updateInterfaceState(IpServer who, int state, int lastError) {
+ notifyInterfaceStateChange(who, state, lastError);
+ }
+
+ @Override
+ public void updateLinkProperties(IpServer who, LinkProperties newLp) {
+ notifyLinkPropertiesChanged(who, newLp);
+ }
+
+ @Override
+ public void dhcpLeasesChanged() {
+ updateConnectedClients(null /* wifiClients */);
+ }
+
+ @Override
+ public void requestEnableTethering(int tetheringType, boolean enabled) {
+ enableTetheringInternal(tetheringType, enabled, null);
+ }
+ };
+ }
+
+ // TODO: Move into TetherMainSM.
+ private void notifyInterfaceStateChange(IpServer who, int state, int error) {
+ final String iface = who.interfaceName();
+ synchronized (mPublicSync) {
+ final TetherState tetherState = mTetherStates.get(iface);
+ if (tetherState != null && tetherState.ipServer.equals(who)) {
+ tetherState.lastState = state;
+ tetherState.lastError = error;
+ } else {
+ if (DBG) Log.d(TAG, "got notification from stale iface " + iface);
+ }
+ }
+
+ mLog.log(String.format("OBSERVED iface=%s state=%s error=%s", iface, state, error));
+
+ // If TetherMainSM is in ErrorState, TetherMainSM stays there.
+ // Thus we give a chance for TetherMainSM to recover to InitialState
+ // by sending CMD_CLEAR_ERROR
+ if (error == TETHER_ERROR_INTERNAL_ERROR) {
+ mTetherMainSM.sendMessage(TetherMainSM.CMD_CLEAR_ERROR, who);
+ }
+ int which;
+ switch (state) {
+ case IpServer.STATE_UNAVAILABLE:
+ case IpServer.STATE_AVAILABLE:
+ which = TetherMainSM.EVENT_IFACE_SERVING_STATE_INACTIVE;
+ break;
+ case IpServer.STATE_TETHERED:
+ case IpServer.STATE_LOCAL_ONLY:
+ which = TetherMainSM.EVENT_IFACE_SERVING_STATE_ACTIVE;
+ break;
+ default:
+ Log.wtf(TAG, "Unknown interface state: " + state);
+ return;
+ }
+ mTetherMainSM.sendMessage(which, state, 0, who);
+ sendTetherStateChangedBroadcast();
+ }
+
+ private void notifyLinkPropertiesChanged(IpServer who, LinkProperties newLp) {
+ final String iface = who.interfaceName();
+ final int state;
+ synchronized (mPublicSync) {
+ final TetherState tetherState = mTetherStates.get(iface);
+ if (tetherState != null && tetherState.ipServer.equals(who)) {
+ state = tetherState.lastState;
+ } else {
+ mLog.log("got notification from stale iface " + iface);
+ return;
+ }
+ }
+
+ mLog.log(String.format(
+ "OBSERVED LinkProperties update iface=%s state=%s lp=%s",
+ iface, IpServer.getStateString(state), newLp));
+ final int which = TetherMainSM.EVENT_IFACE_UPDATE_LINKPROPERTIES;
+ mTetherMainSM.sendMessage(which, state, 0, newLp);
+ }
+
+ private void maybeTrackNewInterfaceLocked(final String iface) {
+ // If we don't care about this type of interface, ignore.
+ final int interfaceType = ifaceNameToType(iface);
+ if (interfaceType == TETHERING_INVALID) {
+ mLog.log(iface + " is not a tetherable iface, ignoring");
+ return;
+ }
+ maybeTrackNewInterfaceLocked(iface, interfaceType);
+ }
+
+ private void maybeTrackNewInterfaceLocked(final String iface, int interfaceType) {
+ // If we have already started a TISM for this interface, skip.
+ if (mTetherStates.containsKey(iface)) {
+ mLog.log("active iface (" + iface + ") reported as added, ignoring");
+ return;
+ }
+
+ mLog.log("adding TetheringInterfaceStateMachine for: " + iface);
+ final TetherState tetherState = new TetherState(
+ new IpServer(iface, mLooper, interfaceType, mLog, mNetd, mBpfCoordinator,
+ makeControlCallback(), mConfig.enableLegacyDhcpServer,
+ mConfig.isBpfOffloadEnabled(), mPrivateAddressCoordinator,
+ mDeps.getIpServerDependencies()));
+ mTetherStates.put(iface, tetherState);
+ tetherState.ipServer.start();
+ }
+
+ private void stopTrackingInterfaceLocked(final String iface) {
+ final TetherState tetherState = mTetherStates.get(iface);
+ if (tetherState == null) {
+ mLog.log("attempting to remove unknown iface (" + iface + "), ignoring");
+ return;
+ }
+ tetherState.ipServer.stop();
+ mLog.log("removing TetheringInterfaceStateMachine for: " + iface);
+ mTetherStates.remove(iface);
+ }
+
+ private static String[] copy(String[] strarray) {
+ return Arrays.copyOf(strarray, strarray.length);
+ }
+}
diff --git a/packages/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java b/packages/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java
new file mode 100644
index 000000000000..2ef8027ead89
--- /dev/null
+++ b/packages/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java
@@ -0,0 +1,616 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.networkstack.tethering;
+
+import static android.net.ConnectivityManager.TYPE_BLUETOOTH;
+import static android.net.ConnectivityManager.TYPE_ETHERNET;
+import static android.net.ConnectivityManager.TYPE_MOBILE;
+import static android.net.ConnectivityManager.TYPE_MOBILE_DUN;
+import static android.net.ConnectivityManager.TYPE_MOBILE_HIPRI;
+import static android.net.ConnectivityManager.TYPE_WIFI;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_DUN;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_VPN;
+import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.ConnectivityManager.NetworkCallback;
+import android.net.IpPrefix;
+import android.net.LinkProperties;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkRequest;
+import android.net.util.PrefixUtils;
+import android.net.util.SharedLog;
+import android.os.Handler;
+import android.util.Log;
+import android.util.SparseIntArray;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.StateMachine;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+
+/**
+ * A class to centralize all the network and link properties information
+ * pertaining to the current and any potential upstream network.
+ *
+ * The owner of UNM gets it to register network callbacks by calling the
+ * following methods :
+ * Calling #startTrackDefaultNetwork() to track the system default network.
+ * Calling #startObserveAllNetworks() to observe all networks. Listening all
+ * networks is necessary while the expression of preferred upstreams remains
+ * a list of legacy connectivity types. In future, this can be revisited.
+ * Calling #registerMobileNetworkRequest() to bring up mobile DUN/HIPRI network.
+ *
+ * The methods and data members of this class are only to be accessed and
+ * modified from the tethering main state machine thread. Any other
+ * access semantics would necessitate the addition of locking.
+ *
+ * TODO: Move upstream selection logic here.
+ *
+ * All callback methods are run on the same thread as the specified target
+ * state machine. This class does not require locking when accessed from this
+ * thread. Access from other threads is not advised.
+ *
+ * @hide
+ */
+public class UpstreamNetworkMonitor {
+ private static final String TAG = UpstreamNetworkMonitor.class.getSimpleName();
+ private static final boolean DBG = false;
+ private static final boolean VDBG = false;
+
+ public static final int EVENT_ON_CAPABILITIES = 1;
+ public static final int EVENT_ON_LINKPROPERTIES = 2;
+ public static final int EVENT_ON_LOST = 3;
+ public static final int NOTIFY_LOCAL_PREFIXES = 10;
+ // This value is used by deprecated preferredUpstreamIfaceTypes selection which is default
+ // disabled.
+ @VisibleForTesting
+ public static final int TYPE_NONE = -1;
+
+ private static final int CALLBACK_LISTEN_ALL = 1;
+ private static final int CALLBACK_DEFAULT_INTERNET = 2;
+ private static final int CALLBACK_MOBILE_REQUEST = 3;
+
+ private static final SparseIntArray sLegacyTypeToTransport = new SparseIntArray();
+ static {
+ sLegacyTypeToTransport.put(TYPE_MOBILE, NetworkCapabilities.TRANSPORT_CELLULAR);
+ sLegacyTypeToTransport.put(TYPE_MOBILE_DUN, NetworkCapabilities.TRANSPORT_CELLULAR);
+ sLegacyTypeToTransport.put(TYPE_MOBILE_HIPRI, NetworkCapabilities.TRANSPORT_CELLULAR);
+ sLegacyTypeToTransport.put(TYPE_WIFI, NetworkCapabilities.TRANSPORT_WIFI);
+ sLegacyTypeToTransport.put(TYPE_BLUETOOTH, NetworkCapabilities.TRANSPORT_BLUETOOTH);
+ sLegacyTypeToTransport.put(TYPE_ETHERNET, NetworkCapabilities.TRANSPORT_ETHERNET);
+ }
+
+ private final Context mContext;
+ private final SharedLog mLog;
+ private final StateMachine mTarget;
+ private final Handler mHandler;
+ private final int mWhat;
+ private final HashMap<Network, UpstreamNetworkState> mNetworkMap = new HashMap<>();
+ private HashSet<IpPrefix> mLocalPrefixes;
+ private ConnectivityManager mCM;
+ private EntitlementManager mEntitlementMgr;
+ private NetworkCallback mListenAllCallback;
+ private NetworkCallback mDefaultNetworkCallback;
+ private NetworkCallback mMobileNetworkCallback;
+ private boolean mDunRequired;
+ // Whether the current default upstream is mobile or not.
+ private boolean mIsDefaultCellularUpstream;
+ // The current system default network (not really used yet).
+ private Network mDefaultInternetNetwork;
+ // The current upstream network used for tethering.
+ private Network mTetheringUpstreamNetwork;
+
+ public UpstreamNetworkMonitor(Context ctx, StateMachine tgt, SharedLog log, int what) {
+ mContext = ctx;
+ mTarget = tgt;
+ mHandler = mTarget.getHandler();
+ mLog = log.forSubComponent(TAG);
+ mWhat = what;
+ mLocalPrefixes = new HashSet<>();
+ mIsDefaultCellularUpstream = false;
+ }
+
+ @VisibleForTesting
+ public UpstreamNetworkMonitor(
+ ConnectivityManager cm, StateMachine tgt, SharedLog log, int what) {
+ this((Context) null, tgt, log, what);
+ mCM = cm;
+ }
+
+ /**
+ * Tracking the system default network. This method should be called when system is ready.
+ *
+ * @param defaultNetworkRequest should be the same as ConnectivityService default request
+ * @param entitle a EntitlementManager object to communicate between EntitlementManager and
+ * UpstreamNetworkMonitor
+ */
+ public void startTrackDefaultNetwork(NetworkRequest defaultNetworkRequest,
+ EntitlementManager entitle) {
+
+ // defaultNetworkRequest is not really a "request", just a way of tracking the system
+ // default network. It's guaranteed not to actually bring up any networks because it's
+ // the should be the same request as the ConnectivityService default request, and thus
+ // shares fate with it. We can't use registerDefaultNetworkCallback because it will not
+ // track the system default network if there is a VPN that applies to our UID.
+ if (mDefaultNetworkCallback == null) {
+ mDefaultNetworkCallback = new UpstreamNetworkCallback(CALLBACK_DEFAULT_INTERNET);
+ cm().requestNetwork(defaultNetworkRequest, mDefaultNetworkCallback, mHandler);
+ }
+ if (mEntitlementMgr == null) {
+ mEntitlementMgr = entitle;
+ }
+ }
+
+ /** Listen all networks. */
+ public void startObserveAllNetworks() {
+ stop();
+
+ final NetworkRequest listenAllRequest = new NetworkRequest.Builder()
+ .clearCapabilities().build();
+ mListenAllCallback = new UpstreamNetworkCallback(CALLBACK_LISTEN_ALL);
+ cm().registerNetworkCallback(listenAllRequest, mListenAllCallback, mHandler);
+ }
+
+ /**
+ * Stop tracking candidate tethering upstreams and release mobile network request.
+ * Note: this function is used when tethering is stopped because tethering do not need to
+ * choose upstream anymore. But it would not stop default network tracking because
+ * EntitlementManager may need to know default network to decide whether to request entitlement
+ * check even tethering is not active yet.
+ */
+ public void stop() {
+ releaseMobileNetworkRequest();
+
+ releaseCallback(mListenAllCallback);
+ mListenAllCallback = null;
+
+ mTetheringUpstreamNetwork = null;
+ mNetworkMap.clear();
+ }
+
+ /** Setup or teardown DUN connection according to |dunRequired|. */
+ public void updateMobileRequiresDun(boolean dunRequired) {
+ final boolean valueChanged = (mDunRequired != dunRequired);
+ mDunRequired = dunRequired;
+ if (valueChanged && mobileNetworkRequested()) {
+ releaseMobileNetworkRequest();
+ registerMobileNetworkRequest();
+ }
+ }
+
+ /** Whether mobile network is requested. */
+ public boolean mobileNetworkRequested() {
+ return (mMobileNetworkCallback != null);
+ }
+
+ /** Request mobile network if mobile upstream is permitted. */
+ public void registerMobileNetworkRequest() {
+ if (!isCellularUpstreamPermitted()) {
+ mLog.i("registerMobileNetworkRequest() is not permitted");
+ releaseMobileNetworkRequest();
+ return;
+ }
+ if (mMobileNetworkCallback != null) {
+ mLog.e("registerMobileNetworkRequest() already registered");
+ return;
+ }
+
+ final NetworkRequest mobileUpstreamRequest;
+ if (mDunRequired) {
+ mobileUpstreamRequest = new NetworkRequest.Builder()
+ .addCapability(NET_CAPABILITY_DUN)
+ .removeCapability(NET_CAPABILITY_NOT_RESTRICTED)
+ .addTransportType(TRANSPORT_CELLULAR).build();
+ } else {
+ mobileUpstreamRequest = new NetworkRequest.Builder()
+ .addCapability(NET_CAPABILITY_INTERNET)
+ .addTransportType(TRANSPORT_CELLULAR).build();
+ }
+
+ // The existing default network and DUN callbacks will be notified.
+ // Therefore, to avoid duplicate notifications, we only register a no-op.
+ mMobileNetworkCallback = new UpstreamNetworkCallback(CALLBACK_MOBILE_REQUEST);
+
+ // The following use of the legacy type system cannot be removed until
+ // upstream selection no longer finds networks by legacy type.
+ // See also http://b/34364553 .
+ final int legacyType = mDunRequired ? TYPE_MOBILE_DUN : TYPE_MOBILE_HIPRI;
+
+ // TODO: Change the timeout from 0 (no onUnavailable callback) to some
+ // moderate callback timeout. This might be useful for updating some UI.
+ // Additionally, we log a message to aid in any subsequent debugging.
+ mLog.i("requesting mobile upstream network: " + mobileUpstreamRequest);
+
+ cm().requestNetwork(mobileUpstreamRequest, 0, legacyType, mHandler,
+ mMobileNetworkCallback);
+ }
+
+ /** Release mobile network request. */
+ public void releaseMobileNetworkRequest() {
+ if (mMobileNetworkCallback == null) return;
+
+ cm().unregisterNetworkCallback(mMobileNetworkCallback);
+ mMobileNetworkCallback = null;
+ }
+
+ // So many TODOs here, but chief among them is: make this functionality an
+ // integral part of this class such that whenever a higher priority network
+ // becomes available and useful we (a) file a request to keep it up as
+ // necessary and (b) change all upstream tracking state accordingly (by
+ // passing LinkProperties up to Tethering).
+ /**
+ * Select the first available network from |perferredTypes|.
+ */
+ public UpstreamNetworkState selectPreferredUpstreamType(Iterable<Integer> preferredTypes) {
+ final TypeStatePair typeStatePair = findFirstAvailableUpstreamByType(
+ mNetworkMap.values(), preferredTypes, isCellularUpstreamPermitted());
+
+ mLog.log("preferred upstream type: " + typeStatePair.type);
+
+ switch (typeStatePair.type) {
+ case TYPE_MOBILE_DUN:
+ case TYPE_MOBILE_HIPRI:
+ // Tethering just selected mobile upstream in spite of the default network being
+ // not mobile. This can happen because of the priority list.
+ // Notify EntitlementManager to check permission for using mobile upstream.
+ if (!mIsDefaultCellularUpstream) {
+ mEntitlementMgr.maybeRunProvisioning();
+ }
+ // If we're on DUN, put our own grab on it.
+ registerMobileNetworkRequest();
+ break;
+ case TYPE_NONE:
+ // If we found NONE and mobile upstream is permitted we don't want to do this
+ // as we want any previous requests to keep trying to bring up something we can use.
+ if (!isCellularUpstreamPermitted()) releaseMobileNetworkRequest();
+ break;
+ default:
+ // If we've found an active upstream connection that's not DUN/HIPRI
+ // we should stop any outstanding DUN/HIPRI requests.
+ releaseMobileNetworkRequest();
+ break;
+ }
+
+ return typeStatePair.ns;
+ }
+
+ /**
+ * Get current preferred upstream network. If default network is cellular and DUN is required,
+ * preferred upstream would be DUN otherwise preferred upstream is the same as default network.
+ * Returns null if no current upstream is available.
+ */
+ public UpstreamNetworkState getCurrentPreferredUpstream() {
+ final UpstreamNetworkState dfltState = (mDefaultInternetNetwork != null)
+ ? mNetworkMap.get(mDefaultInternetNetwork)
+ : null;
+ if (isNetworkUsableAndNotCellular(dfltState)) return dfltState;
+
+ if (!isCellularUpstreamPermitted()) return null;
+
+ if (!mDunRequired) return dfltState;
+
+ // Find a DUN network. Note that code in Tethering causes a DUN request
+ // to be filed, but this might be moved into this class in future.
+ return findFirstDunNetwork(mNetworkMap.values());
+ }
+
+ /** Tell UpstreamNetworkMonitor which network is the current upstream of tethering. */
+ public void setCurrentUpstream(Network upstream) {
+ mTetheringUpstreamNetwork = upstream;
+ }
+
+ /** Return local prefixes. */
+ public Set<IpPrefix> getLocalPrefixes() {
+ return (Set<IpPrefix>) mLocalPrefixes.clone();
+ }
+
+ private boolean isCellularUpstreamPermitted() {
+ if (mEntitlementMgr != null) {
+ return mEntitlementMgr.isCellularUpstreamPermitted();
+ } else {
+ // This flow should only happens in testing.
+ return true;
+ }
+ }
+
+ private void handleAvailable(Network network) {
+ if (mNetworkMap.containsKey(network)) return;
+
+ if (VDBG) Log.d(TAG, "onAvailable for " + network);
+ mNetworkMap.put(network, new UpstreamNetworkState(null, null, network));
+ }
+
+ private void handleNetCap(Network network, NetworkCapabilities newNc) {
+ final UpstreamNetworkState prev = mNetworkMap.get(network);
+ if (prev == null || newNc.equals(prev.networkCapabilities)) {
+ // Ignore notifications about networks for which we have not yet
+ // received onAvailable() (should never happen) and any duplicate
+ // notifications (e.g. matching more than one of our callbacks).
+ return;
+ }
+
+ if (VDBG) {
+ Log.d(TAG, String.format("EVENT_ON_CAPABILITIES for %s: %s",
+ network, newNc));
+ }
+
+ mNetworkMap.put(network, new UpstreamNetworkState(
+ prev.linkProperties, newNc, network));
+ // TODO: If sufficient information is available to select a more
+ // preferable upstream, do so now and notify the target.
+ notifyTarget(EVENT_ON_CAPABILITIES, network);
+ }
+
+ private void handleLinkProp(Network network, LinkProperties newLp) {
+ final UpstreamNetworkState prev = mNetworkMap.get(network);
+ if (prev == null || newLp.equals(prev.linkProperties)) {
+ // Ignore notifications about networks for which we have not yet
+ // received onAvailable() (should never happen) and any duplicate
+ // notifications (e.g. matching more than one of our callbacks).
+ return;
+ }
+
+ if (VDBG) {
+ Log.d(TAG, String.format("EVENT_ON_LINKPROPERTIES for %s: %s",
+ network, newLp));
+ }
+
+ mNetworkMap.put(network, new UpstreamNetworkState(
+ newLp, prev.networkCapabilities, network));
+ // TODO: If sufficient information is available to select a more
+ // preferable upstream, do so now and notify the target.
+ notifyTarget(EVENT_ON_LINKPROPERTIES, network);
+ }
+
+ private void handleLost(Network network) {
+ // There are few TODOs within ConnectivityService's rematching code
+ // pertaining to spurious onLost() notifications.
+ //
+ // TODO: simplify this, probably if favor of code that:
+ // - selects a new upstream if mTetheringUpstreamNetwork has
+ // been lost (by any callback)
+ // - deletes the entry from the map only when the LISTEN_ALL
+ // callback gets notified.
+
+ if (!mNetworkMap.containsKey(network)) {
+ // Ignore loss of networks about which we had not previously
+ // learned any information or for which we have already processed
+ // an onLost() notification.
+ return;
+ }
+
+ if (VDBG) Log.d(TAG, "EVENT_ON_LOST for " + network);
+
+ // TODO: If sufficient information is available to select a more
+ // preferable upstream, do so now and notify the target. Likewise,
+ // if the current upstream network is gone, notify the target of the
+ // fact that we now have no upstream at all.
+ notifyTarget(EVENT_ON_LOST, mNetworkMap.remove(network));
+ }
+
+ private void recomputeLocalPrefixes() {
+ final HashSet<IpPrefix> localPrefixes = allLocalPrefixes(mNetworkMap.values());
+ if (!mLocalPrefixes.equals(localPrefixes)) {
+ mLocalPrefixes = localPrefixes;
+ notifyTarget(NOTIFY_LOCAL_PREFIXES, localPrefixes.clone());
+ }
+ }
+
+ // Fetch (and cache) a ConnectivityManager only if and when we need one.
+ private ConnectivityManager cm() {
+ if (mCM == null) {
+ // MUST call the String variant to be able to write unittests.
+ mCM = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ }
+ return mCM;
+ }
+
+ /**
+ * A NetworkCallback class that handles information of interest directly
+ * in the thread on which it is invoked. To avoid locking, this MUST be
+ * run on the same thread as the target state machine's handler.
+ */
+ private class UpstreamNetworkCallback extends NetworkCallback {
+ private final int mCallbackType;
+
+ UpstreamNetworkCallback(int callbackType) {
+ mCallbackType = callbackType;
+ }
+
+ @Override
+ public void onAvailable(Network network) {
+ handleAvailable(network);
+ }
+
+ @Override
+ public void onCapabilitiesChanged(Network network, NetworkCapabilities newNc) {
+ if (mCallbackType == CALLBACK_DEFAULT_INTERNET) {
+ mDefaultInternetNetwork = network;
+ final boolean newIsCellular = isCellular(newNc);
+ if (mIsDefaultCellularUpstream != newIsCellular) {
+ mIsDefaultCellularUpstream = newIsCellular;
+ mEntitlementMgr.notifyUpstream(newIsCellular);
+ }
+ return;
+ }
+
+ handleNetCap(network, newNc);
+ }
+
+ @Override
+ public void onLinkPropertiesChanged(Network network, LinkProperties newLp) {
+ if (mCallbackType == CALLBACK_DEFAULT_INTERNET) return;
+
+ handleLinkProp(network, newLp);
+ // Any non-LISTEN_ALL callback will necessarily concern a network that will
+ // also match the LISTEN_ALL callback by construction of the LISTEN_ALL callback.
+ // So it's not useful to do this work for non-LISTEN_ALL callbacks.
+ if (mCallbackType == CALLBACK_LISTEN_ALL) {
+ recomputeLocalPrefixes();
+ }
+ }
+
+ @Override
+ public void onLost(Network network) {
+ if (mCallbackType == CALLBACK_DEFAULT_INTERNET) {
+ mDefaultInternetNetwork = null;
+ mIsDefaultCellularUpstream = false;
+ mEntitlementMgr.notifyUpstream(false);
+ return;
+ }
+
+ handleLost(network);
+ // Any non-LISTEN_ALL callback will necessarily concern a network that will
+ // also match the LISTEN_ALL callback by construction of the LISTEN_ALL callback.
+ // So it's not useful to do this work for non-LISTEN_ALL callbacks.
+ if (mCallbackType == CALLBACK_LISTEN_ALL) {
+ recomputeLocalPrefixes();
+ }
+ }
+ }
+
+ private void releaseCallback(NetworkCallback cb) {
+ if (cb != null) cm().unregisterNetworkCallback(cb);
+ }
+
+ private void notifyTarget(int which, Network network) {
+ notifyTarget(which, mNetworkMap.get(network));
+ }
+
+ private void notifyTarget(int which, Object obj) {
+ mTarget.sendMessage(mWhat, which, 0, obj);
+ }
+
+ private static class TypeStatePair {
+ public int type = TYPE_NONE;
+ public UpstreamNetworkState ns = null;
+ }
+
+ private TypeStatePair findFirstAvailableUpstreamByType(
+ Iterable<UpstreamNetworkState> netStates, Iterable<Integer> preferredTypes,
+ boolean isCellularUpstreamPermitted) {
+ final TypeStatePair result = new TypeStatePair();
+
+ for (int type : preferredTypes) {
+ NetworkCapabilities nc;
+ try {
+ nc = networkCapabilitiesForType(type);
+ } catch (IllegalArgumentException iae) {
+ Log.e(TAG, "No NetworkCapabilities mapping for legacy type: " + type);
+ continue;
+ }
+ if (!isCellularUpstreamPermitted && isCellular(nc)) {
+ continue;
+ }
+
+ for (UpstreamNetworkState value : netStates) {
+ try {
+ // Check for both default Network and capabilities match.
+ // This avoids in picking the wrong interface(MOBILE) in
+ // STA+SAP scenarios where WIFI is preferred Network.
+ // In DUN tethering scenarios, check if the request type is
+ // DUN and capabilities match.
+ if ((type == TYPE_MOBILE_DUN || type == cm().getActiveNetworkInfo().getType())
+ && (nc.satisfiedByNetworkCapabilities(value.networkCapabilities))) {
+ result.type = type;
+ result.ns = value;
+ return result;
+ }
+ } catch (NullPointerException npe) {
+ Log.e(TAG, "Null pointer exception in getActiveNetworkInfo", npe);
+ continue;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private static HashSet<IpPrefix> allLocalPrefixes(Iterable<UpstreamNetworkState> netStates) {
+ final HashSet<IpPrefix> prefixSet = new HashSet<>();
+
+ for (UpstreamNetworkState ns : netStates) {
+ final LinkProperties lp = ns.linkProperties;
+ if (lp == null) continue;
+ prefixSet.addAll(PrefixUtils.localPrefixesFrom(lp));
+ }
+
+ return prefixSet;
+ }
+
+ private static boolean isCellular(UpstreamNetworkState ns) {
+ return (ns != null) && isCellular(ns.networkCapabilities);
+ }
+
+ private static boolean isCellular(NetworkCapabilities nc) {
+ return (nc != null) && nc.hasTransport(TRANSPORT_CELLULAR)
+ && nc.hasCapability(NET_CAPABILITY_NOT_VPN);
+ }
+
+ private static boolean hasCapability(UpstreamNetworkState ns, int netCap) {
+ return (ns != null) && (ns.networkCapabilities != null)
+ && ns.networkCapabilities.hasCapability(netCap);
+ }
+
+ private static boolean isNetworkUsableAndNotCellular(UpstreamNetworkState ns) {
+ return (ns != null) && (ns.networkCapabilities != null) && (ns.linkProperties != null)
+ && !isCellular(ns.networkCapabilities);
+ }
+
+ private static UpstreamNetworkState findFirstDunNetwork(
+ Iterable<UpstreamNetworkState> netStates) {
+ for (UpstreamNetworkState ns : netStates) {
+ if (isCellular(ns) && hasCapability(ns, NET_CAPABILITY_DUN)) return ns;
+ }
+
+ return null;
+ }
+
+ /**
+ * Given a legacy type (TYPE_WIFI, ...) returns the corresponding NetworkCapabilities instance.
+ * This function is used for deprecated legacy type and be disabled by default.
+ */
+ @VisibleForTesting
+ public static NetworkCapabilities networkCapabilitiesForType(int type) {
+ final NetworkCapabilities.Builder builder = new NetworkCapabilities.Builder();
+
+ // Map from type to transports.
+ final int notFound = -1;
+ final int transport = sLegacyTypeToTransport.get(type, notFound);
+ if (transport == notFound) {
+ throw new IllegalArgumentException("unknown legacy type: " + type);
+ }
+ builder.addTransportType(transport);
+
+ if (type == TYPE_MOBILE_DUN) {
+ builder.addCapability(NetworkCapabilities.NET_CAPABILITY_DUN);
+ // DUN is restricted network, see NetworkCapabilities#FORCE_RESTRICTED_CAPABILITIES.
+ builder.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED);
+ } else {
+ builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
+ }
+ return builder.build();
+ }
+}
diff --git a/services/core/Android.bp b/services/core/Android.bp
index e5716eee467e..914637caff81 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -90,7 +90,10 @@ genrule {
java_library_static {
name: "services.core.unboosted",
- defaults: ["platform_service_defaults"],
+ defaults: [
+ "framework-wifi-vendor-hide-access-defaults",
+ "platform_service_defaults",
+ ],
srcs: [
":statslog-art-java-gen",
":services.core-sources",
@@ -161,6 +164,8 @@ java_library_static {
"overlayable_policy_aidl-java",
"SurfaceFlingerProperties",
"com.android.sysprop.watchdog",
+ "vendor.qti.hardware.servicetracker-V1.0-java",
+ "vendor.qti.hardware.servicetracker-V1.2-java",
],
javac_shard_size: 50,
}
diff --git a/services/core/java/com/android/server/ActivityTriggerService.java b/services/core/java/com/android/server/ActivityTriggerService.java
new file mode 100644
index 000000000000..323ad096dc5c
--- /dev/null
+++ b/services/core/java/com/android/server/ActivityTriggerService.java
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2019, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of The Linux Foundation nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package com.android.server;
+
+import android.content.pm.ApplicationInfo;
+import android.util.Slog;
+import android.content.Context;
+import com.android.server.am.HostingRecord;
+import java.lang.Runnable;
+import android.os.HandlerThread;
+import android.os.Handler;
+
+public class ActivityTriggerService extends SystemService {
+ private static String TAG = "ActivityTriggerService";
+ public static final int PROC_ADDED_NOTIFICATION = 1;
+ public static final int PROC_REMOVED_NOTIFICATION = 0;
+ private EventHandlerThread eventHandler = new EventHandlerThread("EventHandlerThread");
+
+ public ActivityTriggerService(Context context) {
+ super(context);
+ }
+
+ @Override
+ public void onStart() {
+ Slog.i(TAG, "Starting ActivityTriggerService");
+ eventHandler.start();
+ publishLocalService(ActivityTriggerService.class, this);
+ }
+
+ /*make non-blocking call to add a new event to the handler's queue.
+ the event handler is the one responsible for running each event.*/
+ public void updateRecord(HostingRecord hr, ApplicationInfo info, int pid, int event) {
+ if(hr != null) {
+ eventHandler.getHandler().post(new LocalRunnable(info.packageName, info.longVersionCode, info.processName, pid, event));
+ }
+ }
+
+ public class EventHandlerThread extends HandlerThread {
+ private Handler handler;
+ public EventHandlerThread(String name) {
+ super(name); //no priority specified
+ }
+
+ @Override
+ protected void onLooperPrepared() {
+ //attach a handler to the thread
+ handler = new Handler();
+ }
+ //get the handler that queues and runs Runnables
+ public Handler getHandler() {
+ return handler;
+ }
+ }
+
+ static class LocalRunnable implements Runnable {
+ private String packageName;
+ private long lvCode;
+ private String procName;
+ private int pid;
+ private int event;
+
+ LocalRunnable(String packageName, long lvCode, String procName, int pid, int event) {
+ this.packageName = packageName;
+ this.lvCode = lvCode;
+ this.procName = procName;
+ this.pid = pid;
+ this.event = event;
+ }
+ @Override
+ public void run() {
+ notifyAction_native(packageName, lvCode, procName, pid, event);
+ }
+ }
+
+ //Native methods
+ static native void notifyAction_native(String pkgName, long vCode, String procName, int pid, int event);
+
+}
+
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 7ff693cdaa8d..cffd14c01199 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -131,6 +131,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
private static final int MESSAGE_DISABLE = 2;
private static final int MESSAGE_HANDLE_ENABLE_DELAYED = 3;
private static final int MESSAGE_HANDLE_DISABLE_DELAYED = 4;
+ private static final int MESSAGE_INFORM_ADAPTER_SERVICE_UP = 22;
private static final int MESSAGE_REGISTER_STATE_CHANGE_CALLBACK = 30;
private static final int MESSAGE_UNREGISTER_STATE_CHANGE_CALLBACK = 31;
private static final int MESSAGE_BLUETOOTH_SERVICE_CONNECTED = 40;
@@ -182,7 +183,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
private IBluetoothGatt mBluetoothGatt;
private final ReentrantReadWriteLock mBluetoothLock = new ReentrantReadWriteLock();
private boolean mBinding;
+ private int mBindingUserID;
private boolean mUnbinding;
+ private boolean mTryBindOnBindTimeout = false;
private BluetoothModeChangeHelper mBluetoothModeChangeHelper;
@@ -388,21 +391,24 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mContext.getPackageName(), false);
mBluetooth.onBrEdrDown(mContext.getAttributionSource());
mEnable = false;
- mEnableExternal = false;
}
} catch (RemoteException e) {
Slog.e(TAG, "Unable to call onBrEdrDown", e);
} finally {
mBluetoothLock.readLock().unlock();
}
- } else if (st == BluetoothAdapter.STATE_ON) {
+ } else {
+ Slog.d(TAG, "Airplane ON: sendDisableMsg");
sendDisableMsg(BluetoothProtoEnums.ENABLE_DISABLE_REASON_AIRPLANE_MODE,
mContext.getPackageName());
}
} else if (mEnableExternal) {
- sendEnableMsg(mQuietEnableExternal,
- BluetoothProtoEnums.ENABLE_DISABLE_REASON_AIRPLANE_MODE,
- mContext.getPackageName());
+ if (isBluetoothPersistedStateOn()) {
+ Slog.d(TAG, "Airplane OFF: sendEnableMsg");
+ sendEnableMsg(mQuietEnableExternal,
+ BluetoothProtoEnums.ENABLE_DISABLE_REASON_AIRPLANE_MODE,
+ mContext.getPackageName());
+ }
}
}
}
@@ -497,6 +503,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mBluetoothBinder = null;
mBluetoothGatt = null;
mBinding = false;
+ mTryBindOnBindTimeout = false;
mUnbinding = false;
mEnable = false;
mState = BluetoothAdapter.STATE_OFF;
@@ -788,6 +795,35 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
break;
}
}
+
+ int appCount = mBleApps.size();
+ if (DBG) {
+ Slog.d(TAG, appCount + "Binder is dead,registered Ble Apps");
+ }
+
+ if (appCount == 0 && mEnable) {
+ disableBleScanMode();
+ }
+
+ if (appCount == 0) {
+ int st = BluetoothAdapter.STATE_OFF;
+ try {
+ mBluetoothLock.readLock().lock();
+ if (mBluetooth != null) {
+ st = mBluetooth.getState();
+ }
+ if (!mEnableExternal || (st == BluetoothAdapter.STATE_BLE_ON)) {
+ if (DBG) {
+ Slog.d(TAG, "Move to BT state OFF");
+ }
+ sendBrEdrDownCallback(mContext.getAttributionSource());
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "", e);
+ } finally {
+ mBluetoothLock.readLock().unlock();
+ }
+ }
}
public String getPackageName() {
@@ -906,22 +942,25 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
// Disable ble scan only mode.
private void disableBleScanMode() {
try {
- mBluetoothLock.writeLock().lock();
- if (mBluetooth != null && (mBluetooth.getState() != BluetoothAdapter.STATE_ON)) {
+ mBluetoothLock.readLock().lock();
+ if (mBluetooth != null && (mBluetooth.getState() != BluetoothAdapter.STATE_ON) && (!isBluetoothPersistedStateOnBluetooth())) {
if (DBG) {
Slog.d(TAG, "Reseting the mEnable flag for clean disable");
}
- mEnable = false;
+ if (!mEnableExternal) {
+ mEnable = false;
+ }
}
} catch (RemoteException e) {
Slog.e(TAG, "getState()", e);
} finally {
- mBluetoothLock.writeLock().unlock();
+ mBluetoothLock.readLock().unlock();
}
}
private int updateBleAppCount(IBinder token, boolean enable, String packageName) {
ClientDeathRecipient r = mBleApps.get(token);
+ int st = BluetoothAdapter.STATE_OFF;
if (r == null && enable) {
ClientDeathRecipient deathRec = new ClientDeathRecipient(packageName);
try {
@@ -941,6 +980,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.d(TAG, "Unregistered for death of " + packageName);
}
}
+
int appCount = mBleApps.size();
if (DBG) {
Slog.d(TAG, appCount + " registered Ble Apps");
@@ -1024,12 +1064,15 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
+ " mBinding = " + mBinding + " mState = "
+ BluetoothAdapter.nameForState(mState));
}
+ /* update app count even in bt off state, if quick enableBle and
+ * disableBle during BT turning off may leave app count non zero
+ */
+ updateBleAppCount(token, false, packageName);
if (mState == BluetoothAdapter.STATE_OFF) {
Slog.d(TAG, "disableBLE(): Already disabled");
return false;
}
- updateBleAppCount(token, false, packageName);
if (mState == BluetoothAdapter.STATE_BLE_ON && !isBleAppPresent()) {
if (mEnable) {
@@ -1072,14 +1115,24 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "onBluetoothServiceUp: mBluetooth is null!");
return;
}
- if (!mEnableExternal && !isBleAppPresent()) {
+ int st = mBluetooth.getState();
+ if (st != BluetoothAdapter.STATE_BLE_ON) {
+ if (DBG) Slog.v(TAG, "onBluetoothServiceUp: state isn't BLE_ON: " +
+ BluetoothAdapter.nameForState(st));
+ return;
+ }
+ if (!mEnableExternal && !isBleAppPresent() &&
+ !isBluetoothPersistedStateOnBluetooth()) {
Slog.i(TAG, "Bluetooth was disabled while enabling BLE, disable BLE now");
mEnable = false;
mBluetooth.onBrEdrDown(mContext.getAttributionSource());
return;
}
- if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) {
+ if (isBluetoothPersistedStateOnBluetooth() ||
+ mEnableExternal) {
// This triggers transition to STATE_ON
+ mBluetooth.updateQuietModeStatus(mQuietEnable,
+ mContext.getAttributionSource());
mBluetooth.onLeServiceUp(mContext.getAttributionSource());
persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
}
@@ -1111,7 +1164,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
if (isBleAppPresent()) {
// Need to stay at BLE ON. Disconnect all Gatt connections
try {
- mBluetoothGatt.unregAll(attributionSource);
+ if (mBluetoothGatt != null) {
+ mBluetoothGatt.unregAll(attributionSource);
+ }
} catch (RemoteException e) {
Slog.e(TAG, "Unable to disconnect all apps.", e);
}
@@ -1183,6 +1238,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
synchronized (mReceiver) {
mQuietEnableExternal = false;
mEnableExternal = true;
+
// waive WRITE_SECURE_SETTINGS permission check
sendEnableMsg(false,
BluetoothProtoEnums.ENABLE_DISABLE_REASON_APPLICATION_REQUEST, packageName);
@@ -1212,18 +1268,44 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
if (DBG) {
- Slog.d(TAG, "disable(): mBluetooth = " + mBluetooth + " mBinding = " + mBinding);
+ Slog.d(TAG, "disable(" + packageName + "): mBluetooth = "
+ + mBluetooth + " mBinding = " + mBinding);
}
synchronized (mReceiver) {
if (!isBluetoothPersistedStateOnAirplane()) {
if (persist) {
persistBluetoothSetting(BLUETOOTH_OFF);
+ mEnableExternal = false;
+ }
+ }
+ if (persist) {
+ sendDisableMsg(BluetoothProtoEnums.ENABLE_DISABLE_REASON_APPLICATION_REQUEST,
+ packageName);
+ } else {
+ /* It means disable is called by shutdown thread */
+ synchronized (this) {
+ clearBleApps();
+ }
+
+ try {
+ mBluetoothLock.readLock().lock();
+ mEnableExternal = false;
+ if (mBluetooth != null) {
+ if(mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) {
+ mEnable = false;
+ mBluetooth.onBrEdrDown(attributionSource);
+ } else {
+ sendDisableMsg(BluetoothProtoEnums.ENABLE_DISABLE_REASON_SYSTEM_BOOT,
+ packageName);
+ }
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Unable to initiate disable", e);
+ } finally {
+ mBluetoothLock.readLock().unlock();
}
- mEnableExternal = false;
}
- sendDisableMsg(BluetoothProtoEnums.ENABLE_DISABLE_REASON_APPLICATION_REQUEST,
- packageName);
}
return true;
}
@@ -1330,6 +1412,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mContext.unbindService(mConnection);
mUnbinding = false;
mBinding = false;
+ mTryBindOnBindTimeout = false;
} else {
mUnbinding = false;
}
@@ -1344,14 +1427,29 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
return mBluetoothGatt;
}
+ public boolean isBluetoothAvailableForBinding() {
+ try {
+ mBluetoothLock.readLock().lock();
+ if (mBluetooth != null && ((mBluetooth.getState() == BluetoothAdapter.STATE_ON) ||
+ (mBluetooth.getState() == BluetoothAdapter.STATE_TURNING_ON))) {
+ return true;
+ } else {
+ return false;
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "getState()", e);
+ } finally {
+ mBluetoothLock.readLock().unlock();
+ }
+ return false;
+ }
+
@Override
public boolean bindBluetoothProfileService(int bluetoothProfile,
IBluetoothProfileServiceConnection proxy) {
- if (mState != BluetoothAdapter.STATE_ON) {
- if (DBG) {
- Slog.d(TAG, "Trying to bind to profile: " + bluetoothProfile
- + ", while Bluetooth was disabled");
- }
+ if (isBluetoothAvailableForBinding() == false) {
+ Slog.w(TAG, "bindBluetoothProfileService:Trying to bind to profile: "
+ + bluetoothProfile + ", while Bluetooth is disabled");
return false;
}
synchronized (mProfileServices) {
@@ -1374,6 +1472,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mProfileServices.put(new Integer(bluetoothProfile), psc);
}
+ else
+ Slog.w(TAG, "psc is not null in bindBluetoothProfileService");
}
// Introducing a delay to give the client app time to prepare
@@ -1391,16 +1491,20 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Integer profile = new Integer(bluetoothProfile);
ProfileServiceConnections psc = mProfileServices.get(profile);
if (psc == null) {
+ Slog.e(TAG, "unbindBluetoothProfileService: psc is null, returning");
return;
}
+ Slog.w(TAG, "unbindBluetoothProfileService: calling psc.removeProxy");
psc.removeProxy(proxy);
if (psc.isEmpty()) {
- // All prxoies are disconnected, unbind with the service.
+ // All proxies are disconnected, unbind with the service.
try {
mContext.unbindService(psc);
} catch (IllegalArgumentException e) {
Slog.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e);
}
+ Slog.w(TAG, "psc.isEmpty is true, removing psc entry for profile "
+ + profile);
mProfileServices.remove(profile);
}
}
@@ -1541,6 +1645,13 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "Unable to connect to proxy", e);
}
} else {
+ if (isBluetoothAvailableForBinding() == false) {
+ Slog.w(TAG, "addProxy: Trying to bind to profile: " + mClassName +
+ ", while Bluetooth is disabled");
+ mProxies.unregister(proxy);
+ return;
+ }
+
if (!mHandler.hasMessages(MESSAGE_BIND_PROFILE_SERVICE, this)) {
Message msg = mHandler.obtainMessage(MESSAGE_BIND_PROFILE_SERVICE);
msg.obj = this;
@@ -1558,6 +1669,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "Unable to disconnect proxy", e);
}
}
+
+ Slog.w(TAG, "removing the proxy, count is "
+ + mProxies.getRegisteredCallbackCount());
} else {
Slog.w(TAG, "Trying to remove a null proxy");
}
@@ -1569,7 +1683,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
private boolean isEmpty() {
- return mProxies.getRegisteredCallbackCount() == 0;
+ return (mProxies != null && mProxies.getRegisteredCallbackCount() == 0);
}
@Override
@@ -1607,13 +1721,11 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
@Override
public void onServiceDisconnected(ComponentName className) {
- if (mService == null) {
- return;
- }
+ if (mService == null) return;
try {
mService.unlinkToDeath(this, 0);
} catch (NoSuchElementException e) {
- Log.e(TAG, "error unlinking to death", e);
+ Slog.e(TAG, "Unable to unlinkToDeath", e);
}
mService = null;
mClassName = null;
@@ -1645,6 +1757,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.w(TAG, "Profile service for profile: " + mClassName + " died.");
}
onServiceDisconnected(mClassName);
+
+ if (isBluetoothAvailableForBinding() == false) {
+ Slog.w(TAG, "binderDied: Trying to bind to profile: " + mClassName +
+ ", while Bluetooth is disabled");
+ return;
+ }
// Trigger rebind
Message msg = mHandler.obtainMessage(MESSAGE_BIND_PROFILE_SERVICE);
msg.obj = this;
@@ -1677,6 +1795,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
private void sendBluetoothServiceUpCallback() {
synchronized (mCallbacks) {
try {
+ mBluetoothLock.writeLock().lock();
int n = mCallbacks.beginBroadcast();
Slog.d(TAG, "Broadcasting onBluetoothServiceUp() to " + n + " receivers.");
for (int i = 0; i < n; i++) {
@@ -1688,6 +1807,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
} finally {
mCallbacks.finishBroadcast();
+ mBluetoothLock.writeLock().unlock();
}
}
}
@@ -1774,6 +1894,64 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
return mName;
}
+ public boolean factoryReset() {
+ final int callingUid = Binder.getCallingUid();
+ final boolean callerSystem = UserHandle.getAppId(callingUid) == Process.SYSTEM_UID;
+
+ if (!callerSystem) {
+ if (!checkIfCallerIsForegroundUser()) {
+ Slog.w(TAG, "factoryReset(): not allowed for non-active and non system user");
+ return false;
+ }
+
+ mContext.enforceCallingOrSelfPermission(
+ BLUETOOTH_PRIVILEGED, "Need BLUETOOTH PRIVILEGED permission");
+ }
+ persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
+
+ /* Wait for stable state if bluetooth is temporary state. */
+ int state = getState();
+ if (state == BluetoothAdapter.STATE_BLE_TURNING_ON
+ || state == BluetoothAdapter.STATE_TURNING_ON
+ || state == BluetoothAdapter.STATE_TURNING_OFF) {
+ if (!waitForState(Set.of(BluetoothAdapter.STATE_BLE_ON, BluetoothAdapter.STATE_ON))) {
+ return false;
+ }
+ }
+
+ // Clear registered LE apps to force shut-off
+ clearBleApps();
+ try {
+ mBluetoothLock.writeLock().lock();
+ if (mBluetooth == null) {
+ mEnable = true;
+ handleEnable(mQuietEnable);
+ } else if (state == BluetoothAdapter.STATE_OFF) {
+ mEnable = true;
+ mBluetooth.factoryReset(mContext.getAttributionSource());
+ handleEnable(mQuietEnable);
+ } else if (state == BluetoothAdapter.STATE_BLE_ON) {
+ addActiveLog(
+ BluetoothProtoEnums.ENABLE_DISABLE_REASON_FACTORY_RESET,
+ mContext.getPackageName(), false);
+ mBluetooth.onBrEdrDown(mContext.getAttributionSource());
+ return mBluetooth.factoryReset(mContext.getAttributionSource());
+ } else if (state == BluetoothAdapter.STATE_ON) {
+ addActiveLog(
+ BluetoothProtoEnums.ENABLE_DISABLE_REASON_FACTORY_RESET,
+ mContext.getPackageName(), false);
+ mBluetooth.disable(mContext.getAttributionSource());
+ return mBluetooth.factoryReset(mContext.getAttributionSource());
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "factoryReset(): Unable to do factoryReset.", e);
+ return false;
+ } finally {
+ mBluetoothLock.writeLock().unlock();
+ }
+ return true;
+ }
+
private class BluetoothServiceConnection implements ServiceConnection {
public void onServiceConnected(ComponentName componentName, IBinder service) {
String name = componentName.getClassName();
@@ -1783,6 +1961,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Message msg = mHandler.obtainMessage(MESSAGE_BLUETOOTH_SERVICE_CONNECTED);
if (name.equals("com.android.bluetooth.btservice.AdapterService")) {
msg.arg1 = SERVICE_IBLUETOOTH;
+ mHandler.removeMessages(MESSAGE_TIMEOUT_BIND);
} else if (name.equals("com.android.bluetooth.gatt.GattService")) {
msg.arg1 = SERVICE_IBLUETOOTHGATT;
} else {
@@ -1846,6 +2025,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mHandler.removeMessages(MESSAGE_TIMEOUT_BIND);
} else {
mBinding = true;
+ mBindingUserID = ActivityManager.getCurrentUser();
+ Slog.d(TAG, "Binding BT service. Current user: " + mBindingUserID);
}
} else if (mBluetooth != null) {
try {
@@ -1876,9 +2057,38 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
if (mHandler.hasMessages(MESSAGE_HANDLE_DISABLE_DELAYED)
|| mHandler.hasMessages(MESSAGE_HANDLE_ENABLE_DELAYED)) {
- // We are handling enable or disable right now, wait for it.
- mHandler.sendMessageDelayed(mHandler.obtainMessage(MESSAGE_ENABLE,
- quietEnable, isBle), ENABLE_DISABLE_DELAY_MS);
+ if (msg.arg2 == 0) {
+ int delay = ENABLE_DISABLE_DELAY_MS;
+
+ if (mHandler.hasMessages(MESSAGE_DISABLE)) {
+ delay = ENABLE_DISABLE_DELAY_MS * 2;
+ }
+ // Keep only one MESSAGE_ENABLE and ensure it is the last one
+ // to be taken out of the queue
+ mHandler.removeMessages(MESSAGE_ENABLE);
+ // We are handling enable or disable right now, wait for it.
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_ENABLE, quietEnable, 1), delay);
+ Slog.d(TAG, "Queue new MESSAGE_ENABLE");
+ } else {
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_ENABLE, quietEnable, 1), ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue previous MESSAGE_ENABLE");
+ if (mHandler.hasMessages(MESSAGE_DISABLE)) {
+ // Ensure the original order of just entering the queue
+ // if MESSAGE_DISABLE present
+ mHandler.removeMessages(MESSAGE_DISABLE);
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_DISABLE, 0, 1), ENABLE_DISABLE_DELAY_MS * 2);
+ Slog.d(TAG, "Re-Queue previous MESSAGE_DISABLE");
+ }
+ }
+ break;
+ } else if(msg.arg2 == 0 && mHandler.hasMessages(MESSAGE_DISABLE)) {
+ mHandler.removeMessages(MESSAGE_ENABLE);
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_ENABLE, quietEnable, 1), ENABLE_DISABLE_DELAY_MS * 2);
+ Slog.d(TAG, "MESSAGE_DISABLE exist. Queue new MESSAGE_ENABLE");
break;
}
@@ -1889,6 +2099,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mHandler.removeMessages(MESSAGE_RESTART_BLUETOOTH_SERVICE);
mEnable = true;
+ mQuietEnable = (quietEnable == 1);
if (isBle == 0) {
persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
}
@@ -1925,8 +2136,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mBluetoothLock.readLock().unlock();
}
- mQuietEnable = (quietEnable == 1);
if (mBluetooth == null) {
+ Slog.d(TAG, "MESSAGE_ENABLE: handleEnable");
handleEnable(mQuietEnable);
} else {
//
@@ -1946,6 +2157,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
// continuously failed to turn on itself.
//
mWaitForEnableRetry = 0;
+ Slog.d(TAG, "Re-Queue MESSAGE_HANDLE_ENABLE_DELAYED");
Message enableDelayedMsg =
mHandler.obtainMessage(MESSAGE_HANDLE_ENABLE_DELAYED);
mHandler.sendMessageDelayed(enableDelayedMsg, ENABLE_DISABLE_DELAY_MS);
@@ -1955,15 +2167,45 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
case MESSAGE_DISABLE:
if (mHandler.hasMessages(MESSAGE_HANDLE_DISABLE_DELAYED) || mBinding
|| mHandler.hasMessages(MESSAGE_HANDLE_ENABLE_DELAYED)) {
- // We are handling enable or disable right now, wait for it.
- mHandler.sendMessageDelayed(mHandler.obtainMessage(MESSAGE_DISABLE),
- ENABLE_DISABLE_DELAY_MS);
+ if (msg.arg2 == 0) {
+ int delay = ENABLE_DISABLE_DELAY_MS;
+
+ if (mHandler.hasMessages(MESSAGE_ENABLE)) {
+ delay = ENABLE_DISABLE_DELAY_MS * 2;
+ }
+ // Keep only one MESSAGE_DISABLE and ensure it is the last one
+ // to be taken out of the queue
+ mHandler.removeMessages(MESSAGE_DISABLE);
+ // We are handling enable or disable right now, wait for it.
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_DISABLE, 0, 1), delay);
+ Slog.d(TAG, "Queue new MESSAGE_DISABLE");
+ } else {
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_DISABLE, 0, 1), ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue previous MESSAGE_DISABLE");
+ if (mHandler.hasMessages(MESSAGE_ENABLE)) {
+ // Ensure the original order of just entering the queue
+ // if MESSAGE_DISABLE present
+ mHandler.removeMessages(MESSAGE_ENABLE);
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_ENABLE, mQuietEnableExternal ? 1: 0, 1),
+ ENABLE_DISABLE_DELAY_MS * 2);
+ Slog.d(TAG, "Re-Queue previous MESSAGE_ENABLE");
+ }
+ }
+ break;
+ } else if(msg.arg2 == 0 && mHandler.hasMessages(MESSAGE_ENABLE)) {
+ mHandler.removeMessages(MESSAGE_DISABLE);
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ MESSAGE_DISABLE, 0, 1), ENABLE_DISABLE_DELAY_MS * 2);
+ Slog.d(TAG, "MESSAGE_ENABLE exist. Queue new MESSAGE_DISABLE");
break;
}
if (DBG) {
Slog.d(TAG, "MESSAGE_DISABLE: mBluetooth = " + mBluetooth
- + ", mBinding = " + mBinding);
+ + ", mBinding = " + mBinding + " mEnable = " + mEnable);
}
mHandler.removeMessages(MESSAGE_RESTART_BLUETOOTH_SERVICE);
@@ -1972,20 +2214,51 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Message disableDelayedMsg =
mHandler.obtainMessage(MESSAGE_HANDLE_DISABLE_DELAYED, 0, 0);
mHandler.sendMessageDelayed(disableDelayedMsg, ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue MESSAGE_HANDLE_DISABLE_DELAYED(0)");
} else {
mEnable = false;
handleDisable();
+ Slog.d(TAG, "MESSAGE_DISABLE: handleDisable");
}
break;
case MESSAGE_HANDLE_ENABLE_DELAYED: {
- // The Bluetooth is turning off, wait for STATE_OFF
- if (mState != BluetoothAdapter.STATE_OFF) {
+ /* The Bluetooth is turning off, wait for STATE_OFF then restart bluetooth
+ * if ble app running, then wait for BLE ON and continue bt turn on
+ */
+ Slog.d(TAG, "MESSAGE_HANDLE_ENABLE_DELAYED, mState=" +
+ BluetoothAdapter.nameForState(mState) + " mEnableExternal = "
+ + mEnableExternal + " getServiceRestartMs()="
+ + getServiceRestartMs());
+ if ((mState == BluetoothAdapter.STATE_BLE_ON) && (isBleAppPresent() ||
+ mWaitForEnableRetry > 0)) {
+ Slog.d(TAG, "isBleAppPresent(): " + isBleAppPresent() +
+ " mWaitForEnableRetry=" + mWaitForEnableRetry);
+ mWaitForEnableRetry = 0;
+ if (mEnableExternal || isBluetoothPersistedStateOnBluetooth()) {
+ try {
+ mBluetoothLock.readLock().lock();
+ if (mBluetooth != null) {
+ mBluetooth.updateQuietModeStatus(mQuietEnable,
+ mContext.getAttributionSource());
+ mBluetooth.onLeServiceUp(mContext.getAttributionSource());
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "", e);
+ } finally {
+ mBluetoothLock.readLock().unlock();
+ }
+ } else {
+ Slog.e(TAG, "BLE app running stay in BLE ON state");
+ }
+ break;
+ } else if (mState != BluetoothAdapter.STATE_OFF) {
if (mWaitForEnableRetry < MAX_WAIT_FOR_ENABLE_DISABLE_RETRIES) {
mWaitForEnableRetry++;
Message enableDelayedMsg =
mHandler.obtainMessage(MESSAGE_HANDLE_ENABLE_DELAYED);
mHandler.sendMessageDelayed(enableDelayedMsg, ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue MESSAGE_HANDLE_ENABLE_DELAYED");
break;
} else {
Slog.e(TAG, "Wait for STATE_OFF timeout");
@@ -1997,6 +2270,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Message restartMsg =
mHandler.obtainMessage(MESSAGE_RESTART_BLUETOOTH_SERVICE);
mHandler.sendMessageDelayed(restartMsg, getServiceRestartMs());
+ Slog.d(TAG, "Queue MESSAGE_RESTART_BLUETOOTH_SERVICE");
Slog.d(TAG, "Handle enable is finished");
break;
}
@@ -2005,14 +2279,25 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
boolean disabling = (msg.arg1 == 1);
Slog.d(TAG, "MESSAGE_HANDLE_DISABLE_DELAYED: disabling:" + disabling);
if (!disabling) {
- // The Bluetooth is turning on, wait for STATE_ON
- if (mState != BluetoothAdapter.STATE_ON) {
+ /* if bluetooth is in BLE ON state and enable is from ble app
+ * then skip disable, else wait for complete ON or timeout.
+ */
+ if ((mState == BluetoothAdapter.STATE_BLE_ON) &&
+ !mEnableExternal &&
+ !isBluetoothPersistedStateOnBluetooth() &&
+ isBleAppPresent()) {
+ Slog.w(TAG, "Enable from BLE APP, stay in BLE ON");
+ mWaitForDisableRetry = 0;
+ mEnable = false;
+ break;
+ } else if (mState != BluetoothAdapter.STATE_ON) {
if (mWaitForDisableRetry < MAX_WAIT_FOR_ENABLE_DISABLE_RETRIES) {
mWaitForDisableRetry++;
Message disableDelayedMsg = mHandler.obtainMessage(
MESSAGE_HANDLE_DISABLE_DELAYED, 0, 0);
mHandler.sendMessageDelayed(disableDelayedMsg,
ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue MESSAGE_HANDLE_DISABLE_DELAYED(0)");
break;
} else {
Slog.e(TAG, "Wait for STATE_ON timeout");
@@ -2022,11 +2307,13 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
// should move forward to the next step.
mWaitForDisableRetry = 0;
mEnable = false;
+ Slog.d(TAG, "MESSAGE_HANDLE_DISABLE_DELAYED: handleDisable");
handleDisable();
// Wait for state exiting STATE_ON
Message disableDelayedMsg =
mHandler.obtainMessage(MESSAGE_HANDLE_DISABLE_DELAYED, 1, 0);
mHandler.sendMessageDelayed(disableDelayedMsg, ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue MESSAGE_HANDLE_DISABLE_DELAYED(1)");
} else {
// The Bluetooth is turning off, wait for exiting STATE_ON
if (mState == BluetoothAdapter.STATE_ON) {
@@ -2036,6 +2323,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
MESSAGE_HANDLE_DISABLE_DELAYED, 1, 0);
mHandler.sendMessageDelayed(disableDelayedMsg,
ENABLE_DISABLE_DELAY_MS);
+ Slog.d(TAG, "Re-Queue MESSAGE_HANDLE_DISABLE_DELAYED(1)");
break;
} else {
Slog.e(TAG, "Wait for exiting STATE_ON timeout");
@@ -2049,16 +2337,32 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
case MESSAGE_RESTORE_USER_SETTING:
- if ((msg.arg1 == RESTORE_SETTING_TO_OFF) && mEnable) {
+ if (msg.arg1 == RESTORE_SETTING_TO_OFF) {
if (DBG) {
Slog.d(TAG, "Restore Bluetooth state to disabled");
}
persistBluetoothSetting(BLUETOOTH_OFF);
mEnableExternal = false;
- sendDisableMsg(
- BluetoothProtoEnums.ENABLE_DISABLE_REASON_RESTORE_USER_SETTING,
- mContext.getPackageName());
- } else if ((msg.arg1 == RESTORE_SETTING_TO_ON) && !mEnable) {
+ clearBleApps();
+ try {
+ mBluetoothLock.readLock().lock();
+ mEnableExternal = false;
+ if (mBluetooth != null) {
+ if (mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) {
+ mEnable = false;
+ mBluetooth.onBrEdrDown(mContext.getAttributionSource());
+ } else {
+ sendDisableMsg(
+ BluetoothProtoEnums.ENABLE_DISABLE_REASON_RESTORE_USER_SETTING,
+ mContext.getPackageName());
+ }
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Unable to initiate disable", e);
+ } finally {
+ mBluetoothLock.readLock().unlock();
+ }
+ } else if (msg.arg1 == RESTORE_SETTING_TO_ON) {
if (DBG) {
Slog.d(TAG, "Restore Bluetooth state to enabled");
}
@@ -2070,6 +2374,11 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mContext.getPackageName());
}
break;
+ case MESSAGE_INFORM_ADAPTER_SERVICE_UP: {
+ if (DBG) Slog.d(TAG,"MESSAGE_INFORM_ADAPTER_SERVICE_UP");
+ sendBluetoothServiceUpCallback();
+ break;
+ }
case MESSAGE_REGISTER_STATE_CHANGE_CALLBACK: {
IBluetoothStateChangeCallback callback =
(IBluetoothStateChangeCallback) msg.obj;
@@ -2093,11 +2402,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
break;
}
case MESSAGE_BIND_PROFILE_SERVICE: {
+ Slog.w(TAG, "MESSAGE_BIND_PROFILE_SERVICE");
ProfileServiceConnections psc = (ProfileServiceConnections) msg.obj;
removeMessages(MESSAGE_BIND_PROFILE_SERVICE, msg.obj);
if (psc == null) {
+ Slog.w(TAG, "psc is null, breaking");
break;
}
+ Slog.w(TAG, "Calling psc.bindService from MESSAGE_BIND_PROFILE_SERVICE");
psc.bindService();
break;
}
@@ -2116,10 +2428,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
break;
} // else must be SERVICE_IBLUETOOTH
- //Remove timeout
- mHandler.removeMessages(MESSAGE_TIMEOUT_BIND);
-
mBinding = false;
+ mTryBindOnBindTimeout = false;
mBluetoothBinder = service;
mBluetooth = IBluetooth.Stub.asInterface(Binder.allowBlocking(service));
@@ -2139,7 +2449,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "Unable to register BluetoothCallback", re);
}
//Inform BluetoothAdapter instances that service is up
- sendBluetoothServiceUpCallback();
+ Message informMsg =
+ mHandler.obtainMessage(MESSAGE_INFORM_ADAPTER_SERVICE_UP);
+ mHandler.sendMessage(informMsg);
//Do enable request
try {
@@ -2154,7 +2466,21 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
if (!mEnable) {
- waitForState(Set.of(BluetoothAdapter.STATE_ON));
+ /* Wait for BLE ON or ON state ,if enable is from BLE app
+ * skip disable, else wait for on state and handle disable
+ */
+ waitForState(Set.of(BluetoothAdapter.STATE_BLE_ON,
+ BluetoothAdapter.STATE_ON));
+
+ int st = getState();
+ if ((st == BluetoothAdapter.STATE_TURNING_ON) ||
+ ((st == BluetoothAdapter.STATE_BLE_ON) &&
+ (mEnableExternal || isBluetoothPersistedStateOnBluetooth()))) {
+ waitForState(Set.of(BluetoothAdapter.STATE_ON));
+ } else if ((st == BluetoothAdapter.STATE_BLE_ON) && isBleAppPresent()) {
+ Slog.e(TAG, "MESSAGE_BLUETOOTH_SERVICE_CONNECTED: ble app present");
+ break;
+ }
handleDisable();
waitForState(Set.of(BluetoothAdapter.STATE_OFF,
BluetoothAdapter.STATE_TURNING_ON,
@@ -2182,8 +2508,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
== BluetoothAdapter.STATE_OFF) && (mBluetooth != null) && mEnable) {
recoverBluetoothServiceFromError(false);
}
- if ((prevState == BluetoothAdapter.STATE_TURNING_ON) && (newState
- == BluetoothAdapter.STATE_BLE_ON) && (mBluetooth != null) && mEnable) {
+ if ((prevState == BluetoothAdapter.STATE_TURNING_ON) &&
+ (newState == BluetoothAdapter.STATE_OFF) &&
+ (mBluetooth != null) && mEnable) {
+ persistBluetoothSetting(BLUETOOTH_OFF);
+ }
+ if ((prevState == BluetoothAdapter.STATE_TURNING_ON) &&
+ (newState == BluetoothAdapter.STATE_BLE_ON) &&
+ (mBluetooth != null) && mEnable) {
recoverBluetoothServiceFromError(true);
}
// If we tried to enable BT while BT was in the process of shutting down,
@@ -2193,6 +2525,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
== BluetoothAdapter.STATE_OFF)) {
if (mEnable) {
Slog.d(TAG, "Entering STATE_OFF but mEnabled is true; restarting.");
+ mHandler.removeMessages(MESSAGE_RESTART_BLUETOOTH_SERVICE);
waitForState(Set.of(BluetoothAdapter.STATE_OFF));
Message restartMsg =
mHandler.obtainMessage(MESSAGE_RESTART_BLUETOOTH_SERVICE);
@@ -2230,6 +2563,16 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mBluetoothLock.writeLock().unlock();
}
+ // Make sure BT process exit completely
+ int[] pids = Process.getPidsForCommands(
+ new String[]{ "com.android.bluetooth" });
+ if (pids != null && pids.length > 0) {
+ for(int pid : pids) {
+ Slog.e(TAG, "Killing BT process with PID = " + pid);
+ Process.killProcess(pid);
+ }
+ }
+
// log the unexpected crash
addCrashLog();
addActiveLog(BluetoothProtoEnums.ENABLE_DISABLE_REASON_CRASH,
@@ -2283,6 +2626,20 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mBluetoothLock.writeLock().lock();
mBinding = false;
mBluetoothLock.writeLock().unlock();
+ // Ensure try BIND for one more time
+ if(!mTryBindOnBindTimeout) {
+ int userID = ActivityManager.getCurrentUser();
+
+ Slog.d(TAG, "Current user: " + userID);
+ if (mBindingUserID == userID) {
+ Slog.e(TAG, " Trying to Bind again");
+ mTryBindOnBindTimeout = true;
+ handleEnable(mQuietEnable);
+ }
+ } else {
+ Slog.e(TAG, "Bind trails excedded");
+ mTryBindOnBindTimeout = false;
+ }
break;
}
case MESSAGE_TIMEOUT_UNBIND: {
@@ -2299,17 +2656,40 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
mHandler.removeMessages(MESSAGE_USER_SWITCHED);
- /* disable and enable BT when detect a user switch */
- if (mBluetooth != null && isEnabled()) {
- restartForReason(BluetoothProtoEnums.ENABLE_DISABLE_REASON_USER_SWITCH);
- } else if (mBinding || mBluetooth != null) {
- Message userMsg = mHandler.obtainMessage(MESSAGE_USER_SWITCHED);
- userMsg.arg2 = 1 + msg.arg2;
- // if user is switched when service is binding retry after a delay
- mHandler.sendMessageDelayed(userMsg, USER_SWITCHED_TIME_MS);
- if (DBG) {
- Slog.d(TAG, "Retry MESSAGE_USER_SWITCHED " + userMsg.arg2);
+ try {
+ mBluetoothLock.writeLock().lock();
+ int state = getState();
+
+ if (mBluetooth != null && ((state == BluetoothAdapter.STATE_ON) ||
+ (state == BluetoothAdapter.STATE_BLE_ON && isBleAppPresent()))) {
+
+ /* disable and enable BT when detect a user switch */
+ if (state == BluetoothAdapter.STATE_ON) {
+ restartForReason(
+ BluetoothProtoEnums.ENABLE_DISABLE_REASON_USER_SWITCH);
+ } else {
+ if (DBG) {
+ Slog.d(TAG, "Turn off from BLE state");
+ }
+ clearBleApps();
+ addActiveLog(BluetoothProtoEnums.ENABLE_DISABLE_REASON_USER_SWITCH,
+ mContext.getPackageName(), false);
+ mEnable = false;
+ mBluetooth.onBrEdrDown(mContext.getAttributionSource());
+ }
+ } else if (mBinding || mBluetooth != null) {
+ Message userMsg = mHandler.obtainMessage(MESSAGE_USER_SWITCHED);
+ userMsg.arg2 = 1 + msg.arg2;
+ // if user is switched when service is binding retry after a delay
+ mHandler.sendMessageDelayed(userMsg, USER_SWITCHED_TIME_MS);
+ if (DBG) {
+ Slog.d(TAG, "Retry MESSAGE_USER_SWITCHED " + userMsg.arg2);
+ }
}
+ } catch (RemoteException e) {
+ Slog.e(TAG, "MESSAGE_USER_SWITCHED: Remote exception", e);
+ } finally {
+ mBluetoothLock.writeLock().unlock();
}
break;
}
@@ -2390,7 +2770,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mState = BluetoothAdapter.STATE_TURNING_ON;
}
- waitForState(Set.of(BluetoothAdapter.STATE_ON));
+ /* wait for stable state BLE_ON or ON */
+ waitForState(Set.of(BluetoothAdapter.STATE_BLE_ON,
+ BluetoothAdapter.STATE_ON));
if (mState == BluetoothAdapter.STATE_TURNING_ON) {
bluetoothStateChangeHandler(mState, BluetoothAdapter.STATE_ON);
@@ -2399,28 +2781,49 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
unbindAllBluetoothProfileServices();
// disable
addActiveLog(reason, mContext.getPackageName(), false);
+
+ clearBleApps();
+
handleDisable();
// Pbap service need receive STATE_TURNING_OFF intent to close
bluetoothStateChangeHandler(BluetoothAdapter.STATE_ON,
BluetoothAdapter.STATE_TURNING_OFF);
+ /* wait for BLE_ON or OFF state. If its BLE ON state
+ * post BLE ON state to bluetoothStateChangeHandler
+ * to continue off and wait for off state
+ */
boolean didDisableTimeout =
- !waitForState(Set.of(BluetoothAdapter.STATE_OFF));
+ !waitForState(Set.of(BluetoothAdapter.STATE_BLE_ON,
+ BluetoothAdapter.STATE_OFF));
+
+ if(!didDisableTimeout) {
+ int state = getState();
+ if (state == BluetoothAdapter.STATE_BLE_ON) {
+ bluetoothStateChangeHandler(BluetoothAdapter.STATE_TURNING_OFF,
+ BluetoothAdapter.STATE_BLE_ON);
+ }
+
+ didDisableTimeout =
+ !waitForState(Set.of(BluetoothAdapter.STATE_OFF));
+ }
bluetoothStateChangeHandler(BluetoothAdapter.STATE_TURNING_OFF,
BluetoothAdapter.STATE_OFF);
sendBluetoothServiceDownCallback();
- try {
- mBluetoothLock.writeLock().lock();
- if (mBluetooth != null) {
- mBluetooth = null;
- // Unbind
- mContext.unbindService(mConnection);
+ if(!didDisableTimeout) {
+ try {
+ mBluetoothLock.writeLock().lock();
+ if (mBluetooth != null) {
+ mBluetooth = null;
+ // Unbind
+ mContext.unbindService(mConnection);
+ }
+ mBluetoothGatt = null;
+ } finally {
+ mBluetoothLock.writeLock().unlock();
}
- mBluetoothGatt = null;
- } finally {
- mBluetoothLock.writeLock().unlock();
}
//
@@ -2430,6 +2833,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
//
if (didDisableTimeout) {
SystemClock.sleep(3000);
+ mHandler.removeMessages(MESSAGE_BLUETOOTH_SERVICE_DISCONNECTED);
} else {
SystemClock.sleep(100);
}
@@ -2461,6 +2865,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mHandler.removeMessages(MESSAGE_TIMEOUT_BIND);
} else {
mBinding = true;
+ mBindingUserID = ActivityManager.getCurrentUser();
+ Slog.d(TAG, "Binding BT service. Current user: " + mBindingUserID);
}
} else if (mBluetooth != null) {
//Enable bluetooth
@@ -2543,6 +2949,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
intent.putExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, prevState);
intent.putExtra(BluetoothAdapter.EXTRA_STATE, newState);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
+ intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
mContext.sendBroadcastAsUser(intent, UserHandle.ALL, null, getTempAllowlistBroadcastOptions());
}
@@ -2573,9 +2980,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
if (newState == BluetoothAdapter.STATE_OFF) {
// If Bluetooth is off, send service down event to proxy objects, and unbind
if (DBG) {
- Slog.d(TAG, "Bluetooth is complete send Service Down");
+ Slog.d(TAG, "Bluetooth is complete off, send Service Down");
}
sendBluetoothServiceDownCallback();
+ sendBluetoothStateCallback(false);
unbindAndFinish();
sendBleStateChanged(prevState, newState);
@@ -2648,6 +3056,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
intent.putExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, prevState);
intent.putExtra(BluetoothAdapter.EXTRA_STATE, newState);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
+ intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
mContext.sendBroadcastAsUser(intent, UserHandle.ALL, null,
getTempAllowlistBroadcastOptions());
}
@@ -2655,7 +3064,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
private boolean waitForState(Set<Integer> states) {
int i = 0;
- while (i < 10) {
+ while (i < 16) {
try {
mBluetoothLock.readLock().lock();
if (mBluetooth == null) {
@@ -2677,6 +3086,52 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
return false;
}
+ /* TODO(b/151672214) - Update for change from waitForOnOff -> waitForState
+ private boolean waitForMonitoredState(Set<Integer> states) {
+ int i = 0;
+ while (i < 10) {
+ synchronized(mConnection) {
+ try {
+ if (mBluetooth == null) break;
+ if (on) {
+ if (mBluetooth.getState() == BluetoothAdapter.STATE_ON) return true;
+ if (mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) {
+ bluetoothStateChangeHandler(BluetoothAdapter.STATE_BLE_TURNING_ON,
+ BluetoothAdapter.STATE_BLE_ON);
+ if (mBluetoothGatt != null) {
+ Slog.d(TAG,"GattService is connected, execute waitForState");
+ boolean ret = waitForState(states);
+ return ret;
+ } else {
+ Slog.d(TAG,
+ "GattService connect in progress, return to avoid timeout");
+ return true;
+ }
+ }
+ } else if (off) {
+ if (mBluetooth.getState() == BluetoothAdapter.STATE_OFF) return true;
+ if (mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) {
+ bluetoothStateChangeHandler(BluetoothAdapter.STATE_TURNING_OFF,
+ BluetoothAdapter.STATE_BLE_ON);
+ boolean ret = waitForState(states);
+ return ret;
+ }
+ } else {
+ if (mBluetooth.getState() != BluetoothAdapter.STATE_ON) return true;
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "getState()", e);
+ break;
+ }
+ }
+ SystemClock.sleep(300);
+ i++;
+ }
+ Slog.e(TAG,"waitForMonitoredOnOff time out");
+ return false;
+ }
+ */
+
private void sendDisableMsg(int reason, String packageName) {
mHandler.sendMessage(mHandler.obtainMessage(MESSAGE_DISABLE));
addActiveLog(reason, packageName, false);
@@ -2736,29 +3191,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mBluetoothLock.readLock().unlock();
}
- SystemClock.sleep(500);
-
- // disable
- addActiveLog(BluetoothProtoEnums.ENABLE_DISABLE_REASON_START_ERROR,
- mContext.getPackageName(), false);
- handleDisable();
-
waitForState(Set.of(BluetoothAdapter.STATE_OFF));
sendBluetoothServiceDownCallback();
- try {
- mBluetoothLock.writeLock().lock();
- if (mBluetooth != null) {
- mBluetooth = null;
- // Unbind
- mContext.unbindService(mConnection);
- }
- mBluetoothGatt = null;
- } finally {
- mBluetoothLock.writeLock().unlock();
- }
-
mHandler.removeMessages(MESSAGE_BLUETOOTH_STATE_CHANGE);
mState = BluetoothAdapter.STATE_OFF;
diff --git a/services/core/java/com/android/server/BluetoothModeChangeHelper.java b/services/core/java/com/android/server/BluetoothModeChangeHelper.java
index 3642e4dccf34..2003ebec4a15 100644
--- a/services/core/java/com/android/server/BluetoothModeChangeHelper.java
+++ b/services/core/java/com/android/server/BluetoothModeChangeHelper.java
@@ -83,7 +83,8 @@ public class BluetoothModeChangeHelper {
@VisibleForTesting
public boolean isA2dpOrHearingAidConnected() {
- return isA2dpConnected() || isHearingAidConnected();
+ return isA2dpConnected() || isHearingAidConnected() ||
+ isBroadcastActive();
}
@VisibleForTesting
@@ -142,4 +143,8 @@ public class BluetoothModeChangeHelper {
}
return hearingAid.getConnectedDevices().size() > 0;
}
+
+ private boolean isBroadcastActive() {
+ return mAdapter.isBroadcastActive();
+ }
}
diff --git a/services/core/java/com/android/server/NetPluginDelegate.java b/services/core/java/com/android/server/NetPluginDelegate.java
new file mode 100644
index 000000000000..e167937745d8
--- /dev/null
+++ b/services/core/java/com/android/server/NetPluginDelegate.java
@@ -0,0 +1,161 @@
+/*
+ *Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ *Redistribution and use in source and binary forms, with or without
+ *modification, are permitted provided that the following conditions are
+ *met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ *ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ *BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ *IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.server;
+
+import dalvik.system.PathClassLoader;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import android.os.Environment;
+import android.util.Slog;
+import android.util.Log;
+import android.os.Handler;
+import android.net.NetworkSpecifier;
+
+public class NetPluginDelegate {
+
+ private static final String TAG = "NetPluginDelegate";
+ private static final boolean LOGV = true;
+
+ private static Class tcpBufferRelay = null;
+ private static Object tcpBufferManagerObj = null;
+ private static boolean extJarAvail = true;
+
+ private static Class vendorPropRelay = null;
+ private static Object vendorPropManagerObj = null;
+ private static boolean vendorPropJarAvail = true;
+
+ /*
+ * Returns applicable TCP buffer size based on the network specifier.
+ */
+ public static String get5GTcpBuffers(String currentTcpBuffer, NetworkSpecifier sepcifier) {
+ String tcpBuffer = currentTcpBuffer;
+ if (LOGV) Slog.v(TAG, "get5GTcpBuffers");
+ if (!extJarAvail || !loadConnExtJar())
+ return currentTcpBuffer;
+ try {
+ Object ret = tcpBufferRelay.getMethod("get5GTcpBuffers",
+ String.class, NetworkSpecifier.class).invoke(
+ tcpBufferManagerObj, currentTcpBuffer, sepcifier);
+
+ if(ret !=null && (ret instanceof String)){
+ tcpBuffer = (String) ret;
+ }
+ } catch (InvocationTargetException | SecurityException | NoSuchMethodException e) {
+ if (LOGV) {
+ Log.w(TAG, "Failed to invoke get5GTcpBuffers()");
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ } catch (Exception e) {
+ if (LOGV) {
+ Log.w(TAG, "Error calling get5GTcpBuffers Method on extension jar");
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ }
+ return tcpBuffer;
+ }
+
+ /*
+ * Provides the api to register a handler with the lib. This is used to send
+ * EVENT_UPDATE_TCP_BUFFER_FOR_5G message to the handler queue to take action on it.
+ */
+ public static void registerHandler(Handler mHandler) {
+ if (LOGV) Slog.v(TAG, "registerHandler");
+ if (!extJarAvail || !loadConnExtJar()) return;
+ try {
+ tcpBufferRelay.getMethod("registerHandler", Handler.class).invoke(
+ tcpBufferManagerObj, mHandler);
+ } catch (InvocationTargetException | SecurityException | NoSuchMethodException e) {
+ if (LOGV) {
+ Log.w(TAG, "Failed to call registerHandler");
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ } catch (Exception e) {
+ if (LOGV) {
+ Log.w(TAG, "Error calling registerHandler Method on extension jar");
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ }
+ }
+
+ /*
+ * Dynamically loads the lib.
+ * Checks whether the required lib is avalaiblable if not disables further attempts
+ * to load it.
+ */
+ private static synchronized boolean loadConnExtJar() {
+ final String realProvider = "com.qualcomm.qti.net.connextension.TCPBufferManager";
+ final String realProviderPath = Environment.getSystemExtDirectory().getAbsolutePath()
+ + "/framework/ConnectivityExt.jar";
+
+ if (tcpBufferRelay != null && tcpBufferManagerObj != null) {
+ return true;
+ }
+
+ extJarAvail = new File(realProviderPath).exists();
+ if (!extJarAvail) {
+ Log.w(TAG, "ConnectivityExt jar file not present");
+ return false;
+ }
+
+ if (tcpBufferRelay == null && tcpBufferManagerObj == null) {
+ if (LOGV) Slog.v(TAG, "loading ConnectivityExt jar");
+ try {
+ PathClassLoader classLoader = new PathClassLoader(realProviderPath,
+ ClassLoader.getSystemClassLoader());
+
+ tcpBufferRelay = classLoader.loadClass(realProvider);
+ tcpBufferManagerObj = tcpBufferRelay.newInstance();
+ if (LOGV) Slog.v(TAG, "ConnectivityExt jar loaded");
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+ if (LOGV) {
+ Log.w(TAG, "Failed to find, instantiate or access ConnectivityExt jar ");
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ return false;
+ } catch (Exception e) {
+ if (LOGV) {
+ Log.w(TAG, "unable to load ConnectivityExt jar");
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 3ea0ce173745..2f346076f656 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -311,7 +311,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
public void sendCallback(INetworkManagementEventObserver o) throws RemoteException;
}
- private void invokeForAllObservers(NetworkManagementEventCallback eventCallback) {
+ private synchronized void invokeForAllObservers(NetworkManagementEventCallback eventCallback) {
final int length = mObservers.beginBroadcast();
try {
for (int i = 0; i < length; i++) {
diff --git a/services/core/java/com/android/server/NetworkTimeUpdateService.java b/services/core/java/com/android/server/NetworkTimeUpdateService.java
index ff2308c35b9f..051ae680a9fa 100644
--- a/services/core/java/com/android/server/NetworkTimeUpdateService.java
+++ b/services/core/java/com/android/server/NetworkTimeUpdateService.java
@@ -159,7 +159,7 @@ public class NetworkTimeUpdateService extends Binder {
NtpTrustedTime.TimeResult cachedNtpResult = mTime.getCachedTimeResult();
if (cachedNtpResult == null || cachedNtpResult.getAgeMillis() >= mPollingIntervalMs) {
if (DBG) Log.d(TAG, "Stale NTP fix; forcing refresh");
- mTime.forceRefresh();
+ mTime.forceSync();
cachedNtpResult = mTime.getCachedTimeResult();
}
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 8727932a87f7..0a81c9d12b94 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -157,6 +157,7 @@ import com.android.server.storage.StorageSessionController;
import com.android.server.storage.StorageSessionController.ExternalStorageServiceException;
import com.android.server.wm.ActivityTaskManagerInternal;
import com.android.server.wm.ActivityTaskManagerInternal.ScreenObserver;
+import com.android.internal.widget.ILockSettings;
import libcore.io.IoUtils;
import libcore.util.EmptyArray;
@@ -2984,16 +2985,32 @@ class StorageManagerService extends IStorageManager.Stub
throw new IllegalArgumentException("password cannot be empty");
}
- if (DEBUG_EVENTS) {
- Slog.i(TAG, "changing encryption password...");
- }
+ synchronized (mLock) {
+ if (DEBUG_EVENTS) {
+ Slog.i(TAG, "changing encryption password...");
+ }
- try {
- mVold.fdeChangePassword(type, password);
- return 0;
- } catch (Exception e) {
- Slog.wtf(TAG, e);
- return -1;
+ ILockSettings lockSettings = ILockSettings.Stub.asInterface(
+ ServiceManager.getService("lock_settings"));
+ String currentPassword="default_password";
+ try {
+ currentPassword = lockSettings.getPassword();
+ } catch (Exception e) {
+ Slog.wtf(TAG, "Couldn't get password" + e);
+ }
+
+ try {
+ mVold.fdeChangePassword(type, currentPassword, password);
+ try {
+ lockSettings.sanitizePassword();
+ } catch (Exception e) {
+ Slog.wtf(TAG, "Couldn't sanitize password" + e);
+ }
+ return 0;
+ } catch (Exception e) {
+ Slog.wtf(TAG, e);
+ return -1;
+ }
}
}
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index a8a24f19f6ba..2bb937a26299 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -2390,6 +2390,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
}
handleRemoveListLocked();
}
+ broadcastRadioPowerStateChanged(state, phoneId, subId);
}
@Override
@@ -2881,6 +2882,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
*/
public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
+ /**
+ * Broadcast Action: The radio power state has changed.
+ */
+ private static final String ACTION_RADIO_POWER_STATE_CHANGED =
+ "org.codeaurora.intent.action.RADIO_POWER_STATE";
+
private void broadcastServiceStateChanged(ServiceState state, int phoneId, int subId) {
final long ident = Binder.clearCallingIdentity();
try {
@@ -2929,6 +2936,19 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
Manifest.permission.ACCESS_FINE_LOCATION});
}
+ private void broadcastRadioPowerStateChanged(int state, int phoneId, int subId) {
+ Intent intent = new Intent(ACTION_RADIO_POWER_STATE_CHANGED);
+ intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
+ // Pass the subscription along with the intent.
+ intent.putExtra(PHONE_CONSTANTS_SUBSCRIPTION_KEY, subId);
+ intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
+ intent.putExtra(PHONE_CONSTANTS_SLOT_KEY, phoneId);
+ intent.putExtra(SubscriptionManager.EXTRA_SLOT_INDEX, phoneId);
+ intent.putExtra(PHONE_CONSTANTS_STATE_KEY, state);
+ mContext.sendBroadcastAsUser(intent, UserHandle.ALL,
+ Manifest.permission.READ_PRIVILEGED_PHONE_STATE);
+ }
+
private void broadcastSignalStrengthChanged(SignalStrength signalStrength, int phoneId,
int subId) {
final long ident = Binder.clearCallingIdentity();
diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java
index d10ab8e2d0dd..7119dc85e2e0 100644
--- a/services/core/java/com/android/server/Watchdog.java
+++ b/services/core/java/com/android/server/Watchdog.java
@@ -46,6 +46,7 @@ import com.android.internal.os.ZygoteConnectionConstants;
import com.android.internal.util.FrameworkStatsLog;
import com.android.server.am.ActivityManagerService;
import com.android.server.am.TraceErrorLogger;
+import com.android.server.am.trace.SmartTraceUtils;
import com.android.server.wm.SurfaceAnimationThread;
import java.io.BufferedReader;
@@ -53,7 +54,9 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
+import java.io.FileReader;
import java.io.IOException;
+import java.io.BufferedReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
@@ -62,6 +65,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
+import java.util.Date;
+import java.text.SimpleDateFormat;
/** This class calls its monitor every minute. Killing this process if they don't return **/
public class Watchdog {
@@ -102,6 +107,7 @@ public class Watchdog {
"/system/bin/keystore2",
"/system/bin/mediadrmserver",
"/system/bin/mediaserver",
+ "/system/bin/mediaserver64",
"/system/bin/netd",
"/system/bin/sdcard",
"/system/bin/surfaceflinger",
@@ -161,6 +167,7 @@ public class Watchdog {
private IActivityController mController;
private boolean mAllowRestart = true;
+ SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MM_HH_mm_ss.SSS");
private final List<Integer> mInterestingJavaPids = new ArrayList<>();
private final TraceErrorLogger mTraceErrorLogger;
@@ -577,7 +584,7 @@ public class Watchdog {
}
}
- static ArrayList<Integer> getInterestingNativePids() {
+ public static ArrayList<Integer> getInterestingNativePids() {
HashSet<Integer> pids = new HashSet<>();
addInterestingAidlPids(pids);
addInterestingHidlPids(pids);
@@ -594,6 +601,7 @@ public class Watchdog {
private void run() {
boolean waitedHalf = false;
+ File initialStack = null;
while (true) {
List<HandlerChecker> blockedCheckers = Collections.emptyList();
String subject = "";
@@ -663,10 +671,15 @@ public class Watchdog {
} // END synchronized (mLock)
if (doWaitedHalfDump) {
+ ArrayList<Integer> nativePids = getInterestingNativePids();
// We've waited half the deadlock-detection interval. Pull a stack
// trace and wait another half.
- ActivityManagerService.dumpStackTraces(pids, null, null,
- getInterestingNativePids(), null, subject);
+ initialStack = ActivityManagerService.dumpStackTraces(pids, null, null,
+ nativePids, null, subject);
+ if (initialStack != null){
+ SmartTraceUtils.dumpStackTraces(Process.myPid(), pids,
+ nativePids, initialStack);
+ }
continue;
}
@@ -687,15 +700,30 @@ public class Watchdog {
// Perfetto. Ideally, the Perfetto trace capture should happen as close to the
// point in time when the Watchdog happens as possible.
FrameworkStatsLog.write(FrameworkStatsLog.SYSTEM_SERVER_WATCHDOG_OCCURRED, subject);
+ ArrayList<Integer> nativePids = getInterestingNativePids();
long anrTime = SystemClock.uptimeMillis();
StringBuilder report = new StringBuilder();
report.append(MemoryPressureUtil.currentPsiState());
ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(false);
StringWriter tracesFileException = new StringWriter();
- final File stack = ActivityManagerService.dumpStackTraces(
- pids, processCpuTracker, new SparseArray<>(), getInterestingNativePids(),
+ final File finalStack = ActivityManagerService.dumpStackTraces(
+ pids, processCpuTracker, new SparseArray<>(), nativePids,
tracesFileException, subject);
+ if (finalStack != null){
+ SmartTraceUtils.dumpStackTraces(Process.myPid(), pids, nativePids, finalStack);
+ }
+ //Collect Binder State logs to get status of all the transactions
+ if (Build.IS_DEBUGGABLE) {
+ binderStateRead();
+ }
+
+ long dueTime = 0;
+ if(SmartTraceUtils.isPerfettoDumpEnabled()){
+ SmartTraceUtils.traceStart();
+ //delay 30s to make sure perfetto trace dumped completely
+ dueTime = SystemClock.uptimeMillis() + 30000;
+ }
// Give some extra time to make sure the stack traces get written.
// The system's been hanging for a minute, another second or two won't hurt much.
@@ -705,9 +733,54 @@ public class Watchdog {
report.append(processCpuTracker.printCurrentState(anrTime));
report.append(tracesFileException.getBuffer());
- // Trigger the kernel to dump all blocked threads, and backtraces on all CPUs to the kernel log
- doSysRq('w');
- doSysRq('l');
+ File watchdogTraces;
+ String newTracesPath = "traces_SystemServer_WDT"
+ + mTraceDateFormat.format(new Date()) + "_pid"
+ + String.valueOf(Process.myPid());
+ File tracesDir = new File(ActivityManagerService.ANR_TRACE_DIR);
+ watchdogTraces = new File(tracesDir, newTracesPath);
+ try {
+ if (watchdogTraces.createNewFile()) {
+ FileUtils.setPermissions(watchdogTraces.getAbsolutePath(),
+ 0600, -1, -1); // -rw------- permissions
+
+ // Append both traces from the first and second half
+ // to a new file, making it easier to debug Watchdog timeouts
+ // dumpStackTraces() can return a null instance, so check the same
+ if (initialStack != null) {
+ // check the last-modified time of this file.
+ // we are interested in this only it was written to in the
+ // last 5 minutes or so
+ final long age = System.currentTimeMillis()
+ - initialStack.lastModified();
+ final long FIVE_MINUTES_IN_MILLIS = 1000 * 60 * 5;
+ if (age < FIVE_MINUTES_IN_MILLIS) {
+ Slog.e(TAG, "First set of traces taken from "
+ + initialStack.getAbsolutePath());
+ appendFile(watchdogTraces, initialStack);
+ } else {
+ Slog.e(TAG, "First set of traces were collected more than "
+ + "5 minutes ago, ignoring ...");
+ }
+ } else {
+ Slog.e(TAG, "First set of traces are empty!");
+ }
+
+ if (finalStack != null) {
+ Slog.e(TAG, "Second set of traces taken from "
+ + finalStack.getAbsolutePath());
+ appendFile(watchdogTraces, finalStack);
+ } else {
+ Slog.e(TAG, "Second set of traces are empty!");
+ }
+ } else {
+ Slog.w(TAG, "Unable to create Watchdog dump file: createNewFile failed");
+ }
+ } catch (Exception e) {
+ // catch any exception that happens here;
+ // why kill the system when it is going to die anyways?
+ Slog.e(TAG, "Exception creating Watchdog dump file:", e);
+ }
// Try to add the error to the dropbox, but assuming that the ActivityManager
// itself may be deadlocked. (which has happened, causing this statement to
@@ -719,16 +792,34 @@ public class Watchdog {
if (mActivity != null) {
mActivity.addErrorToDropBox(
"watchdog", null, "system_server", null, null, null,
- null, report.toString(), stack, null, null, null,
+ null, report.toString(), finalStack, null, null, null,
errorId);
}
}
- };
+ };
dropboxThread.start();
try {
dropboxThread.join(2000); // wait up to 2 seconds for it to return.
} catch (InterruptedException ignored) {}
+ // At times, when user space watchdog traces don't give an indication on
+ // which component held a lock, because of which other threads are blocked,
+ // (thereby causing Watchdog), trigger kernel panic
+ boolean crashOnWatchdog = SystemProperties
+ .getBoolean("persist.sys.crashOnWatchdog", false);
+ if (crashOnWatchdog) {
+ // Trigger the kernel to dump all blocked threads, and backtraces
+ // on all CPUs to the kernel log
+ Slog.e(TAG, "Triggering SysRq for system_server watchdog");
+ doSysRq('w');
+ doSysRq('l');
+
+ // wait until the above blocked threads be dumped into kernel log
+ SystemClock.sleep(3000);
+
+ doSysRq('c');
+ }
+
IActivityController controller;
synchronized (mLock) {
controller = mController;
@@ -762,6 +853,13 @@ public class Watchdog {
Slog.w(TAG, "*** WATCHDOG KILLING SYSTEM PROCESS: " + subject);
WatchdogDiagnostics.diagnoseCheckers(blockedCheckers);
Slog.w(TAG, "*** GOODBYE!");
+ if(SmartTraceUtils.isPerfettoDumpEnabled() && dueTime > SystemClock.uptimeMillis()){
+ long timeDelta = dueTime - SystemClock.uptimeMillis();
+ // wait until perfetto log to be dumped completely
+ Slog.i(TAG,"Sleep "+ timeDelta
+ +" ms to make sure perfetto log to be dumped completely");
+ SystemClock.sleep(timeDelta);
+ }
if (!Build.IS_USER && isCrashLoopFound()
&& !WatchdogProperties.should_ignore_fatal_count().orElse(false)) {
breakCrashLoop();
@@ -886,4 +984,59 @@ public class Watchdog {
}
doSysRq('c');
}
+
+ private void appendFile (File writeTo, File copyFrom) {
+ try {
+ BufferedReader in = new BufferedReader(new FileReader(copyFrom));
+ FileWriter out = new FileWriter(writeTo, true);
+ String line = null;
+
+ // Write line-by-line from "copyFrom" to "writeTo"
+ while ((line = in.readLine()) != null) {
+ out.write(line);
+ out.write('\n');
+ }
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ Slog.e(TAG, "Exception while writing watchdog traces to new file!");
+ e.printStackTrace();
+ }
+ }
+
+ private void binderStateRead() {
+ try {
+ boolean binderfsNodePresent = false;
+ BufferedReader in = null;
+ Slog.i(TAG,"Collecting Binder Transaction Status Information");
+ try {
+ in = new BufferedReader(new FileReader("/dev/binderfs/binder_logs/state"));
+ Slog.i(TAG, "Collecting Binder state file from binderfs");
+ binderfsNodePresent = true;
+ } catch(IOException e) {
+ Slog.i(TAG, "Binderfs node not found, Trying to collect it from debugfs", e);
+ }
+ try {
+ if (binderfsNodePresent == false) {
+ in = new BufferedReader(new FileReader("/sys/kernel/debug/binder/state"));
+ Slog.i(TAG, "Collecting Binder state file from debugfs");
+ }
+ } catch(IOException e) {
+ Slog.i(TAG, "Debugfs node not found", e);
+ }
+ FileWriter out = new FileWriter("/data/anr/BinderTraces_pid" +
+ String.valueOf(Process.myPid()) + ".txt");
+ String line = null;
+
+ // Write line-by-line
+ while ((line = in.readLine()) != null) {
+ out.write(line);
+ out.write('\n');
+ }
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ Slog.w(TAG, "Failed to collect state file", e);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/WiredAccessoryManager.java b/services/core/java/com/android/server/WiredAccessoryManager.java
index 7fa93c045ce0..b3a45079ed5e 100644
--- a/services/core/java/com/android/server/WiredAccessoryManager.java
+++ b/services/core/java/com/android/server/WiredAccessoryManager.java
@@ -70,6 +70,14 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
private static final String NAME_H2W = "h2w";
private static final String NAME_USB_AUDIO = "usb_audio";
private static final String NAME_HDMI_AUDIO = "hdmi_audio";
+ private static final String NAME_DP_AUDIO = "soc:qcom,msm-ext-disp";
+ // within a device, a single stream supports DP
+ private static final String[] DP_AUDIO_CONNS = {
+ NAME_DP_AUDIO + "/3/0",
+ NAME_DP_AUDIO + "/2/0",
+ NAME_DP_AUDIO + "/1/0",
+ NAME_DP_AUDIO + "/0/0"
+ };
private static final String NAME_HDMI = "hdmi";
private static final int MSG_NEW_DEVICE_STATE = 1;
@@ -81,6 +89,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
private final AudioManager mAudioManager;
private int mHeadsetState;
+ private int mDpCount;
private int mSwitchValues;
@@ -123,7 +132,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
}
- if (ExtconUEventObserver.extconExists()) {
+ if (ExtconUEventObserver.extconExists() && mExtconObserver.uEventCount() > 0) {
if (mUseDevInputEventForAudioJack) {
Log.w(TAG, "Both input event and extcon are used for audio jack,"
+ " please just choose one.");
@@ -172,7 +181,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
break;
}
- updateLocked(NAME_H2W,
+ updateLocked(NAME_H2W, "",
(mHeadsetState & ~(BIT_HEADSET | BIT_HEADSET_NO_MIC | BIT_LINEOUT)) | headset);
}
}
@@ -193,25 +202,33 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
* results in support for the last one plugged in. Similarly, unplugging either is seen as
* unplugging all.
*
+ * For Display port allow upto two connections.
+ * Block display port request if HDMI already connected and vice versa.
+ *
* @param newName One of the NAME_xxx variables defined above.
* @param newState 0 or one of the BIT_xxx variables defined above.
*/
- private void updateLocked(String newName, int newState) {
+ private void updateLocked(String newName, String address, int newState) {
// Retain only relevant bits
int headsetState = newState & SUPPORTED_HEADSETS;
+ int newDpState = newState & BIT_HDMI_AUDIO;
int usb_headset_anlg = headsetState & BIT_USB_HEADSET_ANLG;
int usb_headset_dgtl = headsetState & BIT_USB_HEADSET_DGTL;
int h2w_headset = headsetState & (BIT_HEADSET | BIT_HEADSET_NO_MIC | BIT_LINEOUT);
boolean h2wStateChange = true;
boolean usbStateChange = true;
+ boolean dpBitState = (mHeadsetState & BIT_HDMI_AUDIO) > 0 ? true: false;
+ boolean dpCountState = (mDpCount == 0) ? false: true;
+
if (LOG) {
Slog.v(TAG, "newName=" + newName
+ " newState=" + newState
+ " headsetState=" + headsetState
- + " prev headsetState=" + mHeadsetState);
+ + " prev headsetState=" + mHeadsetState
+ + " num of active dp conns= " + mDpCount);
}
- if (mHeadsetState == headsetState) {
+ if (mHeadsetState == headsetState && !newName.startsWith(NAME_DP_AUDIO)) {
Log.e(TAG, "No state change.");
return;
}
@@ -234,11 +251,45 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
return;
}
+ if (newName.startsWith(NAME_DP_AUDIO)) {
+ if ((newDpState > 0) && (mDpCount < DP_AUDIO_CONNS.length)
+ && (dpBitState == dpCountState)) {
+ // Allow DP0 if no HDMI previously connected.
+ // Allow second request only if DP connected previously.
+ mDpCount++;
+ } else if ((newDpState == 0) && (mDpCount > 0)){
+ mDpCount--;
+ } else {
+ Log.e(TAG, "No state change for DP.");
+ return;
+ }
+ }
+
mWakeLock.acquire();
Log.i(TAG, "MSG_NEW_DEVICE_STATE");
- Message msg = mHandler.obtainMessage(MSG_NEW_DEVICE_STATE, headsetState,
- mHeadsetState, "");
+
+ Message msg;
+ // send a combined name, address string separated by |
+ if (newName.startsWith(NAME_DP_AUDIO)) {
+ int pseudoHeadsetState = mHeadsetState;
+ if (dpBitState && (newDpState != 0)) {
+ // One DP already connected, so allow request to connect second.
+ pseudoHeadsetState = mHeadsetState & (~BIT_HDMI_AUDIO);
+ }
+ msg = mHandler.obtainMessage(MSG_NEW_DEVICE_STATE, headsetState,
+ pseudoHeadsetState,
+ NAME_DP_AUDIO+"/"+address);
+
+ if ((headsetState == 0) && (mDpCount != 0)) {
+ // Atleast one DP is connected, so keep mHeadsetState's DP bit set.
+ headsetState = headsetState | BIT_HDMI_AUDIO;
+ }
+ } else {
+ msg = mHandler.obtainMessage(MSG_NEW_DEVICE_STATE, headsetState,
+ mHeadsetState,
+ newName+"/"+address);
+ }
mHandler.sendMessage(msg);
mHeadsetState = headsetState;
@@ -261,12 +312,13 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
};
private void setDevicesState(
- int headsetState, int prevHeadsetState, String headsetName) {
+ int headsetState, int prevHeadsetState, String headsetNameAddr) {
synchronized (mLock) {
int allHeadsets = SUPPORTED_HEADSETS;
for (int curHeadset = 1; allHeadsets != 0; curHeadset <<= 1) {
if ((curHeadset & allHeadsets) != 0) {
- setDeviceStateLocked(curHeadset, headsetState, prevHeadsetState, headsetName);
+ setDeviceStateLocked(curHeadset, headsetState, prevHeadsetState,
+ headsetNameAddr);
allHeadsets &= ~curHeadset;
}
}
@@ -274,7 +326,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
}
private void setDeviceStateLocked(int headset,
- int headsetState, int prevHeadsetState, String headsetName) {
+ int headsetState, int prevHeadsetState, String headsetNameAddr) {
if ((headsetState & headset) != (prevHeadsetState & headset)) {
int outDevice = 0;
int inDevice = 0;
@@ -305,15 +357,23 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
}
if (LOG) {
- Slog.v(TAG, "headsetName: " + headsetName +
- (state == 1 ? " connected" : " disconnected"));
+ Slog.v(TAG, "headset: " + headsetNameAddr +
+ (state == 1 ? " connected" : " disconnected"));
}
+ String[] hs = headsetNameAddr.split("/");
if (outDevice != 0) {
- mAudioManager.setWiredDeviceConnectionState(outDevice, state, "", headsetName);
+ if (LOG) {
+ Slog.v(TAG, "Output device address " + (hs.length > 1 ? hs[1] : "")
+ + " name " + hs[0]);
+ }
+ mAudioManager.setWiredDeviceConnectionState(outDevice, state,
+ (hs.length > 1 ? hs[1] : ""), hs[0]);
}
if (inDevice != 0) {
- mAudioManager.setWiredDeviceConnectionState(inDevice, state, "", headsetName);
+
+ mAudioManager.setWiredDeviceConnectionState(inDevice, state,
+ (hs.length > 1 ? hs[1] : ""), hs[0]);
}
}
}
@@ -342,7 +402,6 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
synchronized (mLock) {
if (LOG) Slog.v(TAG, "init()");
char[] buffer = new char[1024];
-
for (int i = 0; i < mUEventInfo.size(); ++i) {
UEventInfo uei = mUEventInfo.get(i);
try {
@@ -416,30 +475,111 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
}
}
+ for (String conn : DP_AUDIO_CONNS) {
+ // Monitor DisplayPort
+ if (LOG) {
+ Slog.v(TAG, "Monitor DP conn " + conn);
+ }
+ uei = new UEventInfo(conn, BIT_HDMI_AUDIO, 0, 0);
+ if (uei.checkSwitchExists()) {
+ retVal.add(uei);
+ } else {
+ Slog.w(TAG, "Conn " + conn + " does not have DP audio support");
+ }
+ }
return retVal;
}
@Override
public void onUEvent(UEventObserver.UEvent event) {
- if (LOG) Slog.v(TAG, "Headset UEVENT: " + event.toString());
+ String devPath = event.get("DEVPATH");
+ String name = event.get("NAME");
+ int state = 0;
+
+ if (name == null)
+ name = event.get("SWITCH_NAME");
try {
- String devPath = event.get("DEVPATH");
- String name = event.get("SWITCH_NAME");
- int state = Integer.parseInt(event.get("SWITCH_STATE"));
- synchronized (mLock) {
- updateStateLocked(devPath, name, state);
+ if (name.startsWith(NAME_DP_AUDIO)) {
+ String state_str = event.get("STATE");
+ int offset = 0;
+ int length = state_str.length();
+
+ //parse DP=1\nHDMI=1\0
+ while (offset < length) {
+ int equals = state_str.indexOf('=', offset);
+
+ if (equals > offset) {
+ String intf_name = state_str.substring(offset,
+ equals);
+
+ if (intf_name.equals("DP")) {
+ state = Integer.parseInt(
+ state_str.substring(equals + 1,
+ equals + 2));
+ break;
+ }
+ }
+
+ offset = equals + 3;
+ }
+ } else {
+ state = Integer.parseInt(event.get("SWITCH_STATE"));
}
} catch (NumberFormatException e) {
- Slog.e(TAG, "Could not parse switch state from event " + event);
+ Slog.i(TAG, "couldn't get state from event, checking node");
+
+ for (int i = 0; i < mUEventInfo.size(); ++i) {
+ UEventInfo uei = mUEventInfo.get(i);
+
+ if (name.equals(uei.getDevName())) {
+ char[] buffer = new char[1024];
+ int len = 0;
+
+ try {
+ FileReader file = new FileReader(
+ uei.getSwitchStatePath());
+ len = file.read(buffer, 0, 1024);
+ file.close();
+ } catch (FileNotFoundException e1) {
+ Slog.e(TAG, "file not found");
+ break;
+ } catch (Exception e11) {
+ Slog.e(TAG, "" , e11);
+ }
+
+ try {
+ state = Integer.parseInt(
+ (new String(buffer, 0, len)).trim());
+ } catch (NumberFormatException e2) {
+ Slog.e(TAG, "could not convert to number");
+ break;
+ }
+ break;
+ }
+ }
+ }
+
+ synchronized (mLock) {
+ updateStateLocked(devPath, name, state);
}
}
private void updateStateLocked(String devPath, String name, int state) {
for (int i = 0; i < mUEventInfo.size(); ++i) {
UEventInfo uei = mUEventInfo.get(i);
+ if (LOG) {
+ Slog.v(TAG, "uei.getDevPath=" + uei.getDevPath());
+ Slog.v(TAG, "uevent.getDevPath=" + devPath);
+ }
+
if (devPath.equals(uei.getDevPath())) {
- updateLocked(name, uei.computeNewHeadsetState(mHeadsetState, state));
+ if (state == 1 && mDpCount > 0) {
+ uei.setStreamIndex(mDpCount);
+ }
+ updateLocked(name, uei.getDevAddress(),
+ uei.computeNewHeadsetState(mHeadsetState,
+ state));
return;
}
}
@@ -447,27 +587,151 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
private final class UEventInfo {
private final String mDevName;
+ private String mDevAddress;
private final int mState1Bits;
private final int mState2Bits;
private final int mStateNbits;
+ private int mDevIndex;
+ private int mCableIndex;
- public UEventInfo(String devName, int state1Bits, int state2Bits, int stateNbits) {
+ public UEventInfo(String devName, int state1Bits,
+ int state2Bits, int stateNbits) {
mDevName = devName;
+ mDevAddress = "controller=0;stream=0";
mState1Bits = state1Bits;
mState2Bits = state2Bits;
mStateNbits = stateNbits;
+ mDevIndex = -1;
+ mCableIndex = -1;
+
+ if (mDevName.startsWith(NAME_DP_AUDIO)) {
+ int idx = mDevName.indexOf("/");
+ if (idx != -1) {
+ int idx2 = mDevName.indexOf("/", idx+1);
+ assert(idx2 != -1);
+ int dev = Integer.parseInt(mDevName.substring(idx+1, idx2));
+ int cable = Integer.parseInt(mDevName.substring(idx2+1));
+ if (LOG) {
+ Slog.v(TAG, "UEvent dev address " + mDevAddress);
+ }
+ checkDevIndex(dev);
+ checkCableIndex(cable);
+ }
+ }
+ }
+
+ private void checkDevIndex(int dev_index) {
+ int index = 0;
+ char[] buffer = new char[1024];
+ while (true) {
+ String devPath = String.format(Locale.US,
+ "/sys/devices/platform/soc/%s/extcon/extcon%d/name",
+ NAME_DP_AUDIO, dev_index);
+ if (LOG) {
+ Slog.v(TAG, "checkDevIndex " + devPath);
+ }
+ File f = new File(devPath);
+ if (!f.exists()) {
+ Slog.e(TAG, "file " + devPath + " not found");
+ break;
+ }
+ try {
+ FileReader file = new FileReader(f);
+ int len = file.read(buffer, 0, 1024);
+ file.close();
+
+ String devName = (new String(buffer, 0, len)).trim();
+ if (devName.startsWith(NAME_DP_AUDIO) && index == dev_index) {
+ Slog.e(TAG, "set dev_index " + dev_index);
+ mDevIndex = dev_index;
+ break;
+ } else {
+ index++;
+ }
+ } catch (Exception e) {
+ Slog.e(TAG, "checkDevIndex exception " , e);
+ break;
+ }
+ }
+ }
+
+ private void checkCableIndex(int cable_index) {
+ if (mDevIndex == -1) {
+ return;
+ }
+ int index = 0;
+ char[] buffer = new char[1024];
+ while (true)
+ {
+ String cablePath = String.format(Locale.US,
+ "/sys/devices/platform/soc/%s/extcon/extcon%d/cable.%d/name",
+ NAME_DP_AUDIO, mDevIndex, index);
+ if (LOG) {
+ Slog.v(TAG, "checkCableIndex " + cablePath);
+ }
+ File f = new File(cablePath);
+ if (!f.exists()) {
+ Slog.e(TAG, "file " + cablePath + " not found");
+ break;
+ }
+ try {
+ FileReader file = new FileReader(f);
+ int len = file.read(buffer, 0, 1024);
+ file.close();
+
+ String cableName = (new String(buffer, 0, len)).trim();
+ if (cableName.equals("DP") && index == cable_index) {
+ mCableIndex = index;
+ Slog.w(TAG, "checkCableIndex set cable " + cable_index);
+ break;
+ } else {
+ Slog.w(TAG, "checkCableIndex no name match, skip ");
+ index++;
+ }
+ } catch (Exception e) {
+ Slog.e(TAG, "checkCableIndex exception", e);
+ break;
+ }
+ }
+ }
+
+ public void setStreamIndex(int streamIndex) {
+ int index1 = mDevAddress.indexOf("=");
+ int index2 = mDevAddress.indexOf("=", index1 + 1);
+
+ String allExceptStreamIdx = mDevAddress.substring(0, index2 + 1);
+ mDevAddress = allExceptStreamIdx + String.valueOf(streamIndex);
}
public String getDevName() {
return mDevName;
}
+ public String getDevAddress() { return mDevAddress; }
+
public String getDevPath() {
- return String.format(Locale.US, "/devices/virtual/switch/%s", mDevName);
+ if (mDevName.startsWith(NAME_DP_AUDIO)) {
+ return String.format(Locale.US,
+ "/devices/platform/soc/%s/extcon/extcon%d",
+ NAME_DP_AUDIO,
+ mDevIndex);
+ } else {
+ return String.format(Locale.US,
+ "/devices/virtual/switch/%s",
+ mDevName);
+ }
}
public String getSwitchStatePath() {
- return String.format(Locale.US, "/sys/class/switch/%s/state", mDevName);
+ if (mDevName.startsWith(NAME_DP_AUDIO)) {
+ return String.format(Locale.US,
+ "/sys/devices/platform/soc/%s/extcon/extcon%d/cable.%d/state",
+ NAME_DP_AUDIO, mDevIndex, mCableIndex);
+ } else {
+ return String.format(Locale.US,
+ "/sys/class/switch/%s/state",
+ mDevName);
+ }
}
public boolean checkSwitchExists() {
@@ -518,6 +782,10 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
}
+ public int uEventCount() {
+ return mExtconInfos.size();
+ }
+
@Override
public Pair<Integer, Integer> parseState(ExtconInfo extconInfo, String status) {
if (LOG) Slog.v(TAG, "status " + status);
@@ -538,7 +806,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
synchronized (mLock) {
int mask = maskAndState.first;
int state = maskAndState.second;
- updateLocked(name, mHeadsetState & ~(mask & ~state) | (mask & state));
+ updateLocked(name, "", mHeadsetState & ~(mask & ~state) | (mask & state));
return;
}
}
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 400b084ee966..6a439622627c 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -1488,6 +1488,7 @@ public class AccountManagerService
@Override
public String getPassword(Account account) {
+ android.util.SeempLog.record(14);
int callingUid = Binder.getCallingUid();
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "getPassword: " + account
@@ -1568,6 +1569,7 @@ public class AccountManagerService
@Override
public String getUserData(Account account, String key) {
+ android.util.SeempLog.record(15);
final int callingUid = Binder.getCallingUid();
if (Log.isLoggable(TAG, Log.VERBOSE)) {
String msg = String.format("getUserData( account: %s, key: %s, callerUid: %s, pid: %s",
@@ -2638,6 +2640,7 @@ public class AccountManagerService
@Override
public void setPassword(Account account, String password) {
+ android.util.SeempLog.record(18);
final int callingUid = Binder.getCallingUid();
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "setAuthToken: " + account
@@ -2704,6 +2707,7 @@ public class AccountManagerService
@Override
public void clearPassword(Account account) {
+ android.util.SeempLog.record(19);
final int callingUid = Binder.getCallingUid();
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "clearPassword: " + account
@@ -2730,6 +2734,7 @@ public class AccountManagerService
@Override
public void setUserData(Account account, String key, String value) {
+ android.util.SeempLog.record(20);
final int callingUid = Binder.getCallingUid();
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "setUserData: " + account
@@ -3238,6 +3243,7 @@ public class AccountManagerService
public void addAccount(final IAccountManagerResponse response, final String accountType,
final String authTokenType, final String[] requiredFeatures,
final boolean expectActivityLaunch, final Bundle optionsIn) {
+ android.util.SeempLog.record(16);
Bundle.setDefusable(optionsIn, true);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "addAccount: accountType " + accountType
@@ -3989,6 +3995,7 @@ public class AccountManagerService
@Override
public void editProperties(IAccountManagerResponse response, final String accountType,
final boolean expectActivityLaunch) {
+ android.util.SeempLog.record(21);
final int callingUid = Binder.getCallingUid();
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "editProperties: accountType " + accountType
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 9a371f3b0b31..3e905960d4df 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -140,6 +140,7 @@ import android.stats.devicepolicy.DevicePolicyEnums;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.EventLog;
import android.util.Pair;
import android.util.PrintWriterPrinter;
@@ -167,6 +168,7 @@ import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.am.ActivityManagerService.ItemMatcher;
import com.android.server.uri.NeededUriGrants;
+import com.android.server.wm.ActivityRecord;
import com.android.server.wm.ActivityServiceConnectionsHolder;
import java.io.FileDescriptor;
@@ -181,6 +183,10 @@ import java.util.Objects;
import java.util.Set;
import java.util.function.Predicate;
+import vendor.qti.hardware.servicetracker.V1_0.IServicetracker;
+import vendor.qti.hardware.servicetracker.V1_0.ServiceData;
+import vendor.qti.hardware.servicetracker.V1_0.ClientData;
+
public final class ActiveServices {
private static final String TAG = TAG_WITH_CLASS_NAME ? "ActiveServices" : TAG_AM;
private static final String TAG_MU = TAG + POSTFIX_MU;
@@ -219,6 +225,12 @@ public final class ActiveServices {
// at the same time.
final int mMaxStartingBackground;
+ //mPerf Object
+ public static BoostFramework mPerf = new BoostFramework();
+
+ // Flag to reschedule the services during app launch. Disable by default.
+ private static boolean SERVICE_RESCHEDULE = false;
+
/**
* Master service bookkeeping, keyed by user number.
*/
@@ -292,6 +304,8 @@ public final class ActiveServices {
/** Amount of time to allow a last ANR message to exist before freeing the memory. */
static final int LAST_ANR_LIFETIME_DURATION_MSECS = 2 * 60 * 60 * 1000; // Two hours
+ private IServicetracker mServicetracker;
+
String mLastAnrDump;
AppWidgetManagerInternal mAppWidgetManagerInternal;
@@ -518,6 +532,9 @@ public final class ActiveServices {
? maxBg : ActivityManager.isLowRamDeviceStatic() ? 1 : 8;
final IBinder b = ServiceManager.getService(Context.PLATFORM_COMPAT_SERVICE);
+
+ if(mPerf != null)
+ SERVICE_RESCHEDULE = Boolean.parseBoolean(mPerf.perfGetProp("ro.vendor.qti.am.reschedule_service", "false"));
}
void systemServicesReady() {
@@ -540,6 +557,24 @@ public final class ActiveServices {
}
}
+ private boolean getServicetrackerInstance() {
+ if (mServicetracker == null ) {
+ try {
+ mServicetracker = IServicetracker.getService(false);
+ } catch (java.util.NoSuchElementException e) {
+ // Service doesn't exist or cannot be opened logged below
+ } catch (RemoteException e) {
+ if (DEBUG_SERVICE) Slog.e(TAG, "Failed to get servicetracker interface", e);
+ return false;
+ }
+ if (mServicetracker == null) {
+ if (DEBUG_SERVICE) Slog.w(TAG, "servicetracker HIDL not available");
+ return false;
+ }
+ }
+ return true;
+ }
+
ServiceRecord getServiceByNameLocked(ComponentName name, int callingUser) {
// TODO: Deal with global services
if (DEBUG_MU)
@@ -2813,6 +2848,30 @@ public final class ActiveServices {
}
clist.add(c);
+ ServiceData sData = new ServiceData();
+ sData.packageName = s.packageName;
+ sData.processName = s.shortInstanceName;
+ sData.lastActivity = s.lastActivity;
+ if (s.app != null) {
+ sData.pid = s.app.getPid();
+ sData.serviceB = s.app.mState.isServiceB();
+ } else {
+ sData.pid = -1;
+ sData.serviceB = false;
+ }
+
+ ClientData cData = new ClientData();
+ cData.processName = callerApp.processName;
+ cData.pid = callerApp.getPid();
+ try {
+ if (getServicetrackerInstance()) {
+ mServicetracker.bindService(sData, cData);
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to send bind details to servicetracker HAL", e);
+ mServicetracker = null;
+ }
+
boolean needOomAdj = false;
if ((flags&Context.BIND_AUTO_CREATE) != 0) {
s.lastActivity = SystemClock.uptimeMillis();
@@ -2995,6 +3054,29 @@ public final class ActiveServices {
try {
while (clist.size() > 0) {
ConnectionRecord r = clist.get(0);
+ ServiceData sData = new ServiceData();
+ sData.packageName = r.binding.service.packageName;
+ sData.processName = r.binding.service.shortInstanceName;
+ sData.lastActivity = r.binding.service.lastActivity;
+ if(r.binding.service.app != null) {
+ sData.pid = r.binding.service.app.getPid();
+ sData.serviceB = r.binding.service.app.mState.isServiceB();
+ } else {
+ sData.pid = -1;
+ sData.serviceB = false;
+ }
+
+ ClientData cData = new ClientData();
+ cData.processName = r.binding.client.processName;
+ cData.pid = r.binding.client.getPid();
+ try {
+ if (getServicetrackerInstance()) {
+ mServicetracker.unbindService(sData, cData);
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to send unbind details to servicetracker HAL", e);
+ mServicetracker = null;
+ }
removeConnectionLocked(r, null, null, true);
if (clist.size() > 0 && clist.get(0) == r) {
// In case it didn't get removed above, do it now.
@@ -3508,6 +3590,14 @@ public final class ActiveServices {
r.pendingStarts.add(0, si);
long dur = SystemClock.uptimeMillis() - si.deliveredTime;
dur *= 2;
+ if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) {
+ Slog.w(TAG,"Can add more delay !!!"
+ +" si.deliveredTime "+si.deliveredTime
+ +" dur "+dur
+ +" si.deliveryCount "+si.deliveryCount
+ +" si.doneExecutingCount "+si.doneExecutingCount
+ +" allowCancel "+allowCancel);
+ }
if (minDuration < dur) minDuration = dur;
if (resetTime < dur) resetTime = dur;
} else {
@@ -3531,6 +3621,13 @@ public final class ActiveServices {
}
r.totalRestartCount++;
+ if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) {
+ Slog.w(TAG,"r.name "+r.name+" N "+N+" minDuration "+minDuration
+ +" resetTime "+resetTime+" now "+now
+ +" r.restartDelay "+r.restartDelay
+ +" r.restartTime+resetTime "+(r.restartTime+resetTime)
+ +" allowCancel "+allowCancel);
+ }
if (r.restartDelay == 0) {
r.restartCount++;
r.restartDelay = minDuration;
@@ -3556,6 +3653,14 @@ public final class ActiveServices {
if (isServiceRestartBackoffEnabledLocked(r.packageName)) {
r.nextRestartTime = now + r.restartDelay;
+ if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) {
+ Slog.w(TAG,"r.name "+r.name+" N "+N+" minDuration "+minDuration
+ +" resetTime "+resetTime+" now "+now
+ +" r.restartDelay "+r.restartDelay
+ +" r.restartTime+resetTime "+(r.restartTime+resetTime)
+ +" r.nextRestartTime "+r.nextRestartTime
+ +" allowCancel "+allowCancel);
+ }
// Make sure that we don't end up restarting a bunch of services
// all at the same time.
@@ -3615,6 +3720,15 @@ public final class ActiveServices {
r.nextRestartTime = now + r.restartDelay;
Slog.w(TAG, scheduling + " restart of crashed service "
+ r.shortInstanceName + " in " + r.restartDelay + "ms for " + reason);
+
+ if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) {
+ for (int i=mRestartingServices.size()-1; i>=0; i--) {
+ ServiceRecord r2 = mRestartingServices.get(i);
+ Slog.w(TAG,"Restarting list - i "+i+" r2.nextRestartTime "
+ +r2.nextRestartTime+" r2.name "+r2.name);
+ }
+ }
+
EventLog.writeEvent(EventLogTags.AM_SCHEDULE_SERVICE_RESTART,
r.userId, r.shortInstanceName, r.restartDelay);
}
@@ -3633,8 +3747,31 @@ public final class ActiveServices {
return;
}
try {
- bringUpServiceLocked(r, r.intent.getIntent().getFlags(), r.createdFromFg, true, false,
- false, true);
+ if(SERVICE_RESCHEDULE) {
+ boolean shouldDelay = false;
+ ActivityRecord top_rc = mAm.mTaskSupervisor.getTopResumedActivity();
+
+ boolean isPersistent
+ = !((r.serviceInfo.applicationInfo.flags&ApplicationInfo.FLAG_PERSISTENT) == 0);
+ if(top_rc != null) {
+ if(top_rc.launching && !r.shortInstanceName.contains(top_rc.packageName)
+ && !isPersistent && r.isForeground == false) {
+ shouldDelay = true;
+ }
+ }
+ if(!shouldDelay) {
+ bringUpServiceLocked(r, r.intent.getIntent().getFlags(), r.createdFromFg, true, false, false, true);
+ } else {
+ if (DEBUG_DELAYED_SERVICE) {
+ Slog.v(TAG, "Reschedule service restart due to app launch"
+ +" r.shortInstanceName "+r.shortInstanceName+" r.app = "+r.app);
+ }
+ r.resetRestartCounter();
+ scheduleServiceRestartLocked(r, true);
+ }
+ } else {
+ bringUpServiceLocked(r, r.intent.getIntent().getFlags(), r.createdFromFg, true, false, false, true);
+ }
} catch (TransactionTooLargeException e) {
// Ignore, it's been logged and nothing upstack cares.
} finally {
@@ -3948,6 +4085,22 @@ public final class ActiveServices {
app.mState.getReportedProcState());
r.postNotification();
created = true;
+
+ ServiceData sData = new ServiceData();
+ sData.packageName = r.packageName;
+ sData.processName = r.shortInstanceName;
+ sData.pid = r.app.getPid();
+ sData.lastActivity = r.lastActivity;
+ sData.serviceB = r.app.mState.isServiceB();
+
+ try {
+ if (getServicetrackerInstance()) {
+ mServicetracker.startService(sData);
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to send start details to servicetracker HAL", e);
+ mServicetracker = null;
+ }
} catch (DeadObjectException e) {
Slog.w(TAG, "Application dead when creating service " + r);
mAm.appDiedLocked(app, "Died when creating service");
@@ -3961,7 +4114,12 @@ public final class ActiveServices {
// Cleanup.
if (newService) {
psr.stopService(r);
- r.setProcess(null, null, 0, null);
+ r.app = null;
+ if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) {
+ Slog.w(TAG, " Failed to create Service !!!! ."
+ +"This will introduce huge delay... "
+ +r.shortInstanceName + " in " + r.restartDelay + "ms");
+ }
}
// Retry.
@@ -4142,7 +4300,25 @@ public final class ActiveServices {
private void bringDownServiceLocked(ServiceRecord r, boolean enqueueOomAdj) {
//Slog.i(TAG, "Bring down service:");
//r.dump(" ");
+ ServiceData sData = new ServiceData();
+ sData.packageName = r.packageName;
+ sData.processName = r.shortInstanceName;
+ sData.lastActivity = r.lastActivity;
+ if (r.app != null) {
+ sData.pid = r.app.getPid();
+ } else {
+ sData.pid = -1;
+ sData.serviceB = false;
+ }
+ try {
+ if (getServicetrackerInstance()) {
+ mServicetracker.destroyService(sData);
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to send destroy details to servicetracker HAL", e);
+ mServicetracker = null;
+ }
// Report to all of the connections that the service is no longer
// available.
ArrayMap<IBinder, ArrayList<ConnectionRecord>> connections = r.getConnections();
@@ -4888,6 +5064,15 @@ public final class ActiveServices {
}
}
+ try {
+ if (getServicetrackerInstance()) {
+ mServicetracker.killProcess(app.getPid());
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to send kill process details to servicetracker HAL", e);
+ mServicetracker = null;
+ }
+
// Clean up any connections this application has to other services.
for (int i = psr.numberOfConnections() - 1; i >= 0; i--) {
ConnectionRecord r = psr.getConnectionAt(i);
diff --git a/services/core/java/com/android/server/am/ActivityManagerConstants.java b/services/core/java/com/android/server/am/ActivityManagerConstants.java
index eeb41a3df969..f4bb04b6f25f 100644
--- a/services/core/java/com/android/server/am/ActivityManagerConstants.java
+++ b/services/core/java/com/android/server/am/ActivityManagerConstants.java
@@ -29,6 +29,8 @@ import android.database.ContentObserver;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
+import android.os.Process;
+import android.os.SystemProperties;
import android.os.Message;
import android.os.PowerExemptionManager;
import android.provider.DeviceConfig;
@@ -37,6 +39,7 @@ import android.provider.DeviceConfig.Properties;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.KeyValueListParser;
import android.util.Slog;
@@ -112,7 +115,7 @@ final class ActivityManagerConstants extends ContentObserver {
static final String KEY_FGS_START_DENIED_LOG_SAMPLE_RATE = "fgs_start_denied_log_sample_rate";
static final String KEY_FGS_ALLOW_OPT_OUT = "fgs_allow_opt_out";
- private static final int DEFAULT_MAX_CACHED_PROCESSES = 32;
+ private static int DEFAULT_MAX_CACHED_PROCESSES = 32;
private static final long DEFAULT_BACKGROUND_SETTLE_TIME = 60*1000;
private static final long DEFAULT_FGSERVICE_MIN_SHOWN_TIME = 2*1000;
private static final long DEFAULT_FGSERVICE_MIN_REPORT_TIME = 3*1000;
@@ -537,6 +540,15 @@ final class ActivityManagerConstants extends ContentObserver {
// process limit. This will be initialized in the constructor.
public int CUR_MAX_CACHED_PROCESSES;
+ public static BoostFramework mPerf = new BoostFramework();
+
+ static boolean USE_TRIM_SETTINGS = true;
+ static int EMPTY_APP_PERCENT = 50;
+ static int TRIM_EMPTY_PERCENT = 100;
+ static int TRIM_CACHE_PERCENT = 100;
+ static long TRIM_ENABLE_MEMORY = 1073741824;
+ public static boolean allowTrim() { return Process.getTotalMemory() < TRIM_ENABLE_MEMORY ; }
+
// The maximum number of empty app processes we will let sit around. This will be
// initialized in the constructor.
public int CUR_MAX_EMPTY_PROCESSES;
@@ -794,6 +806,28 @@ final class ActivityManagerConstants extends ContentObserver {
CUR_MAX_EMPTY_PROCESSES = computeEmptyProcessLimit(CUR_MAX_CACHED_PROCESSES);
}
+ private void updatePerfConfigConstants() {
+ if (mPerf != null) {
+ // Maximum number of cached processes we will allow.
+ DEFAULT_MAX_CACHED_PROCESSES = MAX_CACHED_PROCESSES = CUR_MAX_CACHED_PROCESSES = Integer.valueOf(
+ mPerf.perfGetProp("ro.vendor.qti.sys.fw.bg_apps_limit", "32"));
+
+ //Trim Settings
+ USE_TRIM_SETTINGS = Boolean.parseBoolean(mPerf.perfGetProp("ro.vendor.qti.sys.fw.use_trim_settings", "true"));
+ EMPTY_APP_PERCENT = Integer.valueOf(mPerf.perfGetProp("ro.vendor.qti.sys.fw.empty_app_percent", "50"));
+ TRIM_EMPTY_PERCENT = Integer.valueOf(mPerf.perfGetProp("ro.vendor.qti.sys.fw.trim_empty_percent", "100"));
+ TRIM_CACHE_PERCENT = Integer.valueOf(mPerf.perfGetProp("ro.vendor.qti.sys.fw.trim_cache_percent", "100"));
+ TRIM_ENABLE_MEMORY = Long.valueOf(mPerf.perfGetProp("ro.vendor.qti.sys.fw.trim_enable_memory", "1073741824"));
+
+ // The maximum number of empty app processes we will let sit around.
+ CUR_MAX_EMPTY_PROCESSES = computeEmptyProcessLimit(CUR_MAX_CACHED_PROCESSES);
+
+ final int rawEmptyProcesses = computeEmptyProcessLimit(MAX_CACHED_PROCESSES);
+ CUR_TRIM_EMPTY_PROCESSES = computeTrimEmptyApps(rawEmptyProcesses);
+ CUR_TRIM_CACHED_PROCESSES = computeTrimCachedApps(rawEmptyProcesses, MAX_CACHED_PROCESSES);
+ }
+ }
+
public void start(ContentResolver resolver) {
mResolver = resolver;
mResolver.registerContentObserver(ACTIVITY_MANAGER_CONSTANTS_URI, false, this);
@@ -805,6 +839,8 @@ final class ActivityManagerConstants extends ContentObserver {
false, this);
}
updateConstants();
+ updatePerfConfigConstants();
+
if (mSystemServerAutomaticHeapDumpEnabled) {
updateEnableAutomaticSystemServerHeapDumps();
}
@@ -832,7 +868,27 @@ final class ActivityManagerConstants extends ContentObserver {
}
public static int computeEmptyProcessLimit(int totalProcessLimit) {
- return totalProcessLimit/2;
+ if(USE_TRIM_SETTINGS && allowTrim()) {
+ return totalProcessLimit*EMPTY_APP_PERCENT/100;
+ } else {
+ return totalProcessLimit/2;
+ }
+ }
+
+ public static int computeTrimEmptyApps(int rawMaxEmptyProcesses) {
+ if (USE_TRIM_SETTINGS && allowTrim()) {
+ return rawMaxEmptyProcesses*TRIM_EMPTY_PERCENT/100;
+ } else {
+ return rawMaxEmptyProcesses/2;
+ }
+ }
+
+ public static int computeTrimCachedApps(int rawMaxEmptyProcesses, int totalProcessLimit) {
+ if (USE_TRIM_SETTINGS && allowTrim()) {
+ return totalProcessLimit*TRIM_CACHE_PERCENT/100;
+ } else {
+ return (totalProcessLimit-rawMaxEmptyProcesses)/3;
+ }
}
@Override
@@ -1163,8 +1219,9 @@ final class ActivityManagerConstants extends ContentObserver {
// to consider the same level the point where we do trimming regardless of any
// additional enforced limit.
final int rawMaxEmptyProcesses = computeEmptyProcessLimit(MAX_CACHED_PROCESSES);
- CUR_TRIM_EMPTY_PROCESSES = rawMaxEmptyProcesses/2;
- CUR_TRIM_CACHED_PROCESSES = (MAX_CACHED_PROCESSES-rawMaxEmptyProcesses)/3;
+ CUR_TRIM_EMPTY_PROCESSES = computeTrimEmptyApps(rawMaxEmptyProcesses);
+ CUR_TRIM_CACHED_PROCESSES =
+ computeTrimCachedApps(rawMaxEmptyProcesses, MAX_CACHED_PROCESSES);
}
private void updateMinAssocLogDuration() {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index f5103df80d6a..c1cb6b22d89b 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -316,6 +316,8 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
+import android.util.BoostFramework;
+
import android.view.autofill.AutofillManagerInternal;
import com.android.internal.annotations.CompositeRWLock;
@@ -328,6 +330,7 @@ import com.android.internal.app.ProcessMap;
import com.android.internal.app.SystemUserHomeActivity;
import com.android.internal.app.procstats.ProcessState;
import com.android.internal.app.procstats.ProcessStats;
+import com.android.internal.app.ActivityTrigger;
import com.android.internal.content.PackageHelper;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
@@ -394,11 +397,13 @@ import com.android.server.utils.TimingsTraceAndSlog;
import com.android.server.vr.VrManagerInternal;
import com.android.server.wm.ActivityMetricsLaunchObserver;
import com.android.server.wm.ActivityServiceConnectionsHolder;
+import com.android.server.wm.ActivityTaskSupervisor;
import com.android.server.wm.ActivityTaskManagerInternal;
import com.android.server.wm.ActivityTaskManagerService;
import com.android.server.wm.WindowManagerInternal;
import com.android.server.wm.WindowManagerService;
import com.android.server.wm.WindowProcessController;
+import com.android.server.ActivityTriggerService;
import dalvik.system.VMRuntime;
@@ -539,6 +544,12 @@ public class ActivityManagerService extends IActivityManager.Stub
2000 * Build.HW_TIMEOUT_MULTIPLIER; // 2 seconds;
private static final int JAVA_DUMP_MINIMUM_SIZE = 100; // 100 bytes.
+ /* Freq Aggr boost objects */
+ public static BoostFramework mPerfServiceStartHint = null;
+ /* UX perf event object */
+ public static BoostFramework mUxPerf = new BoostFramework();
+ public static boolean mForceStopKill = false;
+
OomAdjuster mOomAdjuster;
static final String EXTRA_TITLE = "android.intent.extra.TITLE";
@@ -558,6 +569,9 @@ public class ActivityManagerService extends IActivityManager.Stub
private Installer mInstaller;
+ /** Run all ActivityStacks through this */
+ ActivityTaskSupervisor mTaskSupervisor;
+
final InstrumentationReporter mInstrumentationReporter = new InstrumentationReporter();
@CompositeRWLock({"this", "mProcLock"})
@@ -899,6 +913,10 @@ public class ActivityManagerService extends IActivityManager.Stub
sActiveProcessInfoSelfLocked.remove(pid);
}
}
+ ActivityTriggerService atService = LocalServices.getService(ActivityTriggerService.class);
+ if(atService != null) {
+ atService.updateRecord(app.getHostingRecord(), app.info, app.getPid(), ActivityTriggerService.PROC_ADDED_NOTIFICATION);
+ }
mAtmInternal.onProcessMapped(pid, app.getWindowProcessController());
}
@@ -917,6 +935,10 @@ public class ActivityManagerService extends IActivityManager.Stub
synchronized (sActiveProcessInfoSelfLocked) {
sActiveProcessInfoSelfLocked.remove(pid);
}
+ ActivityTriggerService atService = LocalServices.getService(ActivityTriggerService.class);
+ if(atService != null) {
+ atService.updateRecord(app.getHostingRecord(), app.info, app.getPid(), ActivityTriggerService.PROC_REMOVED_NOTIFICATION);
+ }
mAtmInternal.onProcessUnMapped(pid);
}
}
@@ -2343,6 +2365,7 @@ public class ActivityManagerService extends IActivityManager.Stub
mActivityTaskManager.initialize(mIntentFirewall, mPendingIntentController,
DisplayThread.get().getLooper());
mAtmInternal = LocalServices.getService(ActivityTaskManagerInternal.class);
+ mTaskSupervisor = mActivityTaskManager.mTaskSupervisor;
mHiddenApiBlacklist = new HiddenApiSettings(mHandler, mContext);
@@ -2358,7 +2381,7 @@ public class ActivityManagerService extends IActivityManager.Stub
Process.THREAD_GROUP_SYSTEM);
Process.setThreadGroupAndCpuset(
mOomAdjuster.mCachedAppOptimizer.mCachedAppOptimizerThread.getThreadId(),
- Process.THREAD_GROUP_SYSTEM);
+ mOomAdjuster.mCachedAppOptimizer.mCompactionPriority);
} catch (Exception e) {
Slog.w(TAG, "Setting background thread cpuset failed");
}
@@ -2968,6 +2991,46 @@ public class ActivityManagerService extends IActivityManager.Stub
return mActivityTaskManager.startActivityFromRecents(taskId, bOptions);
}
+ public int startActivityAsUserEmpty(Bundle options) {
+ ArrayList<String> pApps = options.getStringArrayList("start_empty_apps");
+ if (pApps != null && pApps.size() > 0) {
+ Iterator<String> apps_itr = pApps.iterator();
+ while (apps_itr.hasNext()) {
+ ProcessRecord empty_app = null;
+ String app_str = apps_itr.next();
+ if (app_str == null)
+ continue;
+ synchronized (this) {
+ Intent intent_l = null;
+ try {
+ intent_l = mContext.getPackageManager().getLaunchIntentForPackage(app_str);
+ if (intent_l == null)
+ continue;
+ ActivityInfo aInfo = mTaskSupervisor.resolveActivity(intent_l, null,
+ 0, null, 0, 0);
+ if (aInfo == null)
+ continue;
+ empty_app = startProcessLocked(
+ app_str,
+ aInfo.applicationInfo,
+ false /* knownToBeDead */,
+ 0 /* intentFlags */,
+ sNullHostingRecord /* hostingRecord */,
+ ZYGOTE_POLICY_FLAG_EMPTY /* zygotePolicyFlags */,
+ false /* allowWhileBooting */,
+ false /* isolated */);
+ if (empty_app != null)
+ updateOomAdjLocked(empty_app, OomAdjuster.OOM_ADJ_REASON_NONE);
+ } catch (Exception e) {
+ if (DEBUG_PROCESSES)
+ Slog.w(TAG, "Exception raised trying to start app as empty " + e);
+ }
+ }
+ }
+ }
+ return 1;
+ }
+
/**
* This is the internal entry point for handling Activity.finish().
*
@@ -3143,6 +3206,12 @@ public class ActivityManagerService extends IActivityManager.Stub
mAppProfiler.setAllowLowerMemLevelLocked(false);
doLowMem = false;
}
+
+ if (mUxPerf != null && !mForceStopKill && !app.mErrorState.isNotResponding() && !app.mErrorState.isCrashing()) {
+ mUxPerf.perfUXEngine_events(BoostFramework.UXE_EVENT_KILL, 0, app.processName, 0);
+ mUxPerf.perfEvent(BoostFramework.VENDOR_HINT_KILL, app.processName, 2, 0, pid);
+ }
+
EventLogTags.writeAmProcDied(app.userId, pid, app.processName, setAdj, setProcState);
if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP,
"Dying app: " + app + ", pid: " + pid + ", thread: " + thread.asBinder());
@@ -3318,13 +3387,19 @@ public class ActivityManagerService extends IActivityManager.Stub
final int max = SystemProperties.getInt("tombstoned.max_anr_count", 64);
final long now = System.currentTimeMillis();
- Arrays.sort(files, Comparator.comparingLong(File::lastModified).reversed());
- for (int i = 0; i < files.length; ++i) {
- if (i > max || (now - files[i].lastModified()) > DAY_IN_MILLIS) {
- if (!files[i].delete()) {
- Slog.w(TAG, "Unable to prune stale trace file: " + files[i]);
+ try {
+ Arrays.sort(files, Comparator.comparingLong(File::lastModified).reversed());
+ for (int i = 0; i < files.length; ++i) {
+ if (i > max || (now - files[i].lastModified()) > DAY_IN_MILLIS) {
+ if (!files[i].delete()) {
+ Slog.w(TAG, "Unable to prune stale trace file: " + files[i]);
+ }
}
}
+ } catch (IllegalArgumentException e) {
+ // The modification times changed while we were sorting. Bail...
+ // https://issuetracker.google.com/169836837
+ Slog.w(TAG, "tombstone modification times changed while sorting; not pruning", e);
}
}
@@ -4177,6 +4252,7 @@ public class ActivityManagerService extends IActivityManager.Stub
mAppErrors.resetProcessCrashTime(packageName == null, appId, userId);
}
+ mForceStopKill = true;
synchronized (mProcLock) {
// Notify first that the package is stopped, so its process won't be restarted
@@ -4394,6 +4470,19 @@ public class ActivityManagerService extends IActivityManager.Stub
EventLogTags.writeAmProcBound(app.userId, pid, app.processName);
+ if (mUxPerf != null && app.getHostingRecord() != null && app.getHostingRecord().isTopApp()) {
+ if (mUxPerf.getPerfHalVersion() >= BoostFramework.PERF_HAL_V23) {
+ int pkgType = mUxPerf.perfGetFeedback(
+ BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE, app.processName);
+ mUxPerf.perfHintAcqRel(-1,
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, app.processName,
+ pid, BoostFramework.Launch.TYPE_ATTACH_APPLICATION, 1, pkgType);
+ } else {
+ mUxPerf.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, app.processName,
+ pid, BoostFramework.Launch.TYPE_ATTACH_APPLICATION);
+ }
+ }
+
synchronized (mProcLock) {
app.mState.setCurAdj(ProcessList.INVALID_ADJ);
app.mState.setSetAdj(ProcessList.INVALID_ADJ);
@@ -4787,6 +4876,7 @@ public class ActivityManagerService extends IActivityManager.Stub
String data, Bundle extras, boolean ordered,
boolean sticky, int sendingUser) {
synchronized (mProcLock) {
+ mOomAdjuster.mCachedAppOptimizer.compactAllSystem();
mAppProfiler.requestPssAllProcsLPr(
SystemClock.uptimeMillis(), true, false);
}
@@ -11835,6 +11925,28 @@ public class ActivityManagerService extends IActivityManager.Stub
}
app.setPid(0);
}
+
+ // Call Preferred App
+ if (app != null) {
+ ArrayList<ApplicationExitInfo> results = new ArrayList<ApplicationExitInfo>();
+ mProcessList.mAppExitInfoTracker.getExitInfo(
+ app.processName, app.uid, app.getPid(), 0, results);
+ if (results != null) {
+ boolean recentAppClose = false;
+ for (int i=0; i<results.size();i++) {
+ ApplicationExitInfo appExitInfo = results.get(i);
+ if ((appExitInfo.getReason() == ApplicationExitInfo.REASON_USER_REQUESTED
+ || appExitInfo.getReason() == ApplicationExitInfo.REASON_USER_STOPPED)
+ && appExitInfo.getDescription() == "remove task") {
+ recentAppClose = true;
+ break;
+ }
+ }
+ if (recentAppClose) {
+ mTaskSupervisor.startPreferredApps();
+ }
+ }
+ }
return false;
}
@@ -15398,6 +15510,11 @@ public class ActivityManagerService extends IActivityManager.Stub
}
@Override
+ public int startActivityAsUserEmpty(Bundle options) {
+ return ActivityManagerService.this.startActivityAsUserEmpty(options);
+ }
+
+ @Override
public void killForegroundAppsForUser(@UserIdInt int userId) {
final ArrayList<ProcessRecord> procs = new ArrayList<>();
synchronized (mProcLock) {
diff --git a/services/core/java/com/android/server/am/AnrHelper.java b/services/core/java/com/android/server/am/AnrHelper.java
index 34d9a60d78aa..b7ec5488775a 100644
--- a/services/core/java/com/android/server/am/AnrHelper.java
+++ b/services/core/java/com/android/server/am/AnrHelper.java
@@ -21,9 +21,12 @@ import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NA
import android.content.pm.ApplicationInfo;
import android.os.SystemClock;
+import android.os.Message;
+import android.os.Handler;
import android.util.Slog;
import com.android.internal.annotations.GuardedBy;
+import com.android.server.FgThread;
import com.android.server.wm.WindowProcessController;
import java.util.ArrayList;
@@ -71,11 +74,27 @@ class AnrHelper {
}
void appNotResponding(ProcessRecord anrProcess, String activityShortComponentName,
- ApplicationInfo aInfo, String parentShortComponentName,
- WindowProcessController parentProcess, boolean aboveSystem, String annotation) {
+ ApplicationInfo aInfo, String parentShortComponentName,
+ WindowProcessController parentProcess, boolean aboveSystem, String annotation) {
+ appNotResponding(new AnrRecord(anrProcess, activityShortComponentName, aInfo,
+ parentShortComponentName, parentProcess, aboveSystem, annotation));
+ }
+
+ void deferAppNotResponding(ProcessRecord anrProcess, String activityShortComponentName,
+ ApplicationInfo aInfo, String parentShortComponentName,
+ WindowProcessController parentProcess, boolean aboveSystem,
+ String annotation, long delayInMillis) {
+ AnrRecord anrRecord = new AnrRecord(anrProcess, activityShortComponentName, aInfo,
+ parentShortComponentName, parentProcess, aboveSystem, annotation);
+ Message msg = Message.obtain();
+ msg.what = APP_NOT_RESPONDING_DEFER_MSG;
+ msg.obj = anrRecord;
+ mFgHandler.sendMessageDelayed(msg, delayInMillis);
+ }
+
+ private void appNotResponding(AnrRecord anrRecord) {
synchronized (mAnrRecords) {
- mAnrRecords.add(new AnrRecord(anrProcess, activityShortComponentName, aInfo,
- parentShortComponentName, parentProcess, aboveSystem, annotation));
+ mAnrRecords.add(anrRecord);
}
startAnrConsumerIfNeeded();
}
@@ -165,4 +184,18 @@ class AnrHelper {
onlyDumpSelf);
}
}
+
+ static final int APP_NOT_RESPONDING_DEFER_MSG = 4;
+ static final int APP_NOT_RESPONDING_DEFER_TIMEOUT_MILLIS = 10 * 1000;
+ private Handler mFgHandler = new Handler(FgThread.getHandler().getLooper()) {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case APP_NOT_RESPONDING_DEFER_MSG:
+ AnrRecord record = (AnrRecord)msg.obj;
+ appNotResponding((AnrRecord)msg.obj);
+ break;
+ }
+ }
+ };
}
diff --git a/services/core/java/com/android/server/am/AppProfiler.java b/services/core/java/com/android/server/am/AppProfiler.java
index 293b8a9e0b12..f51bec423787 100644
--- a/services/core/java/com/android/server/am/AppProfiler.java
+++ b/services/core/java/com/android/server/am/AppProfiler.java
@@ -937,6 +937,11 @@ public class AppProfiler {
}
@GuardedBy("mService")
+ boolean allowLowerMemLevelLocked() {
+ return mAllowLowerMemLevel;
+ }
+
+ @GuardedBy("mService")
void setMemFactorOverrideLocked(@MemFactor int factor) {
mMemFactorOverride = factor;
}
diff --git a/services/core/java/com/android/server/am/CachedAppOptimizer.java b/services/core/java/com/android/server/am/CachedAppOptimizer.java
index 6bb5aa148e59..2aba375fc40b 100644
--- a/services/core/java/com/android/server/am/CachedAppOptimizer.java
+++ b/services/core/java/com/android/server/am/CachedAppOptimizer.java
@@ -28,8 +28,10 @@ import android.net.Uri;
import android.os.Debug;
import android.os.Handler;
import android.os.Message;
+import android.os.PowerManagerInternal;
import android.os.Process;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.os.Trace;
import android.provider.DeviceConfig;
import android.provider.DeviceConfig.OnPropertiesChangedListener;
@@ -38,6 +40,7 @@ import android.provider.Settings;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.Slog;
+import android.util.BoostFramework;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
@@ -60,6 +63,7 @@ public final class CachedAppOptimizer {
// Flags stored in the DeviceConfig API.
@VisibleForTesting static final String KEY_USE_COMPACTION = "use_compaction";
+ @VisibleForTesting static final String KEY_COMPACTION_PRIORITY = "compaction_priority";
@VisibleForTesting static final String KEY_USE_FREEZER = "use_freezer";
@VisibleForTesting static final String KEY_COMPACT_ACTION_1 = "compact_action_1";
@VisibleForTesting static final String KEY_COMPACT_ACTION_2 = "compact_action_2";
@@ -183,7 +187,8 @@ public final class CachedAppOptimizer {
public void onPropertiesChanged(Properties properties) {
synchronized (mPhenotypeFlagLock) {
for (String name : properties.getKeyset()) {
- if (KEY_USE_COMPACTION.equals(name)) {
+ if (KEY_USE_COMPACTION.equals(name) ||
+ KEY_COMPACTION_PRIORITY.equals(name)) {
updateUseCompaction();
} else if (KEY_COMPACT_ACTION_1.equals(name)
|| KEY_COMPACT_ACTION_2.equals(name)) {
@@ -282,6 +287,7 @@ public final class CachedAppOptimizer {
private volatile boolean mUseFreezer = false; // set to DEFAULT in init()
@GuardedBy("this")
private int mFreezerDisableCount = 1; // Freezer is initially disabled, until enabled
+ public volatile int mCompactionPriority = Process.THREAD_GROUP_BACKGROUND;
private final Random mRandom = new Random();
@GuardedBy("mPhenotypeFlagLock")
@VisibleForTesting volatile float mCompactStatsdSampleRate = DEFAULT_STATSD_SAMPLE_RATE;
@@ -324,6 +330,7 @@ public final class CachedAppOptimizer {
private int mBfgsCompactionCount;
private final ProcessDependencies mProcessDependencies;
private final ProcLocksReader mProcLocksReader;
+ public static BoostFramework mPerf = new BoostFramework();
public CachedAppOptimizer(ActivityManagerService am) {
this(am, null, new DefaultProcessDependencies());
@@ -335,7 +342,7 @@ public final class CachedAppOptimizer {
mAm = am;
mProcLock = am.mProcLock;
mCachedAppOptimizerThread = new ServiceThread("CachedAppOptimizerThread",
- Process.THREAD_GROUP_SYSTEM, true);
+ mCompactionPriority, true);
mProcStateThrottle = new HashSet<>();
mProcessDependencies = processDependencies;
mTestCallback = callback;
@@ -370,6 +377,88 @@ public final class CachedAppOptimizer {
updateMinOomAdjThrottle();
updateMaxOomAdjThrottle();
}
+ setAppCompactProperties();
+ }
+
+ private void setAppCompactProperties() {
+ boolean useCompaction =
+ Boolean.valueOf(mPerf.perfGetProp("vendor.appcompact.enable_app_compact",
+ "false"));
+ int threadPriority =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.thread_priority",
+ String.valueOf(Process.THREAD_GROUP_BACKGROUND)));
+ // Let the user change the group back to THREAD_GROUP_SYSYTEM
+ // For any other value, set it to THREAD_GROUP_BACKGROUND
+ if (threadPriority != Process.THREAD_GROUP_SYSTEM)
+ threadPriority = Process.THREAD_GROUP_BACKGROUND;
+
+ int someCompactionType =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.some_compact_type",
+ String.valueOf(COMPACT_ACTION_ANON_FLAG)));
+ int fullCompactionType =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.full_compact_type",
+ String.valueOf(COMPACT_ACTION_ANON_FLAG)));
+ int compactThrottleSomeSome =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.compact_throttle_somesome",
+ String.valueOf(DEFAULT_COMPACT_THROTTLE_1)));
+ int compactThrottleSomeFull =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.compact_throttle_somefull",
+ String.valueOf(DEFAULT_COMPACT_THROTTLE_2)));
+ int compactThrottleFullSome =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.compact_throttle_fullsome",
+ String.valueOf(DEFAULT_COMPACT_THROTTLE_3)));
+ int compactThrottleFullFull =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.compact_throttle_fullfull",
+ String.valueOf(DEFAULT_COMPACT_THROTTLE_4)));
+ int compactThrottleBfgs =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.compact_throttle_bfgs",
+ String.valueOf(DEFAULT_COMPACT_THROTTLE_5)));
+ int compactThrottlePersistent =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.compact_throttle_persistent",
+ String.valueOf(DEFAULT_COMPACT_THROTTLE_6)));
+ int fullRssThrottleKB =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.rss_throttle_kb",
+ String.valueOf(DEFAULT_COMPACT_FULL_RSS_THROTTLE_KB)));
+ int deltaRssThrottleKB =
+ Integer.valueOf(mPerf.perfGetProp("vendor.appcompact.delta_rss_throttle_kb",
+ String.valueOf(DEFAULT_COMPACT_FULL_DELTA_RSS_THROTTLE_KB)));
+
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_ACTION_1,
+ String.valueOf(someCompactionType), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_ACTION_2,
+ String.valueOf(fullCompactionType), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_THROTTLE_1,
+ String.valueOf(compactThrottleSomeSome), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_THROTTLE_2,
+ String.valueOf(compactThrottleSomeFull), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_THROTTLE_3,
+ String.valueOf(compactThrottleFullSome), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_THROTTLE_4,
+ String.valueOf(compactThrottleFullFull), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_THROTTLE_5,
+ String.valueOf(compactThrottleBfgs), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_THROTTLE_6,
+ String.valueOf(compactThrottlePersistent), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_FULL_RSS_THROTTLE_KB,
+ String.valueOf(fullRssThrottleKB), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACT_FULL_DELTA_RSS_THROTTLE_KB,
+ String.valueOf(deltaRssThrottleKB), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_USE_COMPACTION,
+ String.valueOf(useCompaction), true);
+ DeviceConfig.setProperty(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_COMPACTION_PRIORITY,
+ String.valueOf(threadPriority), true);
}
/**
@@ -395,6 +484,7 @@ public final class CachedAppOptimizer {
pw.println("CachedAppOptimizer settings");
synchronized (mPhenotypeFlagLock) {
pw.println(" " + KEY_USE_COMPACTION + "=" + mUseCompaction);
+ pw.println(" " + KEY_COMPACTION_PRIORITY + "=" + mCompactionPriority);
pw.println(" " + KEY_COMPACT_ACTION_1 + "=" + mCompactActionSome);
pw.println(" " + KEY_COMPACT_ACTION_2 + "=" + mCompactActionFull);
pw.println(" " + KEY_COMPACT_THROTTLE_1 + "=" + mCompactThrottleSomeSome);
@@ -531,19 +621,28 @@ public final class CachedAppOptimizer {
*/
@GuardedBy("mPhenotypeFlagLock")
private void updateUseCompaction() {
+ // If this property is null there must have been some unexpected reset
+ String useCompaction = DeviceConfig.getProperty(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_USE_COMPACTION);
+ if (useCompaction == null) {
+ setAppCompactProperties();
+ }
+
mUseCompaction = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
KEY_USE_COMPACTION, DEFAULT_USE_COMPACTION);
+ mCompactionPriority = DeviceConfig.getInt(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_COMPACTION_PRIORITY, Process.THREAD_GROUP_BACKGROUND);
+
if (mUseCompaction && mCompactionHandler == null) {
if (!mCachedAppOptimizerThread.isAlive()) {
mCachedAppOptimizerThread.start();
}
mCompactionHandler = new MemCompactionHandler();
-
- Process.setThreadGroupAndCpuset(mCachedAppOptimizerThread.getThreadId(),
- Process.THREAD_GROUP_SYSTEM);
}
+
+ Process.setThreadGroupAndCpuset(mCachedAppOptimizerThread.getThreadId(),
+ mCompactionPriority);
}
/**
@@ -704,7 +803,8 @@ public final class CachedAppOptimizer {
}
Process.setThreadGroupAndCpuset(mCachedAppOptimizerThread.getThreadId(),
- Process.THREAD_GROUP_SYSTEM);
+ mCompactionPriority);
+
} else {
Slog.d(TAG_AM, "Freezer disabled");
enableFreezer(false);
@@ -1082,6 +1182,9 @@ public final class CachedAppOptimizer {
int lastOomAdj = msg.arg1;
int procState = msg.arg2;
synchronized (mProcLock) {
+ if(mPendingCompactionProcesses.isEmpty()) {
+ return;
+ }
proc = mPendingCompactionProcesses.remove(0);
opt = proc.mOptRecord;
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 88ca8a5e8356..e94c2fa60fc1 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -50,6 +50,7 @@ import static android.os.Process.THREAD_GROUP_TOP_APP;
import static android.os.Process.THREAD_PRIORITY_DISPLAY;
import static android.os.Process.THREAD_PRIORITY_TOP_APP_BOOST;
import static android.os.Process.setProcessGroup;
+import static android.os.Process.setCgroupProcsProcessGroup;
import static android.os.Process.setThreadPriority;
import static android.os.Process.setThreadScheduler;
@@ -95,9 +96,11 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.os.Trace;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.LongSparseArray;
import android.util.Pair;
import android.util.Slog;
@@ -256,6 +259,26 @@ public class OomAdjuster {
private final ProcessList mProcessList;
private final ActivityManagerGlobalLock mProcLock;
+ // Min aging threshold in milliseconds to consider a B-service
+ int mMinBServiceAgingTime = 5000;
+ // Threshold for B-services when in memory pressure
+ int mBServiceAppThreshold = 5;
+ // Enable B-service aging propagation on memory pressure.
+ boolean mEnableBServicePropagation = false;
+ // Process in same process Group keep in same cgroup
+ boolean mEnableProcessGroupCgroupFollow = false;
+ boolean mProcessGroupCgroupFollowDex2oatOnly = false;
+ // Enable hooks for background apps transition
+ boolean mEnableBgt = false;
+
+ public static BoostFramework mPerf = new BoostFramework();
+
+ //Per Task Boost of top-app renderThread
+ public static BoostFramework mPerfBoost = new BoostFramework();
+ public static int mPerfHandle = -1;
+ public static int mCurRenderThreadTid = -1;
+ public static boolean mIsTopAppRenderThreadBoostEnabled = false;
+
private final int mNumSlots;
private final ArrayList<ProcessRecord> mTmpProcessList = new ArrayList<ProcessRecord>();
private final ArrayList<UidRecord> mTmpBecameIdle = new ArrayList<UidRecord>();
@@ -423,19 +446,34 @@ public class OomAdjuster {
mCachedAppOptimizer = new CachedAppOptimizer(mService);
mCacheOomRanker = new CacheOomRanker(service);
+ if(mPerf != null) {
+ mMinBServiceAgingTime = Integer.valueOf(mPerf.perfGetProp("ro.vendor.qti.sys.fw.bservice_age", "5000"));
+ mBServiceAppThreshold = Integer.valueOf(mPerf.perfGetProp("ro.vendor.qti.sys.fw.bservice_limit", "5"));
+ mEnableBServicePropagation = Boolean.parseBoolean(mPerf.perfGetProp("ro.vendor.qti.sys.fw.bservice_enable", "false"));
+ mEnableProcessGroupCgroupFollow = Boolean.parseBoolean(mPerf.perfGetProp("ro.vendor.qti.cgroup_follow.enable", "false"));
+ mProcessGroupCgroupFollowDex2oatOnly = Boolean.parseBoolean(mPerf.perfGetProp("ro.vendor.qti.cgroup_follow.dex2oat_only", "false"));
+ mIsTopAppRenderThreadBoostEnabled = Boolean.parseBoolean(mPerf.perfGetProp("vendor.perf.topAppRenderThreadBoost.enable", "false"));
+ mEnableBgt = Boolean.parseBoolean(mPerf.perfGetProp("vendor.perf.bgt.enable","false"));
+ }
+
mProcessGroupHandler = new Handler(adjusterThread.getLooper(), msg -> {
final int pid = msg.arg1;
final int group = msg.arg2;
+ final ProcessRecord app = (ProcessRecord)msg.obj;
if (pid == ActivityManagerService.MY_PID) {
// Skip setting the process group for system_server, keep it as default.
return true;
}
if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) {
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "setProcessGroup "
- + msg.obj + " to " + group);
+ + app.processName + " to " + group);
}
try {
- setProcessGroup(pid, group);
+ if (mEnableProcessGroupCgroupFollow) {
+ setCgroupProcsProcessGroup(app.info.uid, pid, group, mProcessGroupCgroupFollowDex2oatOnly);
+ } else {
+ setProcessGroup(pid, group);
+ }
} catch (Exception e) {
if (DEBUG_ALL) {
Slog.w(TAG, "Failed setting process group of " + pid + " to " + group, e);
@@ -1183,9 +1221,40 @@ public class OomAdjuster {
int numCachedExtraGroup = 0;
int numEmpty = 0;
int numTrimming = 0;
+ ProcessRecord selectedAppRecord = null;
+ long serviceLastActivity = 0;
+ int numBServices = 0;
for (int i = numLru - 1; i >= 0; i--) {
ProcessRecord app = lruList.get(i);
+ if (mEnableBServicePropagation && app.mState.isServiceB()
+ && (app.mState.getCurAdj() == ProcessList.SERVICE_B_ADJ)) {
+ numBServices++;
+ for (int s = app.mServices.numberOfRunningServices() - 1; s >= 0; s--) {
+ ServiceRecord sr = app.mServices.getRunningServiceAt(s);
+ if (DEBUG_OOM_ADJ) Slog.d(TAG,"app.processName = " + app.processName
+ + " serviceb = " + app.mState.isServiceB() + " s = " + s + " sr.lastActivity = "
+ + sr.lastActivity + " packageName = " + sr.packageName
+ + " processName = " + sr.processName);
+ if (SystemClock.uptimeMillis() - sr.lastActivity
+ < mMinBServiceAgingTime) {
+ if (DEBUG_OOM_ADJ) {
+ Slog.d(TAG,"Not aged enough!!!");
+ }
+ continue;
+ }
+ if (serviceLastActivity == 0) {
+ serviceLastActivity = sr.lastActivity;
+ selectedAppRecord = app;
+ } else if (sr.lastActivity < serviceLastActivity) {
+ serviceLastActivity = sr.lastActivity;
+ selectedAppRecord = app;
+ }
+ }
+ }
+ if (DEBUG_OOM_ADJ && selectedAppRecord != null) Slog.d(TAG,
+ "Identified app.processName = " + selectedAppRecord.processName
+ + " app.pid = " + selectedAppRecord.getPid());
final ProcessStateRecord state = app.mState;
if (!app.isKilledByAm() && app.getThread() != null) {
// We don't need to apply the update for the process which didn't get computed
@@ -1268,6 +1337,15 @@ public class OomAdjuster {
}
}
+ if ((numBServices > mBServiceAppThreshold) && (true == mService.mAppProfiler.allowLowerMemLevelLocked())
+ && (selectedAppRecord != null)) {
+ ProcessList.setOomAdj(selectedAppRecord.getPid(), selectedAppRecord.info.uid,
+ ProcessList.CACHED_APP_MAX_ADJ);
+ selectedAppRecord.mState.setSetAdj(selectedAppRecord.mState.getCurAdj());
+ if (DEBUG_OOM_ADJ) Slog.d(TAG,"app.processName = " + selectedAppRecord.processName
+ + " app.pid = " + selectedAppRecord.getPid() + " is moved to higher adj");
+ }
+
mProcessList.incrementProcStateSeqAndNotifyAppsLOSP(activeUids);
return mService.mAppProfiler.updateLowMemStateLSP(numCached, numEmpty, numTrimming);
@@ -1646,6 +1724,25 @@ public class OomAdjuster {
hasVisibleActivities = true;
procState = PROCESS_STATE_CUR_TOP;
state.bumpAllowStartFgsState(PROCESS_STATE_TOP);
+
+ if(mIsTopAppRenderThreadBoostEnabled) {
+ if(mCurRenderThreadTid != app.getRenderThreadTid() && app.getRenderThreadTid() > 0) {
+ mCurRenderThreadTid = app.getRenderThreadTid();
+ if (mPerfBoost != null) {
+ Slog.d(TAG, "TOP-APP: pid:" + app.getPid() + ", processName: "
+ + app.processName + ", renderThreadTid: " + app.getRenderThreadTid());
+ if (mPerfHandle >= 0) {
+ mPerfBoost.perfLockRelease();
+ mPerfHandle = -1;
+ }
+ mPerfHandle = mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_BOOST_RENDERTHREAD,
+ app.processName, app.getRenderThreadTid(), 1);
+ Slog.d(TAG, "VENDOR_HINT_BOOST_RENDERTHREAD perfHint was called. mPerfHandle: "
+ + mPerfHandle);
+ }
+ }
+ }
+
if (DEBUG_OOM_ADJ_REASON || logUid == appUid) {
reportOomAdjMessageLocked(TAG_OOM_ADJ, "Making top: " + app);
}
@@ -2626,7 +2723,32 @@ public class OomAdjuster {
}
if (state.getCurAdj() != state.getSetAdj()) {
- ProcessList.setOomAdj(app.getPid(), app.uid, state.getCurAdj());
+ // Hooks for background apps transition
+ if (mEnableBgt) {
+ if ((state.getSetAdj() >= ProcessList.CACHED_APP_MIN_ADJ &&
+ state.getSetAdj() <= ProcessList.CACHED_APP_MAX_ADJ) &&
+ state.getCurAdj() == ProcessList.FOREGROUND_APP_ADJ &&
+ state.hasForegroundActivities()) {
+ Slog.d(TAG,"App adj change from cached state to fg state : "
+ + app.getPid() + " " + app.processName);
+ if (mPerf != null) {
+ int fgAppPerfLockArgs[] = {BoostFramework.MPCTLV3_GPU_IS_APP_FG, app.getPid()};
+ mPerf.perfLockAcquire(10, fgAppPerfLockArgs);
+ }
+ }
+ if(state.getSetAdj() == ProcessList.PREVIOUS_APP_ADJ &&
+ (state.getCurAdj() >= ProcessList.CACHED_APP_MIN_ADJ &&
+ state.getCurAdj() <= ProcessList.CACHED_APP_MAX_ADJ) &&
+ app.hasActivities()) {
+ Slog.d(TAG,"App adj change from previous state to cached state : "
+ + app.getPid() + " " + app.processName);
+ if (mPerf != null) {
+ int bgAppPerfLockArgs[] = {BoostFramework.MPCTLV3_GPU_IS_APP_BG, app.getPid()};
+ mPerf.perfLockAcquire(10, bgAppPerfLockArgs);
+ }
+ }
+ }
+ ProcessList.setOomAdj(app.getPid(), app.uid, app.mState.getCurAdj());
if (DEBUG_SWITCH || DEBUG_OOM_ADJ || mService.mCurOomAdjUid == app.info.uid) {
String msg = "Set " + app.getPid() + " " + app.processName + " adj "
+ state.getCurAdj() + ": " + state.getAdjType();
@@ -2668,7 +2790,7 @@ public class OomAdjuster {
break;
}
mProcessGroupHandler.sendMessage(mProcessGroupHandler.obtainMessage(
- 0 /* unused */, app.getPid(), processGroup, app.processName));
+ 0 /* unused */, app.getPid(), processGroup, app));
try {
final int renderThreadTid = app.getRenderThreadTid();
if (curSchedGroup == ProcessList.SCHED_GROUP_TOP_APP) {
diff --git a/services/core/java/com/android/server/am/ProcessErrorStateRecord.java b/services/core/java/com/android/server/am/ProcessErrorStateRecord.java
index 7e79ef5a5e69..ea7daee2fde9 100644
--- a/services/core/java/com/android/server/am/ProcessErrorStateRecord.java
+++ b/services/core/java/com/android/server/am/ProcessErrorStateRecord.java
@@ -35,6 +35,7 @@ import android.os.Message;
import android.os.Process;
import android.os.ServiceManager;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.os.incremental.IIncrementalService;
import android.os.incremental.IncrementalManager;
import android.os.incremental.IncrementalMetrics;
@@ -48,7 +49,9 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.ProcessCpuTracker;
import com.android.internal.util.FrameworkStatsLog;
+import com.android.server.am.trace.SmartTraceUtils;
import com.android.server.MemoryPressureUtil;
+import com.android.server.Watchdog;
import com.android.server.wm.WindowProcessController;
import java.io.File;
@@ -89,6 +92,8 @@ class ProcessErrorStateRecord {
@CompositeRWLock({"mService", "mProcLock"})
private boolean mNotResponding;
+ @CompositeRWLock({"mService", "mProcLock"})
+ private boolean mDefered;
/**
* The report about crash of the app, generated &amp; stored when an app gets into a crash.
* Will be "null" when all is OK.
@@ -165,6 +170,16 @@ class ProcessErrorStateRecord {
}
@GuardedBy(anyOf = {"mService", "mProcLock"})
+ boolean isDefered() {
+ return mDefered;
+ }
+
+ @GuardedBy({"mService", "mProcLock"})
+ void setDefered(boolean defer) {
+ mDefered = defer;
+ }
+
+ @GuardedBy(anyOf = {"mService", "mProcLock"})
Runnable getCrashHandler() {
return mCrashHandler;
}
@@ -354,28 +369,32 @@ class ProcessErrorStateRecord {
StringBuilder report = new StringBuilder();
report.append(MemoryPressureUtil.currentPsiState());
ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true);
-
+ ArrayList<Integer> nativePids = null;
+ boolean smTraceEnabled = isSmartTraceEnabled(isSilentAnr);
+ boolean isDefered;
+ synchronized (mProcLock) {
+ isDefered = isDefered();
+ }
// don't dump native PIDs for background ANRs unless it is the process of interest
- String[] nativeProcs = null;
+ String[] nativeProc = null;
if (isSilentAnr || onlyDumpSelf) {
for (int i = 0; i < NATIVE_STACKS_OF_INTEREST.length; i++) {
if (NATIVE_STACKS_OF_INTEREST[i].equals(mApp.processName)) {
- nativeProcs = new String[] { mApp.processName };
+ nativeProc = new String[] { mApp.processName };
break;
}
}
- } else {
- nativeProcs = NATIVE_STACKS_OF_INTEREST;
- }
-
- int[] pids = nativeProcs == null ? null : Process.getPidsForCommands(nativeProcs);
- ArrayList<Integer> nativePids = null;
-
- if (pids != null) {
- nativePids = new ArrayList<>(pids.length);
- for (int i : pids) {
- nativePids.add(i);
+ int[] pids = nativeProc == null ? null : Process.getPidsForCommands(nativeProc);
+ if(pids != null){
+ nativePids = new ArrayList<>(pids.length);
+ for (int i : pids) {
+ nativePids.add(i);
+ }
}
+ } else {
+ if (!smTraceEnabled || SmartTraceUtils.isDumpPredefinedPidsEnabled()) {
+ nativePids = Watchdog.getInstance().getInterestingNativePids();
+ }
}
// For background ANRs, don't pass the ProcessCpuTracker to
@@ -387,6 +406,19 @@ class ProcessErrorStateRecord {
isSilentAnr ? null : processCpuTracker, isSilentAnr ? null : lastPids,
nativePids, tracesFileException, offsets, annotation);
+ long dueTime = SystemClock.uptimeMillis()
+ + AnrHelper.APP_NOT_RESPONDING_DEFER_TIMEOUT_MILLIS;
+ if (smTraceEnabled && tracesFile != null){
+ long time = SystemClock.uptimeMillis();
+ SmartTraceUtils.dumpStackTraces(pid, firstPids, nativePids, tracesFile);
+ Slog.i(TAG, mApp.processName + " hit anr, dumpStackTraces cost "
+ +(SystemClock.uptimeMillis() - time) +" ms");
+ }
+
+ if (isPerfettoDumpEnabled(isSilentAnr) && !isDefered){
+ SmartTraceUtils.traceStart();
+ }
+
if (isMonitorCpuUsage()) {
mService.updateCpuStatsNow();
mService.mAppProfiler.printCurrentCpuState(report, anrTime);
@@ -396,8 +428,37 @@ class ProcessErrorStateRecord {
report.append(tracesFileException.getBuffer());
info.append(processCpuTracker.printCurrentState(anrTime));
+ if(shouldDeferAppNotResponding(isSilentAnr)) {
+ if(!isDefered){
+ Slog.e(TAG, info.toString());
+ long now = SystemClock.uptimeMillis();
+ long delay = 0;
+ if (dueTime < now){
+ delay = 2000;
+ }else {
+ delay = dueTime - now;
+ }
+ Slog.i(TAG, "Defer to handle " + mApp.processName
+ + " ANR, delay "+delay+" ms ");
+ mApp.mService.mAnrHelper.deferAppNotResponding(mApp, activityShortComponentName,
+ aInfo, parentShortComponentName, parentProcess,
+ aboveSystem, annotation, delay);
+ synchronized (mProcLock) {
+ setDefered(true);
+ setNotResponding(false);
+ setNotRespondingReport(null);
+ }
+ return;
+ }else {
+ synchronized (mProcLock) {
+ setDefered(false);
+ }
+ Slog.d(TAG, mApp.processName +" has been defered, handle anr right now ");
+ }
+ }else {
+ Slog.e(TAG, info.toString());
+ }
- Slog.e(TAG, info.toString());
if (tracesFile == null) {
// There is no trace file, so dump (only) the alleged culprit's threads to the log
Process.sendSignal(pid, Process.SIGNAL_QUIT);
@@ -540,6 +601,21 @@ class ProcessErrorStateRecord {
mApp.getWindowProcessController().stopFreezingActivities();
}
+ private boolean isSmartTraceEnabled(boolean isSilentAnr) {
+ return SmartTraceUtils.isSmartTraceEnabled() &&
+ (!isSilentAnr || (isSilentAnr && SmartTraceUtils.isSmartTraceEnabledOnBgApp()));
+ }
+
+ private boolean isPerfettoDumpEnabled(boolean isSilentAnr) {
+ return SmartTraceUtils.isPerfettoDumpEnabled() &&
+ (!isSilentAnr || (isSilentAnr && SmartTraceUtils.isPerfettoDumpEnabledOnBgApp()));
+ }
+
+ private boolean shouldDeferAppNotResponding(boolean isSilentAnr) {
+ return (isSmartTraceEnabled(isSilentAnr) ||
+ isPerfettoDumpEnabled(isSilentAnr));
+ }
+
@GuardedBy({"mService", "mProcLock"})
void startAppProblemLSP() {
// If this app is not running under the current user, then we can't give it a report button
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index 1e66ed42ff96..29ac8738eeab 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -107,6 +107,7 @@ import android.system.Os;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.DebugUtils;
import android.util.EventLog;
import android.util.LongSparseArray;
@@ -580,6 +581,11 @@ public final class ProcessList {
ActivityManagerGlobalLock mProcLock;
+ /**
+ * BoostFramework Object
+ */
+ public static BoostFramework mPerfServiceStartHint = new BoostFramework();
+
final class IsolatedUidRange {
@VisibleForTesting
public final int mFirstUid;
@@ -2438,6 +2444,16 @@ public final class ProcessList {
storageManagerInternal.prepareStorageDirs(userId, pkgDataInfoMap.keySet(),
app.processName);
}
+ if (mPerfServiceStartHint != null) {
+ if ((hostingRecord.getType() != null)
+ && (hostingRecord.getType().equals("activity")
+ || hostingRecord.getType().equals("pre-top-activity"))) {
+ //TODO: not acting on pre-activity
+ if (startResult != null) {
+ mPerfServiceStartHint.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, app.processName, startResult.pid, BoostFramework.Launch.TYPE_START_PROC);
+ }
+ }
+ }
checkSlow(startTime, "startProcess: returned from zygote!");
return startResult;
} finally {
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index b9d7917ed38d..dd2c810750ac 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -46,6 +46,7 @@ import android.util.EventLog;
import android.util.Slog;
import android.util.TimeUtils;
import android.util.proto.ProtoOutputStream;
+import android.util.BoostFramework;
import com.android.internal.annotations.CompositeRWLock;
import com.android.internal.annotations.GuardedBy;
@@ -566,6 +567,21 @@ class ProcessRecord implements WindowProcessListener {
@GuardedBy({"mService", "mProcLock"})
public void makeActive(IApplicationThread thread, ProcessStatsService tracker) {
+ // TODO(b/180501180): Add back this logging message.
+ /*
+ String seempStr = "app_uid=" + uid
+ + ",app_pid=" + pid + ",oom_adj=" + curAdj
+ + ",setAdj=" + setAdj + ",hasShownUi=" + (hasShownUi ? 1 : 0)
+ + ",cached=" + (mCached ? 1 : 0)
+ + ",fA=" + (mHasForegroundActivities ? 1 : 0)
+ + ",fS=" + (mHasForegroundServices ? 1 : 0)
+ + ",systemNoUi=" + (systemNoUi ? 1 : 0)
+ + ",curSchedGroup=" + mCurSchedGroup
+ + ",curProcState=" + getCurProcState() + ",setProcState=" + setProcState
+ + ",killed=" + (killed ? 1 : 0) + ",killedByAm=" + (killedByAm ? 1 : 0)
+ + ",isDebugging=" + (isDebugging() ? 1 : 0);
+ android.util.SeempLog.record_str(386, seempStr);
+ */
mProfile.onProcessActive(thread, tracker);
mThread = thread;
mWindowProcessController.setThread(thread);
@@ -573,6 +589,21 @@ class ProcessRecord implements WindowProcessListener {
@GuardedBy({"mService", "mProcLock"})
public void makeInactive(ProcessStatsService tracker) {
+ // TODO(b/180501180): Add back this logging message.
+ /*
+ String seempStr = "app_uid=" + uid
+ + ",app_pid=" + pid + ",oom_adj=" + curAdj
+ + ",setAdj=" + setAdj + ",hasShownUi=" + (hasShownUi ? 1 : 0)
+ + ",cached=" + (mCached ? 1 : 0)
+ + ",fA=" + (mHasForegroundActivities ? 1 : 0)
+ + ",fS=" + (mHasForegroundServices ? 1 : 0)
+ + ",systemNoUi=" + (systemNoUi ? 1 : 0)
+ + ",curSchedGroup=" + mCurSchedGroup
+ + ",curProcState=" + getCurProcState() + ",setProcState=" + setProcState
+ + ",killed=" + (killed ? 1 : 0) + ",killedByAm=" + (killedByAm ? 1 : 0)
+ + ",isDebugging=" + (isDebugging() ? 1 : 0);
+ android.util.SeempLog.record_str(387, seempStr);
+ */
mThread = null;
mWindowProcessController.setThread(null);
mProfile.onProcessInactive(tracker);
@@ -993,6 +1024,7 @@ class ProcessRecord implements WindowProcessListener {
boolean noisy) {
if (!mKilledByAm) {
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "kill");
+ BoostFramework ux_perf = new BoostFramework();
if (mService != null && (noisy || info.uid == mService.mCurOomAdjUid)) {
mService.reportUidInfoMessageLocked(TAG,
"Killing " + toShortString() + " (adj " + mState.getSetAdj()
@@ -1014,6 +1046,13 @@ class ProcessRecord implements WindowProcessListener {
mKillTime = SystemClock.uptimeMillis();
}
}
+ if (ux_perf != null && !mService.mForceStopKill && !mErrorState.isNotResponding()
+ && !mErrorState.isCrashing()) {
+ ux_perf.perfUXEngine_events(BoostFramework.UXE_EVENT_KILL, 0, this.processName, 0);
+ ux_perf.perfEvent(BoostFramework.VENDOR_HINT_KILL,this.processName, 2, 0,getPid());
+ } else {
+ mService.mForceStopKill = false;
+ }
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
}
diff --git a/services/core/java/com/android/server/am/trace/BinderTransactions.java b/services/core/java/com/android/server/am/trace/BinderTransactions.java
new file mode 100644
index 000000000000..1a2da95fb200
--- /dev/null
+++ b/services/core/java/com/android/server/am/trace/BinderTransactions.java
@@ -0,0 +1,204 @@
+/* Copyright (c) 2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.server.am.trace;
+
+import android.os.Process;
+import android.util.Slog;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.Locale;
+
+public class BinderTransactions {
+ private static final String TAG = "BinderTransactions";
+ private final static String REGEX_PATTERN =
+ "\\s+(outgoing|incoming|pending)\\s+transaction.*from"
+ + "\\s+(\\d+):\\d+\\s+to\\s+(\\d+):\\d+\\s+.*";
+ private final static String BINDER_TRANSATION_FILE = "/dev/binderfs/binder_logs/state";
+ private static final int DUMP_MAX_COUNT = 10;
+ // binder ref mapping to binder service
+ private Map<Integer, HashSet<Integer>> mLocalToRemotesMap =
+ new HashMap<Integer, HashSet<Integer>>();
+ private int mCheckPid;
+ //whether need recursive find the blocked target process
+ private boolean mRecursiveMode;
+ private Set<Integer> mRemotePids = new HashSet();
+ /**
+ * @param recursive recursive mode
+ */
+ public BinderTransactions(boolean recursive) {
+ mRecursiveMode = recursive;
+ }
+
+ /**
+ * find all the processes who is binder transaction to {pid}
+ * @param pid anr happen on PID
+ * @return
+ */
+ public Set<Integer> getTargetPidsStuckInBinder(int pid){
+ mCheckPid = pid;
+ parseFromFile();
+ if(!mRecursiveMode) {
+ if(mLocalToRemotesMap.containsKey(pid)){
+ for(int remotePid: mLocalToRemotesMap.get(pid)) {
+ mRemotePids.add(remotePid);
+ }
+ }
+ }else {
+ Set<Integer> keyPids = mLocalToRemotesMap.keySet();
+ for(Integer p: keyPids) {
+ if(p == mCheckPid) {
+ mRemotePids.add(p);
+ findRemotePid(p);
+ }
+ }
+ }
+
+ Set<Integer> ret = new HashSet<Integer>();
+ mRemotePids.forEach(
+ p->{if(p!= 0 && ret.size() <= SmartTraceUtils.DUMP_MAX_COUNT) ret.add(p);});
+ return ret;
+ }
+
+ public void binderStateRead(File outputFile) {
+ try {
+ boolean binderfsNodePresent = false;
+ BufferedReader in = null;
+ Slog.i(TAG,"Collecting Binder Transaction Status Information");
+ try {
+ in = new BufferedReader(new FileReader(BINDER_TRANSATION_FILE));
+ Slog.i(TAG, "Collecting Binder state file from binderfs");
+ binderfsNodePresent = true;
+ } catch(IOException e) {
+ Slog.i(TAG, "Binderfs node not found, Trying to collect it from debugfs", e);
+ }
+ try {
+ if (binderfsNodePresent == false) {
+ in = new BufferedReader(new FileReader("/sys/kernel/debug/binder/state"));
+ Slog.i(TAG, "Collecting Binder state file from debugfs");
+ }
+ } catch(IOException e) {
+ Slog.i(TAG, "Debugfs node not found", e);
+ }
+ if (in == null) {
+ return;
+ }
+ String format = "yyyy-MM-dd-HH-mm-ss";
+ String now = new SimpleDateFormat(format, Locale.US).format(new Date());
+ FileWriter out = new FileWriter(outputFile, true);
+ String line = null;
+
+ // Write line-by-line
+ while ((line = in.readLine()) != null) {
+ out.write(line);
+ out.write('\n');
+ }
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ Slog.w(TAG, "Failed to collect state file", e);
+ }
+ }
+
+ private void findRemotePid(int s) {
+ if(mLocalToRemotesMap.containsKey(s)) {
+ for(Integer p: mLocalToRemotesMap.get(s)) {
+ if(!mRemotePids.contains(p)) {
+ mRemotePids.add(p);
+ //continue to search
+ findRemotePid(p);
+ }
+ }
+ }
+ }
+
+ private void parseFromFile() {
+ try {
+ mLocalToRemotesMap.clear();
+ mRemotePids.clear();
+ BufferedReader in =
+ new BufferedReader(new FileReader(BINDER_TRANSATION_FILE));
+ Pattern outP=Pattern.compile(REGEX_PATTERN);
+ Matcher m;
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ // match outgoing transaction
+ m = outP.matcher(line);
+ if(m.find()) {
+ addItem(Integer.parseInt(m.group(2)),
+ Integer.parseInt(m.group(3)),
+ m.group(1).equals("outgoing"));
+ }
+ }
+ in.close();
+ } catch (FileNotFoundException e) {
+ Slog.w(TAG, "Unexpected FileNotFoundException" , e);
+ } catch (IOException e) {
+ Slog.w(TAG, "Unexpected IOException" , e);
+ } catch (NumberFormatException e) {
+ Slog.w(TAG,"Unexpected NumberFormatException ", e);
+ }
+ }
+
+ /**
+ * @spid source pid
+ * @stid source tid
+ * @tpid target pid
+ * @ttid target tid
+ */
+ private void addItem(int spid, int tpid, boolean outgoing) {
+ if(outgoing) {
+ if(mLocalToRemotesMap.containsKey(spid)) {
+ mLocalToRemotesMap.get(spid).add(tpid);
+ }else {
+ HashSet<Integer> set = new HashSet<Integer>();
+ set.add(tpid);
+ mLocalToRemotesMap.put(spid, set);
+ }
+ }else {
+ if(tpid == mCheckPid) {
+ mRemotePids.add(spid);
+ }
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/trace/SmartTraceUtils.java b/services/core/java/com/android/server/am/trace/SmartTraceUtils.java
new file mode 100644
index 000000000000..8262fd8ff55e
--- /dev/null
+++ b/services/core/java/com/android/server/am/trace/SmartTraceUtils.java
@@ -0,0 +1,172 @@
+/* Copyright (c) 2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.server.am.trace;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Set;
+
+import static android.text.format.DateUtils.DAY_IN_MILLIS;
+
+import android.os.SystemProperties;
+import android.text.TextUtils;
+import android.util.Slog;
+
+public class SmartTraceUtils {
+ // true to enable smart trace function
+ public static final String PROP_ENABLE_SMART_TRACE= "persist.sys.smtrace.enable";
+ public static final String PROP_ENABLE_ON_BG_APP = "persist.sys.smtrace.bgapp.enable";
+ public static final String PROP_ENABLE_PERFETTO_DUMP = "persist.sys.perfetto_dump.enable";
+ public static final String PROP_ENABLE_PERFETTO_ON_BG_APP = "persist.sys.perfetto.bgapp.enable";
+ //whether need to dump process defined in NATIVE_STACKS_OF_INTEREST Watchdog.java
+ //default value false
+ public static final String PROP_ENABLE_DUMP_PREDEFINED_PIDS =
+ "persist.sys.smtrace.dump.predefined_pids.enable";
+ //defined extra cmdline to dump trace
+ public static final String PROP_DUMP_CMDLINES= "persist.sys.smtrace.dump.cmdlines.extra";
+ //whether need recursive find the blocked target process
+ public static final String PROP_ENABLE_RECURSIVE_MODE =
+ "persist.sys.smtrace.recursivemode.enable";
+
+ public static final int DUMP_MAX_COUNT = 10;
+ private static final String PROP_PERFETTO_COMMAND = "sys.perfetto.cmd";
+ //should not set by user
+ private static final String PROP_DUMP_CMD = "sys.smtrace.cmd";
+ //perfetto max file count
+ private static final String PROP_PERFETTO_MAX_TRACE_COUNT=
+ "persist.sys.perfetto.max_trace_count";
+ private static final String TRACE_DIRECTORY = "/data/misc/perfetto-traces/";
+ private static final String TAG = "SmartTraceUtils";
+
+ public static boolean isSmartTraceEnabled() {
+ return SystemProperties.getBoolean(PROP_ENABLE_SMART_TRACE, false);
+ }
+
+ public static boolean isSmartTraceEnabledOnBgApp() {
+ return SystemProperties.getBoolean(PROP_ENABLE_ON_BG_APP, true);
+ }
+
+ public static boolean isDumpPredefinedPidsEnabled() {
+ return SystemProperties.getBoolean(PROP_ENABLE_DUMP_PREDEFINED_PIDS, false);
+ }
+
+ public static boolean isPerfettoDumpEnabled() {
+ return SystemProperties.getBoolean(PROP_ENABLE_PERFETTO_DUMP, false);
+ }
+
+ public static boolean isPerfettoDumpEnabledOnBgApp() {
+ return SystemProperties.getBoolean(PROP_ENABLE_PERFETTO_ON_BG_APP, true);
+ }
+
+ public static boolean isRecursiveModeEnabled() {
+ return SystemProperties.getBoolean(PROP_ENABLE_RECURSIVE_MODE, true);
+ }
+
+ //process ids store in "sys.smtrace.cmd" property shows IPC communicate with
+ //system process, it requires /system/bin/binder_trace_dump.sh tool to dump their trace
+ //and reset property value to "" after work finished.
+ public static void dumpStackTraces(int pid, ArrayList<Integer> firstPids,
+ ArrayList<Integer> nativePids, File outputFile) {
+ if(!isSmartTraceEnabled()) {
+ return;
+ }
+ if (isDumpingOn()){
+ Slog.e(TAG,
+ "Attempting to run smart trace dump but trace is already in progress, skip it");
+ return;
+ }
+ Set<Integer> pidSet = getTargetPidsStuckInBinder(pid, firstPids, nativePids, outputFile);
+ if(pidSet != null && pidSet.size() != 0) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(pid);
+ pidSet.forEach(p->{sb.append(","); sb.append(p);});
+ sb.append(":"+outputFile.getPath());
+ SystemProperties.set(PROP_DUMP_CMD,sb.toString());
+ Slog.i(TAG, "Start collect stack trace for "+sb.toString());
+ }
+ }
+
+ public static boolean traceStart() {
+ if (isTracingOn()){
+ Slog.e(TAG,
+ "Attempting to start perfetto trace but trace is already in progress, skip it");
+ return false;
+ }
+ Slog.i(TAG,"Perfetto trace start..");
+ SystemProperties.set(PROP_PERFETTO_COMMAND,"START");
+ return true;
+ }
+
+ private static boolean isDumpingOn() {
+ return !TextUtils.isEmpty(SystemProperties.get(PROP_DUMP_CMD,""));
+ }
+
+ private static boolean isTracingOn() {
+ return !TextUtils.isEmpty(SystemProperties.get(PROP_PERFETTO_COMMAND,""));
+ }
+
+ private static Set<Integer> getTargetPidsStuckInBinder(int pid, ArrayList<Integer> firstPids,
+ ArrayList<Integer> nativePids, File outputFile) {
+ BinderTransactions transactions = new BinderTransactions(isRecursiveModeEnabled());
+ transactions.binderStateRead(outputFile);
+ Set<Integer> pidSet = transactions.getTargetPidsStuckInBinder(pid);
+ //remove duplicate process
+ pidSet.removeAll(firstPids);
+ if(nativePids != null){
+ pidSet.removeAll(nativePids);
+ }
+
+ int[] extraPids = readExtraCmdlinesFromProperty();
+ if(extraPids != null) {
+ for(int p: extraPids){
+ pidSet.add(p);
+ }
+ }
+ return pidSet;
+ }
+
+ private static int[] readExtraCmdlinesFromProperty() {
+ String cmdlines = SystemProperties.get(PROP_DUMP_CMDLINES, "");
+ if (TextUtils.isEmpty(cmdlines)) {
+ return null;
+ }
+
+ try {
+ return android.os.Process.getPidsForCommands(cmdlines.split(","));
+ }catch(NullPointerException e) {
+ Slog.e(TAG, "Exception get pid for commonds " + cmdlines, e);
+ }catch(OutOfMemoryError e) {
+ Slog.e(TAG, "Out of Memory when get pid for commonds " + cmdlines, e);
+ }
+ return null;
+ }
+}
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
index b1e62483c472..bdc7099f2532 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
@@ -547,7 +547,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
return true;
}
if (o instanceof BtDeviceConnectionInfo) {
- return mDevice.equals(((BtDeviceConnectionInfo) o).mDevice);
+ return mDevice.equals(((BtDeviceConnectionInfo) o).mDevice) &&
+ mProfile == (((BtDeviceConnectionInfo) o).mProfile);
}
return false;
}
@@ -580,7 +581,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
// when receiving a request to change the connection state of a device, this last
// request is the source of truth, so cancel all previous requests that are already in
// the handler
- removeScheduledA2dpEvents(info.mDevice);
+ removeScheduledA2dpEvents(info.mDevice, info.mProfile);
sendLMsgNoDelay(
info.mState == BluetoothProfile.STATE_CONNECTED
@@ -592,14 +593,16 @@ import java.util.concurrent.atomic.AtomicBoolean;
/** remove all previously scheduled connection and state change events for the given device */
@GuardedBy("mDeviceStateLock")
- private void removeScheduledA2dpEvents(@NonNull BluetoothDevice device) {
- mBrokerHandler.removeEqualMessages(MSG_L_A2DP_DEVICE_CONFIG_CHANGE, device);
+ private void removeScheduledA2dpEvents(@NonNull BluetoothDevice device, int profile) {
+ if (profile == BluetoothProfile.A2DP) {
+ mBrokerHandler.removeEqualMessages(MSG_L_A2DP_DEVICE_CONFIG_CHANGE, device);
+ }
final BtDeviceConnectionInfo connectionInfoToRemove = new BtDeviceConnectionInfo(device,
// the next parameters of the constructor will be ignored when finding the message
// to remove as the equality of the message's object is tested on the device itself
// (see BtDeviceConnectionInfo.equals() method override)
- BluetoothProfile.STATE_CONNECTED, 0, false, -1);
+ BluetoothProfile.STATE_CONNECTED, profile, false, -1);
mBrokerHandler.removeEqualMessages(MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION,
connectionInfoToRemove);
mBrokerHandler.removeEqualMessages(MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION,
@@ -615,6 +618,18 @@ import java.util.concurrent.atomic.AtomicBoolean;
devInfoToRemove);
}
+ /*package*/ void postBluetoothA2dpDeviceConfigChangeExt(
+ @NonNull BluetoothDevice device,
+ @AudioService.BtProfileConnectionState int state, int profile,
+ boolean suppressNoisyIntent, int a2dpVolume) {
+ final BtDeviceConnectionInfo info = new BtDeviceConnectionInfo(device, state, profile,
+ suppressNoisyIntent, a2dpVolume);
+ synchronized (mDeviceStateLock) {
+ removeScheduledA2dpEvents(info.mDevice, info.mProfile);
+ sendLMsgNoDelay(MSG_L_A2DP_ACTIVE_DEVICE_CHANGE_EXT, SENDMSG_QUEUE, info);
+ }
+ }
+
private static final class HearingAidDeviceConnectionInfo {
final @NonNull BluetoothDevice mDevice;
final @AudioService.BtProfileConnectionState int mState;
@@ -1470,6 +1485,22 @@ import java.util.concurrent.atomic.AtomicBoolean;
info.mDevice, info.mState, info.mSupprNoisy, info.mMusicDevice);
}
} break;
+ case MSG_L_A2DP_ACTIVE_DEVICE_CHANGE_EXT: {
+ final BtDeviceConnectionInfo info = (BtDeviceConnectionInfo) msg.obj;
+ AudioService.sDeviceLogger.log((new AudioEventLogger.StringEvent(
+ "handleBluetoothA2dpActiveDeviceChangeExt "
+ + " state=" + info.mState
+ // only querying address as this is the only readily available
+ // field on the device
+ + " addr=" + info.mDevice.getAddress()
+ + " prof=" + info.mProfile + " supprNoisy=" + info.mSupprNoisy
+ + " vol=" + info.mVolume)).printLog(TAG));
+ synchronized (mDeviceStateLock) {
+ mDeviceInventory.handleBluetoothA2dpActiveDeviceChangeExt(
+ info.mDevice, info.mState, info.mProfile,
+ info.mSupprNoisy, info.mVolume);
+ }
+ } break;
case MSG_IL_SAVE_PREF_DEVICES_FOR_STRATEGY: {
final int strategy = msg.arg1;
final List<AudioDeviceAttributes> devices =
@@ -1594,6 +1625,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
private static final int MSG_L_UPDATE_COMMUNICATION_ROUTE_CLIENT = 43;
private static final int MSG_I_SCO_AUDIO_STATE_CHANGED = 44;
+ // process external command to (dis)connect or change active A2DP device
+ private static final int MSG_L_A2DP_ACTIVE_DEVICE_CHANGE_EXT = 64;
+
private static boolean isMessageHandledUnderWakelock(int msgId) {
switch(msgId) {
case MSG_L_SET_WIRED_DEVICE_CONNECTION_STATE:
@@ -1609,6 +1643,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION:
case MSG_L_HEARING_AID_DEVICE_CONNECTION_CHANGE_EXT:
case MSG_CHECK_MUTE_MUSIC:
+ case MSG_L_A2DP_ACTIVE_DEVICE_CHANGE_EXT:
return true;
default:
return false;
@@ -1837,7 +1872,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
// what has been communicated to audio policy manager. The device
// returned by requestedCommunicationDevice() can be a dummy SCO device if legacy
// APIs are used to start SCO audio.
- AudioDeviceAttributes device = mBtHelper.getHeadsetAudioDevice();
+ AudioDeviceAttributes device = mBtHelper.getHeadsetAudioDummyDevice();
if (device != null) {
return device;
}
diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java
index 5288a04ce86e..6eb3235566f9 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java
@@ -36,6 +36,7 @@ import android.media.MediaMetrics;
import android.os.Binder;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.os.SystemProperties;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -49,6 +50,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
+import java.util.Map;
import java.util.List;
import java.util.Set;
@@ -366,6 +368,8 @@ public class AudioDeviceInventory {
address = "";
}
+ final @AudioSystem.AudioFormatNativeEnumForBtCodec int a2dpCodec = btInfo.getCodec();
+
synchronized (mDevicesLock) {
final String key = DeviceInfo.makeDeviceListKey(
AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, address);
@@ -384,7 +388,7 @@ public class AudioDeviceInventory {
if (isConnected && state != BluetoothProfile.STATE_CONNECTED) {
makeA2dpSrcUnavailable(address);
} else if (!isConnected && state == BluetoothProfile.STATE_CONNECTED) {
- makeA2dpSrcAvailable(address);
+ makeA2dpSrcAvailable(address, a2dpCodec);
}
}
}
@@ -451,14 +455,6 @@ public class AudioDeviceInventory {
+ " event=" + BtHelper.a2dpDeviceEventToString(event)));
synchronized (mDevicesLock) {
- if (mDeviceBroker.hasScheduledA2dpSinkConnectionState(btDevice)) {
- AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent(
- "A2dp config change ignored (scheduled connection change)")
- .printLog(TAG));
- mmi.set(MediaMetrics.Property.EARLY_RETURN, "A2dp config change ignored")
- .record();
- return;
- }
final String key = DeviceInfo.makeDeviceListKey(
AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address);
final DeviceInfo di = mConnectedDevices.get(key);
@@ -468,6 +464,20 @@ public class AudioDeviceInventory {
return;
}
+ if (mDeviceBroker.hasScheduledA2dpSinkConnectionState(btDevice)) {
+ //Incase of Active device change, mConnectedDevices might have already
+ //updated in handleBluetoothA2dpActiveDeviceChangeExt
+ //Now if we are ignoring active device change,update mApmConnected ,
+ //so that next connection events are handled
+ mApmConnectedDevices.replace(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, key);
+ AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent(
+ "A2dp config change ignored (scheduled connection change)")
+ .printLog(TAG));
+ mmi.set(MediaMetrics.Property.EARLY_RETURN, "A2dp config change ignored")
+ .record();
+ return;
+ }
+
mmi.set(MediaMetrics.Property.ADDRESS, address)
.set(MediaMetrics.Property.ENCODING,
AudioSystem.audioFormatToString(a2dpCodec))
@@ -476,6 +486,7 @@ public class AudioDeviceInventory {
if (event == BtHelper.EVENT_ACTIVE_DEVICE_CHANGE) {
// Device is connected
+ mApmConnectedDevices.replace(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, key);
if (a2dpVolume != -1) {
mDeviceBroker.postSetVolumeIndexOnDevice(AudioSystem.STREAM_MUSIC,
// convert index to internal representation in VolumeStreamState
@@ -894,7 +905,20 @@ public class AudioDeviceInventory {
delay = 0;
}
- final int a2dpCodec = mDeviceBroker.getA2dpCodec(device);
+ final int a2dpCodec;
+ if (state == BluetoothA2dp.STATE_DISCONNECTED) {
+ final String key = DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
+ device.getAddress());
+ final DeviceInfo di = mConnectedDevices.get(key);
+ if (di != null) {
+ a2dpCodec = di.mDeviceCodecFormat;
+ } else {
+ Log.e(TAG, "invalid null DeviceInfo in setBluetoothA2dpDeviceConnectionState");
+ return;
+ }
+ } else {
+ a2dpCodec = mDeviceBroker.getA2dpCodec(device);
+ }
if (AudioService.DEBUG_DEVICES) {
Log.i(TAG, "setBluetoothA2dpDeviceConnectionState device: " + device
@@ -917,6 +941,62 @@ public class AudioDeviceInventory {
}
}
+ /*package*/ void handleBluetoothA2dpActiveDeviceChangeExt(
+ @NonNull BluetoothDevice device,
+ @AudioService.BtProfileConnectionState int state, int profile,
+ boolean suppressNoisyIntent, int a2dpVolume) {
+ if (state == BluetoothProfile.STATE_DISCONNECTED) {
+ mDeviceBroker.queueBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(
+ new AudioDeviceBroker.BtDeviceConnectionInfo(device,state,profile,suppressNoisyIntent, a2dpVolume));
+ BtHelper.SetA2dpActiveDevice(null);
+ return;
+ }
+
+ if (state == BluetoothProfile.STATE_CONNECTED && profile == BluetoothProfile.A2DP_SINK) {
+ mDeviceBroker.queueBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(
+ new AudioDeviceBroker.BtDeviceConnectionInfo(device,state,profile,suppressNoisyIntent, a2dpVolume));
+ return;
+ }
+
+ // state == BluetoothProfile.STATE_CONNECTED
+ synchronized (mConnectedDevices) {
+ final String address = device.getAddress();
+ final int a2dpCodec = mDeviceBroker.getA2dpCodec(device);
+ final String deviceKey = DeviceInfo.makeDeviceListKey(
+ AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address);
+ DeviceInfo deviceInfo = mConnectedDevices.get(deviceKey);
+ if (deviceInfo != null) {
+ // Device config change for matching A2DP device
+ mDeviceBroker.postBluetoothA2dpDeviceConfigChange(device);
+ return;
+ }
+ for (Map.Entry<String, DeviceInfo> existingDevice : mConnectedDevices.entrySet()) {
+ if (existingDevice.getValue().mDeviceType != AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) {
+ continue;
+ }
+ // A2DP device exists, handle active device change
+ mConnectedDevices.remove(existingDevice.getKey());
+ mConnectedDevices.put(deviceKey, new DeviceInfo(
+ AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, BtHelper.getName(device),
+ address, a2dpCodec));
+ if (BtHelper.isTwsPlusSwitch(device, existingDevice.getValue().mDeviceAddress)) {
+ BtHelper.SetA2dpActiveDevice(device);
+ if (AudioService.DEBUG_DEVICES) {
+ Log.d(TAG,"TWS+ device switch");
+ }
+ return;
+ }
+ mDeviceBroker.postA2dpActiveDeviceChange(
+ new BtHelper.BluetoothA2dpDeviceInfo(
+ device, a2dpVolume, a2dpCodec));
+ return;
+ }
+ }
+ // New A2DP device connection
+ mDeviceBroker.queueBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(
+ new AudioDeviceBroker.BtDeviceConnectionInfo(device,state,profile,suppressNoisyIntent, a2dpVolume));
+ }
+
/*package*/ int setWiredDeviceConnectionState(int type, @AudioService.ConnectionState int state,
String address, String name, String caller) {
synchronized (mDevicesLock) {
@@ -970,16 +1050,18 @@ public class AudioDeviceInventory {
AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent(
"APM failed to make available A2DP device addr=" + address
+ " error=" + res).printLog(TAG));
- // TODO: connection failed, stop here
- // TODO: return;
+ // If error is audioserver died,add device to the list,so that during restart AS will
+ // restore by triggering onRestoreDevices to add A2DP device to APM by calling
+ // setDeviceConnection
+ if (res != AudioSystem.AUDIO_STATUS_SERVER_DIED) {
+ return;
+ }
+
} else {
AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent(
"A2DP device addr=" + address + " now available").printLog(TAG));
}
- // Reset A2DP suspend state each time a new sink is connected
- mAudioSystem.setParameters("A2dpSuspended=false");
-
final DeviceInfo di = new DeviceInfo(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, name,
address, a2dpCodec);
final String diKey = di.getKey();
@@ -1057,21 +1139,25 @@ public class AudioDeviceInventory {
@GuardedBy("mDevicesLock")
- private void makeA2dpSrcAvailable(String address) {
+ private void makeA2dpSrcAvailable(String address, int a2dpCodec) {
mAudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP,
AudioSystem.DEVICE_STATE_AVAILABLE, address, "",
- AudioSystem.AUDIO_FORMAT_DEFAULT);
+ a2dpCodec);
mConnectedDevices.put(
DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, address),
new DeviceInfo(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, "",
- address, AudioSystem.AUDIO_FORMAT_DEFAULT));
+ address, a2dpCodec));
}
@GuardedBy("mDevicesLock")
private void makeA2dpSrcUnavailable(String address) {
+ final String deviceKey =
+ DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, address);
+ final DeviceInfo deviceInfo = mConnectedDevices.get(deviceKey);
+ final int a2dpCodec = deviceInfo != null ? deviceInfo.mDeviceCodecFormat :
+ AudioSystem.AUDIO_FORMAT_DEFAULT;
mAudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP,
- AudioSystem.DEVICE_STATE_UNAVAILABLE, address, "",
- AudioSystem.AUDIO_FORMAT_DEFAULT);
+ AudioSystem.DEVICE_STATE_UNAVAILABLE, address, "", a2dpCodec);
mConnectedDevices.remove(
DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, address));
}
@@ -1216,7 +1302,7 @@ public class AudioDeviceInventory {
return 0;
}
mDeviceBroker.postBroadcastBecomingNoisy();
- delay = AudioService.BECOMING_NOISY_DELAY_MS;
+ delay = SystemProperties.getInt("audio.sys.noisy.broadcast.delay", 700);
} else {
Log.i(TAG, "not sending NOISY: device:0x" + Integer.toHexString(device)
+ " musicDevice:0x" + Integer.toHexString(musicDevice)
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 2e02e4977094..c9bc6308ca8a 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -226,6 +226,9 @@ public class AudioService extends IAudioService.Stub
/** Debug communication route */
protected static final boolean DEBUG_COMM_RTE = false;
+ /** debug SCO modes */
+ protected static final boolean DEBUG_SCO = true;
+
/** How long to delay before persisting a change in volume/ringer mode. */
private static final int PERSIST_DELAY = 500;
@@ -254,6 +257,9 @@ public class AudioService extends IAudioService.Stub
// indicates whether the system maps all streams to a single stream.
private final boolean mIsSingleVolume;
+ private static HashMap<String, String> mCachedParams =
+ new HashMap<String, String>();
+
/*package*/ boolean isPlatformVoice() {
return mPlatformType == AudioSystem.PLATFORM_VOICE;
}
@@ -1045,6 +1051,16 @@ public class AudioService extends IAudioService.Stub
// done with service initialization, continue additional work in our Handler thread
queueMsgUnderWakeLock(mAudioHandler, MSG_INIT_STREAMS_VOLUMES,
0 /* arg1 */, 0 /* arg2 */, null /* obj */, 0 /* delay */);
+
+ mCachedParams.put("hdr_record_on", "false");
+ mCachedParams.put("wnr_on", "false");
+ mCachedParams.put("ans_on", "false");
+ mCachedParams.put("orientation", "landscape");
+ mCachedParams.put("inverted", "false");
+ mCachedParams.put("facing", "none");
+ mCachedParams.put("hdr_audio_channel_count", "0");
+ mCachedParams.put("hdr_audio_sampling_rate", "0");
+
queueMsgUnderWakeLock(mAudioHandler, MSG_INIT_SPATIALIZER,
0 /* arg1 */, 0 /* arg2 */, null /* obj */, 0 /* delay */);
}
@@ -1325,6 +1341,26 @@ public class AudioService extends IAudioService.Stub
// process restarts after a crash, not the first time it is started.
AudioSystem.setParameters("restarting=true");
+ // Restore cached parameters
+ String params = new String("");
+ Log.i(TAG, "Cached params " + mCachedParams.toString());
+ for (HashMap.Entry<String, String> parm : mCachedParams.entrySet()) {
+ if (!params.isEmpty()) {
+ params += ";";
+ }
+ Log.i(TAG, "Key " + parm.getKey() + " Value " + parm.getValue());
+ params += parm.getKey();
+ params += "=";
+ params += parm.getValue();
+ Log.i(TAG, "Params " + params);
+ }
+ if (!params.isEmpty()) {
+ Log.i(TAG, "Restore params " + params);
+ AudioSystem.setParameters(params);
+ } else {
+ Log.i(TAG, "Empty cached params " + params);
+ }
+
readAndSetLowRamDevice();
mIsCallScreeningModeSupported = AudioSystem.isCallScreeningModeSupported();
@@ -2719,6 +2755,10 @@ public class AudioService extends IAudioService.Stub
final int streamType;
synchronized (mForceControlStreamLock) {
+ if (DEBUG_VOL) Log.d(TAG, "adjustSuggestedStreamVolume() stream=" + suggestedStreamType
+ + ", flags=" + flags + ", caller=" + caller
+ + ", volControlStream=" + mVolumeControlStream
+ + ", userSelect=" + mUserSelectedVolumeControlStream);
// Request lock in case mVolumeControlStream is changed by other thread.
if (mUserSelectedVolumeControlStream) { // implies mVolumeControlStream != -1
streamType = mVolumeControlStream;
@@ -2800,11 +2840,12 @@ public class AudioService extends IAudioService.Stub
protected void adjustStreamVolume(int streamType, int direction, int flags,
String callingPackage, String caller, int uid, int pid, boolean hasModifyAudioSettings,
int keyEventMode) {
+ if (DEBUG_VOL) Log.d(TAG, "adjustStreamVolume() stream=" + streamType + ", dir=" + direction
+ + ", flags=" + flags + ", caller=" + caller);
+
if (mUseFixedVolume) {
return;
}
- if (DEBUG_VOL) Log.d(TAG, "adjustStreamVolume() stream=" + streamType + ", dir=" + direction
- + ", flags=" + flags + ", caller=" + caller);
ensureValidDirection(direction);
ensureValidStreamType(streamType);
@@ -3565,6 +3606,7 @@ public class AudioService extends IAudioService.Stub
Log.d(TAG, "setStreamVolume(stream=" + streamType+", index=" + index
+ ", calling=" + callingPackage + ")");
}
+
if (mUseFixedVolume) {
return;
}
@@ -5270,6 +5312,8 @@ public class AudioService extends IAudioService.Stub
final String eventSource = new StringBuilder("setSpeakerphoneOn(").append(on)
.append(") from u/pid:").append(uid).append("/")
.append(pid).toString();
+ Log.i(TAG, "In setSpeakerphoneOn(), on: " + on + ", eventSource: " + eventSource);
+
new MediaMetrics.Item(MediaMetrics.Name.AUDIO_DEVICE
+ MediaMetrics.SEPARATOR + "setSpeakerphoneOn")
.setUid(uid)
@@ -5297,9 +5341,11 @@ public class AudioService extends IAudioService.Stub
if (!checkAudioSettingsPermission("setBluetoothScoOn()")) {
return;
}
-
// Only enable calls from system components
if (UserHandle.getCallingAppId() >= FIRST_APPLICATION_UID) {
+ Log.i(TAG, "In setBluetoothScoOn(), on: "+on+". The calling application Uid: "
+ + Binder.getCallingUid() + ", is greater than FIRST_APPLICATION_UID"
+ + " exiting from setBluetoothScoOn()");
mBtScoOnByApp = on;
return;
}
@@ -5309,6 +5355,7 @@ public class AudioService extends IAudioService.Stub
final int pid = Binder.getCallingPid();
final String eventSource = new StringBuilder("setBluetoothScoOn(").append(on)
.append(") from u/pid:").append(uid).append("/").append(pid).toString();
+ Log.i(TAG, "In setBluetoothScoOn(), eventSource: " + eventSource);
//bt sco
new MediaMetrics.Item(MediaMetrics.Name.AUDIO_DEVICE
@@ -5361,10 +5408,17 @@ public class AudioService extends IAudioService.Stub
/** @see AudioManager#startBluetoothSco() */
public void startBluetoothSco(IBinder cb, int targetSdkVersion) {
+ Log.i(TAG, "In startBluetoothSco()");
if (!checkAudioSettingsPermission("startBluetoothSco()")) {
return;
}
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if ((adapter == null) || (adapter.getState() != BluetoothAdapter.STATE_ON)) {
+ Log.i(TAG, "startBluetoothSco(), BT is not turned ON or adapter is null");
+ return;
+ }
+
final int uid = Binder.getCallingUid();
final int pid = Binder.getCallingPid();
final int scoAudioMode =
@@ -5387,6 +5441,7 @@ public class AudioService extends IAudioService.Stub
/** @see AudioManager#startBluetoothScoVirtualCall() */
public void startBluetoothScoVirtualCall(IBinder cb) {
+ Log.i(TAG, "In startBluetoothScoVirtualCall()");
if (!checkAudioSettingsPermission("startBluetoothScoVirtualCall()")) {
return;
}
@@ -5408,6 +5463,7 @@ public class AudioService extends IAudioService.Stub
}
void startBluetoothScoInt(IBinder cb, int pid, int scoAudioMode, @NonNull String eventSource) {
+ Log.i(TAG, "In startBluetoothScoInt(), scoAudioMode: " + scoAudioMode);
MediaMetrics.Item mmi = new MediaMetrics.Item(MediaMetrics.Name.AUDIO_BLUETOOTH)
.set(MediaMetrics.Property.EVENT, "startBluetoothScoInt")
.set(MediaMetrics.Property.SCO_AUDIO_MODE,
@@ -5426,6 +5482,12 @@ public class AudioService extends IAudioService.Stub
/** @see AudioManager#stopBluetoothSco() */
public void stopBluetoothSco(IBinder cb){
+ Log.i(TAG, "In stopBluetoothSco()");
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if ((adapter == null) || (adapter.getState() != BluetoothAdapter.STATE_ON)) {
+ Log.i(TAG, "stopBluetoothSco(), BT is not turned ON or adapter is null");
+ return;
+ }
if (!checkAudioSettingsPermission("stopBluetoothSco()") ||
!mSystemReady) {
return;
@@ -5472,8 +5534,7 @@ public class AudioService extends IAudioService.Stub
mMusicActiveMs += MUSIC_ACTIVE_POLL_PERIOD_MS;
if (mMusicActiveMs > UNSAFE_VOLUME_MUSIC_ACTIVE_MS_MAX) {
setSafeMediaVolumeEnabled(true, caller);
- mMusicActiveMs = 0;
- }
+ mMusicActiveMs = 0; }
saveMusicActiveMs();
}
}
@@ -5525,7 +5586,6 @@ public class AudioService extends IAudioService.Stub
SystemProperties.getBoolean("audio.safemedia.force", false)
|| mContext.getResources().getBoolean(
com.android.internal.R.bool.config_safe_media_volume_enabled);
-
boolean safeMediaVolumeBypass =
SystemProperties.getBoolean("audio.safemedia.bypass", false);
@@ -6346,6 +6406,27 @@ public class AudioService extends IAudioService.Stub
/*obj*/ device, /*delay*/ 0);
}
+ /**
+ * @see AudioManager#handleBluetoothA2dpActiveDeviceChange(BluetoothDevice, int, int,
+ * boolean, int)
+ */
+ public void handleBluetoothA2dpActiveDeviceChange(
+ BluetoothDevice device, int state, int profile, boolean suppressNoisyIntent,
+ int a2dpVolume) {
+ if (device == null) {
+ throw new IllegalArgumentException("Illegal null device");
+ }
+ if (profile != BluetoothProfile.A2DP && profile != BluetoothProfile.A2DP_SINK) {
+ throw new IllegalArgumentException("invalid profile " + profile);
+ }
+ if (state != BluetoothProfile.STATE_CONNECTED
+ && state != BluetoothProfile.STATE_DISCONNECTED) {
+ throw new IllegalArgumentException("Invalid state " + state);
+ }
+ mDeviceBroker.postBluetoothA2dpDeviceConfigChangeExt(device, state, profile,
+ suppressNoisyIntent, a2dpVolume);
+ }
+
private static final Set<Integer> DEVICE_MEDIA_UNMUTED_ON_PLUG_SET;
static {
DEVICE_MEDIA_UNMUTED_ON_PLUG_SET = new HashSet<>();
@@ -7957,8 +8038,7 @@ public class AudioService extends IAudioService.Stub
UserManager.DISALLOW_RECORD_AUDIO, false, userId);
} else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
- if (state == BluetoothAdapter.STATE_OFF ||
- state == BluetoothAdapter.STATE_TURNING_OFF) {
+ if (state == BluetoothAdapter.STATE_OFF) {
mDeviceBroker.disconnectAllBluetoothProfiles();
}
} else if (action.equals(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION) ||
@@ -9085,6 +9165,7 @@ public class AudioService extends IAudioService.Stub
+ " from system=" + mMicMuteFromSystemCached);
pw.print("\n mAssistantUid="); pw.println(mAssistantUid);
pw.print(" mCurrentImeUid="); pw.println(mCurrentImeUid);
+ pw.print(" mMonitorRotation="); pw.println(mMonitorRotation);
dumpAccessibilityServiceUids(pw);
dumpAudioPolicies(pw);
@@ -10626,6 +10707,17 @@ public class AudioService extends IAudioService.Stub
}
}
+ public void cacheParameters(String keyValuePairs) {
+ String[] kvpairs = keyValuePairs.split(";");
+ for (String pair : kvpairs) {
+ String[] kv = pair.split("=");
+ if (mCachedParams.containsKey(kv[0])) {
+ String oldVal = mCachedParams.put(kv[0], kv[1]);
+ Slog.w(TAG, "Updated cached param " + kv[0] + " from " + oldVal + " to " + kv[1]);
+ }
+ }
+ }
+
/**
* @hide
* Sets an additional audio output device delay in milliseconds.
diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java
index a9a8d1096dd8..812d947c97cc 100644
--- a/services/core/java/com/android/server/audio/BtHelper.java
+++ b/services/core/java/com/android/server/audio/BtHelper.java
@@ -38,7 +38,9 @@ import android.util.Log;
import com.android.internal.annotations.GuardedBy;
import java.io.PrintWriter;
+import java.util.HashMap;
import java.util.List;
+import java.util.Iterator;
import java.util.Objects;
/**
@@ -61,10 +63,13 @@ public class BtHelper {
// Bluetooth headset device
private @Nullable BluetoothDevice mBluetoothHeadsetDevice;
+ private @Nullable BluetoothDevice mBluetoothHeadsetDummyDevice;
+
private @Nullable BluetoothHearingAid mHearingAid;
// Reference to BluetoothA2dp to query for AbsoluteVolume.
- private @Nullable BluetoothA2dp mA2dp;
+ static private @Nullable BluetoothA2dp mA2dp;
+ static private @Nullable BluetoothDevice mBluetoothA2dpActiveDevice;
// If absolute volume is supported in AVRCP device
private boolean mAvrcpAbsVolSupported = false;
@@ -212,6 +217,31 @@ public class BtHelper {
return deviceName;
}
+ /*packages*/ static void SetA2dpActiveDevice(BluetoothDevice device) {
+ Log.w(TAG,"SetA2dpActiveDevice for TWS+ pair as " + device);
+ mBluetoothA2dpActiveDevice = device;
+ }
+
+ /*packages*/ @NonNull static boolean isTwsPlusSwitch(@NonNull BluetoothDevice device,
+ String address) {
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ BluetoothDevice connDevice = adapter.getRemoteDevice(address);
+ if (device == null || connDevice == null ||
+ device.getTwsPlusPeerAddress() == null) {
+ return false;
+ }
+ if (device.isTwsPlusDevice() &&
+ connDevice.isTwsPlusDevice() &&
+ device.getTwsPlusPeerAddress().equals(address)) {
+ if (mBluetoothA2dpActiveDevice == null) {
+ Log.w(TAG,"Not a TwsPlusSwitch as previous active device was null");
+ return false;
+ }
+ Log.i(TAG,"isTwsPlusSwitch true");
+ return true;
+ }
+ return false;
+ }
//----------------------------------------------------------------------
// Interface for AudioDeviceBroker
@@ -219,6 +249,9 @@ public class BtHelper {
@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
/*package*/ synchronized void onSystemReady() {
mScoConnectionState = android.media.AudioManager.SCO_AUDIO_STATE_ERROR;
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In onSystemReady(), calling resetBluetoothSco()");
+ }
resetBluetoothSco();
getBluetoothHeadset();
@@ -290,6 +323,139 @@ public class BtHelper {
return AudioSystem.bluetoothCodecToAudioFormat(btCodecConfig.getCodecType());
}
+ //SCO device tracking for TWSPLUS or GROUP device
+ private HashMap<BluetoothDevice, Integer> mScoClientDevices =
+ new HashMap<BluetoothDevice, Integer>();
+ private static final int GROUP_ID_START = 0;
+ private static final int GROUP_ID_END = 15;
+
+ private void updateTwsPlusScoState(BluetoothDevice device, Integer state) {
+ if (mScoClientDevices.containsKey(device)) {
+ Integer prevState = mScoClientDevices.get(device);
+ Log.i(TAG, "updateTwsPlusScoState: prevState: " + prevState + "state: " + state);
+ if (state != prevState) {
+ mScoClientDevices.remove(device);
+ mScoClientDevices.put(device, state);
+ }
+ } else {
+ mScoClientDevices.put(device, state);
+ }
+ }
+
+ private boolean isAudioPathUp() {
+ boolean ret = false;
+ Iterator it = mScoClientDevices.entrySet().iterator();
+ for (Integer value : mScoClientDevices.values()) {
+ if (value == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
+ ret = true;
+ break;
+ }
+ }
+ Log.d(TAG, "isAudioPathUp returns" + ret);
+ return ret;
+ }
+
+ private boolean checkAndUpdatTwsPlusScoState(Intent intent, Integer state) {
+ //default ret value is true
+ //so that legacy devices fallsthru
+ boolean ret = true;
+ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ Log.i(TAG, "device:" + device);
+
+ if (device == null) {
+ Log.e(TAG, "checkAndUpdatTwsPlusScoState: device is null");
+ //intent cant have device has null
+ //in case it is treat them as non-twsplus case and return true
+ return ret;
+ }
+
+ if (device.isTwsPlusDevice()) {
+ if (state == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
+ //if adding new Device
+ //check if there is no device already connected
+ if (isAudioPathUp()) {
+ Log.i(TAG, "No need to bringup audio-path");
+ ret = false;
+ }
+ //Update the States now
+ updateTwsPlusScoState(device, state);
+ } else {
+ //For disconnect cases, update the state first
+ updateTwsPlusScoState(device, state);
+ //if deleting new Device
+ //check if all devices are disconnected
+ if (isAudioPathUp()) {
+ Log.i(TAG, "not good to tear down audio-path");
+ ret = false;
+ }
+ }
+ }
+ Log.i(TAG, "checkAndUpdatTwsPlusScoState returns " + ret);
+ return ret;
+ }
+
+ private boolean isGroupDevice(BluetoothDevice device) {
+ int type = device.getDeviceType();
+ boolean ret = false;
+ Log.i(TAG, "Bluetooth device type: " + type);
+ if (type >= GROUP_ID_START && type <= GROUP_ID_END)
+ ret = true;
+ Log.i(TAG, "isGroupDevice return " + ret);
+ return ret;
+ }
+
+ private void updateGroupScoState(BluetoothDevice device, Integer state) {
+ if (mScoClientDevices.containsKey(device)) {
+ Integer prevState = mScoClientDevices.get(device);
+ Log.i(TAG, "updateGroupScoState: prevState: " + prevState + "state: " + state);
+ if (state != prevState) {
+ mScoClientDevices.remove(device);
+ mScoClientDevices.put(device, state);
+ }
+ } else {
+ mScoClientDevices.put(device, state);
+ }
+ }
+
+ private boolean checkAndUpdateGroupScoState(Intent intent, Integer state) {
+ //default ret value is true
+ //so that legacy devices fallsthru
+ boolean ret = true;
+ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ Log.i(TAG, "device:" + device);
+
+ if (device == null) {
+ Log.e(TAG, "checkAndUpdateGroupScoState: device is null");
+ //intent cant have device has null
+ //in case it is treat them as non-twsplus case and return true
+ return ret;
+ }
+
+ if (isGroupDevice(device)) {
+ if (state == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
+ //if adding new Device
+ //check if there is no device already connected
+ if (isAudioPathUp()) {
+ Log.i(TAG, "No need to bringup audio-path");
+ ret = false;
+ }
+ //Update the States now
+ updateGroupScoState(device, state);
+ } else {
+ //For disconnect cases, update the state first
+ updateGroupScoState(device, state);
+ //if deleting new Device
+ //check if all devices are disconnected
+ if (isAudioPathUp()) {
+ Log.i(TAG, "not good to tear down audio-path");
+ ret = false;
+ }
+ }
+ }
+ Log.i(TAG, "checkAndUpdateGroupScoState returns " + ret);
+ return ret;
+ }
+
// @GuardedBy("AudioDeviceBroker.mSetModeLock")
@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
/*package*/ synchronized void receiveBtEvent(Intent intent) {
@@ -301,11 +467,109 @@ public class BtHelper {
setBtScoActiveDevice(btDevice);
} else if (action.equals(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED)) {
int btState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1);
- Log.i(TAG,"receiveBtEvent ACTION_AUDIO_STATE_CHANGED: "+btState);
- mDeviceBroker.postScoAudioStateChanged(btState);
+ Log.i(TAG, "receiveBtEvent ACTION_AUDIO_STATE_CHANGED: " + btState);
+ switch (btState) {
+ case BluetoothHeadset.STATE_AUDIO_CONNECTED:
+ if (checkAndUpdatTwsPlusScoState(intent,
+ BluetoothHeadset.STATE_AUDIO_CONNECTED) &&
+ checkAndUpdateGroupScoState(intent,
+ BluetoothHeadset.STATE_AUDIO_CONNECTED)) {
+ scoAudioState = AudioManager.SCO_AUDIO_STATE_CONNECTED;
+ if (mScoAudioState != SCO_STATE_ACTIVE_INTERNAL &&
+ mScoAudioState != SCO_STATE_DEACTIVATE_REQ) {
+ mScoAudioState = SCO_STATE_ACTIVE_EXTERNAL;
+ }
+ mDeviceBroker.setBluetoothScoOn(true, "BtHelper.receiveBtEvent");
+ Log.i(TAG, "Audio-path brought-up");
+ }
+ scoAudioState = AudioManager.SCO_AUDIO_STATE_CONNECTED;
+ if (mScoAudioState != SCO_STATE_ACTIVE_INTERNAL
+ && mScoAudioState != SCO_STATE_DEACTIVATE_REQ) {
+ mScoAudioState = SCO_STATE_ACTIVE_EXTERNAL;
+ } else if (mDeviceBroker.isBluetoothScoRequested()) {
+ // broadcast intent if the connection was initated by AudioService
+ broadcast = true;
+ }
+ break;
+ case BluetoothHeadset.STATE_AUDIO_DISCONNECTED:
+ if (checkAndUpdatTwsPlusScoState(intent,
+ BluetoothHeadset.STATE_AUDIO_DISCONNECTED) &&
+ checkAndUpdateGroupScoState(intent,
+ BluetoothHeadset.STATE_AUDIO_DISCONNECTED)) {
+ mDeviceBroker.setBluetoothScoOn(false, "BtHelper.receiveBtEvent");
+ scoAudioState = AudioManager.SCO_AUDIO_STATE_DISCONNECTED;
+ // There are two cases where we want to immediately reconnect audio:
+ // 1) If a new start request was received while disconnecting: this was
+ // notified by requestScoState() setting state to SCO_STATE_ACTIVATE_REQ.
+ // 2) If audio was connected then disconnected via Bluetooth APIs and
+ // we still have pending activation requests by apps: this is indicated by
+ // state SCO_STATE_ACTIVE_EXTERNAL and the mScoClients list not empty.
+ if (mScoAudioState == SCO_STATE_ACTIVATE_REQ
+ || (mScoAudioState == SCO_STATE_ACTIVE_EXTERNAL
+ && mDeviceBroker.isBluetoothScoRequested())) {
+ if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null
+ && connectBluetoothScoAudioHelper(mBluetoothHeadset,
+ mBluetoothHeadsetDevice, mScoAudioMode)) {
+ mScoAudioState = SCO_STATE_ACTIVE_INTERNAL;
+ scoAudioState = AudioManager.SCO_AUDIO_STATE_CONNECTING;
+ broadcast = true;
+ break;
+ }
+ }
+ if (mScoAudioState != SCO_STATE_ACTIVE_EXTERNAL) {
+ broadcast = true;
+ }
+ mScoAudioState = SCO_STATE_INACTIVE;
+ Log.i(TAG, "Audio-path brought-down");
+ }
+ break;
+ case BluetoothHeadset.STATE_AUDIO_CONNECTING:
+ if (mScoAudioState != SCO_STATE_ACTIVE_INTERNAL
+ && mScoAudioState != SCO_STATE_DEACTIVATE_REQ) {
+ mScoAudioState = SCO_STATE_ACTIVE_EXTERNAL;
+ }
+ break;
+ default:
+ break;
+ }
+ if (broadcast) {
+ broadcastScoConnectionState(scoAudioState);
+ //FIXME: this is to maintain compatibility with deprecated intent
+ // AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED. Remove when appropriate.
+ Intent newIntent = new Intent(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED);
+ newIntent.putExtra(AudioManager.EXTRA_SCO_AUDIO_STATE, scoAudioState);
+ sendStickyBroadcastToAll(newIntent);
+ }
}
}
+ /*package*/ boolean isBluetoothAudioNotConnectedToEarbud() {
+ //default value as true so that
+ //non-twsplus device case returns true
+ boolean ret = true;
+
+ if (mBluetoothHeadsetDevice != null
+ && mBluetoothHeadsetDevice.isTwsPlusDevice()) {
+ //If It is TWSplus Device, check for TWS pair device
+ //Sco state
+ String pDevAddr = mBluetoothHeadsetDevice.getTwsPlusPeerAddress();
+ if (pDevAddr != null) {
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ BluetoothDevice peerDev = adapter.getRemoteDevice(pDevAddr);
+ Log.d(TAG, "peer device audio State: " + mBluetoothHeadset.getAudioState(peerDev));
+ if (mBluetoothHeadset.getAudioState(peerDev)
+ == BluetoothHeadset.STATE_AUDIO_CONNECTED ||
+ mBluetoothHeadset.getAudioState(mBluetoothHeadsetDevice)
+ == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
+ Log.w(TAG, "TwsPLus Case: one of eb SCO is connected");
+ ret = false;
+ }
+ }
+ }
+ Log.d(TAG, "isBluetoothAudioConnectedToEarbud returns: " + ret);
+ return ret;
+ }
+
/**
* Exclusively called from AudioDeviceBroker when handling MSG_I_SCO_AUDIO_STATE_CHANGED
* as part of the serialization of the communication route selection
@@ -441,9 +705,12 @@ public class BtHelper {
// @GuardedBy("AudioDeviceBroker.mSetModeLock")
@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
/*package*/ synchronized void resetBluetoothSco() {
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In resetBluetoothSco(), calling clearAllScoClients()");
+ }
mScoAudioState = SCO_STATE_INACTIVE;
broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_DISCONNECTED);
- AudioSystem.setParameters("A2dpSuspended=false");
+ mScoClientDevices.clear();
mDeviceBroker.setBluetoothScoOn(false, "resetBluetoothSco");
}
@@ -548,12 +815,21 @@ public class BtHelper {
return btHeadsetDeviceToAudioDevice(mBluetoothHeadsetDevice);
}
+ @Nullable AudioDeviceAttributes getHeadsetAudioDummyDevice() {
+ if (mBluetoothHeadsetDummyDevice == null) {
+ return null;
+ }
+ return btHeadsetDeviceToAudioDevice(mBluetoothHeadsetDummyDevice);
+ }
+
private AudioDeviceAttributes btHeadsetDeviceToAudioDevice(BluetoothDevice btDevice) {
String address = btDevice.getAddress();
if (!BluetoothAdapter.checkBluetoothAddress(address)) {
address = "";
}
- BluetoothClass btClass = btDevice.getBluetoothClass();
+ String dummyAddress = "00:00:00:00:00:00";
+ BluetoothClass btClass = dummyAddress.equals(address) ? null :
+ btDevice.getBluetoothClass();
int nativeType = AudioSystem.DEVICE_OUT_BLUETOOTH_SCO;
if (btClass != null) {
switch (btClass.getDeviceClass()) {
@@ -578,9 +854,19 @@ public class BtHelper {
if (btDevice == null) {
return true;
}
+ String address = btDevice.getAddress();
+ String dummyAddress = "00:00:00:00:00:00";
+ BluetoothClass btClass = dummyAddress.equals(address) ? null :
+ btDevice.getBluetoothClass();
int inDevice = AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET;
AudioDeviceAttributes audioDevice = btHeadsetDeviceToAudioDevice(btDevice);
String btDeviceName = getName(btDevice);
+ if (btDeviceName == null) {
+ Log.i(TAG, "handleBtScoActiveDeviceChange: btDeviceName is null," +
+ " sending empty string");
+ btDeviceName = "";
+ }
+
boolean result = false;
if (isActive) {
result |= mDeviceBroker.handleDeviceConnection(isActive, audioDevice.getInternalType(),
@@ -614,21 +900,45 @@ public class BtHelper {
Log.i(TAG, "setBtScoActiveDevice: " + getAnonymizedAddress(mBluetoothHeadsetDevice)
+ " -> " + getAnonymizedAddress(btDevice));
final BluetoothDevice previousActiveDevice = mBluetoothHeadsetDevice;
+ if (mBluetoothHeadsetDevice != null && mBluetoothHeadsetDevice.isTwsPlusDevice()
+ && btDevice != null
+ && Objects.equals(mBluetoothHeadsetDevice.getTwsPlusPeerAddress(), btDevice.getAddress())) {
+ Log.i(TAG, "setBtScoActiveDevice: Active device switch between twsplus devices");
+ //Keep the same mBluetoothHeadsetDevice as current Active so
+ //that It tears down when active becomes null
+ return;
+ }
if (Objects.equals(btDevice, previousActiveDevice)) {
return;
}
- if (!handleBtScoActiveDeviceChange(previousActiveDevice, false)) {
- Log.w(TAG, "setBtScoActiveDevice() failed to remove previous device "
- + getAnonymizedAddress(previousActiveDevice));
+ String DummyAddress = "00:00:00:00:00:00";
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if (adapter == null) {
+ Log.i(TAG, "adapter is null, returning from setBtScoActiveDevice");
+ return;
+ }
+ mBluetoothHeadsetDummyDevice = adapter.getRemoteDevice(DummyAddress);
+ if (mBluetoothHeadsetDevice == null && btDevice != null) {
+ //SCO device entry is added to mConnectedDevices hash map only when active
+ //device connects for the first time.
+ if (!handleBtScoActiveDeviceChange(mBluetoothHeadsetDummyDevice, true)) {
+ Log.e(TAG, "setBtScoActiveDevice() failed to add new device " + btDevice);
+ // set mBluetoothHeadsetDevice to null when failing to add new device
+ btDevice = null;
+ }
}
- if (!handleBtScoActiveDeviceChange(btDevice, true)) {
- Log.e(TAG, "setBtScoActiveDevice() failed to add new device "
- + getAnonymizedAddress(btDevice));
- // set mBluetoothHeadsetDevice to null when failing to add new device
- btDevice = null;
+ if (mBluetoothHeadsetDevice != null && btDevice == null) {
+ //SCO device entry is removed from mConnectedDevices hash map only when active
+ //device is disconnected.
+ if (!handleBtScoActiveDeviceChange(mBluetoothHeadsetDummyDevice, false)) {
+ Log.w(TAG, "setBtScoActiveDevice() failed to remove previous device "
+ + previousActiveDevice);
+ }
}
mBluetoothHeadsetDevice = btDevice;
if (mBluetoothHeadsetDevice == null) {
+ mBluetoothHeadsetDummyDevice = null;
+ Log.i(TAG, "In setBtScoActiveDevice(), calling resetBluetoothSco()");
resetBluetoothSco();
}
}
@@ -638,6 +948,10 @@ public class BtHelper {
private BluetoothProfile.ServiceListener mBluetoothProfileServiceListener =
new BluetoothProfile.ServiceListener() {
public void onServiceConnected(int profile, BluetoothProfile proxy) {
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In onServiceConnected(), profile: " + profile +
+ ", proxy: "+proxy);
+ }
switch(profile) {
case BluetoothProfile.A2DP:
AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent(
@@ -694,28 +1008,32 @@ public class BtHelper {
//----------------------------------------------------------------------
- // @GuardedBy("AudioDeviceBroker.mSetModeLock")
- //@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
- @GuardedBy("BtHelper.this")
- private boolean requestScoState(int state, int scoAudioMode) {
- checkScoAudioState();
- if (state == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
- // Make sure that the state transitions to CONNECTING even if we cannot initiate
- // the connection.
- broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_CONNECTING);
- switch (mScoAudioState) {
- case SCO_STATE_INACTIVE:
- mScoAudioMode = scoAudioMode;
- if (scoAudioMode == SCO_MODE_UNDEFINED) {
- mScoAudioMode = SCO_MODE_VIRTUAL_CALL;
- if (mBluetoothHeadsetDevice != null) {
- mScoAudioMode = Settings.Global.getInt(
- mDeviceBroker.getContentResolver(),
- "bluetooth_sco_channel_"
- + mBluetoothHeadsetDevice.getAddress(),
- SCO_MODE_VIRTUAL_CALL);
- if (mScoAudioMode > SCO_MODE_MAX || mScoAudioMode < 0) {
- mScoAudioMode = SCO_MODE_VIRTUAL_CALL;
+ // @GuardedBy("AudioDeviceBroker.mSetModeLock")
+ //@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
+ @GuardedBy("BtHelper.this")
+ private boolean requestScoState(int state, int scoAudioMode) {
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In requestScoState(), state: " + state + ", scoAudioMode: "
+ + scoAudioMode);
+ }
+ checkScoAudioState();
+ if (state == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
+ // Make sure that the state transitions to CONNECTING even if we cannot initiate
+ // the connection.
+ broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_CONNECTING);
+ switch (mScoAudioState) {
+ case SCO_STATE_INACTIVE:
+ mScoAudioMode = scoAudioMode;
+ if (scoAudioMode == SCO_MODE_UNDEFINED) {
+ mScoAudioMode = SCO_MODE_VIRTUAL_CALL;
+ if (mBluetoothHeadsetDevice != null) {
+ mScoAudioMode = Settings.Global.getInt(
+ mDeviceBroker.getContentResolver(),
+ "bluetooth_sco_channel_"
+ + mBluetoothHeadsetDevice.getAddress(),
+ SCO_MODE_VIRTUAL_CALL);
+ if (mScoAudioMode > SCO_MODE_MAX || mScoAudioMode < 0) {
+ mScoAudioMode = SCO_MODE_VIRTUAL_CALL;
}
}
}
@@ -834,12 +1152,28 @@ public class BtHelper {
private static boolean disconnectBluetoothScoAudioHelper(BluetoothHeadset bluetoothHeadset,
BluetoothDevice device, int scoAudioMode) {
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In disconnectBluetoothScoAudioHelper(), scoAudioMode: " + scoAudioMode +
+ ", bluetoothHeadset: " + bluetoothHeadset + ", BluetoothDevice: " + device);
+ }
switch (scoAudioMode) {
case SCO_MODE_RAW:
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In disconnectBluetoothScoAudioHelper(), calling "
+ + "disconnectAudio()");
+ }
return bluetoothHeadset.disconnectAudio();
case SCO_MODE_VIRTUAL_CALL:
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In disconnectBluetoothScoAudioHelper(), calling " +
+ "stopScoUsingVirtualVoiceCall()");
+ }
return bluetoothHeadset.stopScoUsingVirtualVoiceCall();
case SCO_MODE_VR:
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In disconnectBluetoothScoAudioHelper(), calling " +
+ "stopVoiceRecognition()");
+ }
return bluetoothHeadset.stopVoiceRecognition(device);
default:
return false;
@@ -848,12 +1182,27 @@ public class BtHelper {
private static boolean connectBluetoothScoAudioHelper(BluetoothHeadset bluetoothHeadset,
BluetoothDevice device, int scoAudioMode) {
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In connectBluetoothScoAudioHelper(), scoAudioMode: " + scoAudioMode +
+ ", bluetoothHeadset: " + bluetoothHeadset + ", BluetoothDevice: " + device);
+ }
switch (scoAudioMode) {
case SCO_MODE_RAW:
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In connectBluetoothScoAudioHelper(), calling connectAudio()");
+ }
return bluetoothHeadset.connectAudio();
case SCO_MODE_VIRTUAL_CALL:
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In connectBluetoothScoAudioHelper(), calling "
+ + "startScoUsingVirtualVoiceCall()");
+ }
return bluetoothHeadset.startScoUsingVirtualVoiceCall();
case SCO_MODE_VR:
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In connectBluetoothScoAudioHelper(), calling "
+ + "startVoiceRecognition()");
+ }
return bluetoothHeadset.startVoiceRecognition(device);
default:
return false;
@@ -868,6 +1217,9 @@ public class BtHelper {
!= BluetoothHeadset.STATE_AUDIO_DISCONNECTED) {
mScoAudioState = SCO_STATE_ACTIVE_EXTERNAL;
}
+ if (AudioService.DEBUG_SCO) {
+ Log.i(TAG, "In checkScoAudioState(), mScoAudioState: " + mScoAudioState);
+ }
}
private boolean getBluetoothHeadset() {
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index b394d6b49d65..a432d5bf081c 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -109,6 +109,7 @@ import android.util.Spline;
import android.view.Display;
import android.view.DisplayEventReceiver;
import android.view.DisplayInfo;
+import android.view.DisplayAddress;
import android.view.Surface;
import android.view.SurfaceControl;
@@ -425,6 +426,13 @@ public final class DisplayManagerService extends SystemService {
@EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.S)
static final long DISPLAY_MODE_RETURNS_PHYSICAL_REFRESH_RATE = 170503758L;
+ // The synchronization root for the display dumpsys.
+ private final SyncRoot mSyncDump = new SyncRoot();
+
+ // Whether dump is inprogress or not.
+ @GuardedBy("mSyncDump")
+ private boolean mDumpInProgress;
+
public DisplayManagerService(Context context) {
this(context, new Injector());
}
@@ -458,6 +466,7 @@ public final class DisplayManagerService extends SystemService {
mAllowNonNativeRefreshRateOverride = mInjector.getAllowNonNativeRefreshRateOverride();
mSystemReady = false;
+ mDumpInProgress = false;
}
public void setupSchedulerPolicies() {
@@ -720,8 +729,10 @@ public final class DisplayManagerService extends SystemService {
final BrightnessPair brightnessPair =
index < 0 ? null : mDisplayBrightnesses.valueAt(index);
if (index < 0 || (mDisplayStates.valueAt(index) == state
- && brightnessPair.brightness == brightnessState
- && brightnessPair.sdrBrightness == sdrBrightnessState)) {
+ && BrightnessSynchronizer.floatEquals(
+ brightnessPair.brightness, brightnessState)
+ && BrightnessSynchronizer.floatEquals(
+ brightnessPair.sdrBrightness, sdrBrightnessState))) {
return; // Display no longer exists or no change.
}
@@ -1259,7 +1270,7 @@ public final class DisplayManagerService extends SystemService {
recordTopInsetLocked(display);
}
addDisplayPowerControllerLocked(display);
- mDisplayStates.append(displayId, Display.STATE_UNKNOWN);
+ mDisplayStates.append(displayId, Display.STATE_ON);
final float brightnessDefault = display.getDisplayInfoLocked().brightnessDefault;
mDisplayBrightnesses.append(displayId,
@@ -1991,6 +2002,14 @@ public final class DisplayManagerService extends SystemService {
}
private void dumpInternal(PrintWriter pw) {
+ synchronized (mSyncDump) {
+ if (mDumpInProgress) {
+ pw.println("One dump is in service already.");
+ return;
+ }
+ mDumpInProgress = true;
+ }
+
pw.println("DISPLAY MANAGER (dumpsys display)");
synchronized (mSyncRoot) {
@@ -2068,6 +2087,9 @@ public final class DisplayManagerService extends SystemService {
}
pw.println();
mDisplayModeDirector.dump(pw);
+ synchronized (mSyncDump) {
+ mDumpInProgress = false;
+ }
}
private static float[] getFloatArray(TypedArray array) {
diff --git a/services/core/java/com/android/server/display/DisplayModeDirector.java b/services/core/java/com/android/server/display/DisplayModeDirector.java
index a4f7c85dee29..ae51dd787bf5 100644
--- a/services/core/java/com/android/server/display/DisplayModeDirector.java
+++ b/services/core/java/com/android/server/display/DisplayModeDirector.java
@@ -2243,14 +2243,12 @@ public class DisplayModeDirector {
void dump(PrintWriter pw) {
pw.println(" SensorObserver");
- synchronized (mSensorObserverLock) {
pw.println(" mIsProxActive=" + mIsProxActive);
pw.println(" mDozeStateByDisplay:");
for (int i = 0; i < mDozeStateByDisplay.size(); i++) {
final int id = mDozeStateByDisplay.keyAt(i);
final boolean dozed = mDozeStateByDisplay.valueAt(i);
pw.println(" " + id + " -> " + dozed);
- }
}
}
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 77c1fc031598..00920eefd044 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -1393,8 +1393,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
final float currentBrightness = mPowerState.getScreenBrightness();
final float currentSdrBrightness = mPowerState.getSdrScreenBrightness();
if (isValidBrightnessValue(animateValue)
- && (animateValue != currentBrightness
- || sdrAnimateValue != currentSdrBrightness)) {
+ && (!BrightnessSynchronizer.floatEquals(animateValue, currentBrightness)
+ || !BrightnessSynchronizer.floatEquals(
+ sdrAnimateValue, currentSdrBrightness))) {
if (initialRampSkip || hasBrightnessBuckets
|| wasOrWillBeInVr || !isDisplayContentVisible || brightnessIsTemporary) {
animateScreenBrightness(animateValue, sdrAnimateValue,
@@ -1740,10 +1741,11 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
mHbmController.getCurrentBrightnessMin(), mHbmController.getCurrentBrightnessMax());
}
- // Checks whether the brightness is within the valid brightness range, not including off.
- private boolean isValidBrightnessValue(float brightness) {
- return brightness >= PowerManager.BRIGHTNESS_MIN
- && brightness <= PowerManager.BRIGHTNESS_MAX;
+ // Checks whether the brightness is within the valid brightness range, not including the off or
+ // invalid states.
+ private boolean isValidBrightnessValue(float brightnessState) {
+ return brightnessState >= PowerManager.BRIGHTNESS_MIN
+ && brightnessState <= PowerManager.BRIGHTNESS_MAX;
}
private void animateScreenBrightness(float target, float sdrTarget, float rate) {
@@ -2073,9 +2075,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
}
private void putScreenBrightnessSetting(float brightnessValue, boolean updateCurrent) {
- if (!isValidBrightnessValue(brightnessValue)) {
- return;
- }
if (updateCurrent) {
setCurrentScreenBrightness(brightnessValue);
}
@@ -2125,7 +2124,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|| mPendingScreenBrightnessSetting < 0.0f)) {
return treatAsIfUserChanged;
}
- if (mCurrentScreenBrightnessSetting == mPendingScreenBrightnessSetting) {
+ if (BrightnessSynchronizer.floatEquals(
+ mCurrentScreenBrightnessSetting, mPendingScreenBrightnessSetting)) {
mPendingScreenBrightnessSetting = PowerManager.BRIGHTNESS_INVALID_FLOAT;
mTemporaryScreenBrightness = PowerManager.BRIGHTNESS_INVALID_FLOAT;
return treatAsIfUserChanged;
diff --git a/services/core/java/com/android/server/display/DisplayPowerState.java b/services/core/java/com/android/server/display/DisplayPowerState.java
index 147050cd271f..0ec05a8189bd 100644
--- a/services/core/java/com/android/server/display/DisplayPowerState.java
+++ b/services/core/java/com/android/server/display/DisplayPowerState.java
@@ -26,6 +26,8 @@ import android.util.Slog;
import android.view.Choreographer;
import android.view.Display;
+import com.android.internal.display.BrightnessSynchronizer;
+
import java.io.PrintWriter;
/**
@@ -164,11 +166,10 @@ final class DisplayPowerState {
/**
* Sets the display's SDR brightness.
*
- * @param brightness The brightness, ranges from 0.0f (minimum) to 1.0f (brightest), or is -1f
- * (off).
+ * @param brightness The brightness, ranges from 0.0f (minimum / off) to 1.0f (brightest).
*/
public void setSdrScreenBrightness(float brightness) {
- if (mSdrScreenBrightness != brightness) {
+ if (!BrightnessSynchronizer.floatEquals(mSdrScreenBrightness, brightness)) {
if (DEBUG) {
Slog.d(TAG, "setSdrScreenBrightness: brightness=" + brightness);
}
@@ -191,11 +192,10 @@ final class DisplayPowerState {
/**
* Sets the display brightness.
*
- * @param brightness The brightness, ranges from 0.0f (minimum) to 1.0f (brightest), or is -1f
- * (off).
+ * @param brightness The brightness, ranges from 0.0f (minimum / off) to 1.0f (brightest).
*/
public void setScreenBrightness(float brightness) {
- if (mScreenBrightness != brightness) {
+ if (!BrightnessSynchronizer.floatEquals(mScreenBrightness, brightness)) {
if (DEBUG) {
Slog.d(TAG, "setScreenBrightness: brightness=" + brightness);
}
@@ -432,8 +432,10 @@ final class DisplayPowerState {
public boolean setState(int state, float brightnessState, float sdrBrightnessState) {
synchronized (mLock) {
boolean stateChanged = state != mPendingState;
- boolean backlightChanged = brightnessState != mPendingBacklight
- || sdrBrightnessState != mPendingSdrBacklight;
+ boolean backlightChanged =
+ !BrightnessSynchronizer.floatEquals(brightnessState, mPendingBacklight)
+ || !BrightnessSynchronizer.floatEquals(
+ sdrBrightnessState, mPendingSdrBacklight);
if (stateChanged || backlightChanged) {
if (DEBUG) {
Slog.d(TAG, "Requesting new screen state: state="
@@ -484,8 +486,10 @@ final class DisplayPowerState {
stateChanged = (state != mActualState);
brightnessState = mPendingBacklight;
sdrBrightnessState = mPendingSdrBacklight;
- backlightChanged = brightnessState != mActualBacklight
- || sdrBrightnessState != mActualSdrBacklight;
+ backlightChanged =
+ !BrightnessSynchronizer.floatEquals(brightnessState, mActualBacklight)
+ || !BrightnessSynchronizer.floatEquals(
+ sdrBrightnessState, mActualSdrBacklight);
if (!stateChanged) {
// State changed applied, notify outer class.
postScreenUpdateThreadSafe();
diff --git a/services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java b/services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java
new file mode 100644
index 000000000000..1be474b09ef2
--- /dev/null
+++ b/services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.android.server.display;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import android.media.RemoteDisplay;
+import android.os.Handler;
+import android.util.Slog;
+import android.content.Context;
+
+class ExtendedRemoteDisplayHelper {
+ private static final String TAG = "ExtendedRemoteDisplayHelper";
+
+ // ExtendedRemoteDisplay class
+ // ExtendedRemoteDisplay is an enhanced RemoteDisplay. It has
+ // similar interface as RemoteDisplay class
+ private static Class sExtRemoteDisplayClass;
+
+ // Method object for the API ExtendedRemoteDisplay.Listen
+ // ExtendedRemoteDisplay.Listen has the same API signature as
+ // RemoteDisplay.Listen except for an additional argument to pass the
+ // Context
+ private static Method sExtRemoteDisplayListen;
+
+ // Method Object for the API ExtendedRemoteDisplay.Dispose
+ // ExtendedRemoteDisplay.Dispose follows the same API signature as
+ // RemoteDisplay.Dispose
+ private static Method sExtRemoteDisplayDispose;
+
+ static {
+ //Check availability of ExtendedRemoteDisplay runtime
+ try {
+ sExtRemoteDisplayClass = Class.forName("com.qualcomm.wfd.ExtendedRemoteDisplay");
+ } catch (Throwable t) {
+ Slog.i(TAG, "ExtendedRemoteDisplay Not available.");
+ }
+
+ if(sExtRemoteDisplayClass != null) {
+ // If ExtendedRemoteDisplay is available find the methods
+ Slog.i(TAG, "ExtendedRemoteDisplay Is available. Find Methods");
+ try {
+ Class args[] = {
+ String.class,
+ RemoteDisplay.Listener.class,
+ Handler.class, Context.class
+ };
+ sExtRemoteDisplayListen = sExtRemoteDisplayClass.getDeclaredMethod("listen", args);
+ } catch (Throwable t) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.listen Not available.");
+ }
+
+ try {
+ Class args[] = {};
+ sExtRemoteDisplayDispose = sExtRemoteDisplayClass.getDeclaredMethod("dispose", args);
+ } catch (Throwable t) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.dispose Not available.");
+ }
+ }
+ }
+
+ /**
+ * Starts listening for displays to be connected on the specified interface.
+ *
+ * @param iface The interface address and port in the form "x.x.x.x:y".
+ * @param listener The listener to invoke
+ * when displays are connected or disconnected.
+ * @param handler The handler on which to invoke the listener.
+ * @param context The current service context
+ * */
+ public static Object listen(String iface, RemoteDisplay.Listener listener,
+ Handler handler, Context context)
+ {
+ Object extRemoteDisplay = null;
+ Slog.i(TAG, "ExtendedRemoteDisplay.listen");
+
+ if(sExtRemoteDisplayListen != null && sExtRemoteDisplayDispose != null){
+ try {
+ extRemoteDisplay = sExtRemoteDisplayListen.invoke(null,
+ iface, listener, handler, context);
+ } catch (InvocationTargetException e) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.listen - InvocationTargetException");
+ Throwable cause = e.getCause();
+ if (cause instanceof RuntimeException) {
+ throw (RuntimeException) cause;
+ } else if (cause instanceof Error) {
+ throw (Error) cause;
+ } else {
+ throw new RuntimeException(e);
+ }
+ } catch (IllegalAccessException e) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.listen -IllegalAccessException");
+ e.printStackTrace();
+ }
+ }
+ return extRemoteDisplay;
+ }
+
+ /**
+ * Disconnects the remote display and stops listening for new connections.
+ */
+ public static void dispose(Object extRemoteDisplay) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.dispose");
+ try{
+ sExtRemoteDisplayDispose.invoke(extRemoteDisplay);
+ } catch (InvocationTargetException e) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.dispose - InvocationTargetException");
+ Throwable cause = e.getCause();
+ if (cause instanceof RuntimeException) {
+ throw (RuntimeException) cause;
+ } else if (cause instanceof Error) {
+ throw (Error) cause;
+ } else {
+ throw new RuntimeException(e);
+ }
+ } catch (IllegalAccessException e) {
+ Slog.i(TAG, "ExtendedRemoteDisplay.dispose-IllegalAccessException");
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Checks if ExtendedRemoteDisplay is available
+ */
+ public static boolean isAvailable()
+ {
+ if(sExtRemoteDisplayClass != null &&
+ sExtRemoteDisplayDispose != null &&
+ sExtRemoteDisplayListen != null) {
+ Slog.i(TAG, "ExtendedRemoteDisplay isAvailable() : Available.");
+ return true;
+ }
+ Slog.i(TAG, "ExtendedRemoteDisplay isAvailable() : Not Available.");
+ return false;
+ }
+}
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 5a9efd707f5d..526e8e11f555 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -592,6 +592,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
}
final Resources res = getOverlayContext().getResources();
+ final boolean isBuiltIn = ((mInfo.address) != null) ?
+ ((((DisplayAddress.Physical) mInfo.address).getPort() & 0x80) == 0x80) : false;
if (mIsDefaultDisplay) {
mInfo.flags |= DisplayDeviceInfo.FLAG_DEFAULT_DISPLAY;
@@ -601,6 +603,26 @@ final class LocalDisplayAdapter extends DisplayAdapter {
&& SystemProperties.getBoolean(PROPERTY_EMULATOR_CIRCULAR, false))) {
mInfo.flags |= DisplayDeviceInfo.FLAG_ROUND;
}
+ } else if (isBuiltIn) {
+ mInfo.type = Display.TYPE_INTERNAL;
+ mInfo.touch = DisplayDeviceInfo.TOUCH_INTERNAL;
+ mInfo.name = getContext().getResources().getString(
+ com.android.internal.R.string.display_manager_built_in_display_name);
+ mInfo.flags |= DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT;
+
+ if (SystemProperties.getBoolean(
+ "vendor.display.builtin_presentation", false)) {
+ mInfo.flags |= DisplayDeviceInfo.FLAG_PRESENTATION;
+ } else {
+ mInfo.flags |= DisplayDeviceInfo.FLAG_PRIVATE;
+ }
+
+ if (!SystemProperties.getBoolean(
+ "vendor.display.builtin_mirroring", false)) {
+ mInfo.flags |= DisplayDeviceInfo.FLAG_OWN_CONTENT_ONLY;
+ }
+
+ mInfo.setAssumedDensityForExternalDisplay(mActiveSfDisplayMode.width, mActiveSfDisplayMode.height);
} else {
if (!res.getBoolean(
com.android.internal.R.bool.config_localDisplaysMirrorContent)) {
@@ -649,11 +671,12 @@ final class LocalDisplayAdapter extends DisplayAdapter {
public Runnable requestDisplayStateLocked(final int state, final float brightnessState,
final float sdrBrightnessState) {
// Assume that the brightness is off if the display is being turned off.
- assert state != Display.STATE_OFF
- || brightnessState == PowerManager.BRIGHTNESS_OFF_FLOAT;
+ assert state != Display.STATE_OFF || BrightnessSynchronizer.floatEquals(
+ brightnessState, PowerManager.BRIGHTNESS_OFF_FLOAT);
final boolean stateChanged = (mState != state);
- final boolean brightnessChanged = mBrightnessState != brightnessState
- || mSdrBrightnessState != sdrBrightnessState;
+ final boolean brightnessChanged =
+ !(BrightnessSynchronizer.floatEquals(mBrightnessState, brightnessState)
+ && BrightnessSynchronizer.floatEquals(mSdrBrightnessState, sdrBrightnessState));
if (stateChanged || brightnessChanged) {
final long physicalDisplayId = mPhysicalDisplayId;
final IBinder token = getDisplayTokenLocked();
@@ -807,7 +830,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
}
private float brightnessToBacklight(float brightness) {
- if (brightness == PowerManager.BRIGHTNESS_OFF_FLOAT) {
+ if (BrightnessSynchronizer.floatEquals(
+ brightness, PowerManager.BRIGHTNESS_OFF_FLOAT)) {
return PowerManager.BRIGHTNESS_OFF_FLOAT;
} else {
return getDisplayDeviceConfig().getBacklightFromBrightness(brightness);
diff --git a/services/core/java/com/android/server/display/LogicalDisplayMapper.java b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
index f0093bd07752..4ff3db825003 100644
--- a/services/core/java/com/android/server/display/LogicalDisplayMapper.java
+++ b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
@@ -33,6 +33,7 @@ import android.util.SparseIntArray;
import android.view.Display;
import android.view.DisplayAddress;
import android.view.DisplayInfo;
+import android.view.DisplayAddress;
import com.android.internal.annotations.VisibleForTesting;
import com.android.server.display.LogicalDisplay.DisplayPhase;
@@ -109,6 +110,7 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
*/
private final SparseArray<LogicalDisplay> mLogicalDisplays =
new SparseArray<LogicalDisplay>();
+ private int mNextBuiltInDisplayId = 4096;
/** Map of all display groups indexed by display group id. */
private final SparseArray<DisplayGroup> mDisplayGroups = new SparseArray<>();
diff --git a/services/core/java/com/android/server/display/RampAnimator.java b/services/core/java/com/android/server/display/RampAnimator.java
index d8672fc07619..5e933a8413c3 100644
--- a/services/core/java/com/android/server/display/RampAnimator.java
+++ b/services/core/java/com/android/server/display/RampAnimator.java
@@ -20,6 +20,8 @@ import android.animation.ValueAnimator;
import android.util.FloatProperty;
import android.view.Choreographer;
+import com.android.internal.display.BrightnessSynchronizer;
+
/**
* A custom animator that progressively updates a property value at
* a given variable rate until it reaches a particular target value.
@@ -168,10 +170,10 @@ class RampAnimator<T> {
}
final float oldCurrentValue = mCurrentValue;
mCurrentValue = mAnimatedValue;
- if (oldCurrentValue != mCurrentValue) {
- setPropertyValue(mCurrentValue);
+ if (!BrightnessSynchronizer.floatEquals(oldCurrentValue, mCurrentValue)) {
+ mProperty.setValue(mObject, mCurrentValue);
}
- if (mTargetValue != mCurrentValue) {
+ if (!BrightnessSynchronizer.floatEquals(mTargetValue, mCurrentValue)) {
postAnimationCallback();
} else {
mAnimating = false;
diff --git a/services/core/java/com/android/server/display/WifiDisplayController.java b/services/core/java/com/android/server/display/WifiDisplayController.java
index a7e1a2876f81..c24cfadf61c7 100644
--- a/services/core/java/com/android/server/display/WifiDisplayController.java
+++ b/services/core/java/com/android/server/display/WifiDisplayController.java
@@ -40,6 +40,7 @@ import android.net.wifi.p2p.WifiP2pManager.GroupInfoListener;
import android.net.wifi.p2p.WifiP2pManager.PeerListListener;
import android.net.wifi.p2p.WifiP2pWfdInfo;
import android.os.Handler;
+import android.os.SystemProperties;
import android.provider.Settings;
import android.util.Slog;
import android.view.Surface;
@@ -47,6 +48,8 @@ import android.view.Surface;
import com.android.internal.util.DumpUtils;
import java.io.PrintWriter;
+import java.lang.StackTraceElement;
+import java.lang.Thread;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
@@ -69,8 +72,10 @@ import java.util.Objects;
*/
final class WifiDisplayController implements DumpUtils.Dump {
private static final String TAG = "WifiDisplayController";
- private static final boolean DEBUG = false;
-
+ private static final boolean DEBUG =
+ SystemProperties.getBoolean("persist.vendor.debug.wfdcdbg",false);
+ private static final boolean DEBUGV =
+ SystemProperties.getBoolean("persist.vendor.debug.wfdcdbgv",false);
private static final int DEFAULT_CONTROL_PORT = 7236;
private static final int MAX_THROUGHPUT = 50;
private static final int CONNECTION_TIMEOUT_SECONDS = 30;
@@ -136,6 +141,10 @@ final class WifiDisplayController implements DumpUtils.Dump {
// Number of connection retries remaining.
private int mConnectionRetriesLeft;
+ // The Extended remote display that is listening on the connection.
+ // Created after the Wifi P2P network is connected.
+ private Object mExtRemoteDisplay;
+
// The remote display that is listening on the connection.
// Created after the Wifi P2P network is connected.
private RemoteDisplay mRemoteDisplay;
@@ -246,6 +255,35 @@ final class WifiDisplayController implements DumpUtils.Dump {
}
}
+ private void dump() {
+ Slog.d(TAG,"mWifiDisplayOnSetting=" + mWifiDisplayOnSetting);
+ Slog.d(TAG,"mWifiP2pEnabled=" + mWifiP2pEnabled);
+ Slog.d(TAG,"mWfdEnabled=" + mWfdEnabled);
+ Slog.d(TAG,"mWfdEnabling=" + mWfdEnabling);
+ Slog.d(TAG,"mNetworkInfo=" + mNetworkInfo);
+ Slog.d(TAG,"mScanRequested=" + mScanRequested);
+ Slog.d(TAG,"mDiscoverPeersInProgress=" + mDiscoverPeersInProgress);
+ Slog.d(TAG,"mDesiredDevice=" + describeWifiP2pDevice(mDesiredDevice));
+ Slog.d(TAG,"mConnectingDisplay=" + describeWifiP2pDevice(mConnectingDevice));
+ Slog.d(TAG,"mDisconnectingDisplay=" + describeWifiP2pDevice(mDisconnectingDevice));
+ Slog.d(TAG,"mCancelingDisplay=" + describeWifiP2pDevice(mCancelingDevice));
+ Slog.d(TAG,"mConnectedDevice=" + describeWifiP2pDevice(mConnectedDevice));
+ Slog.d(TAG,"mConnectionRetriesLeft=" + mConnectionRetriesLeft);
+ Slog.d(TAG,"mRemoteDisplay=" + mRemoteDisplay);
+ Slog.d(TAG,"mRemoteDisplayInterface=" + mRemoteDisplayInterface);
+ Slog.d(TAG,"mRemoteDisplayConnected=" + mRemoteDisplayConnected);
+ Slog.d(TAG,"mAdvertisedDisplay=" + mAdvertisedDisplay);
+ Slog.d(TAG,"mAdvertisedDisplaySurface=" + mAdvertisedDisplaySurface);
+ Slog.d(TAG,"mAdvertisedDisplayWidth=" + mAdvertisedDisplayWidth);
+ Slog.d(TAG,"mAdvertisedDisplayHeight=" + mAdvertisedDisplayHeight);
+ Slog.d(TAG,"mAdvertisedDisplayFlags=" + mAdvertisedDisplayFlags);
+
+ Slog.d(TAG,"mAvailableWifiDisplayPeers: size=" + mAvailableWifiDisplayPeers.size());
+ for (WifiP2pDevice device : mAvailableWifiDisplayPeers) {
+ Slog.d(TAG," " + describeWifiP2pDevice(device));
+ }
+ }
+
public void requestStartScan() {
if (!mScanRequested) {
mScanRequested = true;
@@ -367,7 +405,9 @@ final class WifiDisplayController implements DumpUtils.Dump {
}
private void updateScanState() {
- if (mScanRequested && mWfdEnabled && mDesiredDevice == null) {
+ if (mScanRequested && mWfdEnabled &&
+ (mDesiredDevice == null) && (mConnectedDevice == null)
+ && (mDisconnectingDevice == null)) {
if (!mDiscoverPeersInProgress) {
Slog.i(TAG, "Starting Wifi display scan.");
mDiscoverPeersInProgress = true;
@@ -543,6 +583,10 @@ final class WifiDisplayController implements DumpUtils.Dump {
return;
}
+ if (handlePreExistingConnection(device)) {
+ Slog.i(TAG, "already handle the preexisting p2p connection status");
+ return;
+ }
mDesiredDevice = device;
mConnectionRetriesLeft = CONNECT_MAX_RETRIES;
updateConnection();
@@ -567,20 +611,35 @@ final class WifiDisplayController implements DumpUtils.Dump {
* connection is established (or not).
*/
private void updateConnection() {
+ if(DEBUGV) {
+ //new Throwable("WFD_DBG").printStackTrace();
+ StackTraceElement[] st = Thread.currentThread().getStackTrace();
+ for(int i = 2 ; i < st.length && i < 5; i++) {
+ Slog.i(TAG,st[i].toString());
+ }
+ dump();
+ }
// Step 0. Stop scans if necessary to prevent interference while connected.
// Resume scans later when no longer attempting to connect.
updateScanState();
// Step 1. Before we try to connect to a new device, tell the system we
// have disconnected from the old one.
- if (mRemoteDisplay != null && mConnectedDevice != mDesiredDevice) {
- Slog.i(TAG, "Stopped listening for RTSP connection on " + mRemoteDisplayInterface
- + " from Wifi display: " + mConnectedDevice.deviceName);
+ if ((mRemoteDisplay != null || mExtRemoteDisplay != null) &&
+ (mConnectedDevice != mDesiredDevice)||
+ (mRemoteDisplayInterface != null && mConnectedDevice == null)) {
+ Slog.i(TAG, "Stopped listening for RTSP connection on "
+ + mRemoteDisplayInterface);
+
+ if(mRemoteDisplay != null) {
+ mRemoteDisplay.dispose();
+ } else if(mExtRemoteDisplay != null) {
+ ExtendedRemoteDisplayHelper.dispose(mExtRemoteDisplay);
+ }
- mRemoteDisplay.dispose();
+ mExtRemoteDisplay = null;
mRemoteDisplay = null;
mRemoteDisplayInterface = null;
- mRemoteDisplayConnected = false;
mHandler.removeCallbacks(mRtspTimeout);
mWifiP2pManager.setMiracastMode(WifiP2pManager.MIRACAST_DISABLED);
@@ -590,7 +649,7 @@ final class WifiDisplayController implements DumpUtils.Dump {
}
// Step 2. Before we try to connect to a new device, disconnect from the old one.
- if (mDisconnectingDevice != null) {
+ if (mRemoteDisplayConnected || mDisconnectingDevice != null) {
return; // wait for asynchronous callback
}
if (mConnectedDevice != null && mConnectedDevice != mDesiredDevice) {
@@ -674,6 +733,75 @@ final class WifiDisplayController implements DumpUtils.Dump {
return; // done
}
+ //Before we connect, we need to set the oldDevice to the desiredDevice to check
+ //the device on receiving callbacks from the Remote display modules
+ final WifiP2pDevice oldDevice = mDesiredDevice;
+ RemoteDisplay.Listener listener = new RemoteDisplay.Listener() {
+ @Override
+ public void onDisplayConnected(Surface surface,
+ int width, int height, int flags, int session) {
+ if (mConnectedDevice == oldDevice && !mRemoteDisplayConnected) {
+ Slog.i(TAG, "Opened RTSP connection with Wifi display: "
+ + mConnectedDevice.deviceName);
+ mRemoteDisplayConnected = true;
+ mHandler.removeCallbacks(mRtspTimeout);
+
+ if (mWifiDisplayCertMode) {
+ mListener.onDisplaySessionInfo(
+ getSessionInfo(mConnectedDeviceGroupInfo, session));
+ }
+
+ final WifiDisplay display = createWifiDisplay(mConnectedDevice);
+ advertiseDisplay(display, surface, width, height, flags);
+ }
+ }
+
+ @Override
+ public void onDisplayDisconnected() {
+ if (mConnectedDevice == oldDevice) {
+ Slog.i(TAG, "Closed RTSP connection with Wifi display: "
+ + mConnectedDevice.deviceName);
+ mHandler.removeCallbacks(mRtspTimeout);
+ mRemoteDisplayConnected = false;
+ disconnect();
+ }
+ }
+
+ @Override
+ public void onDisplayError(int error) {
+ if (mConnectedDevice == oldDevice) {
+ Slog.i(TAG, "Lost RTSP connection with Wifi display due to error "
+ + error + ": " + mConnectedDevice.deviceName);
+ mHandler.removeCallbacks(mRtspTimeout);
+ handleConnectionFailure(false);
+ }
+ }
+ };
+
+ int WFDR2Info = SystemProperties.getInt("persist.vendor.setWFDInfo.R2",0);
+ Slog.i(TAG, "WFDR2info is: " + WFDR2Info);
+ /*R1 source - R1 sink ->0
+ *R1 source - R2 sink ->1
+ *R2 source - R1 sink ->2
+ *R2 source - R2 sink ->3*/
+ if(WFDR2Info==2 || WFDR2Info==3){
+ WifiP2pWfdInfo wfdInfo = mThisDevice.getWfdInfo();
+ mWifiP2pManager.setWFDR2Info(mWifiP2pChannel, wfdInfo, new ActionListener() {
+ @Override
+ public void onSuccess() {
+ if (DEBUG) {
+ Slog.i(TAG, "Successfully set WFD R2 info.");
+ }
+ }
+
+ @Override
+ public void onFailure(int reason) {
+ if (DEBUG) {
+ Slog.i(TAG, "Failed to set WFD R2 info with reason " + reason + ".");
+ }
+ }
+ });
+ }
// Step 5. Try to connect.
if (mConnectedDevice == null && mConnectingDevice == null) {
Slog.i(TAG, "Connecting to Wifi display: " + mDesiredDevice.deviceName);
@@ -699,6 +827,19 @@ final class WifiDisplayController implements DumpUtils.Dump {
WifiDisplay display = createWifiDisplay(mConnectingDevice);
advertiseDisplay(display, null, 0, 0, 0);
+ if(ExtendedRemoteDisplayHelper.isAvailable()&&
+ mExtRemoteDisplay == null){
+ final int port = getPortNumber(mDesiredDevice);
+ //IP is superfluous for WFD source, and we don't have one at this stage anyway since
+ //P2P connection hasn't been established yet
+ final String iface = "255.255.255.255:" + port;
+ mRemoteDisplayInterface = iface;
+ Slog.i(TAG, "Listening for RTSP connection on " + iface
+ + " from Wifi display: " + mDesiredDevice.deviceName);
+ mExtRemoteDisplay = ExtendedRemoteDisplayHelper.listen(iface,
+ listener, mHandler, mContext);
+ }
+
final WifiP2pDevice newDevice = mDesiredDevice;
mWifiP2pManager.connect(mWifiP2pChannel, config, new ActionListener() {
@Override
@@ -736,54 +877,16 @@ final class WifiDisplayController implements DumpUtils.Dump {
mWifiP2pManager.setMiracastMode(WifiP2pManager.MIRACAST_SOURCE);
- final WifiP2pDevice oldDevice = mConnectedDevice;
final int port = getPortNumber(mConnectedDevice);
final String iface = addr.getHostAddress() + ":" + port;
mRemoteDisplayInterface = iface;
- Slog.i(TAG, "Listening for RTSP connection on " + iface
- + " from Wifi display: " + mConnectedDevice.deviceName);
-
- mRemoteDisplay = RemoteDisplay.listen(iface, new RemoteDisplay.Listener() {
- @Override
- public void onDisplayConnected(Surface surface,
- int width, int height, int flags, int session) {
- if (mConnectedDevice == oldDevice && !mRemoteDisplayConnected) {
- Slog.i(TAG, "Opened RTSP connection with Wifi display: "
- + mConnectedDevice.deviceName);
- mRemoteDisplayConnected = true;
- mHandler.removeCallbacks(mRtspTimeout);
-
- if (mWifiDisplayCertMode) {
- mListener.onDisplaySessionInfo(
- getSessionInfo(mConnectedDeviceGroupInfo, session));
- }
-
- final WifiDisplay display = createWifiDisplay(mConnectedDevice);
- advertiseDisplay(display, surface, width, height, flags);
- }
- }
-
- @Override
- public void onDisplayDisconnected() {
- if (mConnectedDevice == oldDevice) {
- Slog.i(TAG, "Closed RTSP connection with Wifi display: "
- + mConnectedDevice.deviceName);
- mHandler.removeCallbacks(mRtspTimeout);
- disconnect();
- }
- }
-
- @Override
- public void onDisplayError(int error) {
- if (mConnectedDevice == oldDevice) {
- Slog.i(TAG, "Lost RTSP connection with Wifi display due to error "
- + error + ": " + mConnectedDevice.deviceName);
- mHandler.removeCallbacks(mRtspTimeout);
- handleConnectionFailure(false);
- }
- }
- }, mHandler, mContext.getOpPackageName());
+ if(!ExtendedRemoteDisplayHelper.isAvailable()){
+ Slog.i(TAG, "Listening for RTSP connection on " + iface
+ + " from Wifi display: " + mConnectedDevice.deviceName);
+ mRemoteDisplay = RemoteDisplay.listen(iface, listener,
+ mHandler, mContext.getOpPackageName());
+ }
// Use extended timeout value for certification, as some tests require user inputs
int rtspTimeout = mWifiDisplayCertMode ?
@@ -794,7 +897,7 @@ final class WifiDisplayController implements DumpUtils.Dump {
}
private WifiDisplaySessionInfo getSessionInfo(WifiP2pGroup info, int session) {
- if (info == null) {
+ if (info == null || info.getOwner() == null) {
return null;
}
Inet4Address addr = getInterfaceAddress(info);
@@ -835,6 +938,10 @@ final class WifiDisplayController implements DumpUtils.Dump {
mWifiP2pManager.requestGroupInfo(mWifiP2pChannel, new GroupInfoListener() {
@Override
public void onGroupInfoAvailable(WifiP2pGroup info) {
+ if(info == null) {
+ return;
+ }
+
if (DEBUG) {
Slog.d(TAG, "Received group info: " + describeWifiP2pGroup(info));
}
@@ -854,8 +961,9 @@ final class WifiDisplayController implements DumpUtils.Dump {
}
if (mWifiDisplayCertMode) {
- boolean owner = info.getOwner().deviceAddress
- .equals(mThisDevice.deviceAddress);
+ boolean owner = (info.getOwner() != null)?
+ info.getOwner().deviceAddress
+ .equals(mThisDevice.deviceAddress):false;
if (owner && info.getClientList().isEmpty()) {
// this is the case when we started Autonomous GO,
// and no client has connected, save group info
@@ -893,6 +1001,12 @@ final class WifiDisplayController implements DumpUtils.Dump {
disconnect();
}
+ if (mDesiredDevice != null) {
+ Slog.i(TAG, "reconnect new device: " + mDesiredDevice.deviceName);
+ updateConnection();
+ return;
+ }
+
// After disconnection for a group, for some reason we have a tendency
// to get a peer change notification with an empty list of peers.
// Perform a fresh scan.
@@ -925,7 +1039,8 @@ final class WifiDisplayController implements DumpUtils.Dump {
@Override
public void run() {
if (mConnectedDevice != null
- && mRemoteDisplay != null && !mRemoteDisplayConnected) {
+ && (mRemoteDisplay != null || mExtRemoteDisplay != null)
+ && !mRemoteDisplayConnected) {
Slog.i(TAG, "Timed out waiting for Wifi display RTSP connection after "
+ RTSP_TIMEOUT_SECONDS + " seconds: "
+ mConnectedDevice.deviceName);
@@ -1009,6 +1124,41 @@ final class WifiDisplayController implements DumpUtils.Dump {
mAdvertisedDisplayFlags);
}
+ private boolean handlePreExistingConnection(final WifiP2pDevice device) {
+ if (mNetworkInfo == null || !mNetworkInfo.isConnected() || mWifiDisplayCertMode) {
+ return false;
+ }
+ Slog.i(TAG, "handle the preexisting p2p connection status");
+ mWifiP2pManager.requestGroupInfo(mWifiP2pChannel, new GroupInfoListener() {
+ @Override
+ public void onGroupInfoAvailable(WifiP2pGroup info) {
+ if (info == null) {
+ return;
+ }
+ if (contains(info, device)) {
+ Slog.i(TAG, "already connected to the desired device: " + device.deviceName);
+ updateConnection();
+ handleConnectionChanged(mNetworkInfo);
+ } else {
+ mWifiP2pManager.removeGroup(mWifiP2pChannel, new ActionListener() {
+ @Override
+ public void onSuccess() {
+ Slog.i(TAG, "disconnect the old device");
+ }
+
+ @Override
+ public void onFailure(int reason) {
+ Slog.i(TAG, "Failed to disconnect the old device: reason=" + reason);
+ }
+ });
+ }
+ }
+ });
+ mDesiredDevice = device;
+ mConnectionRetriesLeft = CONNECT_MAX_RETRIES;
+ return true;
+ }
+
private static Inet4Address getInterfaceAddress(WifiP2pGroup info) {
NetworkInterface iface;
try {
diff --git a/services/core/java/com/android/server/display/layout/Layout.java b/services/core/java/com/android/server/display/layout/Layout.java
index e53aec12f186..399a7950b512 100644
--- a/services/core/java/com/android/server/display/layout/Layout.java
+++ b/services/core/java/com/android/server/display/layout/Layout.java
@@ -45,6 +45,20 @@ public class Layout {
return isDefault ? DEFAULT_DISPLAY : sNextNonDefaultDisplayId++;
}
+ public static int assignDisplayIdLocked(boolean isDefault, DisplayAddress address) {
+ boolean isDisplayBuiltIn = false;
+ if (address instanceof DisplayAddress.Physical) {
+ isDisplayBuiltIn =
+ (((DisplayAddress.Physical) address).getPort() < 0);
+ }
+ if (!isDefault && isDisplayBuiltIn) {
+ return sNextNonDefaultDisplayId++;
+ }
+
+ return assignDisplayIdLocked(isDefault);
+ }
+
+
@Override
public String toString() {
return mDisplays.toString();
diff --git a/services/core/java/com/android/server/location/LocationManagerService.java b/services/core/java/com/android/server/location/LocationManagerService.java
index e6210b2a8cc9..044f2628bcca 100644
--- a/services/core/java/com/android/server/location/LocationManagerService.java
+++ b/services/core/java/com/android/server/location/LocationManagerService.java
@@ -243,6 +243,11 @@ public class LocationManagerService extends ILocationManager.Stub implements
private final GeofenceManager mGeofenceManager;
private volatile @Nullable GnssManagerService mGnssManagerService = null;
+
+ private String mComboNlpPackageName;
+ private String mComboNlpReadyMarker;
+ private String mComboNlpScreenMarker;
+
private GeocoderProxy mGeocodeProvider;
private final Object mDeprecatedGnssBatchingLock = new Object();
@@ -443,6 +448,13 @@ public class LocationManagerService extends ILocationManager.Stub implements
Log.e(TAG, "no geocoder provider found");
}
+ mComboNlpPackageName = mContext.getResources().getString(
+ com.android.internal.R.string.config_comboNetworkLocationProvider);
+ if (mComboNlpPackageName != null) {
+ mComboNlpReadyMarker = mComboNlpPackageName + ".nlp:ready";
+ mComboNlpScreenMarker = mComboNlpPackageName + ".nlp:screen";
+ }
+
// bind to hardware activity recognition
HardwareActivityRecognitionProxy hardwareActivityRecognitionProxy =
HardwareActivityRecognitionProxy.createAndRegister(mContext);
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java
index 7d5b7e535ca9..65c0503c2028 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsService.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -208,6 +208,7 @@ public class LockSettingsService extends ILockSettings.Stub {
// Order of holding lock: mSeparateChallengeLock -> mSpManager -> this
// Do not call into ActivityManager while holding mSpManager lock.
private final Object mSeparateChallengeLock = new Object();
+ private static final String DEFAULT_PASSWORD = "default_password";
private final DeviceProvisionedObserver mDeviceProvisionedObserver =
new DeviceProvisionedObserver();
@@ -232,6 +233,8 @@ public class LockSettingsService extends ILockSettings.Stub {
private final KeyStore mKeyStore;
private final java.security.KeyStore mJavaKeyStore;
+ private static String mSavePassword = DEFAULT_PASSWORD;
+
private final RecoverableKeyStoreManager mRecoverableKeyStoreManager;
private ManagedProfilePasswordCache mManagedProfilePasswordCache;
@@ -1304,6 +1307,45 @@ public class LockSettingsService extends ILockSettings.Stub {
return getCredentialTypeInternal(userId) != CREDENTIAL_TYPE_NONE;
}
+ public void retainPassword(String password) {
+ if (LockPatternUtils.isDeviceEncryptionEnabled()) {
+ if (password != null)
+ mSavePassword = password;
+ else
+ mSavePassword = DEFAULT_PASSWORD;
+ }
+ }
+
+ public void sanitizePassword() {
+ if (LockPatternUtils.isDeviceEncryptionEnabled()) {
+ mSavePassword = DEFAULT_PASSWORD;
+ }
+ }
+
+ private boolean checkCryptKeeperPermissions() {
+ boolean permission_err = false;
+ try {
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.CRYPT_KEEPER,
+ "no permission to get the password");
+ } catch (SecurityException e) {
+ permission_err = true;
+ }
+ return permission_err;
+ }
+
+ public String getPassword() {
+ /** if calling process does't have crypt keeper or admin permissions,
+ * throw the exception.
+ */
+ if (checkCryptKeeperPermissions())
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE,
+ "no crypt_keeper or admin permission to get the password");
+
+ return mSavePassword;
+ }
+
@VisibleForTesting /** Note: this method is overridden in unit tests */
void setKeystorePassword(byte[] password, int userHandle) {
AndroidKeyStoreMaintenance.onUserPasswordChanged(userHandle, password);
@@ -2147,7 +2189,15 @@ public class LockSettingsService extends ILockSettings.Stub {
ICheckCredentialProgressCallback progressCallback) {
checkPasswordReadPermission();
try {
- return doVerifyCredential(credential, userId, progressCallback, 0 /* flags */);
+ VerifyCredentialResponse response = doVerifyCredential(credential,
+ userId, progressCallback, 0 /* flags */);
+ if ((response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) &&
+ (userId == UserHandle.USER_OWNER)) {
+ //TODO(b/127810705): Update to credentials to use LockscreenCredential
+ String credentialString = credential.isNone() ? null : new String(credential.getCredential());
+ retainPassword(credentialString);
+ }
+ return response;
} finally {
scheduleGc();
}
diff --git a/services/core/java/com/android/server/media/BluetoothRouteProvider.java b/services/core/java/com/android/server/media/BluetoothRouteProvider.java
index 7afa81aa047d..3a25859f3d7d 100644
--- a/services/core/java/com/android/server/media/BluetoothRouteProvider.java
+++ b/services/core/java/com/android/server/media/BluetoothRouteProvider.java
@@ -50,6 +50,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
+import java.util.Set;
class BluetoothRouteProvider {
private static final String TAG = "BTRouteProvider";
@@ -165,8 +166,9 @@ class BluetoothRouteProvider {
private void buildBluetoothRoutes() {
mBluetoothRoutes.clear();
- if (mBluetoothAdapter.getBondedDevices() != null) {
- for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
+ Set<BluetoothDevice> bondedDevices = mBluetoothAdapter.getBondedDevices();
+ if (bondedDevices != null) {
+ for (BluetoothDevice device : bondedDevices) {
if (device.isConnected()) {
BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
if (newBtRoute.connectedProfiles.size() > 0) {
diff --git a/services/core/java/com/android/server/net/IpConfigStore.java b/services/core/java/com/android/server/net/IpConfigStore.java
index df1eb6d9fe3c..d17dbde496ce 100644
--- a/services/core/java/com/android/server/net/IpConfigStore.java
+++ b/services/core/java/com/android/server/net/IpConfigStore.java
@@ -322,8 +322,11 @@ public class IpConfigStore {
gateway = InetAddresses.parseNumericAddress(in.readUTF());
}
// If the destination is a default IPv4 route, use the gateway
- // address unless already set.
- if (dest.getAddress() instanceof Inet4Address
+ // address unless already set. If there is no destination, assume
+ // it is default route and use the gateway address in all cases.
+ if (dest == null) {
+ gatewayAddress = gateway;
+ } else if (dest.getAddress() instanceof Inet4Address
&& dest.getPrefixLength() == 0 && gatewayAddress == null) {
gatewayAddress = gateway;
} else {
diff --git a/services/core/java/com/android/server/om/OverlayManagerSettings.java b/services/core/java/com/android/server/om/OverlayManagerSettings.java
index 55bca1733d37..55bca1733d37 100644..100755
--- a/services/core/java/com/android/server/om/OverlayManagerSettings.java
+++ b/services/core/java/com/android/server/om/OverlayManagerSettings.java
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index 708b2129ad29..37d5736633d2 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -568,6 +568,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
private int createSessionInternal(SessionParams params, String installerPackageName,
String installerAttributionTag, int userId)
throws IOException {
+ android.util.SeempLog.record(90);
final int callingUid = Binder.getCallingUid();
mPm.enforceCrossUserPermission(
callingUid, userId, true, true, "createSession");
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 3ddcf17d0a47..f17efaa0fa8e 100644..100755
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -134,6 +134,7 @@ import android.util.SparseArray;
import android.util.TypedXmlPullParser;
import android.util.TypedXmlSerializer;
import android.util.apk.ApkSignatureVerifier;
+import android.util.BoostFramework;
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
@@ -278,6 +279,13 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
*/
private final StagingManager mStagingManager;
+ /*
+ * @hide
+ */
+ private BoostFramework mPerfBoostInstall = null;
+ private boolean mIsPerfLockAcquired = false;
+ private final int MAX_INSTALL_DURATION = 20000;
+
final int sessionId;
final int userId;
final SessionParams params;
@@ -1456,6 +1464,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
public ParcelFileDescriptor openWrite(String name, long offsetBytes, long lengthBytes) {
assertCanWrite(false);
try {
+ if (mPerfBoostInstall == null){
+ mPerfBoostInstall = new BoostFramework();
+ }
+ if (mPerfBoostInstall != null && !mIsPerfLockAcquired) {
+ mPerfBoostInstall.perfHint(BoostFramework.VENDOR_HINT_PACKAGE_INSTALL_BOOST,
+ null, MAX_INSTALL_DURATION, -1);
+ mIsPerfLockAcquired = true;
+ }
return doWriteInternal(name, offsetBytes, lengthBytes, null);
} catch (IOException e) {
throw ExceptionUtils.wrap(e);
@@ -1685,6 +1701,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@Override
public void commit(@NonNull IntentSender statusReceiver, boolean forTransfer) {
+ if (mIsPerfLockAcquired && mPerfBoostInstall != null) {
+ mPerfBoostInstall.perfLockRelease();
+ mIsPerfLockAcquired = false;
+ }
if (hasParentSessionId()) {
throw new IllegalStateException(
"Session " + sessionId + " is a child of multi-package session "
@@ -3708,6 +3728,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
private void abandonNonStaged() {
+
synchronized (mLock) {
assertNotChildLocked("abandonNonStaged");
assertCallerIsOwnerOrRootOrSystem();
@@ -3731,6 +3752,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@Override
public void abandon() {
+ if (mIsPerfLockAcquired && mPerfBoostInstall != null) {
+ mPerfBoostInstall.perfLockRelease();
+ mIsPerfLockAcquired = false;
+ }
if (params.isStaged) {
mStagedSession.abandon();
} else {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 6f1c88722e21..48f7386747dc 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -332,6 +332,7 @@ import android.util.Xml;
import android.util.apk.ApkSignatureVerifier;
import android.util.jar.StrictJarFile;
import android.util.proto.ProtoOutputStream;
+import android.util.BoostFramework;
import android.view.Display;
import com.android.internal.R;
@@ -421,6 +422,7 @@ import libcore.util.HexEncoding;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
@@ -428,7 +430,9 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
@@ -778,6 +782,8 @@ public class PackageManagerService extends IPackageManager.Stub
private static final String COMPANION_PACKAGE_NAME = "com.android.companiondevicemanager";
+ private static final String PROPERTY_NO_RIL = "ro.radio.noril";
+
// Compilation reasons.
public static final int REASON_FIRST_BOOT = 0;
public static final int REASON_BOOT_AFTER_OTA = 1;
@@ -884,6 +890,19 @@ public class PackageManagerService extends IPackageManager.Stub
"PackageManagerService.mIsolatedOwners");
/**
+ * Tracks packages that need to be disabled.
+ * Map of package name to its path on the file system.
+ */
+ final private HashMap<String, String> mPackagesToBeDisabled = new HashMap<>();
+
+ /**
+ * Tracks packages that need to be disabled for QSPA enabled taregts.
+ * List of packages path on the file system.
+ */
+ final private List<String> mPackagesPathToBeDisabledForQSPA = new ArrayList<String>();
+ final private boolean mQspaEnabled = SystemProperties.getBoolean("ro.config.qspa.apps", false);
+
+ /**
* Tracks new system packages [received in an OTA] that we expect to
* find updated user-installed versions. Keys are package name, values
* are package location.
@@ -1384,6 +1403,7 @@ public class PackageManagerService extends IPackageManager.Stub
public @NonNull String requiredPermissionControllerPackage;
public @NonNull String requiredUninstallerPackage;
public @Nullable String requiredVerifierPackage;
+ public @Nullable String optionalVerifierPackage;
public String[] separateProcesses;
public @NonNull String servicesExtensionPackageName;
public @Nullable String setupWizardPackage;
@@ -1695,6 +1715,7 @@ public class PackageManagerService extends IPackageManager.Stub
| FLAG_PERMISSION_REVOKED_COMPAT;
final @Nullable String mRequiredVerifierPackage;
+ final @Nullable String mOptionalVerifierPackage;
final @NonNull String mRequiredInstallerPackage;
final @NonNull String mRequiredUninstallerPackage;
final @NonNull String mRequiredPermissionControllerPackage;
@@ -7313,6 +7334,7 @@ public class PackageManagerService extends IPackageManager.Stub
mSeparateProcesses = testParams.separateProcesses;
mViewCompiler = testParams.viewCompiler;
mRequiredVerifierPackage = testParams.requiredVerifierPackage;
+ mOptionalVerifierPackage = testParams.optionalVerifierPackage;
mRequiredInstallerPackage = testParams.requiredInstallerPackage;
mRequiredUninstallerPackage = testParams.requiredUninstallerPackage;
mRequiredPermissionControllerPackage = testParams.requiredPermissionControllerPackage;
@@ -7381,6 +7403,16 @@ public class PackageManagerService extends IPackageManager.Stub
mInstaller = injector.getInstaller();
mEnableFreeCacheV2 = SystemProperties.getBoolean("fw.free_cache_v2", true);
+ t.traceBegin("readListOfPackagesToBeDisabled");
+ readListOfPackagesToBeDisabled();
+ t.traceEnd();
+
+ mPackagesPathToBeDisabledForQSPA.add("/system_ext/priv-app/SystemUI");
+ mPackagesPathToBeDisabledForQSPA.add("/system_ext/priv-app/Launcher3QuickStep");
+ mPackagesPathToBeDisabledForQSPA.add("/system/app/PrintSpooler");
+ mPackagesPathToBeDisabledForQSPA.add("/system/priv-app/StatementService");
+ mPackagesPathToBeDisabledForQSPA.add("/product/app/Calendar");
+
// Create sub-components that provide services / data. Order here is important.
t.traceBegin("createSubComponents");
@@ -8093,6 +8125,7 @@ public class PackageManagerService extends IPackageManager.Stub
if (!mOnlyCore) {
mRequiredVerifierPackage = getRequiredButNotReallyRequiredVerifierLPr();
+ mOptionalVerifierPackage = getOptionalVerifierLPr();
mRequiredInstallerPackage = getRequiredInstallerLPr();
mRequiredUninstallerPackage = getRequiredUninstallerLPr();
ComponentName intentFilterVerifierComponent =
@@ -8113,6 +8146,7 @@ public class PackageManagerService extends IPackageManager.Stub
SharedLibraryInfo.VERSION_UNDEFINED);
} else {
mRequiredVerifierPackage = null;
+ mOptionalVerifierPackage = null;
mRequiredInstallerPackage = null;
mRequiredUninstallerPackage = null;
mServicesExtensionPackageName = null;
@@ -8266,6 +8300,75 @@ public class PackageManagerService extends IPackageManager.Stub
}
/**
+ * Read the list of packages that need to be disabled.
+ *
+ * For wifi-only devices (modem-less), telephony related applications do not need to run.
+ * This method will read the list of packages from a predefined file in the file system,
+ * and store it in {@link #mPackagesToBeDisabled}. These applications will be skipped when
+ * directories are scanned later.
+ */
+ private void readListOfPackagesToBeDisabled() {
+ boolean wifiOnly = SystemProperties.getBoolean(PROPERTY_NO_RIL, false);
+ if (!wifiOnly) {
+ // Apps need to be disabled only for modem-less devices
+ return;
+ }
+
+ final String TELEPHONY_PACKAGES_PATH = "etc/telephony_packages.xml";
+ File telephonyPackagesFile =
+ new File(Environment.getVendorDirectory(), TELEPHONY_PACKAGES_PATH);
+ FileReader packagesReader = null;
+ Slog.d(TAG, "Disabling packages for wifi-only device, source: " + telephonyPackagesFile);
+
+ try {
+ XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ XmlPullParser packagesParser = factory.newPullParser();
+ packagesReader = new FileReader(telephonyPackagesFile);
+
+ if (packagesParser != null) {
+ packagesParser.setInput(packagesReader);
+ int eventType = packagesParser.getEventType();
+ while (eventType != XmlPullParser.END_DOCUMENT) {
+ String tagName = packagesParser.getName();
+ switch (eventType) {
+ case XmlPullParser.START_TAG:
+ if (TextUtils.equals(tagName, "packageinfo")) {
+ String name = packagesParser.getAttributeValue(null, "name");
+ String path = packagesParser.getAttributeValue(null, "path");
+ mPackagesToBeDisabled.put(name, path);
+ }
+ break;
+ }
+ eventType = packagesParser.next();
+ }
+ }
+ } catch (XmlPullParserException e) {
+ Log.e(TAG, "XmlPullParserException parsing '"+ telephonyPackagesFile + "'", e);
+ } catch (IOException e) {
+ Log.e(TAG, "IOException parsing '" + telephonyPackagesFile + "'", e);
+ } catch (Exception e) {
+ Log.e(TAG, "Exception parsing '" + telephonyPackagesFile + "'", e);
+ }
+
+ if (packagesReader != null) {
+ try {
+ packagesReader.close();
+ } catch (IOException e) {
+ // do nothing
+ }
+ }
+
+ if (DEBUG_PACKAGE_SCANNING) {
+ for (String packageName : mPackagesToBeDisabled.keySet()) {
+ Slog.d(TAG, "readListOfPackagesToBeDisabled"
+ + ", package: " + packageName
+ + ", path: " + mPackagesToBeDisabled.get(packageName));
+ }
+ }
+ }
+
+ /**
* Extract, install and enable a stub package.
* <p>If the compressed file can not be extracted / installed for any reason, the stub
* APK will be installed and the package will be disabled. To recover from this situation,
@@ -8549,6 +8652,14 @@ public class PackageManagerService extends IPackageManager.Stub
UserHandle.USER_SYSTEM, false /*allowDynamicSplits*/);
if (matches.size() == 1) {
return matches.get(0).getComponentInfo().packageName;
+ } else if (matches.size() > 1) {
+ String optionalVerifierName = mContext.getResources().getString(R.string.config_optionalPackageVerifierName);
+ if (TextUtils.isEmpty(optionalVerifierName))
+ return matches.get(0).getComponentInfo().packageName;
+ for (int i = 0; i < matches.size(); i++) {
+ if (!matches.get(i).getComponentInfo().packageName.contains(optionalVerifierName))
+ return matches.get(i).getComponentInfo().packageName;
+ }
} else if (matches.size() == 0) {
Log.w(TAG, "There should probably be a verifier, but, none were found");
return null;
@@ -8556,6 +8667,25 @@ public class PackageManagerService extends IPackageManager.Stub
throw new RuntimeException("There must be exactly one verifier; found " + matches);
}
+ private @Nullable String getOptionalVerifierLPr() {
+ final Intent intent = new Intent("com.qualcomm.qti.intent.action.PACKAGE_NEEDS_OPTIONAL_VERIFICATION");
+
+ final List<ResolveInfo> matches = queryIntentReceiversInternal(intent, PACKAGE_MIME_TYPE,
+ MATCH_SYSTEM_ONLY | MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE,
+ UserHandle.USER_SYSTEM, false /*allowDynamicSplits*/);
+ if (matches.size() >= 1) {
+ String optionalVerifierName = mContext.getResources().getString(R.string.config_optionalPackageVerifierName);
+ if (TextUtils.isEmpty(optionalVerifierName))
+ return null;
+ for (int i = 0; i < matches.size(); i++) {
+ if (matches.get(i).getComponentInfo().packageName.contains(optionalVerifierName)) {
+ return matches.get(i).getComponentInfo().packageName;
+ }
+ }
+ }
+ return null;
+ }
+
private @NonNull String getRequiredSharedLibraryLPr(String name, int version) {
synchronized (mLock) {
SharedLibraryInfo libraryInfo = getSharedLibraryInfoLPr(name, version);
@@ -11943,6 +12073,23 @@ public class PackageManagerService extends IPackageManager.Stub
// Ignore entries which are not packages
continue;
}
+
+ if (mQspaEnabled) {
+ if (mPackagesPathToBeDisabledForQSPA != null &&
+ mPackagesPathToBeDisabledForQSPA.contains(file.toString())) {
+ // Ignore entries contained in {@link #mPackagesPathToBeDisabledForQSPA}
+ Slog.d(TAG, "QSPA enabled ignoring package for install : " + file);
+ continue;
+ }
+ }
+
+ if (mPackagesToBeDisabled.values() != null &&
+ mPackagesToBeDisabled.values().contains(file.toString())) {
+ // Ignore entries contained in {@link #mPackagesToBeDisabled}
+ Slog.d(TAG, "ignoring package: " + file);
+ continue;
+ }
+
parallelPackageParser.submit(file, parseFlags);
fileCount++;
}
@@ -18435,6 +18582,9 @@ public class PackageManagerService extends IPackageManager.Stub
: getPackageUid(mRequiredVerifierPackage, MATCH_DEBUG_TRIAGED_MISSING,
verifierUser.getIdentifier());
verificationState.setRequiredVerifierUid(requiredUid);
+ final int optionalUid = mOptionalVerifierPackage == null ? -1
+ : getPackageUid(mOptionalVerifierPackage, MATCH_DEBUG_TRIAGED_MISSING,
+ verifierUser.getIdentifier());
final int installerUid =
verificationInfo == null ? -1 : verificationInfo.installerUid;
final boolean isVerificationEnabled = isVerificationEnabled(
@@ -18520,14 +18670,42 @@ public class PackageManagerService extends IPackageManager.Stub
}
}
+ if (mOptionalVerifierPackage != null) {
+ final Intent optionalIntent = new Intent(verification);
+ optionalIntent.setAction("com.qualcomm.qti.intent.action.PACKAGE_NEEDS_OPTIONAL_VERIFICATION");
+ final List<ResolveInfo> optional_receivers = queryIntentReceiversInternal(optionalIntent,
+ PACKAGE_MIME_TYPE, 0, verifierUser.getIdentifier(), false /*allowDynamicSplits*/);
+ final ComponentName optionalVerifierComponent = matchComponentForVerifier(
+ mOptionalVerifierPackage, optional_receivers);
+ optionalIntent.setComponent(optionalVerifierComponent);
+ verificationState.addOptionalVerifier(optionalUid);
+ if (mRequiredVerifierPackage != null) {
+ mContext.sendBroadcastAsUser(optionalIntent, verifierUser, android.Manifest.permission.PACKAGE_VERIFICATION_AGENT);
+ } else {
+ mContext.sendOrderedBroadcastAsUser(optionalIntent, verifierUser, android.Manifest.permission.PACKAGE_VERIFICATION_AGENT,
+ new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final Message msg = mHandler.obtainMessage(CHECK_PENDING_VERIFICATION);
+ msg.arg1 = verificationId;
+ mHandler.sendMessageDelayed(msg, getVerificationTimeout());
+ }
+ }, null, 0, null, null);
+ /*
+ * We don't want the copy to proceed until
+ * verification succeeds.
+ */
+ mWaitForVerificationToComplete = false;
+ }
+ }
if (mRequiredVerifierPackage != null) {
- final ComponentName requiredVerifierComponent = matchComponentForVerifier(
- mRequiredVerifierPackage, receivers);
/*
* Send the intent to the required verification agent,
* but only start the verification timeout after the
* target BroadcastReceivers have run.
*/
+ final ComponentName requiredVerifierComponent = matchComponentForVerifier(
+ mRequiredVerifierPackage, receivers);
verification.setComponent(requiredVerifierComponent);
idleController.addPowerSaveTempWhitelistApp(Process.myUid(),
mRequiredVerifierPackage, idleDuration,
@@ -19189,6 +19367,8 @@ public class PackageManagerService extends IPackageManager.Stub
final String installerPackageName = installSource.installerPackageName;
if (DEBUG_INSTALL) Slog.d(TAG, "New package installed in " + pkg.getPath());
+ if (pkgName != null)
+ acquireUxPerfLock(BoostFramework.UXE_EVENT_PKG_INSTALL, pkgName, 0);
synchronized (mLock) {
// For system-bundled packages, we assume that installing an upgraded version
// of the package implies that the user actually wants to run that new code,
@@ -20655,6 +20835,11 @@ public class PackageManagerService extends IPackageManager.Stub
// on the device; we should replace it.
replace = true;
if (DEBUG_INSTALL) Slog.d(TAG, "Replace existing pacakge: " + pkgName);
+ acquireUxPerfLock(BoostFramework.UXE_EVENT_PKG_INSTALL, pkgName, 1);
+ BoostFramework mPerf = new BoostFramework();
+ if (mPerf != null) {
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_APP_UPDATE, pkgName, -1, 0);
+ }
}
if (replace) {
@@ -21795,9 +21980,19 @@ public class PackageManagerService extends IPackageManager.Stub
}
}
+ if (res && packageName != null) {
+ acquireUxPerfLock(BoostFramework.UXE_EVENT_PKG_UNINSTALL, packageName, userId);
+ }
return res ? PackageManager.DELETE_SUCCEEDED : PackageManager.DELETE_FAILED_INTERNAL_ERROR;
}
+ private void acquireUxPerfLock(int opcode, String pkgName, int dat) {
+ BoostFramework ux_perf = new BoostFramework();
+ if (ux_perf != null) {
+ ux_perf.perfUXEngine_events(opcode, 0, pkgName, dat);
+ }
+ }
+
static class PackageRemovedInfo {
final PackageSender packageSender;
String removedPackage;
@@ -24691,6 +24886,7 @@ public class PackageManagerService extends IPackageManager.Stub
}, overlayFilter);
mModuleInfoProvider.systemReady();
+ new BoostFramework(mContext, true);
// Installer service might attempt to install some packages that have been staged for
// installation on reboot. Make sure this is the last component to be call since the
@@ -25535,7 +25731,7 @@ public class PackageManagerService extends IPackageManager.Stub
UserManagerInternal umInternal = mInjector.getUserManagerInternal();
StorageManagerInternal smInternal = mInjector.getLocalService(StorageManagerInternal.class);
for (UserInfo user : mUserManager.getUsers(false /* includeDying */)) {
- final int flags;
+ int flags;
if (StorageManager.isUserKeyUnlocked(user.id)
&& smInternal.isCeStoragePrepared(user.id)) {
flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;
@@ -25544,9 +25740,12 @@ public class PackageManagerService extends IPackageManager.Stub
} else {
continue;
}
-
+ if ((vol.disk.flags & DiskInfo.FLAG_UFS_CARD) == DiskInfo.FLAG_UFS_CARD) {
+ flags = flags | DiskInfo.FLAG_UFS_CARD;
+ }
+ final int pflags = flags;
try {
- sm.prepareUserStorage(volumeUuid, user.id, user.serialNumber, flags);
+ sm.prepareUserStorage(volumeUuid, user.id, user.serialNumber, pflags);
synchronized (mInstallLock) {
reconcileAppsDataLI(volumeUuid, user.id, flags, true /* migrateAppData */);
}
diff --git a/services/core/java/com/android/server/pm/PackageVerificationState.java b/services/core/java/com/android/server/pm/PackageVerificationState.java
index cb9c2e997e22..0eb663dbbbf8 100644
--- a/services/core/java/com/android/server/pm/PackageVerificationState.java
+++ b/services/core/java/com/android/server/pm/PackageVerificationState.java
@@ -42,6 +42,14 @@ class PackageVerificationState {
private boolean mRequiredVerificationPassed;
+ private int mOptionalVerifierUid;
+
+ private boolean mHasOptionalVerifier;
+
+ private boolean mOptionalVerificationComplete;
+
+ private boolean mOptionalVerificationPassed;
+
private boolean mExtendedTimeout;
private boolean mIntegrityVerificationComplete;
@@ -74,6 +82,11 @@ class PackageVerificationState {
mSufficientVerifierUids.put(uid, true);
}
+ public void addOptionalVerifier(int uid) {
+ mOptionalVerifierUid = uid;
+ mHasOptionalVerifier = true;
+ }
+
/**
* Should be called when a verification is received from an agent so the state of the package
* verification can be tracked.
@@ -95,6 +108,16 @@ class PackageVerificationState {
mRequiredVerificationPassed = false;
}
return true;
+ } else if (mHasOptionalVerifier && uid == mOptionalVerifierUid) {
+ mOptionalVerificationComplete = true;
+ switch (code) {
+ case PackageManager.VERIFICATION_ALLOW:
+ mOptionalVerificationPassed = true;
+ break;
+ default:
+ mOptionalVerificationPassed = false;
+ }
+ return true;
} else {
if (mSufficientVerifierUids.get(uid)) {
if (code == PackageManager.VERIFICATION_ALLOW) {
@@ -121,7 +144,11 @@ class PackageVerificationState {
* @return {@code true} when verification is considered complete
*/
boolean isVerificationComplete() {
- if (!mRequiredVerificationComplete) {
+ if (mRequiredVerifierUid != -1 && !mRequiredVerificationComplete) {
+ return false;
+ }
+
+ if (mHasOptionalVerifier && !mOptionalVerificationComplete) {
return false;
}
@@ -139,7 +166,11 @@ class PackageVerificationState {
* @return {@code true} if installation should be allowed
*/
boolean isInstallAllowed() {
- if (!mRequiredVerificationPassed) {
+ if (mRequiredVerifierUid != -1 && !mRequiredVerificationPassed) {
+ return false;
+ }
+
+ if (mHasOptionalVerifier && !mOptionalVerificationPassed) {
return false;
}
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index b7d4d22d3966..b02d08027510 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -694,6 +694,22 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
};
+ private UEventObserver mHDMISwitchObserver = new UEventObserver() {
+ @Override
+ public void onUEvent(UEventObserver.UEvent event) {
+ mDefaultDisplayPolicy.setHdmiPlugged("1".equals(event.get("STATUS")));
+ }
+ };
+
+ private UEventObserver mExtEventObserver = new UEventObserver() {
+ @Override
+ public void onUEvent(UEventObserver.UEvent event) {
+ if (event.get("status") != null) {
+ mDefaultDisplayPolicy.setHdmiPlugged("connected".equals(event.get("status")));
+ }
+ }
+ };
+
class SettingsObserver extends ContentObserver {
SettingsObserver(Handler handler) {
super(handler);
@@ -3352,7 +3368,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
void initializeHdmiStateInternal() {
boolean plugged = false;
+ mExtEventObserver.startObserving("mdss_mdp/drm/card");
// watch for HDMI plug messages if the hdmi switch exists
+ mHDMISwitchObserver.startObserving("change@/devices/virtual/graphics/fb2");
if (new File("/sys/devices/virtual/switch/hdmi/state").exists()) {
mHDMIObserver.startObserving("DEVPATH=/devices/virtual/switch/hdmi");
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index e94575c43363..3db7769f5aac 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -74,6 +74,12 @@ public final class ShutdownThread extends Thread {
private static final int PACKAGE_MANAGER_STOP_PERCENT = 6;
private static final int RADIO_STOP_PERCENT = 18;
private static final int MOUNT_SERVICE_STOP_PERCENT = 20;
+ // Time we should wait for vendor subsystem shutdown
+ // Sleep times(ms) between checks of the vendor subsystem state
+ private static final int VENDOR_SUBSYS_STATE_CHECK_INTERVAL_MS = 100;
+ // Max time we wait for vendor subsystems to shut down before resuming
+ // with full system shutdown
+ private static final int VENDOR_SUBSYS_MAX_WAIT_MS = 10000;
// length of vibration before shutting down
private static final int SHUTDOWN_VIBRATE_MS = 500;
@@ -678,6 +684,59 @@ public final class ShutdownThread extends Thread {
* @param reason reason for reboot/shutdown
*/
public static void rebootOrShutdown(final Context context, boolean reboot, String reason) {
+ String subsysProp;
+ subsysProp = SystemProperties.get("vendor.peripheral.shutdown_critical_list",
+ "ERROR");
+ //If we don't have the shutdown critical subsystem list we can't
+ //really do anything. Proceed with full system shutdown.
+ if (!subsysProp.equals("ERROR")) {
+ Log.i(TAG, "Shutdown critical subsyslist is :"+subsysProp+": ");
+ Log.i(TAG, "Waiting for a maximum of " +
+ (VENDOR_SUBSYS_MAX_WAIT_MS) + "ms");
+ String[] subsysList = subsysProp.split(" ");
+ int wait_count = 0;
+ boolean okToShutdown = true;
+ String subsysState;
+ int subsysListLength = subsysList.length;
+ do {
+ okToShutdown = true;
+ for (int i = 0; i < subsysListLength; i++) {
+ subsysState =
+ SystemProperties.get(
+ "vendor.peripheral." +
+ subsysList[i] +
+ ".state",
+ "ERROR");
+ if(subsysState.equals("ONLINE")) {
+ //We only want to delay shutdown while
+ //one of the shutdown critical
+ //subsystems still shows as 'ONLINE'.
+ okToShutdown = false;
+ }
+ }
+ if (okToShutdown == false) {
+ SystemClock.sleep(VENDOR_SUBSYS_STATE_CHECK_INTERVAL_MS);
+ wait_count++;
+ }
+ } while (okToShutdown != true &&
+ wait_count < (VENDOR_SUBSYS_MAX_WAIT_MS/VENDOR_SUBSYS_STATE_CHECK_INTERVAL_MS));
+ if (okToShutdown != true) {
+ for (int i = 0; i < subsysList.length; i++) {
+ subsysState =
+ SystemProperties.get(
+ "vendor.peripheral." +
+ subsysList[i] +
+ ".state",
+ "ERROR");
+ if(subsysState.equals("ONLINE")) {
+ Log.w(TAG, "Subsystem " + subsysList[i]+
+ "did not shut down within timeout");
+ }
+ }
+ } else {
+ Log.i(TAG, "Vendor subsystem(s) shutdown successful");
+ }
+ }
if (reboot) {
Log.i(TAG, "Rebooting, reason: " + reason);
PowerManagerService.lowLevelReboot(reason);
diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java
index 02d978dfdf99..6608b9636671 100644
--- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java
+++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java
@@ -519,6 +519,12 @@ class SoundTriggerModule implements IHwBinder.DeathRecipient {
hidlConfig.base.header.captureDevice = mSession.mDeviceHandle;
hidlConfig.base.header.captureHandle = mSession.mIoHandle;
mHalService.startRecognition(mHandle, hidlConfig, this, 0);
+ try {
+ hidlConfig.base.data.close();
+ } catch (Exception e) {
+ // will be handled during finalize()
+ Log.e(TAG, "Failed to close hidl memory", e);
+ }
setState(ModelState.ACTIVE);
}
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 18b2a0e4ff1f..92d8d2f03841 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -83,6 +83,7 @@ import com.android.server.notification.NotificationDelegate;
import com.android.server.policy.GlobalActionsProvider;
import com.android.server.power.ShutdownCheckPoints;
import com.android.server.power.ShutdownThread;
+import com.android.server.UiThread;
import com.android.server.wm.ActivityTaskManagerInternal;
import java.io.FileDescriptor;
diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
index f87856255b3e..e640650d8f12 100644
--- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
@@ -1,5 +1,6 @@
package com.android.server.wm;
+import android.app.ActivityManager;
import static android.app.ActivityManager.START_SUCCESS;
import static android.app.ActivityManager.START_TASK_TO_FRONT;
import static android.app.ActivityManager.processStateAmToProto;
@@ -88,6 +89,7 @@ import android.os.SystemClock;
import android.os.Trace;
import android.os.incremental.IncrementalManager;
import android.util.ArrayMap;
+import android.util.BoostFramework;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
@@ -167,6 +169,10 @@ class ActivityMetricsLogger {
private ArtManagerInternal mArtManagerInternal;
private final StringBuilder mStringBuilder = new StringBuilder();
+ public static BoostFramework mUxPerf = new BoostFramework();
+ public static BoostFramework mPerfBoost = new BoostFramework();
+ private static ActivityRecord mLaunchedActivity;
+
/**
* Due to the global single concurrent launch sequence, all calls to this observer must be made
* in-order on the same thread to fulfill the "happens-before" guarantee in LaunchObserver.
@@ -931,6 +937,8 @@ class ActivityMetricsLogger {
private void logAppTransitionFinished(@NonNull TransitionInfo info, boolean isHibernating) {
if (DEBUG_METRICS) Slog.i(TAG, "logging finished transition " + info);
+ mLaunchedActivity = info.mLastLaunchedActivity;
+
// Take a snapshot of the transition info before sending it to the handler for logging.
// This will avoid any races with other operations that modify the ActivityRecord.
final TransitionInfoSnapshot infoSnapshot = new TransitionInfoSnapshot(info);
@@ -1053,7 +1061,41 @@ class ActivityMetricsLogger {
sb.append(info.launchedActivityShortComponentName);
sb.append(": ");
TimeUtils.formatDuration(info.windowsDrawnDelayMs, sb);
+
+ if (mPerfBoost != null) {
+ if (info.processRecord != null) {
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_DRAW, info.packageName,
+ info.processRecord.getPid(), BoostFramework.Draw.EVENT_TYPE_V1);
+ }
+ }
+
+ if (mUxPerf != null) {
+ mUxPerf.perfUXEngine_events(BoostFramework.UXE_EVENT_DISPLAYED_ACT, 0, info.packageName, info.windowsDrawnDelayMs);
+ }
+
Log.i(TAG, sb.toString());
+
+ if (mUxPerf != null) {
+ int isGame;
+
+ if (ActivityManager.isLowRamDeviceStatic()) {
+ isGame = mLaunchedActivity.isAppInfoGame();
+ } else {
+ isGame = (mUxPerf.perfGetFeedback(BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE,
+ mLaunchedActivity.packageName) == BoostFramework.WorkloadType.GAME) ? 1 : 0;
+ }
+ if (mLaunchedActivity.processName != null) {
+ if (!mLaunchedActivity.processName.equals(info.packageName)) {
+ isGame = 1;
+ }
+ }
+ mUxPerf.perfUXEngine_events(BoostFramework.UXE_EVENT_GAME, 0, info.packageName, isGame);
+ }
+
+ if (mLaunchedActivity.mPerf != null && mLaunchedActivity.perfActivityBoostHandler > 0) {
+ mLaunchedActivity.mPerf.perfLockReleaseHandler(mLaunchedActivity.perfActivityBoostHandler);
+ mLaunchedActivity.perfActivityBoostHandler = -1;
+ }
}
private static int getAppStartTransitionType(int tronType, boolean relaunched) {
diff --git a/services/core/java/com/android/server/wm/ActivityPluginDelegate.java b/services/core/java/com/android/server/wm/ActivityPluginDelegate.java
new file mode 100644
index 000000000000..b2b08f2198d7
--- /dev/null
+++ b/services/core/java/com/android/server/wm/ActivityPluginDelegate.java
@@ -0,0 +1,174 @@
+/*
+ *Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ *Redistribution and use in source and binary forms, with or without
+ *modification, are permitted provided that the following conditions are
+ *met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ *ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ *BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ *IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.server.wm;
+
+import dalvik.system.PathClassLoader;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import android.os.Environment;
+import android.util.Log;
+import android.content.Context;
+import android.provider.Settings;
+import android.app.ActivityThread;
+
+public class ActivityPluginDelegate {
+
+ private static final String TAG = "ActivityPluginDelegate";
+ private static final boolean LOGV = false;
+
+ private static Class activityServiceClass = null;
+ private static Object activityServiceObj = null;
+ private static boolean extJarAvail = true;
+
+ private static final String FOREGROUND_ACTIVITY_TRIGGER =
+ "foreground_activity_trigger";
+
+ //Try to get global settings for 15 times, if
+ //foreground_activity_trigger does not set to 1 after 15 times
+ //stop retry and foreground_activity_trigger is 0
+ private static final int MAX_CONNECT_RETRIES = 15;
+
+ static int mGetFeatureEnableRetryCount = MAX_CONNECT_RETRIES;
+ static boolean isEnabled = false;
+
+ public static void activityInvokeNotification(String appName,
+ boolean isFullScreen) {
+ if (LOGV) Log.v(TAG, "activityInvokeNotification("
+ + appName + ", " + isFullScreen + ")");
+ if (!getFeatureFlag() || !extJarAvail || !loadActivityExtJar())
+ return;
+
+ try {
+ activityServiceClass.getMethod("sendActivityInvokeNotification",
+ String.class, boolean.class).invoke(
+ activityServiceObj, appName, isFullScreen);
+ } catch (InvocationTargetException |
+ SecurityException | NoSuchMethodException e) {
+ if (LOGV) {
+ Log.w(TAG, "Failed to invoke activityInvokeNotification: " + e);
+ e.printStackTrace();
+ }
+ } catch (Exception e) {
+ if (LOGV) {
+ Log.w(TAG, "Error calling activityInvokeNotification"+
+ "Method on ActivityExt jar: " + e);
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static void activitySuspendNotification(String appName,
+ boolean isFullScreen,
+ boolean isBg) {
+ if (LOGV) Log.v(TAG, "activitySuspendNotification("
+ + appName + ", " + isFullScreen + ", " + isBg + ")");
+ if (!getFeatureFlag() || !extJarAvail || !loadActivityExtJar())
+ return;
+
+ try {
+ activityServiceClass.getMethod("sendActivitySuspendNotification",
+ String.class, boolean.class, boolean.class).invoke(
+ activityServiceObj, appName, isFullScreen, isBg);
+ } catch (InvocationTargetException |
+ SecurityException | NoSuchMethodException e) {
+ if (LOGV) {
+ Log.w(TAG, "Failed to call sendActivitySuspendNotification: " + e);
+ e.printStackTrace();
+ }
+ } catch (Exception e) {
+ if (LOGV) {
+ Log.w(TAG, "Error calling sendActivitySuspendNotification"+
+ "Method on ActivityExt jar: " + e);
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static synchronized boolean loadActivityExtJar() {
+ final String realProvider = "com.qualcomm.qti."+
+ "activityextension.ActivityNotifier";
+ final String realProviderPath = Environment.getSystemExtDirectory().
+ getAbsolutePath() + "/framework/ActivityExt.jar";
+
+ if (activityServiceClass != null && activityServiceObj != null) {
+ return true;
+ }
+
+ if ((extJarAvail = new File(realProviderPath).exists()) == false) {
+ if (LOGV) Log.w(TAG, "ActivityExt jar file not present");
+ return extJarAvail;
+ }
+
+ if (activityServiceClass == null && activityServiceObj == null) {
+ if (LOGV) Log.v(TAG, "loading ActivityExt jar");
+ try {
+ PathClassLoader classLoader = new PathClassLoader
+ (realProviderPath, ClassLoader.getSystemClassLoader());
+
+ activityServiceClass = classLoader.loadClass(realProvider);
+ activityServiceObj = activityServiceClass.newInstance();
+ if (LOGV) Log.v(TAG, "ActivityExt jar loaded");
+ } catch (ClassNotFoundException |
+ InstantiationException | IllegalAccessException e) {
+ if (LOGV) {
+ Log.w(TAG, "Failed to find, instantiate or access ActivityExt jar:" + e);
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ return false;
+ } catch (Exception e) {
+ if (LOGV) {
+ Log.w(TAG, "unable to load ActivityExt jar:" + e);
+ e.printStackTrace();
+ }
+ extJarAvail = false;
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static synchronized boolean getFeatureFlag() {
+ //Global setting has been enabled for foreground_activity_trigger
+ //Or no one sets foreground_activity_trigger after all retry
+ //No need to invoke Settings API
+ if(isEnabled == true || (mGetFeatureEnableRetryCount == 0)) {
+ return isEnabled;
+ }
+ isEnabled = ((Settings.Global.getInt(ActivityThread.currentApplication().
+ getApplicationContext().getContentResolver(),
+ FOREGROUND_ACTIVITY_TRIGGER, 1)) == 1);
+ --mGetFeatureEnableRetryCount;
+ return isEnabled;
+ }
+}
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 618e421038c7..e4ee577d1aea 100644..100755
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -180,6 +180,7 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SWITCH;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_TRANSITION;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_USER_LEAVING;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_VISIBILITY;
+import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SERVICETRACKER;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_ADD_REMOVE;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_APP;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_CONFIGURATION;
@@ -290,6 +291,7 @@ import android.service.dreams.DreamActivity;
import android.service.dreams.DreamManagerInternal;
import android.service.voice.IVoiceInteractionSession;
import android.text.TextUtils;
+import android.util.BoostFramework;
import android.util.ArraySet;
import android.util.EventLog;
import android.util.Log;
@@ -365,10 +367,14 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
+import vendor.qti.hardware.servicetracker.V1_2.IServicetracker;
+import vendor.qti.hardware.servicetracker.V1_2.ActivityDetails;
+import vendor.qti.hardware.servicetracker.V1_2.ActivityStats;
+import vendor.qti.hardware.servicetracker.V1_2.ActivityStates;
/**
* An entry in the history task, representing an activity.
*/
-final class ActivityRecord extends WindowToken implements WindowManagerService.AppFreezeListener {
+public final class ActivityRecord extends WindowToken implements WindowManagerService.AppFreezeListener {
private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityRecord" : TAG_ATM;
private static final String TAG_ADD_REMOVE = TAG + POSTFIX_ADD_REMOVE;
private static final String TAG_APP = TAG + POSTFIX_APP;
@@ -433,7 +439,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
final int mUserId;
// The package implementing intent's component
// TODO: rename to mPackageName
- final String packageName;
+ public final String packageName;
// the intent component, or target of an alias.
final ComponentName mActivityComponent;
// Input application handle used by the input dispatcher.
@@ -463,6 +469,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
private int logo; // resource identifier of activity's logo.
private int theme; // resource identifier of activity's theme.
private int windowFlags; // custom window flags for preview window.
+ public int perfActivityBoostHandler = -1; //perflock handler when activity is created.
private Task task; // the task this is in.
private long createTime = System.currentTimeMillis();
long lastVisibleTime; // last time this activity became visible
@@ -523,6 +530,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// process that it is hidden.
private boolean mLastDeferHidingClient; // If true we will defer setting mClientVisible to false
// and reporting to the client that it is hidden.
+ public boolean launching; // is activity launch in progress?
+ public boolean translucentWindowLaunch; // a translucent window launch?
boolean nowVisible; // is this activity's window visible?
boolean mClientVisibilityDeferred;// was the visibility change message to client deferred?
boolean idle; // has the activity gone idle?
@@ -603,6 +612,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
boolean pendingVoiceInteractionStart; // Waiting for activity-invoked voice session
IVoiceInteractionSession voiceSession; // Voice interaction session for this activity
+ public BoostFramework mPerf = null;
+ public BoostFramework mPerf_iop = null;
+
boolean mVoiceInteraction;
private int mPendingRelaunchCount;
@@ -1753,6 +1765,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
resultWho = _resultWho;
requestCode = _reqCode;
setState(INITIALIZING, "ActivityRecord ctor");
+ callServiceTrackeronActivityStatechange(INITIALIZING, true);
launchFailed = false;
stopped = false;
delayedResume = false;
@@ -1764,6 +1777,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
super.setClientVisible(true);
idle = false;
hasBeenLaunched = false;
+ launching = false;
+ translucentWindowLaunch = false;
mTaskSupervisor = supervisor;
info.taskAffinity = computeTaskAffinity(info.taskAffinity, info.applicationInfo.uid,
@@ -1841,6 +1856,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
createTime = _createTime;
}
mAtmService.mPackageConfigPersister.updateConfigIfNeeded(this, mUserId, packageName);
+
+ if (mPerf == null)
+ mPerf = new BoostFramework();
}
/**
@@ -2009,6 +2027,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
windowDisableStarting);
// If this activity is launched from system surface, ignore windowDisableStarting
if (windowIsTranslucent || windowIsFloating) {
+ translucentWindowLaunch = true;
return false;
}
if (windowShowWallpaper
@@ -3321,6 +3340,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// destroyed when the next activity reports idle.
addToStopping(false /* scheduleIdle */, false /* idleDelayed */,
"completeFinishing");
+ callServiceTrackeronActivityStatechange(STOPPING, true);
setState(STOPPING, "completeFinishing");
} else if (addToFinishingAndWaitForIdle()) {
// We added this activity to the finishing list and something else is becoming
@@ -3347,6 +3367,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* destroying it until the next one starts.
*/
boolean destroyIfPossible(String reason) {
+ callServiceTrackeronActivityStatechange(FINISHING, true);
setState(FINISHING, "destroyIfPossible");
// Make sure the record is cleaned out of other places.
@@ -3371,6 +3392,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
makeFinishingLocked();
+ getRootTask().onARStopTriggered(this);
final boolean activityRemoved = destroyImmediately("finish-imm:" + reason);
// If the display does not have running activity, the configuration may need to be
@@ -3397,6 +3419,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
@VisibleForTesting
boolean addToFinishingAndWaitForIdle() {
ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending finish: %s", this);
+ callServiceTrackeronActivityStatechange(FINISHING, true);
setState(FINISHING, "addToFinishingAndWaitForIdle");
if (!mTaskSupervisor.mFinishingActivities.contains(this)) {
mTaskSupervisor.mFinishingActivities.add(this);
@@ -3467,12 +3490,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// we are not removing it from the list.
if (finishing && !skipDestroy) {
ProtoLog.v(WM_DEBUG_STATES, "Moving to DESTROYING: %s (destroy requested)", this);
+ callServiceTrackeronActivityStatechange(DESTROYING, true);
setState(DESTROYING,
"destroyActivityLocked. finishing and not skipping destroy");
mAtmService.mH.postDelayed(mDestroyTimeoutRunnable, DESTROY_TIMEOUT);
} else {
ProtoLog.v(WM_DEBUG_STATES, "Moving to DESTROYED: %s "
+ "(destroy skipped)", this);
+ callServiceTrackeronActivityStatechange(DESTROYED, true);
setState(DESTROYED,
"destroyActivityLocked. not finishing or skipping destroy");
if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during destroy for activity " + this);
@@ -3485,6 +3510,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
removedFromHistory = true;
} else {
ProtoLog.v(WM_DEBUG_STATES, "Moving to DESTROYED: %s (no app)", this);
+ callServiceTrackeronActivityStatechange(DESTROYED, true);
setState(DESTROYED, "destroyActivityLocked. not finishing and had no app");
}
}
@@ -3521,6 +3547,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
removeTimeouts();
ProtoLog.v(WM_DEBUG_STATES, "Moving to DESTROYED: %s (removed from history)",
this);
+ callServiceTrackeronActivityStatechange(DESTROYED, true);
setState(DESTROYED, "removeFromHistory");
if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during remove for activity " + this);
detachFromProcess();
@@ -3599,6 +3626,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
frozenBeforeDestroy = false;
if (setState) {
+ callServiceTrackeronActivityStatechange(DESTROYED, true);
setState(DESTROYED, "cleanUp");
if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during cleanUp for activity " + this);
detachFromProcess();
@@ -5140,6 +5168,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mState = state;
+ callServiceTrackeronActivityStatechange(state, false);
+
if (getTaskFragment() != null) {
getTaskFragment().onActivityStateChanged(this, state, reason);
}
@@ -5201,6 +5231,76 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
}
+ void callServiceTrackeronActivityStatechange(State state, boolean early_notify) {
+ IServicetracker mServicetracker;
+ ActivityDetails aDetails = new ActivityDetails();
+ ActivityStats aStats = new ActivityStats();
+ int aState = ActivityStates.UNKNOWN;
+
+ aDetails.launchedFromPid = this.launchedFromPid;
+ aDetails.launchedFromUid = this.launchedFromUid;
+ aDetails.packageName = this.packageName;
+ aDetails.processName = (this.processName!= null)? this.processName:"none";
+ aDetails.intent = this.intent.getComponent().toString();
+ aDetails.className = this.intent.getComponent().getClassName();
+ aDetails.versioncode = this.info.applicationInfo.versionCode;
+
+ aStats.createTime = this.createTime;
+ aStats.lastVisibleTime = this.lastVisibleTime;
+ aStats.launchCount = this.launchCount;
+ aStats.lastLaunchTime = this.lastLaunchTime;
+
+ switch(state) {
+ case INITIALIZING :
+ aState = ActivityStates.INITIALIZING;
+ break;
+ case STARTED :
+ aState = ActivityStates.STARTED;
+ break;
+ case RESUMED :
+ aState = ActivityStates.RESUMED;
+ break;
+ case PAUSING :
+ aState = ActivityStates.PAUSING;
+ break;
+ case PAUSED :
+ aState = ActivityStates.PAUSED;
+ break;
+ case STOPPING :
+ aState = ActivityStates.STOPPING;
+ break;
+ case STOPPED:
+ aState = ActivityStates.STOPPED;
+ break;
+ case FINISHING :
+ aState = ActivityStates.FINISHING;
+ break;
+ case DESTROYING:
+ aState = ActivityStates.DESTROYING;
+ break;
+ case DESTROYED :
+ aState = ActivityStates.DESTROYED;
+ break;
+ case RESTARTING_PROCESS:
+ aState = ActivityStates.RESTARTING_PROCESS;
+ break;
+ }
+ if(DEBUG_SERVICETRACKER) {
+ Slog.v(TAG, "Calling mServicetracker.OnActivityStateChange with flag " + early_notify + " state " + state);
+ }
+ try {
+ mServicetracker = mAtmService.mTaskSupervisor.getServicetrackerInstance();
+ if (mServicetracker != null)
+ mServicetracker.OnActivityStateChange(aState, aDetails, aStats, early_notify);
+ else
+ Slog.e(TAG, "Unable to get servicetracker HAL instance");
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to send activity state change details to servicetracker HAL", e);
+ mAtmService.mTaskSupervisor.destroyServicetrackerInstance();
+ }
+
+ }
+
State getState() {
return mState;
}
@@ -5496,6 +5596,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
// An activity must be in the {@link PAUSING} state for the system to validate
// the move to {@link PAUSED}.
+ callServiceTrackeronActivityStatechange(PAUSING, true);
setState(PAUSING, "makeActiveIfNeeded");
try {
mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), appToken,
@@ -5508,6 +5609,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (DEBUG_VISIBILITY) {
Slog.v(TAG_VISIBILITY, "Start visible activity, " + this);
}
+ callServiceTrackeronActivityStatechange(STARTED, true);
setState(STARTED, "makeActiveIfNeeded");
try {
@@ -5671,6 +5773,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (isActivityTypeHome()) {
mTaskSupervisor.updateHomeProcess(task.getBottomMostActivity().app);
+ try {
+ mTaskSupervisor.new PreferredAppsTask().execute();
+ } catch (Exception e) {
+ Slog.v (TAG, "Exception: " + e);
+ }
}
if (nowVisible) {
@@ -5721,6 +5828,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
shortComponentName, pausingActivity != null
? pausingActivity.shortComponentName : "(none)");
if (isState(PAUSING)) {
+ callServiceTrackeronActivityStatechange(PAUSED, true);
setState(PAUSED, "activityPausedLocked");
if (finishing) {
ProtoLog.v(WM_DEBUG_STATES,
@@ -5767,6 +5875,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
void stopIfPossible() {
if (DEBUG_SWITCH) Slog.d(TAG_SWITCH, "Stopping: " + this);
+ launching = false;
final Task rootTask = getRootTask();
if (isNoHistory()) {
if (!finishing) {
@@ -5791,8 +5900,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
try {
stopped = false;
ProtoLog.v(WM_DEBUG_STATES, "Moving to STOPPING: %s (stop requested)", this);
+ callServiceTrackeronActivityStatechange(STOPPING, true);
setState(STOPPING, "stopIfPossible");
+ getRootTask().onARStopTriggered(this);
if (DEBUG_VISIBILITY) {
Slog.v(TAG_VISIBILITY, "Stopping:" + this);
}
@@ -5809,6 +5920,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// Just in case, assume it to be stopped.
stopped = true;
ProtoLog.v(WM_DEBUG_STATES, "Stop failed; moving to STOPPED: %s", this);
+ callServiceTrackeronActivityStatechange(STOPPED, true);
setState(STOPPED, "stopIfPossible");
if (deferRelaunchUntilPaused) {
destroyImmediately("stop-except");
@@ -5842,6 +5954,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
removeStopTimeout();
stopped = true;
if (isStopping) {
+ callServiceTrackeronActivityStatechange(STOPPED, true);
setState(STOPPED, "activityStoppedLocked");
}
@@ -6127,6 +6240,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
/** Called when the windows associated app window container are drawn. */
private void onWindowsDrawn(long timestampNs) {
+ if (mPerf != null && perfActivityBoostHandler > 0) {
+ mPerf.perfLockReleaseHandler(perfActivityBoostHandler);
+ perfActivityBoostHandler = -1;
+ } else if (perfActivityBoostHandler > 0) {
+ Slog.w(TAG, "activity boost didn't release as expected");
+ }
final TransitionInfoSnapshot info = mTaskSupervisor
.getActivityMetricsLogger().notifyWindowsDrawn(this, timestampNs);
final boolean validInfo = info != null;
@@ -6156,6 +6275,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (DEBUG_SWITCH) Log.v(TAG_SWITCH, "windowsVisibleLocked(): " + this);
if (!nowVisible) {
nowVisible = true;
+ launching = false;
lastVisibleTime = SystemClock.uptimeMillis();
mAtmService.scheduleAppGcsLocked();
// The nowVisible may be false in onAnimationFinished because the transition animation
@@ -6180,6 +6300,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (DEBUG_VISIBILITY) Slog.v(TAG_WM, "Reporting gone in " + appToken);
if (DEBUG_SWITCH) Log.v(TAG_SWITCH, "windowsGone(): " + this);
nowVisible = false;
+ launching = false;
}
@Override
@@ -6838,6 +6959,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return task == null || task.shouldAnimate();
}
+ public int isAppInfoGame() {
+ int isGame = 0;
+ if (info.applicationInfo != null) {
+ isGame = (info.applicationInfo.category == ApplicationInfo.CATEGORY_GAME ||
+ (info.applicationInfo.flags & ApplicationInfo.FLAG_IS_GAME) == ApplicationInfo.FLAG_IS_GAME) ? 1 : 0;
+ }
+ return isGame;
+ }
+
/**
* Creates a layer to apply crop to an animation.
*/
@@ -8671,6 +8801,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mAtmService.getAppWarningsLocked().onResumeActivity(this);
} else {
removePauseTimeout();
+ callServiceTrackeronActivityStatechange(PAUSED, true);
setState(PAUSED, "relaunchActivityLocked");
}
@@ -8700,6 +8831,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
// The restarting state avoids removing this record when process is died.
+ callServiceTrackeronActivityStatechange(RESTARTING_PROCESS, true);
setState(RESTARTING_PROCESS, "restartActivityProcess");
if (!mVisibleRequested || mHaveState) {
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 436a325559e6..d6f93ce491b3 100644..100755
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -112,6 +112,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.service.voice.IVoiceInteractionSession;
import android.text.TextUtils;
+import android.util.BoostFramework;
import android.util.ArraySet;
import android.util.DebugUtils;
import android.util.Pools.SynchronizedPool;
@@ -208,6 +209,8 @@ class ActivityStarter {
private IVoiceInteractionSession mVoiceSession;
private IVoiceInteractor mVoiceInteractor;
+ public BoostFramework mPerf = null;
+
// Last activity record we attempted to start
private ActivityRecord mLastStartActivityRecord;
// The result of the last activity we attempted to start.
@@ -553,6 +556,7 @@ class ActivityStarter {
mSupervisor = supervisor;
mInterceptor = interceptor;
reset(true);
+ mPerf = new BoostFramework();
}
/**
@@ -1768,6 +1772,26 @@ class ActivityStarter {
if (newTask) {
final Task taskToAffiliate = (mLaunchTaskBehind && mSourceRecord != null)
? mSourceRecord.getTask() : null;
+ String packageName= mService.mContext.getPackageName();
+ if (mPerf != null) {
+ if (mPerf.getPerfHalVersion() >= BoostFramework.PERF_HAL_V23) {
+ int pkgType =
+ mPerf.perfGetFeedback(BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE,
+ packageName);
+ mStartActivity.perfActivityBoostHandler =
+ mPerf.perfHintAcqRel(mStartActivity.perfActivityBoostHandler,
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, packageName,
+ -1, BoostFramework.Launch.ACTIVITY_LAUNCH_BOOST, 1, pkgType);
+ } else {
+ if (mStartActivity.perfActivityBoostHandler > 0) {
+ Slog.i(TAG, "Activity boosted, release it firstly");
+ mPerf.perfLockReleaseHandler(mStartActivity.perfActivityBoostHandler);
+ }
+ mStartActivity.perfActivityBoostHandler =
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ packageName, -1, BoostFramework.Launch.BOOST_V1);
+ }
+ }
setNewTask(taskToAffiliate);
} else if (mAddingToTask) {
addOrReparentStartingActivity(targetTask, "adding to task");
@@ -2803,6 +2827,26 @@ class ActivityStarter {
}
private void addOrReparentStartingActivity(@NonNull Task task, String reason) {
+ String packageName= mService.mContext.getPackageName();
+ if (mPerf != null) {
+ if (mPerf.getPerfHalVersion() >= BoostFramework.PERF_HAL_V23) {
+ int pkgType =
+ mPerf.perfGetFeedback(BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE,
+ packageName);
+ mStartActivity.perfActivityBoostHandler =
+ mPerf.perfHintAcqRel(mStartActivity.perfActivityBoostHandler,
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, packageName,
+ -1, BoostFramework.Launch.ACTIVITY_LAUNCH_BOOST, 1, pkgType);
+ } else {
+ if (mStartActivity.perfActivityBoostHandler > 0) {
+ Slog.i(TAG, "Activity boosted, release it firstly");
+ mPerf.perfLockReleaseHandler(mStartActivity.perfActivityBoostHandler);
+ }
+ mStartActivity.perfActivityBoostHandler =
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ packageName, -1, BoostFramework.Launch.BOOST_V1);
+ }
+ }
TaskFragment newParent = task;
if (mInTaskFragment != null) {
// mInTaskFragment is created and added to the leaf task by task fragment organizer's
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerDebugConfig.java b/services/core/java/com/android/server/wm/ActivityTaskManagerDebugConfig.java
index 33d1b44b9743..6671b360ed0b 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerDebugConfig.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerDebugConfig.java
@@ -58,6 +58,8 @@ public class ActivityTaskManagerDebugConfig {
static final boolean DEBUG_ACTIVITY_STARTS = DEBUG_ALL || false;
public static final boolean DEBUG_CLEANUP = DEBUG_ALL || false;
public static final boolean DEBUG_METRICS = DEBUG_ALL || false;
+ //Flag to enable Servicetracker logs in AOSP side
+ static final boolean DEBUG_SERVICETRACKER = false;
static final String POSTFIX_APP = APPEND_CATEGORY_NAME ? "_App" : "";
static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : "";
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index f17c9f9c0a53..0e7611a890da 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -371,7 +371,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
* @see WindowManagerThreadPriorityBooster
*/
final Object mGlobalLockWithoutBoost = mGlobalLock;
- ActivityTaskSupervisor mTaskSupervisor;
+ public ActivityTaskSupervisor mTaskSupervisor;
ActivityClientController mActivityClientController;
RootWindowContainer mRootWindowContainer;
WindowManagerService mWindowManager;
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index ef4b8390413a..6be88c7c8fa0 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -49,6 +49,7 @@ import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_STATES;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_TASKS;
+import static com.android.server.wm.ActivityRecord.State.DESTROYED;
import static com.android.server.wm.ActivityRecord.State.PAUSED;
import static com.android.server.wm.ActivityRecord.State.PAUSING;
import static com.android.server.wm.ActivityRecord.State.RESTARTING_PROCESS;
@@ -135,6 +136,8 @@ import android.util.MergedConfiguration;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseIntArray;
+import android.util.BoostFramework;
+import com.android.internal.app.procstats.ProcessStats;
import android.view.Display;
import com.android.internal.R;
@@ -156,6 +159,11 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
+import java.util.Arrays;
+import android.os.AsyncTask;
+
+import vendor.qti.hardware.servicetracker.V1_2.IServicetracker;
+
// TODO: This class has become a dumping ground. Let's
// - Move things relating to the hierarchy to RootWindowContainer
// - Move things relating to activity life cycles to maybe a new class called ActivityLifeCycler
@@ -179,6 +187,12 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
// How long we can hold the launch wake lock before giving up.
private static final int LAUNCH_TIMEOUT = 10 * 1000 * Build.HW_TIMEOUT_MULTIPLIER;
+ public static boolean mPerfSendTapHint = false;
+ public static boolean mIsPerfBoostAcquired = false;
+ public static int mPerfHandle = -1;
+ public BoostFramework mPerfBoost = new BoostFramework();
+ public BoostFramework mUxPerf = new BoostFramework();
+
/** How long we wait until giving up on the activity telling us it released the top state. */
private static final int TOP_RESUMED_STATE_LOSS_TIMEOUT = 500;
@@ -238,7 +252,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
private static final int MAX_TASK_IDS_PER_USER = UserHandle.PER_USER_RANGE;
final ActivityTaskManagerService mService;
- RootWindowContainer mRootWindowContainer;
+ public RootWindowContainer mRootWindowContainer;
/** The historial list of recent tasks including inactive tasks */
RecentTasks mRecentTasks;
@@ -254,6 +268,8 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
private AppOpsManager mAppOpsManager;
+ private IServicetracker mServicetracker;
+
/** Common synchronization logic used to save things to disks. */
PersisterQueue mPersisterQueue;
LaunchParamsPersister mLaunchParamsPersister;
@@ -421,6 +437,28 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
mLaunchParamsPersister.onSystemReady();
}
+ public IServicetracker getServicetrackerInstance() {
+ if (mServicetracker == null) {
+ try {
+ mServicetracker = IServicetracker.getService(false);
+ } catch (java.util.NoSuchElementException e) {
+ // Service doesn't exist or cannot be opened logged below
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to get servicetracker interface", e);
+ return null;
+ }
+ if (mServicetracker == null) {
+ Slog.w(TAG, "servicetracker HIDL not available");
+ return null;
+ }
+ }
+ return mServicetracker;
+ }
+
+ public void destroyServicetrackerInstance() {
+ mServicetracker = null;
+ }
+
void onUserUnlocked(int userId) {
// Only start persisting when the first user is unlocked. The method call is
// idempotent so there is no side effect to call it again when the second user is
@@ -581,6 +619,15 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
void reportActivityLaunched(boolean timeout, ActivityRecord r, long totalTime,
@WaitResult.LaunchState int launchState) {
boolean changed = false;
+ if (totalTime > 0) {
+ if (mPerfBoost != null) {
+ if (r.app != null) {
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_DRAW,
+ r.packageName, r.app.getPid(),
+ BoostFramework.Draw.EVENT_TYPE_V1);
+ }
+ }
+ }
for (int i = mWaitingActivityLaunched.size() - 1; i >= 0; i--) {
final WaitInfo info = mWaitingActivityLaunched.get(i);
if (!info.matches(r)) {
@@ -710,7 +757,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
}
}
- ActivityInfo resolveActivity(Intent intent, String resolvedType, int startFlags,
+ public ActivityInfo resolveActivity(Intent intent, String resolvedType, int startFlags,
ProfilerInfo profilerInfo, int userId, int filterCallingUid) {
final ResolveInfo rInfo = resolveIntent(intent, resolvedType, userId, 0, filterCallingUid);
return resolveActivity(intent, rInfo, startFlags, profilerInfo);
@@ -995,6 +1042,10 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
boolean knownToBeDead = false;
if (wpc != null && wpc.hasThread()) {
try {
+ if (mPerfBoost != null) {
+ Slog.i(TAG, "The Process " + r.processName + " Already Exists in BG. So sending its PID: " + wpc.getPid());
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, r.processName, wpc.getPid(), BoostFramework.Launch.TYPE_START_APP_FROM_BG);
+ }
realStartActivityLocked(r, wpc, andResume, checkConfig);
return;
} catch (RemoteException e) {
@@ -1382,6 +1433,16 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
void findTaskToMoveToFront(Task task, int flags, ActivityOptions options, String reason,
boolean forceNonResizeable) {
Task currentRootTask = task.getRootTask();
+
+ Task focusedStack = mRootWindowContainer.getTopDisplayFocusedRootTask();
+ ActivityRecord top_activity = focusedStack != null ? focusedStack.getTopNonFinishingActivity() : null;
+
+ //top_activity = task.stack.topRunningActivityLocked();
+ /* App is launching from recent apps and it's a new process */
+ if((top_activity != null) && (top_activity.getState() == DESTROYED)) {
+ acquireAppLaunchPerfLock(top_activity);
+ }
+
if (currentRootTask == null) {
Slog.e(TAG, "findTaskToMoveToFront: can't move task="
+ task + " to front. Root task is null");
@@ -1647,6 +1708,15 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
ActivityManagerInternal::killProcessesForRemovedTask, mService.mAmInternal,
procsToKill);
mService.mH.sendMessage(m);
+
+ }
+
+ public void startPreferredApps() {
+ try {
+ new PreferredAppsTask().execute();
+ } catch (Exception e) {
+ Slog.v (TAG, "Exception while calling PreferredAppsTask: " + e);
+ }
}
/**
@@ -1801,6 +1871,79 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
return timedout;
}
+ void acquireAppLaunchPerfLock(ActivityRecord r) {
+ /* Acquire perf lock during new app launch */
+ if (mPerfBoost != null) {
+
+ int pkgType = mPerfBoost.perfGetFeedback(BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE,
+ r.packageName);
+ int wpcPid = -1;
+ if (mService != null && r != null && r.info != null && r.info.applicationInfo !=null) {
+ final WindowProcessController wpc =
+ mService.getProcessController(r.processName, r.info.applicationInfo.uid);
+ if (wpc != null && wpc.hasThread()) {
+ //If target process didn't start yet, this operation will be done when app call attach
+ wpcPid = wpc.getPid();
+ }
+ }
+ if (mPerfBoost.getPerfHalVersion() >= BoostFramework.PERF_HAL_V23) {
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V1, 2, pkgType, wpcPid);
+ mPerfSendTapHint = true;
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V2, 2, pkgType, wpcPid);
+ if (wpcPid != -1) {
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, wpcPid, BoostFramework.Launch.TYPE_ATTACH_APPLICATION,
+ 2, pkgType, wpcPid);
+ }
+
+ if (pkgType == BoostFramework.WorkloadType.GAME)
+ {
+ mPerfHandle =
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_GAME, 2, pkgType, wpcPid);
+ } else {
+ mPerfHandle =
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V3, 2, pkgType, wpcPid);
+ }
+
+ } else {
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, r.packageName,
+ -1, BoostFramework.Launch.BOOST_V1);
+ mPerfSendTapHint = true;
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, r.packageName,
+ -1, BoostFramework.Launch.BOOST_V2);
+ if (wpcPid != -1) {
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, wpcPid, BoostFramework.Launch.TYPE_ATTACH_APPLICATION);
+ }
+
+ if (pkgType == BoostFramework.WorkloadType.GAME)
+ {
+ mPerfHandle = mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_GAME);
+ } else {
+ mPerfHandle = mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V3);
+ }
+ }
+ if (mPerfHandle > 0)
+ mIsPerfBoostAcquired = true;
+ // Start IOP
+ if (r.info.applicationInfo != null && r.info.applicationInfo.sourceDir != null) {
+ mPerfBoost.perfIOPrefetchStart(-1,r.packageName,
+ r.info.applicationInfo.sourceDir.substring(0,
+ r.info.applicationInfo.sourceDir.lastIndexOf('/')));
+ }
+ }
+ }
+
+ public ActivityRecord getTopResumedActivity() {
+ return mTopResumedActivity;
+ }
+
void comeOutOfSleepIfNeededLocked() {
removeSleepTimeouts();
if (mGoingToSleepWakeLock.isHeld()) {
@@ -2637,4 +2780,37 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
mResult.dump(pw, prefix + " ");
}
}
+
+ class PreferredAppsTask extends AsyncTask<Void, Void, Void> {
+ @Override
+ protected Void doInBackground(Void... params) {
+ String res = null;
+ final Intent intent = new Intent(Intent.ACTION_MAIN);
+ int trimLevel = 0;
+ try {
+ trimLevel = ActivityManager.getService().getMemoryTrimLevel();
+ } catch (RemoteException e) {
+ return null;
+ }
+ if (mUxPerf != null
+ && trimLevel < ProcessStats.ADJ_MEM_FACTOR_CRITICAL) {
+ res = mUxPerf.perfUXEngine_trigger(BoostFramework.UXE_TRIGGER);
+ if (res == null)
+ return null;
+ String[] p_apps = res.split("/");
+ if (p_apps.length != 0) {
+ ArrayList<String> apps_l = new ArrayList(Arrays.asList(p_apps));
+ Bundle bParams = new Bundle();
+ if (bParams == null)
+ return null;
+ bParams.putStringArrayList("start_empty_apps", apps_l);
+ final Message msg = PooledLambda.obtainMessage(
+ ActivityManagerInternal::startActivityAsUserEmpty, mService.mAmInternal, bParams);
+ mService.mH.sendMessage(msg);
+ }
+ }
+ return null;
+ }
+ }
+
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index b184d5c62008..ff0146320818 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -4122,6 +4122,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
* which controls the visibility and animation of the input method window.
*/
void updateImeInputAndControlTarget(WindowState target) {
+ if (target != null && target.mActivityRecord != null) {
+ target.mActivityRecord.mImeInsetsFrozenUntilStartInput = false;
+ }
if (mImeInputTarget != target) {
ProtoLog.i(WM_DEBUG_IME, "setInputMethodInputTarget %s", target);
setImeInputTarget(target);
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index b64be7ce9e94..9fae2cab7135 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -16,6 +16,7 @@
package com.android.server.wm;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
@@ -111,6 +112,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Px;
import android.app.ActivityManager;
+import android.app.ActivityTaskManager;
import android.app.ActivityThread;
import android.app.LoadedApk;
import android.app.ResourcesManager;
@@ -118,6 +120,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.content.pm.ApplicationInfo;
import android.graphics.Insets;
import android.graphics.PixelFormat;
import android.graphics.Point;
@@ -133,6 +136,7 @@ import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.PrintWriterPrinter;
import android.util.Slog;
import android.util.SparseArray;
@@ -227,6 +231,19 @@ public class DisplayPolicy {
private final ImmersiveModeConfirmation mImmersiveModeConfirmation;
private final ScreenshotHelper mScreenshotHelper;
+ private static boolean SCROLL_BOOST_SS_ENABLE = false;
+ private static boolean DRAG_PLH_ENABLE = false;
+ private static boolean isLowRAM = false;
+
+ /*
+ * @hide
+ */
+ BoostFramework mPerfBoostDrag = null;
+ BoostFramework mPerfBoostFling = null;
+ BoostFramework mPerfBoostPrefling = null;
+ BoostFramework mPerf = new BoostFramework();
+ private boolean mIsPerfBoostFlingAcquired;
+
private final Object mServiceAcquireLock = new Object();
private StatusBarManagerInternal mStatusBarManagerInternal;
@@ -447,6 +464,38 @@ public class DisplayPolicy {
}
}
+ private String getAppPackageName() {
+ String currentPackage;
+ try {
+ ActivityManager.RunningTaskInfo rti = ActivityTaskManager.getService().getTasks(
+ 1, false /* filterVisibleRecents */, false /*keepIntentExtra */).get(0);
+ currentPackage = rti.topActivity.getPackageName();
+ } catch (Exception e) {
+ currentPackage = null;
+ }
+ return currentPackage;
+ }
+
+ private boolean isTopAppGame(String currentPackage, BoostFramework BoostType) {
+ boolean isGame = false;
+ if (isLowRAM) {
+ try {
+ ApplicationInfo ai = mContext.getPackageManager().getApplicationInfo(currentPackage, 0);
+ if(ai != null) {
+ isGame = (ai.category == ApplicationInfo.CATEGORY_GAME) ||
+ ((ai.flags & ApplicationInfo.FLAG_IS_GAME) ==
+ ApplicationInfo.FLAG_IS_GAME);
+ }
+ } catch (Exception e) {
+ return false;
+ }
+ } else {
+ isGame = (BoostType.perfGetFeedback(BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE,
+ currentPackage) == BoostFramework.WorkloadType.GAME);
+ }
+ return isGame;
+ }
+
DisplayPolicy(WindowManagerService service, DisplayContent displayContent) {
mService = service;
mContext = displayContent.isDefaultDisplay ? service.mContext
@@ -476,6 +525,12 @@ public class DisplayPolicy {
mScreenOnFully = true;
}
+ if (mPerf != null) {
+ SCROLL_BOOST_SS_ENABLE = Boolean.parseBoolean(mPerf.perfGetProp("vendor.perf.gestureflingboost.enable", "false"));
+ DRAG_PLH_ENABLE = Boolean.parseBoolean(mPerf.perfGetProp("ro.vendor.perf.dplh", "false"));
+ }
+ isLowRAM = SystemProperties.getBoolean("ro.config.low_ram", false);
+
final Looper looper = UiThread.getHandler().getLooper();
mHandler = new PolicyHandler(looper);
// TODO(b/181821798) Migrate SystemGesturesPointerEventListener to use window context.
@@ -557,6 +612,100 @@ public class DisplayPolicy {
}
@Override
+ public void onVerticalFling(int duration) {
+ String currentPackage = getAppPackageName();
+ if (currentPackage == null) {
+ Slog.e(TAG, "Error: package name null");
+ return;
+ }
+ if (SCROLL_BOOST_SS_ENABLE) {
+ if (mPerfBoostFling == null) {
+ mPerfBoostFling = new BoostFramework();
+ mIsPerfBoostFlingAcquired = false;
+ }
+ if (mPerfBoostFling == null) {
+ Slog.e(TAG, "Error: boost object null");
+ return;
+ }
+ boolean isGame = isTopAppGame(currentPackage, mPerfBoostFling);
+ if (!isGame) {
+ mPerfBoostFling.perfHint(BoostFramework.VENDOR_HINT_SCROLL_BOOST,
+ currentPackage, duration + 160, BoostFramework.Scroll.VERTICAL);
+ mIsPerfBoostFlingAcquired = true;
+ }
+ }
+ }
+
+ @Override
+ public void onHorizontalFling(int duration) {
+ String currentPackage = getAppPackageName();
+ if (currentPackage == null) {
+ Slog.e(TAG, "Error: package name null");
+ return;
+ }
+ if (SCROLL_BOOST_SS_ENABLE) {
+ if (mPerfBoostFling == null) {
+ mPerfBoostFling = new BoostFramework();
+ mIsPerfBoostFlingAcquired = false;
+ }
+ if (mPerfBoostFling == null) {
+ Slog.e(TAG, "Error: boost object null");
+ return;
+ }
+ boolean isGame = isTopAppGame(currentPackage, mPerfBoostFling);
+ if (!isGame) {
+ mPerfBoostFling.perfHint(BoostFramework.VENDOR_HINT_SCROLL_BOOST,
+ currentPackage, duration + 160, BoostFramework.Scroll.HORIZONTAL);
+ mIsPerfBoostFlingAcquired = true;
+ }
+ }
+ }
+
+ @Override
+ public void onScroll(boolean started) {
+ String currentPackage = getAppPackageName();
+ if (currentPackage == null) {
+ Slog.e(TAG, "Error: package name null");
+ return;
+ }
+ boolean isGame;
+ if (mPerfBoostDrag == null) {
+ mPerfBoostDrag = new BoostFramework();
+ }
+ if (mPerfBoostDrag == null) {
+ Slog.e(TAG, "Error: boost object null");
+ return;
+ }
+ if (SCROLL_BOOST_SS_ENABLE) {
+ if (mPerfBoostPrefling == null) {
+ mPerfBoostPrefling = new BoostFramework();
+ }
+ if (mPerfBoostPrefling == null) {
+ Slog.e(TAG, "Error: boost object null");
+ return;
+ }
+ isGame = isTopAppGame(currentPackage, mPerfBoostPrefling);
+ if (!isGame) {
+ mPerfBoostPrefling.perfHint(BoostFramework.VENDOR_HINT_SCROLL_BOOST,
+ currentPackage, -1, BoostFramework.Scroll.PREFILING);
+ }
+ }
+ isGame = isTopAppGame(currentPackage, mPerfBoostDrag);
+ if (!isGame && started) {
+ if (DRAG_PLH_ENABLE) {
+ mPerfBoostDrag.perfEvent(BoostFramework.VENDOR_HINT_DRAG_START, currentPackage);
+ }
+ mPerfBoostDrag.perfHint(BoostFramework.VENDOR_HINT_DRAG_BOOST,
+ currentPackage, -1, 1);
+ } else {
+ if (DRAG_PLH_ENABLE) {
+ mPerfBoostDrag.perfEvent(BoostFramework.VENDOR_HINT_DRAG_END, currentPackage);
+ }
+ mPerfBoostDrag.perfLockRelease();
+ }
+ }
+
+ @Override
public void onDebug() {
// no-op
}
@@ -572,6 +721,11 @@ public class DisplayPolicy {
if (listener != null) {
listener.onTouchStart();
}
+ if(SCROLL_BOOST_SS_ENABLE && mPerfBoostFling!= null
+ && mIsPerfBoostFlingAcquired) {
+ mPerfBoostFling.perfLockRelease();
+ mIsPerfBoostFlingAcquired = false;
+ }
}
@Override
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index b6552cb1b962..3f130f5a1457 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -40,9 +40,11 @@ import android.annotation.AnimRes;
import android.annotation.IntDef;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
+import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
+import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.ActivityInfo.ScreenOrientation;
import android.content.pm.PackageManager;
@@ -231,6 +233,31 @@ public class DisplayRotation {
}
};
+ /**
+ * Broadcast Action: WiFi Display video is enabled or disabled
+ *
+ * <p>The intent will have the following extra values:</p>
+ * <ul>
+ * <li><em>state</em> - 0 for disabled, 1 for enabled. </li>
+ * </ul>
+ */
+
+ private static final String ACTION_WIFI_DISPLAY_VIDEO =
+ "org.codeaurora.intent.action.WIFI_DISPLAY_VIDEO";
+
+ /**
+ * Broadcast Permission for Wifi Display
+ */
+
+ private static final String WIFI_DISPLAY_PERMISSION =
+ "com.qualcomm.permission.wfd.QC_WFD";
+
+ /**
+ * Wifi Display specific variables
+ */
+ private boolean mWifiDisplayConnected = false;
+ private int mWifiDisplayRotation = -1;
+
DisplayRotation(WindowManagerService service, DisplayContent displayContent) {
this(service, displayContent, displayContent.getDisplayPolicy(),
service.mDisplayWindowSettings, service.mContext, service.getWindowManagerLock());
@@ -261,6 +288,49 @@ public class DisplayRotation {
mOrientationListener.setCurrentRotation(mRotation);
mSettingsObserver = new SettingsObserver(uiHandler);
mSettingsObserver.observe();
+
+ /* Register for WIFI Display Intents in a separate thread
+ * to avoid possible deadlock between ActivityManager and
+ * WindowManager global locks*/
+ Thread t = new Thread(){
+ public void run() {
+ context.registerReceiver(new BroadcastReceiver(){
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (action.equals(ACTION_WIFI_DISPLAY_VIDEO)) {
+ int state = intent.getIntExtra("state", 0);
+ if(state == 1) {
+ mWifiDisplayConnected = true;
+ } else {
+ mWifiDisplayConnected = false;
+ }
+ int rotation = intent.getIntExtra("wfd_UIBC_rot", -1);
+ switch (rotation) {
+ case 0:
+ mWifiDisplayRotation = Surface.ROTATION_0;
+ break;
+ case 1:
+ mWifiDisplayRotation = Surface.ROTATION_90;
+ break;
+ case 2:
+ mWifiDisplayRotation = Surface.ROTATION_180;
+ break;
+ case 3:
+ mWifiDisplayRotation = Surface.ROTATION_270;
+ break;
+ default:
+ mWifiDisplayRotation = -1;
+ }
+ mService.updateRotation(true /* alwaysSendConfiguration */,
+ false/* forceRelayout */);
+ }
+ }
+ }, new IntentFilter(ACTION_WIFI_DISPLAY_VIDEO),
+ WIFI_DISPLAY_PERMISSION,
+ UiThread.getHandler());
+ }
+ };
+ t.start();
}
}
@@ -1164,10 +1234,13 @@ public class DisplayRotation {
// This case can override the behavior of NOSENSOR, and can also
// enable 180 degree rotation while docked.
preferredRotation = deskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation;
- } else if (hdmiPlugged && mDemoHdmiRotationLock) {
+ } else if ((hdmiPlugged || mWifiDisplayConnected) && mDemoHdmiRotationLock) {
// Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled.
// Note that the dock orientation overrides the HDMI orientation.
preferredRotation = mDemoHdmiRotation;
+ } else if (mWifiDisplayConnected && (mWifiDisplayRotation > -1)) {
+ // Ignore sensor when WFD is active and UIBC rotation is enabled
+ preferredRotation = mWifiDisplayRotation;
} else if (hdmiPlugged && dockMode == Intent.EXTRA_DOCK_STATE_UNDOCKED
&& mUndockedHdmiRotation >= 0) {
// Ignore sensor when plugged into HDMI and an undocked orientation has
diff --git a/services/core/java/com/android/server/wm/ForceRefreshRatePackagelist.java b/services/core/java/com/android/server/wm/ForceRefreshRatePackagelist.java
new file mode 100755
index 000000000000..15d1e7df1f69
--- /dev/null
+++ b/services/core/java/com/android/server/wm/ForceRefreshRatePackagelist.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ *
+ * Not a contribution.
+*/
+
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.wm;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.ContentObserver;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.text.TextUtils;
+import android.util.ArrayMap;
+import android.util.Log;
+import android.view.Display;
+import android.view.DisplayInfo;
+
+import com.android.server.UiThread;
+
+/**
+ * A list for packages that should force the display out of high refresh rate.
+ */
+class ForceRefreshRatePackageList {
+
+ private static final String TAG = ForceRefreshRatePackageList.class.getSimpleName();
+ private static final String KEY_FORCE_REFRESH_RATE_LIST = "ext_force_refresh_rate_list";
+ private static final float REFRESH_RATE_EPSILON = 0.01f;
+
+ private final ArrayMap<String, Float> mForcedPackageList = new ArrayMap<>();
+ private final Object mLock = new Object();
+ private final Handler mHandler;
+ private DisplayInfo mDisplayInfo;
+ private SettingsObserver mSettingsObserver;
+
+ ForceRefreshRatePackageList(WindowManagerService wmService, DisplayInfo displayInfo) {
+ mDisplayInfo = displayInfo;
+ final Looper looper = UiThread.getHandler().getLooper();
+ mHandler = new Handler(looper);
+ mSettingsObserver = new SettingsObserver(wmService.mContext);
+ mHandler.post(mSettingsObserver::observe);
+ }
+
+ private void updateForcedPackagelist(String forcePackagesStr) {
+ synchronized (mLock) {
+ mForcedPackageList.clear();
+ if (!TextUtils.isEmpty(forcePackagesStr)) {
+ String[] pairs = forcePackagesStr.split(";");
+ for (String pair : pairs) {
+ String[] keyValue = pair.split(",");
+ if (keyValue != null && keyValue.length == 2) {
+ if (!TextUtils.isEmpty(keyValue[0].trim())
+ && !TextUtils.isEmpty(keyValue[1].trim())) {
+ try {
+ String packageName = keyValue[0].trim();
+ Float refreshRate = new Float(keyValue[1].trim());
+ mForcedPackageList.put(packageName, refreshRate);
+ } catch (NumberFormatException e) {
+ Log.e(TAG, "Invalid refresh rate input! input: " + keyValue);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ int getForceRefreshRateId(String packageName) {
+ synchronized (mLock) {
+ if(mForcedPackageList.containsKey(packageName)) {
+ float refreshRate = mForcedPackageList.get(packageName).floatValue();
+ Display.Mode mode = findModeByRefreshRate(refreshRate);
+ return mode != null ? mode.getModeId() : 0;
+ }else {
+ return 0;
+ }
+ }
+ }
+
+ float getForceRefreshRate(String packageName) {
+ synchronized (mLock) {
+ if(mForcedPackageList.containsKey(packageName)) {
+ float refreshRate = mForcedPackageList.get(packageName).floatValue();
+ Display.Mode mode = findModeByRefreshRate(refreshRate);
+ return mode != null ? mode.getRefreshRate() : 0;
+ }else {
+ return 0;
+ }
+ }
+ }
+
+ private Display.Mode findModeByRefreshRate(float refreshRate) {
+ Display.Mode[] modes = mDisplayInfo.supportedModes;
+ for (int i = 0; i < modes.length; i++) {
+ if (Math.abs(modes[i].getRefreshRate() - refreshRate) < REFRESH_RATE_EPSILON) {
+ return modes[i];
+ }
+ }
+ return null;
+ }
+
+ private class SettingsObserver extends ContentObserver {
+ private final Uri mForceRefreshRateListSetting =
+ Settings.System.getUriFor(KEY_FORCE_REFRESH_RATE_LIST);
+ private Context mContext;
+
+ SettingsObserver(@NonNull Context context) {
+ super(mHandler);
+ mContext = context;
+ }
+
+ public void observe() {
+ final ContentResolver cr = mContext.getContentResolver();
+ cr.registerContentObserver(mForceRefreshRateListSetting, false, this,
+ UserHandle.USER_SYSTEM);
+ updateForcedPackagelist(getForcePackages());
+ }
+
+ @Override
+ public void onChange(boolean selfChange, Uri uri, int userId) {
+ if (mForceRefreshRateListSetting.equals(uri)) {
+ updateForcedPackagelist(getForcePackages());
+ }
+ }
+
+ private String getForcePackages() {
+ ContentResolver cr = mContext.getContentResolver();
+ return Settings.System.getString(cr, KEY_FORCE_REFRESH_RATE_LIST);
+ }
+ }
+}
+
diff --git a/services/core/java/com/android/server/wm/RecentTasks.java b/services/core/java/com/android/server/wm/RecentTasks.java
index dca0bbda78cf..11d1270b48c3 100644
--- a/services/core/java/com/android/server/wm/RecentTasks.java
+++ b/services/core/java/com/android/server/wm/RecentTasks.java
@@ -68,6 +68,7 @@ import android.util.ArraySet;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
+import android.util.BoostFramework;
import android.view.MotionEvent;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
@@ -202,6 +203,7 @@ class RecentTasks {
private final HashMap<ComponentName, ActivityInfo> mTmpAvailActCache = new HashMap<>();
private final HashMap<String, ApplicationInfo> mTmpAvailAppCache = new HashMap<>();
private final SparseBooleanArray mTmpQuietProfileUserIds = new SparseBooleanArray();
+ private final BoostFramework mUxPerf = new BoostFramework();
// TODO(b/127498985): This is currently a rough heuristic for interaction inside an app
private final PointerEventListener mListener = new PointerEventListener() {
@@ -1202,6 +1204,17 @@ class RecentTasks {
void remove(Task task) {
mTasks.remove(task);
notifyTaskRemoved(task, false /* wasTrimmed */, false /* killProcess */);
+ if (task != null) {
+ final Intent intent = task.getBaseIntent();
+ if (intent == null) return;
+ final ComponentName componentName = intent.getComponent();
+ if (componentName == null) return;
+
+ final String taskPkgName = componentName.getPackageName();
+ if (mUxPerf != null) {
+ mUxPerf.perfUXEngine_events(BoostFramework.UXE_EVENT_KILL, 0, taskPkgName, 0);
+ }
+ }
}
/**
diff --git a/services/core/java/com/android/server/wm/RefreshRatePolicy.java b/services/core/java/com/android/server/wm/RefreshRatePolicy.java
index b63843dd20d4..1aa1edc60656 100644..100755
--- a/services/core/java/com/android/server/wm/RefreshRatePolicy.java
+++ b/services/core/java/com/android/server/wm/RefreshRatePolicy.java
@@ -33,6 +33,7 @@ class RefreshRatePolicy {
private final ArraySet<String> mNonHighRefreshRatePackages = new ArraySet<>();
private final HighRefreshRateDenylist mHighRefreshRateDenylist;
private final WindowManagerService mWmService;
+ private final ForceRefreshRatePackageList mForceList;
/**
* The following constants represent priority of the window. SF uses this information when
@@ -60,6 +61,7 @@ class RefreshRatePolicy {
mLowRefreshRateMode = findLowRefreshRateMode(displayInfo);
mHighRefreshRateDenylist = denylist;
mWmService = wmService;
+ mForceList = new ForceRefreshRatePackageList(mWmService, displayInfo);
}
/**
@@ -95,6 +97,12 @@ class RefreshRatePolicy {
return 0;
}
+ // If app is forced to specified refresh rate, return the corresponding mode id.
+ int forceRefreshRateId = mForceList.getForceRefreshRateId(w.getOwningPackage());
+ if(forceRefreshRateId > 0) {
+ return forceRefreshRateId;
+ }
+
return w.mAttrs.preferredDisplayModeId;
}
@@ -129,6 +137,12 @@ class RefreshRatePolicy {
return 0;
}
+ // If app is forced to specified refresh rate, return the specified refresh rate.
+ float forceRefreshRate = mForceList.getForceRefreshRate(w.getOwningPackage());
+ if(forceRefreshRate > 0) {
+ return forceRefreshRate;
+ }
+
// If the app set a preferredDisplayModeId, the preferred refresh rate is the refresh rate
// of that mode id.
final int preferredModeId = w.mAttrs.preferredDisplayModeId;
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 9cd37b305dc6..ae5638fb6b9b 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -54,6 +54,7 @@ import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.policy.PhoneWindowManager.SYSTEM_DIALOG_REASON_ASSIST;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
+import static com.android.server.wm.ActivityRecord.State.DESTROYED;
import static com.android.server.wm.ActivityRecord.State.FINISHING;
import static com.android.server.wm.ActivityRecord.State.PAUSED;
import static com.android.server.wm.ActivityRecord.State.RESUMED;
@@ -134,6 +135,7 @@ import android.provider.Settings;
import android.service.voice.IVoiceInteractionSession;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.DisplayMetrics;
import android.util.IntArray;
import android.util.Pair;
@@ -173,7 +175,7 @@ import java.util.function.Consumer;
import java.util.function.Function;
/** Root {@link WindowContainer} for the device. */
-class RootWindowContainer extends WindowContainer<DisplayContent>
+public class RootWindowContainer extends WindowContainer<DisplayContent>
implements DisplayManager.DisplayListener {
private static final String TAG = TAG_WITH_CLASS_NAME ? "RootWindowContainer" : TAG_WM;
@@ -254,6 +256,12 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
DisplayManager mDisplayManager;
private DisplayManagerInternal mDisplayManagerInternal;
+ public static boolean mPerfSendTapHint = false;
+ public static boolean mIsPerfBoostAcquired = false;
+ public static int mPerfHandle = -1;
+ public BoostFramework mPerfBoost = null;
+ public BoostFramework mUxPerf = null;
+
/** Reference to default display so we can quickly look it up. */
private DisplayContent mDefaultDisplay;
private final SparseArray<IntArray> mDisplayAccessUIDs = new SparseArray<>();
@@ -1879,7 +1887,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
@Nullable
- Task getTopDisplayFocusedRootTask() {
+ public Task getTopDisplayFocusedRootTask() {
for (int i = getChildCount() - 1; i >= 0; --i) {
final Task focusedRootTask = getChildAt(i).getFocusedRootTask();
if (focusedRootTask != null) {
@@ -2272,15 +2280,99 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
}
+ void acquireAppLaunchPerfLock(ActivityRecord r) {
+ /* Acquire perf lock during new app launch */
+ if (mPerfBoost == null) {
+ mPerfBoost = new BoostFramework();
+ }
+ if (mPerfBoost != null) {
+ int pkgType = mPerfBoost.perfGetFeedback(BoostFramework.VENDOR_FEEDBACK_WORKLOAD_TYPE,
+ r.packageName);
+ int wpcPid = -1;
+ if (mService != null && r != null && r.info != null && r.info.applicationInfo !=null) {
+ final WindowProcessController wpc =
+ mService.getProcessController(r.processName, r.info.applicationInfo.uid);
+ if (wpc != null && wpc.hasThread()) {
+ //If target process didn't start yet,
+ // this operation will be done when app call attach
+ wpcPid = wpc.getPid();
+ }
+ }
+ if (mPerfBoost.getPerfHalVersion() >= BoostFramework.PERF_HAL_V23) {
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V1, 2, pkgType, wpcPid);
+ mPerfSendTapHint = true;
+ mPerfBoost.perfHintAcqRel(-1, BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V2, 2, pkgType, wpcPid);
+ if (wpcPid != -1) {
+ mPerfBoost.perfHintAcqRel(-1,
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, wpcPid,
+ BoostFramework.Launch.TYPE_ATTACH_APPLICATION, 2, pkgType, wpcPid);
+ }
+
+ if (pkgType == BoostFramework.WorkloadType.GAME)
+ {
+ mPerfHandle = mPerfBoost.perfHintAcqRel(-1,
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_GAME, 2, pkgType, wpcPid);
+ } else {
+ mPerfHandle = mPerfBoost.perfHintAcqRel(-1,
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V3, 2, pkgType, wpcPid);
+ }
+ } else {
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST, r.packageName,
+ -1, BoostFramework.Launch.BOOST_V1);
+ mPerfSendTapHint = true;
+ mPerfBoost.perfHint(BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V2);
+ if (wpcPid != -1) {
+ mPerfBoost.perfHint(
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, wpcPid,
+ BoostFramework.Launch.TYPE_ATTACH_APPLICATION);
+ }
+
+ if (pkgType == BoostFramework.WorkloadType.GAME)
+ {
+ mPerfHandle = mPerfBoost.perfHint(
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_GAME);
+ } else {
+ mPerfHandle = mPerfBoost.perfHint(
+ BoostFramework.VENDOR_HINT_FIRST_LAUNCH_BOOST,
+ r.packageName, -1, BoostFramework.Launch.BOOST_V3);
+ }
+ }
+ if (mPerfHandle > 0)
+ mIsPerfBoostAcquired = true;
+ // Start IOP
+ if(r.info.applicationInfo != null &&
+ r.info.applicationInfo.sourceDir != null) {
+ mPerfBoost.perfIOPrefetchStart(-1,r.packageName,
+ r.info.applicationInfo.sourceDir.substring(
+ 0, r.info.applicationInfo.sourceDir.lastIndexOf('/')));
+ }
+ }
+ }
+
+ void acquireUxPerfLock(int opcode, String packageName) {
+ mUxPerf = new BoostFramework();
+ if (mUxPerf != null) {
+ mUxPerf.perfUXEngine_events(opcode, 0, packageName, 0);
+ }
+ }
+
@Nullable
ActivityRecord findTask(ActivityRecord r, TaskDisplayArea preferredTaskDisplayArea) {
return findTask(r.getActivityType(), r.taskAffinity, r.intent, r.info,
- preferredTaskDisplayArea);
+ preferredTaskDisplayArea, r);
}
@Nullable
ActivityRecord findTask(int activityType, String taskAffinity, Intent intent, ActivityInfo info,
- TaskDisplayArea preferredTaskDisplayArea) {
+ TaskDisplayArea preferredTaskDisplayArea, ActivityRecord r) {
ProtoLog.d(WM_DEBUG_TASKS, "Looking for task of type=%s, taskAffinity=%s, intent=%s"
+ ", info=%s, preferredTDA=%s", activityType, taskAffinity, intent, info,
preferredTaskDisplayArea);
@@ -2291,12 +2383,28 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
if (preferredTaskDisplayArea != null) {
mTmpFindTaskResult.process(preferredTaskDisplayArea);
if (mTmpFindTaskResult.mIdealRecord != null) {
+ if(mTmpFindTaskResult.mIdealRecord.getState() == DESTROYED) {
+ /*It's a new app launch */
+ acquireAppLaunchPerfLock(r);
+ }
+
+ if(mTmpFindTaskResult.mIdealRecord.getState() == STOPPED) {
+ /*Warm launch */
+ acquireUxPerfLock(BoostFramework.UXE_EVENT_SUB_LAUNCH,
+ r.packageName);
+ }
return mTmpFindTaskResult.mIdealRecord;
} else if (mTmpFindTaskResult.mCandidateRecord != null) {
candidateActivity = mTmpFindTaskResult.mCandidateRecord;
}
}
+ /* Acquire perf lock *only* during new app launch */
+ if ((mTmpFindTaskResult.mIdealRecord == null) ||
+ (mTmpFindTaskResult.mIdealRecord.getState() == DESTROYED)) {
+ acquireAppLaunchPerfLock(r);
+ }
+
final ActivityRecord idealMatchActivity = getItemFromTaskDisplayAreas(taskDisplayArea -> {
if (taskDisplayArea == preferredTaskDisplayArea) {
return null;
diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
index d1460f41cad6..255905a5819d 100644
--- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -41,6 +41,7 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.HardwareBuffer;
import android.os.Trace;
+import android.util.BoostFramework;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.DisplayInfo;
@@ -90,6 +91,9 @@ import java.io.PrintWriter;
class ScreenRotationAnimation {
private static final String TAG = TAG_WITH_CLASS_NAME ? "ScreenRotationAnimation" : TAG_WM;
+ private BoostFramework mPerf = null;
+ private boolean mIsPerfLockAcquired = false;
+
private final Context mContext;
private final DisplayContent mDisplayContent;
private final float[] mTmpFloats = new float[9];
@@ -140,6 +144,8 @@ class ScreenRotationAnimation {
mDisplayContent = displayContent;
displayContent.getBounds(mOriginalDisplayRect);
+ mPerf = new BoostFramework();
+
// Screenshot does NOT include rotation!
final DisplayInfo displayInfo = displayContent.getDisplayInfo();
final int realOriginalRotation = displayInfo.rotation;
@@ -444,6 +450,10 @@ class ScreenRotationAnimation {
mDisplayContent.getWindowingLayer());
startAnimation(t, maxAnimationDuration, animationScale, finalWidth, finalHeight,
exitAnim, enterAnim);
+ if (mPerf != null && !mIsPerfLockAcquired) {
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_ROTATION_ANIM_BOOST, null);
+ mIsPerfLockAcquired = true;
+ }
}
if (!mStarted) {
return false;
@@ -497,6 +507,11 @@ class ScreenRotationAnimation {
mRotateAlphaAnimation.cancel();
mRotateAlphaAnimation = null;
}
+
+ if (mPerf != null && mIsPerfLockAcquired) {
+ mPerf.perfLockRelease();
+ mIsPerfLockAcquired = false;
+ }
}
public boolean isAnimating() {
diff --git a/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java b/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java
index 658f4efbdb2f..02d8c2a1413f 100644
--- a/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java
+++ b/services/core/java/com/android/server/wm/SystemGesturesPointerEventListener.java
@@ -80,6 +80,7 @@ class SystemGesturesPointerEventListener implements PointerEventListener {
private boolean mDebugFireable;
private boolean mMouseHoveringAtEdge;
private long mLastFlingTime;
+ private boolean mScrollFired;
SystemGesturesPointerEventListener(Context context, Handler handler, Callbacks callbacks) {
mContext = checkNull("context", context);
@@ -172,6 +173,7 @@ class SystemGesturesPointerEventListener implements PointerEventListener {
case MotionEvent.ACTION_DOWN:
mSwipeFireable = true;
mDebugFireable = true;
+ mScrollFired = false;
mDownPointers = 0;
captureDown(event, 0);
if (mMouseHoveringAtEdge) {
@@ -228,6 +230,9 @@ class SystemGesturesPointerEventListener implements PointerEventListener {
case MotionEvent.ACTION_CANCEL:
mSwipeFireable = false;
mDebugFireable = false;
+ if (mScrollFired)
+ mCallbacks.onScroll(false);
+ mScrollFired = false;
mCallbacks.onUpOrCancel();
break;
default:
@@ -359,10 +364,25 @@ class SystemGesturesPointerEventListener implements PointerEventListener {
if (duration > MAX_FLING_TIME_MILLIS) {
duration = MAX_FLING_TIME_MILLIS;
}
+ if(Math.abs(velocityY) >= Math.abs(velocityX))
+ mCallbacks.onVerticalFling(duration);
+ else
+ mCallbacks.onHorizontalFling(duration);
+
mLastFlingTime = now;
mCallbacks.onFling(duration);
return true;
}
+
+ @Override
+ public boolean onScroll(MotionEvent e1, MotionEvent e2,
+ float distanceX, float distanceY) {
+ if (!mScrollFired) {
+ mCallbacks.onScroll(true);
+ mScrollFired = true;
+ }
+ return true;
+ }
}
interface Callbacks {
@@ -371,6 +391,9 @@ class SystemGesturesPointerEventListener implements PointerEventListener {
void onSwipeFromRight();
void onSwipeFromLeft();
void onFling(int durationMs);
+ void onVerticalFling(int durationMs);
+ void onHorizontalFling(int durationMs);
+ void onScroll(boolean started);
void onDown();
void onUpOrCancel();
void onMouseHoverAtTop();
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index fd5df6f6c390..69c3c6e46346 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -173,6 +173,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.service.voice.IVoiceInteractionSession;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.DisplayMetrics;
import android.util.Slog;
import android.util.TypedXmlPullParser;
@@ -524,6 +525,9 @@ class Task extends TaskFragment {
private final Handler mHandler;
+ private static final ActivityPluginDelegate mActivityPluginDelegate =
+ new ActivityPluginDelegate();
+
private class ActivityTaskHandler extends Handler {
ActivityTaskHandler(Looper looper) {
@@ -5123,6 +5127,11 @@ class Task extends TaskFragment {
ProtoLog.i(WM_DEBUG_ADD_REMOVE, "Adding activity %s to task %s "
+ "callers: %s", r, task, new RuntimeException("here").fillInStackTrace());
+ if (mActivityPluginDelegate != null) {
+ mActivityPluginDelegate.activityInvokeNotification
+ (r.info.packageName, getWindowingMode() == WINDOWING_MODE_FULLSCREEN);
+ }
+
// The transition animation and starting window are not needed if {@code allowMoveToFront}
// is false, because the activity won't be visible.
if ((!isHomeOrRecentsRootTask() || hasActivity()) && allowMoveToFront) {
@@ -6148,6 +6157,13 @@ class Task extends TaskFragment {
return mAnimatingActivityRegistry;
}
+ public void onARStopTriggered(ActivityRecord r) {
+ if (mActivityPluginDelegate != null && getWindowingMode() != WINDOWING_MODE_UNDEFINED) {
+ mActivityPluginDelegate.activitySuspendNotification
+ (r.info.applicationInfo.packageName, getWindowingMode() == WINDOWING_MODE_FULLSCREEN, false);
+ }
+ }
+
@Override
void executeAppTransition(ActivityOptions options) {
mDisplayContent.executeAppTransition();
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index 15a294ee7484..15a294ee7484 100644..100755
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index ae7e96fab1fe..104e0368b084 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -82,6 +82,7 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.RemoteException;
+import android.util.BoostFramework;
import android.util.DisplayMetrics;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
@@ -93,6 +94,7 @@ import android.window.TaskFragmentInfo;
import android.window.TaskFragmentOrganizerToken;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.app.ActivityTrigger;
import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.function.pooled.PooledFunction;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -240,6 +242,12 @@ class TaskFragment extends WindowContainer<WindowContainer> {
@Nullable
private IBinder mFragmentToken;
+ //Perf
+ public BoostFramework mPerf = null;
+
+ //ActivityTrigger
+ static final ActivityTrigger mActivityTrigger = new ActivityTrigger();
+
/**
* Whether to delay the last activity of TaskFragment being immediately removed while finishing.
* This should only be set on a embedded TaskFragment, where the organizer can have the
@@ -1049,8 +1057,24 @@ class TaskFragment extends WindowContainer<WindowContainer> {
// appropriate for it.
mTaskSupervisor.mStoppingActivities.remove(next);
+ if (!next.translucentWindowLaunch)
+ next.launching = true;
+
if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resuming " + next);
+ //Trigger Activity Resume
+ if (mActivityTrigger != null) {
+ mActivityTrigger.activityResumeTrigger(next.intent, next.info,
+ next.info.applicationInfo,
+ next.occludesParent());
+ }
+
+ // TODO(b/223439401) adjust the value-add
+ // if (mActivityPluginDelegate != null && getWindowingMode() != WINDOWING_MODE_UNDEFINED) {
+ // mActivityPluginDelegate.activityInvokeNotification
+ // (next.info.packageName, getWindowingMode() == WINDOWING_MODE_FULLSCREEN);
+ // }
+
mTaskSupervisor.setLaunchSource(next.info.applicationInfo.uid);
ActivityRecord lastResumed = null;
@@ -1152,6 +1176,9 @@ class TaskFragment extends WindowContainer<WindowContainer> {
// to ignore it when computing the desired screen orientation.
boolean anim = true;
final DisplayContent dc = taskDisplayArea.mDisplayContent;
+ if (mPerf == null) {
+ mPerf = new BoostFramework();
+ }
if (prev != null) {
if (prev.finishing) {
if (DEBUG_TRANSITION) {
@@ -1161,6 +1188,10 @@ class TaskFragment extends WindowContainer<WindowContainer> {
anim = false;
dc.prepareAppTransition(TRANSIT_NONE);
} else {
+ if(prev.getTask() != next.getTask() && mPerf != null) {
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_ANIM_BOOST,
+ next.packageName);
+ }
dc.prepareAppTransition(TRANSIT_CLOSE);
}
prev.setVisibility(false);
@@ -1172,6 +1203,10 @@ class TaskFragment extends WindowContainer<WindowContainer> {
anim = false;
dc.prepareAppTransition(TRANSIT_NONE);
} else {
+ if(prev.getTask() != next.getTask() && mPerf != null) {
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_ANIM_BOOST,
+ next.packageName);
+ }
dc.prepareAppTransition(TRANSIT_OPEN,
next.mLaunchTaskBehind ? TRANSIT_FLAG_OPEN_BEHIND : 0);
}
@@ -1434,6 +1469,17 @@ class TaskFragment extends WindowContainer<WindowContainer> {
return false;
}
+ //Trigger Activity Pause
+ if (mActivityTrigger != null) {
+ mActivityTrigger.activityPauseTrigger(prev.intent, prev.info,
+ prev.info.applicationInfo);
+ }
+
+ // TODO(b/223439401) adjust the value-add
+ // if (mActivityPluginDelegate != null && getWindowingMode() != WINDOWING_MODE_UNDEFINED) {
+ // mActivityPluginDelegate.activitySuspendNotification
+ // (prev.info.packageName, getWindowingMode() == WINDOWING_MODE_FULLSCREEN, true);
+ // }
ProtoLog.v(WM_DEBUG_STATES, "Moving to PAUSING: %s", prev);
mPausingActivity = prev;
mLastPausedActivity = prev;
diff --git a/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java b/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java
index 523b484269c0..86b873d4a546 100644
--- a/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java
+++ b/services/core/java/com/android/server/wm/TaskTapPointerEventListener.java
@@ -30,6 +30,10 @@ import android.view.MotionEvent;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import com.android.server.wm.WindowManagerService.H;
+import com.android.server.am.ActivityManagerService;
+import com.android.server.wm.ActivityTaskSupervisor;
+import com.android.server.wm.DisplayContent;
+import android.util.BoostFramework;
/**
* 1. Adjust the top most focus display if touch down on some display.
@@ -42,11 +46,15 @@ public class TaskTapPointerEventListener implements PointerEventListener {
private final DisplayContent mDisplayContent;
private final Rect mTmpRect = new Rect();
private int mPointerIconType = TYPE_NOT_SPECIFIED;
+ public BoostFramework mPerfObj = null;
public TaskTapPointerEventListener(WindowManagerService service,
DisplayContent displayContent) {
mService = service;
mDisplayContent = displayContent;
+ if (mPerfObj == null) {
+ mPerfObj = new BoostFramework();
+ }
}
private void restorePointerIcon(int x, int y) {
@@ -129,6 +137,29 @@ public class TaskTapPointerEventListener implements PointerEventListener {
}
break;
}
+ if (ActivityTaskSupervisor.mIsPerfBoostAcquired && (mPerfObj != null)) {
+ if (ActivityTaskSupervisor.mPerfHandle > 0) {
+ mPerfObj.perfLockReleaseHandler(ActivityTaskSupervisor.mPerfHandle);
+ ActivityTaskSupervisor.mPerfHandle = -1;
+ }
+ ActivityTaskSupervisor.mIsPerfBoostAcquired = false;
+ }
+ if (ActivityTaskSupervisor.mPerfSendTapHint && (mPerfObj != null)) {
+ mPerfObj.perfHint(BoostFramework.VENDOR_HINT_TAP_EVENT, null);
+ ActivityTaskSupervisor.mPerfSendTapHint = false;
+ }
+ if (RootWindowContainer.mIsPerfBoostAcquired && (mPerfObj != null)) {
+ if (RootWindowContainer.mPerfHandle > 0) {
+ mPerfObj.perfLockReleaseHandler(
+ RootWindowContainer.mPerfHandle);
+ RootWindowContainer.mPerfHandle = -1;
+ }
+ RootWindowContainer.mIsPerfBoostAcquired = false;
+ }
+ if (RootWindowContainer.mPerfSendTapHint && (mPerfObj != null)) {
+ mPerfObj.perfHint(BoostFramework.VENDOR_HINT_TAP_EVENT, null);
+ RootWindowContainer.mPerfSendTapHint = false;
+ }
}
void setTouchExcludeRegion(Region newRegion) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 1820159d6458..2255384b00b0 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -216,6 +216,7 @@ import android.sysprop.SurfaceFlingerProperties;
import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.BoostFramework;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.MergedConfiguration;
@@ -346,6 +347,8 @@ public class WindowManagerService extends IWindowManager.Stub
static final int LAYOUT_REPEAT_THRESHOLD = 4;
static final boolean PROFILE_ORIENTATION = false;
+ static WindowState mFocusingWindow;
+ String mFocusingActivity;
/** The maximum length we will accept for a loaded animation duration:
* this is 10 seconds.
@@ -473,6 +476,8 @@ public class WindowManagerService extends IWindowManager.Stub
private final DisplayAreaPolicy.Provider mDisplayAreaPolicyProvider;
+ private BoostFramework mPerf = null;
+
final private KeyguardDisableHandler mKeyguardDisableHandler;
// VR Vr2d Display Id.
@@ -3393,12 +3398,28 @@ public class WindowManagerService extends IWindowManager.Stub
ValueAnimator.setDurationScale(scale);
}
+ private float animationScalesCheck (int which) {
+ float value = -1.0f;
+ if (!mAnimationsDisabled) {
+ if (value == -1.0f) {
+ switch (which) {
+ case WINDOW_ANIMATION_SCALE: value = mWindowAnimationScaleSetting; break;
+ case TRANSITION_ANIMATION_SCALE: value = mTransitionAnimationScaleSetting; break;
+ case ANIMATION_DURATION_SCALE: value = mAnimatorDurationScaleSetting; break;
+ }
+ }
+ } else {
+ value = 0;
+ }
+ return value;
+ }
+
public float getWindowAnimationScaleLocked() {
- return mAnimationsDisabled ? 0 : mWindowAnimationScaleSetting;
+ return animationScalesCheck(WINDOW_ANIMATION_SCALE);
}
public float getTransitionAnimationScaleLocked() {
- return mAnimationsDisabled ? 0 : mTransitionAnimationScaleSetting;
+ return animationScalesCheck(TRANSITION_ANIMATION_SCALE);
}
@Override
@@ -5939,6 +5960,12 @@ public class WindowManagerService extends IWindowManager.Stub
}
mLatencyTracker.onActionStart(ACTION_ROTATE_SCREEN);
+ if (mPerf == null) {
+ mPerf = new BoostFramework();
+ }
+ if (mPerf != null) {
+ mPerf.perfHint(BoostFramework.VENDOR_HINT_ROTATION_LATENCY_BOOST, null);
+ }
mExitAnimId = exitAnim;
mEnterAnimId = enterAnim;
@@ -6063,6 +6090,9 @@ public class WindowManagerService extends IWindowManager.Stub
}
mAtmService.endLaunchPowerMode(POWER_MODE_REASON_FREEZE_DISPLAY);
mLatencyTracker.onActionEnd(ACTION_ROTATE_SCREEN);
+ if (mPerf != null) {
+ mPerf.perfLockRelease();
+ }
}
static int getPropertyInt(String[] tokens, int index, int defUnits, int defDps,
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 53401fd47178..34c0cdef19a1 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -71,6 +71,7 @@ cc_library_static {
"com_android_server_am_LowMemDetector.cpp",
"com_android_server_pm_PackageManagerShellCommandDataLoader.cpp",
"com_android_server_sensor_SensorService.cpp",
+ "com_android_server_activityTriggerService.cpp",
"onload.cpp",
":lib_cachedAppOptimizer_native",
":lib_networkStatsFactory_native",
diff --git a/services/core/jni/com_android_server_activityTriggerService.cpp b/services/core/jni/com_android_server_activityTriggerService.cpp
new file mode 100644
index 000000000000..025091f76e38
--- /dev/null
+++ b/services/core/jni/com_android_server_activityTriggerService.cpp
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2019, The Linux Foundation. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of The Linux Foundation nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "jni.h"
+#include <nativehelper/JNIHelp.h>
+#include "android_runtime/AndroidRuntime.h"
+#include <utils/Log.h>
+#include <dlfcn.h>
+#include <limits.h>
+
+namespace android {
+
+//structure which has a handle for dynamically loading the trigger handler lib.
+
+typedef struct dlLibHandler {
+ void *handle;
+ void (*set_info)(const char*, const char*, int *);
+ const char *dlname;
+}dlLibhandler;
+
+//initialize the handler
+static dlLibHandler handler = {
+ NULL, NULL, "libtrigger-handler.so"
+};
+
+static void trigger_handler_lib_init() {
+ bool dlError = false;
+ handler.handle = dlopen(handler.dlname, RTLD_NOW | RTLD_LOCAL);
+ /*no need to proceed if the lib isn't available*/
+ if(handler.handle == NULL) {
+ ALOGE("Activity trigger handling disabled.");
+ return;
+ }
+ *(void **) (&handler.set_info) = dlsym(handler.handle, "set_info");
+ if(handler.set_info == NULL) {
+ dlError = true;
+ }
+ if(dlError) {
+ handler.set_info = NULL;
+ if(handler.handle) dlclose(handler.handle);
+ handler.handle = NULL;
+ }
+}
+
+static void notifyAction_native (JNIEnv* env, jobject /*jclazz*/,jstring pkgName, jlong vCode, jstring /*procName*/, jint pid_in, jint flag) {
+ int pid = (int)pid_in;
+ std::string versionCode = std::to_string((long)vCode) + std::to_string((int)flag);
+ const char* version = versionCode.c_str();
+
+ if(pkgName && handler.set_info) {
+ const char *package = env->GetStringUTFChars(pkgName, NULL);
+ if(package) {
+ (*handler.set_info)(package,version,&pid);
+ env->ReleaseStringUTFChars(pkgName, package);
+ }
+ }
+}
+
+static JNINativeMethod method_list[] = {
+ { "notifyAction_native", "(Ljava/lang/String;JLjava/lang/String;II)V", (void*)notifyAction_native },
+};
+
+int register_android_server_ActivityTriggerService(JNIEnv *env) {
+ //load and link to the handler library
+ trigger_handler_lib_init();
+ return jniRegisterNativeMethods(env, "com/android/server/ActivityTriggerService",
+ method_list, NELEM(method_list));
+}
+};
diff --git a/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp b/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp
index 94bc22a05d7a..619b612b0374 100644
--- a/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp
+++ b/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp
@@ -57,6 +57,19 @@ using android::base::unique_fd;
#define ASYNC_RECEIVED_WHILE_FROZEN (2)
#define TXNS_PENDING_WHILE_FROZEN (4)
+#define MAX_RW_COUNT (INT_MAX & PAGE_MASK)
+
+// Defines the maximum amount of VMAs we can send per process_madvise syscall.
+// Currently this is set to UIO_MAXIOV which is the maximum segments allowed by
+// iovec implementation used by process_madvise syscall
+#define MAX_VMAS_PER_COMPACTION UIO_MAXIOV
+
+// Maximum bytes that we can send per process_madvise syscall once this limit
+// is reached we split the remaining VMAs into another syscall. The MAX_RW_COUNT
+// limit is imposed by iovec implementation. However, if you want to use a smaller
+// limit, it has to be a page aligned value, otherwise, compaction would fail.
+#define MAX_BYTES_PER_COMPACTION MAX_RW_COUNT
+
namespace android {
static bool cancelRunningCompaction;
@@ -70,8 +83,10 @@ static inline void compactProcessProcfs(int pid, const std::string& compactionTy
}
// Compacts a set of VMAs for pid using an madviseType accepted by process_madvise syscall
-// On success returns the total bytes that where compacted. On failure it returns
-// a negative error code from the standard linux error codes.
+// Returns the total bytes that where madvised.
+//
+// If any VMA fails compaction due to -EINVAL it will be skipped and continue.
+// However, if it fails for any other reason, it will bail out and forward the error
static int64_t compactMemory(const std::vector<Vma>& vmas, int pid, int madviseType) {
// UIO_MAXIOV is currently a small value and we might have more addresses
// we do multiple syscalls if we exceed its maximum
@@ -138,7 +153,12 @@ static int getAnyPageAdvice(const Vma& vma) {
}
// Perform a full process compaction using process_madvise syscall
-// reading all filtering VMAs and filtering pages as specified by pageFilter
+// using the madvise behavior defined by vmaToAdviseFunc per VMA.
+//
+// Currently supported behaviors are MADV_COLD and MADV_PAGEOUT.
+//
+// Returns the total number of bytes compacted or forwards an
+// process_madvise error.
static int64_t compactProcess(int pid, VmaToAdviseFunc vmaToAdviseFunc) {
ProcMemInfo meminfo(pid);
std::vector<Vma> pageoutVmas, coldVmas;
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index ff61abc4ff7f..237dbcd27b4e 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -63,6 +63,7 @@ int register_android_server_FaceService(JNIEnv* env);
int register_android_server_GpuService(JNIEnv* env);
int register_android_server_stats_pull_StatsPullAtomService(JNIEnv* env);
int register_android_server_sensor_SensorService(JavaVM* vm, JNIEnv* env);
+int register_android_server_ActivityTriggerService(JNIEnv* env);
};
using namespace android;
@@ -119,5 +120,6 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
register_android_server_GpuService(env);
register_android_server_stats_pull_StatsPullAtomService(env);
register_android_server_sensor_SensorService(vm, env);
+ register_android_server_ActivityTriggerService(env);
return JNI_VERSION_1_4;
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java b/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java
index 10ff2447948b..7a4a6ecd3bfe 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java
@@ -28,6 +28,8 @@ import android.util.Slog;
import com.android.server.SystemService;
+import java.util.List;
+
/**
* Defines the required interface for IDevicePolicyManager implemenation.
*
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index f5f1d497878a..97e1f0b2df99 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -63,6 +63,7 @@ import android.os.FactoryTest;
import android.os.FileUtils;
import android.os.IBinder;
import android.os.IIncidentManager;
+import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
@@ -205,6 +206,9 @@ import com.android.server.wm.WindowManagerGlobalLock;
import com.android.server.wm.WindowManagerService;
import dalvik.system.VMRuntime;
+import dalvik.system.PathClassLoader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import com.google.android.startop.iorap.IorapForwardingService;
@@ -1345,6 +1349,8 @@ public final class SystemServer implements Dumpable {
MmsServiceBroker mmsService = null;
HardwarePropertiesManagerService hardwarePropertiesService = null;
PacProxyService pacProxyService = null;
+ Object wigigP2pService = null;
+ Object wigigService = null;
boolean disableSystemTextClassifier = SystemProperties.getBoolean(
"config.disable_systemtextclassifier", false);
@@ -1356,6 +1362,7 @@ public final class SystemServer implements Dumpable {
boolean enableLeftyService = SystemProperties.getBoolean("config.enable_lefty", false);
boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1");
+ boolean enableWigig = SystemProperties.getBoolean("persist.vendor.wigig.enable", false);
boolean isWatch = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WATCH);
@@ -1555,6 +1562,8 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(IorapForwardingService.class);
t.traceEnd();
+ mSystemServiceManager.startService(ActivityTriggerService.class);
+
if (Build.IS_DEBUGGABLE && ProfcollectForwardingService.enabled()) {
t.traceBegin("ProfcollectForwardingService");
mSystemServiceManager.startService(ProfcollectForwardingService.class);
@@ -1941,6 +1950,34 @@ public final class SystemServer implements Dumpable {
}
t.traceEnd();
+ if (enableWigig) {
+ try {
+ Slog.i(TAG, "Wigig Service");
+ String wigigClassPath =
+ "/system/system_ext/framework/wigig-service.jar" + ":" +
+ "/system/system_ext/framework/vendor.qti.hardware.wigig.supptunnel-V1.0-java.jar" + ":" +
+ "/system/system_ext/framework/vendor.qti.hardware.wigig.netperftuner-V1.0-java.jar" + ":" +
+ "/system/system_ext/framework/vendor.qti.hardware.capabilityconfigstore-V1.0-java.jar";
+ PathClassLoader wigigClassLoader =
+ new PathClassLoader(wigigClassPath, getClass().getClassLoader());
+ Class wigigP2pClass = wigigClassLoader.loadClass(
+ "com.qualcomm.qti.server.wigig.p2p.WigigP2pServiceImpl");
+ Constructor<Class> ctor = wigigP2pClass.getConstructor(Context.class);
+ wigigP2pService = ctor.newInstance(context);
+ Slog.i(TAG, "Successfully loaded WigigP2pServiceImpl class");
+ ServiceManager.addService("wigigp2p", (IBinder) wigigP2pService);
+
+ Class wigigClass = wigigClassLoader.loadClass(
+ "com.qualcomm.qti.server.wigig.WigigService");
+ ctor = wigigClass.getConstructor(Context.class);
+ wigigService = ctor.newInstance(context);
+ Slog.i(TAG, "Successfully loaded WigigService class");
+ ServiceManager.addService("wigig", (IBinder) wigigService);
+ } catch (Throwable e) {
+ reportWtf("starting WigigService", e);
+ }
+ }
+
t.traceBegin("StartNsdService");
try {
serviceDiscovery = NsdService.create(context);
@@ -2551,6 +2588,25 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startBootPhase(t, SystemService.PHASE_SYSTEM_SERVICES_READY);
t.traceEnd();
+ // Wigig services are not registered as system services because of class loader
+ // limitations, send boot phase notification separately
+ if (enableWigig) {
+ try {
+ Slog.i(TAG, "calling onBootPhase for Wigig Services");
+ Class wigigP2pClass = wigigP2pService.getClass();
+ Method m = wigigP2pClass.getMethod("onBootPhase", int.class);
+ m.invoke(wigigP2pService, new Integer(
+ SystemService.PHASE_SYSTEM_SERVICES_READY));
+
+ Class wigigClass = wigigService.getClass();
+ m = wigigClass.getMethod("onBootPhase", int.class);
+ m.invoke(wigigService, new Integer(
+ SystemService.PHASE_SYSTEM_SERVICES_READY));
+ } catch (Throwable e) {
+ reportWtf("Wigig services ready", e);
+ }
+ }
+
t.traceBegin("MakeWindowManagerServiceReady");
try {
wm.systemReady();
diff --git a/services/tests/servicestests/src/com/android/server/display/DisplayModeDirectorTest.java b/services/tests/servicestests/src/com/android/server/display/DisplayModeDirectorTest.java
index 418831f47c1a..c1569ce51270 100644
--- a/services/tests/servicestests/src/com/android/server/display/DisplayModeDirectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/DisplayModeDirectorTest.java
@@ -1668,6 +1668,63 @@ public class DisplayModeDirectorTest {
assertNull(vote);
}
+ private void setHbmAndAssertRefreshRate(
+ DisplayModeDirector director, DisplayListener listener, int mode, float rr) {
+ when(mInjector.getBrightnessInfo(DISPLAY_ID))
+ .thenReturn(new BrightnessInfo(1.0f, 0.0f, 1.0f, mode, TRANSITION_POINT));
+ listener.onDisplayChanged(DISPLAY_ID);
+
+ final Vote vote = director.getVote(DISPLAY_ID, Vote.PRIORITY_HIGH_BRIGHTNESS_MODE);
+ if (Float.isNaN(rr)) {
+ assertNull(vote);
+ } else {
+ assertVoteForRefreshRate(vote, rr);
+ }
+ }
+
+ @Test
+ public void testHbmVoting_forSunlightAndHdr() {
+ DisplayModeDirector director =
+ createDirectorFromRefreshRateArray(new float[] {60.0f, 90.0f}, 0);
+
+ // Specify HDR limitation before starting DisplayModeDirector to avoid waiting on property
+ // propagation
+ final int hdrRr = 60;
+ mInjector.getDeviceConfig().setRefreshRateInHbmHdr(hdrRr);
+ director.start(createMockSensorManager());
+
+ ArgumentCaptor<DisplayListener> captor = ArgumentCaptor.forClass(DisplayListener.class);
+ verify(mInjector).registerDisplayListener(captor.capture(), any(Handler.class),
+ eq(DisplayManager.EVENT_FLAG_DISPLAY_BRIGHTNESS
+ | DisplayManager.EVENT_FLAG_DISPLAY_REMOVED));
+ DisplayListener listener = captor.getValue();
+
+ // Specify Sunlight limitations
+ final float sunlightRr = 90.0f;
+ when(mDisplayManagerInternalMock.getRefreshRateLimitations(DISPLAY_ID))
+ .thenReturn(List.of(new RefreshRateLimitation(
+ DisplayManagerInternal.REFRESH_RATE_LIMIT_HIGH_BRIGHTNESS_MODE, sunlightRr,
+ sunlightRr)));
+
+ // Verify that there is no HBM vote initially
+ Vote vote = director.getVote(DISPLAY_ID, Vote.PRIORITY_HIGH_BRIGHTNESS_MODE);
+ assertNull(vote);
+
+ // Verify all state transitions
+ setHbmAndAssertRefreshRate(
+ director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_SUNLIGHT, sunlightRr);
+ setHbmAndAssertRefreshRate(
+ director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_HDR, hdrRr);
+ setHbmAndAssertRefreshRate(
+ director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF, Float.NaN);
+ setHbmAndAssertRefreshRate(
+ director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_HDR, hdrRr);
+ setHbmAndAssertRefreshRate(
+ director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_SUNLIGHT, sunlightRr);
+ setHbmAndAssertRefreshRate(
+ director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF, Float.NaN);
+ }
+
@Test
public void testHbmVoting_HbmUnsupported() {
DisplayModeDirector director =
@@ -1734,63 +1791,6 @@ public class DisplayModeDirectorTest {
assertNull(vote);
}
- private void setHbmAndAssertRefreshRate(
- DisplayModeDirector director, DisplayListener listener, int mode, float rr) {
- when(mInjector.getBrightnessInfo(DISPLAY_ID))
- .thenReturn(new BrightnessInfo(1.0f, 0.0f, 1.0f, mode, TRANSITION_POINT));
- listener.onDisplayChanged(DISPLAY_ID);
-
- final Vote vote = director.getVote(DISPLAY_ID, Vote.PRIORITY_HIGH_BRIGHTNESS_MODE);
- if (Float.isNaN(rr)) {
- assertNull(vote);
- } else {
- assertVoteForRefreshRate(vote, rr);
- }
- }
-
- @Test
- public void testHbmVoting_forSunlightAndHdr() {
- DisplayModeDirector director =
- createDirectorFromRefreshRateArray(new float[] {60.0f, 90.0f}, 0);
-
- // Specify HDR limitation before starting DisplayModeDirector to avoid waiting on property
- // propagation
- final int hdrRr = 60;
- mInjector.getDeviceConfig().setRefreshRateInHbmHdr(hdrRr);
- director.start(createMockSensorManager());
-
- ArgumentCaptor<DisplayListener> captor = ArgumentCaptor.forClass(DisplayListener.class);
- verify(mInjector).registerDisplayListener(captor.capture(), any(Handler.class),
- eq(DisplayManager.EVENT_FLAG_DISPLAY_BRIGHTNESS
- | DisplayManager.EVENT_FLAG_DISPLAY_REMOVED));
- DisplayListener listener = captor.getValue();
-
- // Specify Sunlight limitations
- final float sunlightRr = 90.0f;
- when(mDisplayManagerInternalMock.getRefreshRateLimitations(DISPLAY_ID))
- .thenReturn(List.of(new RefreshRateLimitation(
- DisplayManagerInternal.REFRESH_RATE_LIMIT_HIGH_BRIGHTNESS_MODE, sunlightRr,
- sunlightRr)));
-
- // Verify that there is no HBM vote initially
- Vote vote = director.getVote(DISPLAY_ID, Vote.PRIORITY_HIGH_BRIGHTNESS_MODE);
- assertNull(vote);
-
- // Verify all state transitions
- setHbmAndAssertRefreshRate(
- director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_SUNLIGHT, sunlightRr);
- setHbmAndAssertRefreshRate(
- director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_HDR, hdrRr);
- setHbmAndAssertRefreshRate(
- director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF, Float.NaN);
- setHbmAndAssertRefreshRate(
- director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_HDR, hdrRr);
- setHbmAndAssertRefreshRate(
- director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_SUNLIGHT, sunlightRr);
- setHbmAndAssertRefreshRate(
- director, listener, BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF, Float.NaN);
- }
-
@Test
public void testHbmVoting_RemovedDisplay() {
DisplayModeDirector director =
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
index 3e8a2e9b7b17..01deb5c7834c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
@@ -91,6 +91,7 @@ import androidx.test.filters.SmallTest;
import com.android.server.wm.LaunchParamsController.LaunchParamsModifier;
import com.android.server.wm.utils.MockTracker;
+import org.junit.Ignore;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -382,6 +383,7 @@ public class ActivityStarterTests extends WindowTestsBase {
* Ensures that values specified at launch time are passed to {@link LaunchParamsModifier}
* when we are laying out a new task.
*/
+ @Ignore // TODO(b/119048275): Reenable failing test in activity_manager_test suite
@Test
public void testCreateTaskLayout() {
// modifier for validating passed values.
@@ -492,6 +494,7 @@ public class ActivityStarterTests extends WindowTestsBase {
/**
* Tests activity is cleaned up properly in a task mode violation.
*/
+ @Ignore // TODO(b/119048275): Reenable failing test in activity_manager_test suite
@Test
public void testTaskModeViolation() {
final DisplayContent display = mAtm.mRootWindowContainer.getDefaultDisplay();
@@ -518,6 +521,7 @@ public class ActivityStarterTests extends WindowTestsBase {
/**
* This test ensures that activity starts are not being logged when the logging is disabled.
*/
+ @Ignore // TODO(b/119048275): Reenable failing test in activity_manager_test suite
@Test
public void testActivityStartsLogging_noLoggingWhenDisabled() {
doReturn(false).when(mAtm).isActivityStartsLoggingEnabled();
@@ -534,6 +538,7 @@ public class ActivityStarterTests extends WindowTestsBase {
/**
* This test ensures that activity starts are being logged when the logging is enabled.
*/
+ @Ignore // TODO(b/119048275): Reenable failing test in activity_manager_test suite
@Test
public void testActivityStartsLogging_logsWhenEnabled() {
// note: conveniently this package doesn't have any activity visible
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 661dcbb7f489..7f151265380e 100644..100755
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -132,6 +132,8 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
private static final String USB_STATE_MATCH =
"DEVPATH=/devices/virtual/android_usb/android0";
+ private static final String USB_STATE_MATCH_SEC =
+ "DEVPATH=/devices/virtual/android_usb/android1";
private static final String ACCESSORY_START_MATCH =
"DEVPATH=/devices/virtual/misc/usb_accessory";
private static final String FUNCTIONS_PATH =
@@ -379,6 +381,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
// Watch for USB configuration changes
mUEventObserver = new UsbUEventObserver();
mUEventObserver.startObserving(USB_STATE_MATCH);
+ mUEventObserver.startObserving(USB_STATE_MATCH_SEC);
mUEventObserver.startObserving(ACCESSORY_START_MATCH);
}
@@ -630,7 +633,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
Slog.e(TAG, "unknown state " + state);
return;
}
- removeMessages(MSG_UPDATE_STATE);
+ if (configured == 0) removeMessages(MSG_UPDATE_STATE);
if (connected == 1) removeMessages(MSG_FUNCTION_SWITCH_TIMEOUT);
Message msg = Message.obtain(this, MSG_UPDATE_STATE);
msg.arg1 = connected;
@@ -1695,6 +1698,10 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
mCurrentFunctions = usbFunctions;
if (functions == null || applyAdbFunction(functions)
.equals(UsbManager.USB_FUNCTION_NONE)) {
+ functions = getSystemProperty(getPersistProp(true),
+ UsbManager.USB_FUNCTION_NONE);
+
+ if (functions.equals(UsbManager.USB_FUNCTION_NONE))
functions = UsbManager.usbFunctionsToString(getChargingFunctions());
}
functions = applyAdbFunction(functions);
diff --git a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerService.java b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerService.java
index 5183e5b8e246..0da89efe8249 100644
--- a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerService.java
+++ b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerService.java
@@ -645,6 +645,7 @@ public class SoundTriggerService extends SystemService {
sEventLogger.log(new SoundTriggerLogger.StringEvent("unloadSoundModel(): id = "
+ soundModelId));
+
synchronized (mLock) {
SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
if (soundModel == null) {
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index f0d43faed5ed..c40de406fb6d 100755
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -564,8 +564,15 @@ public final class Call {
*/
public static final int CAPABILITY_TRANSFER_CONSULTATIVE = 0x08000000;
+ /**
+ * Remote device supports RTT.
+ * @hide
+ */
+ public static final int CAPABILITY_SUPPORTS_RTT_REMOTE = 0x10000000;
+
+
//******************************************************************************************
- // Next CAPABILITY value: 0x10000000
+ // Next CAPABILITY value: 0x20000000
//******************************************************************************************
/**
@@ -817,6 +824,9 @@ public final class Call {
if (can(capabilities, CAPABILITY_TRANSFER_CONSULTATIVE)) {
builder.append(" CAPABILITY_TRANSFER_CONSULTATIVE");
}
+ if (can(capabilities, CAPABILITY_SUPPORTS_RTT_REMOTE)) {
+ builder.append(" CAPABILITY_SUPPORTS_RTT_REMOTE");
+ }
builder.append("]");
return builder.toString();
}
diff --git a/telecomm/java/android/telecom/CallerInfo.java b/telecomm/java/android/telecom/CallerInfo.java
index 2983e6339d4b..419c28eeb001 100644
--- a/telecomm/java/android/telecom/CallerInfo.java
+++ b/telecomm/java/android/telecom/CallerInfo.java
@@ -206,6 +206,7 @@ public class CallerInfo {
* @hide
*/
public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) {
+ android.util.SeempLog.record_uri(12, contactRef);
CallerInfo info = new CallerInfo();
info.photoResource = 0;
info.phoneLabel = null;
@@ -398,6 +399,7 @@ public class CallerInfo {
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public static CallerInfo getCallerInfo(Context context, String number, int subId) {
+ android.util.SeempLog.record_str(12, "number="+number+",subId="+subId);
if (TextUtils.isEmpty(number)) {
return null;
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index f2f1645b335d..b5fdfc2d6ec6 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -422,8 +422,14 @@ public abstract class Connection extends Conferenceable {
*/
public static final int CAPABILITY_TRANSFER_CONSULTATIVE = 0x10000000;
+ /**
+ * Remote device supports RTT.
+ * @hide
+ */
+ public static final int CAPABILITY_SUPPORTS_RTT_REMOTE = 0x20000000;
+
//**********************************************************************************************
- // Next CAPABILITY value: 0x20000000
+ // Next CAPABILITY value: 0x40000000
//**********************************************************************************************
/**
@@ -555,6 +561,16 @@ public abstract class Connection extends Conferenceable {
*/
public static final int PROPERTY_CROSS_SIM = 1 << 13;
+ /**
+ * Set by the framework to indicate that a Connection is participant host, which
+ * means the conference participant's handle is the same as the conference host's handle.
+ * <p>
+ * This property is specific to IMS conference calls originating in Telephony.
+ * @hide
+ */
+ public static final int PROPERTY_IS_PARTICIPANT_HOST = 1 << 14;
+
+
//**********************************************************************************************
// Next PROPERTY value: 1<<14
//**********************************************************************************************
@@ -839,6 +855,14 @@ public abstract class Connection extends Conferenceable {
"android.telecom.extra.IS_DEVICE_TO_DEVICE_COMMUNICATION_AVAILABLE";
/**
+ * Boolean connection extra key set on a {@link Connection} to indicate that swapping
+ * the call is not allowed.
+ * @hide
+ */
+ public static final String EXTRA_DISABLE_SWAP_CALL =
+ "android.telecom.extra.DISABLE_SWAP_CALL";
+
+ /**
* Connection event used to inform Telecom that it should play the on hold tone. This is used
* to play a tone when the peer puts the current call on hold. Sent to Telecom via
* {@link #sendConnectionEvent(String, Bundle)}.
@@ -887,6 +911,17 @@ public abstract class Connection extends Conferenceable {
public static final String EVENT_CALL_HOLD_FAILED = "android.telecom.event.CALL_HOLD_FAILED";
/**
+ * Connection event used to inform Telecom when a resume operation on a call has failed.
+ * This event is only sent when concurrent calls (DSDA) are possible
+ * <p>
+ * Sent via {@link #sendConnectionEvent(String, Bundle)}. The {@link Bundle} parameter is
+ * expected to be null when this connection event is used.
+ * @hide
+ */
+ public static final String EVENT_CALL_RESUME_FAILED =
+ "android.telecom.event.CALL_RESUME_FAILED";
+
+ /**
* Connection event used to inform Telecom when a switch operation on a call has failed.
* <p>
* Sent via {@link #sendConnectionEvent(String, Bundle)}. The {@link Bundle} parameter is
@@ -1138,6 +1173,9 @@ public abstract class Connection extends Conferenceable {
== CAPABILITY_TRANSFER_CONSULTATIVE) {
builder.append(isLong ? " CAPABILITY_TRANSFER_CONSULTATIVE" : " sup_cTrans");
}
+ if ((capabilities & CAPABILITY_SUPPORTS_RTT_REMOTE) == CAPABILITY_SUPPORTS_RTT_REMOTE) {
+ builder.append(isLong ? " CAPABILITY_SUPPORTS_RTT_REMOTE" : " sup_rtt");
+ }
builder.append("]");
return builder.toString();
}
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index c5fc4365df7a..90f5074a20a6 100755
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -2215,7 +2215,8 @@ public abstract class ConnectionService extends Service {
findConnectionForAction(callId, "abort").onAbort();
}
- private void answerVideo(String callId, int videoState) {
+ /** {@hide} */
+ protected void answerVideo(String callId, int videoState) {
Log.i(this, "answerVideo %s", callId);
if (mConnectionById.containsKey(callId)) {
findConnectionForAction(callId, "answer").onAnswer(videoState);
@@ -2224,7 +2225,8 @@ public abstract class ConnectionService extends Service {
}
}
- private void answer(String callId) {
+ /** {@hide} */
+ protected void answer(String callId) {
Log.i(this, "answer %s", callId);
if (mConnectionById.containsKey(callId)) {
findConnectionForAction(callId, "answer").onAnswer();
@@ -2283,7 +2285,8 @@ public abstract class ConnectionService extends Service {
}
}
- private void hold(String callId) {
+ /** {@hide} */
+ protected void hold(String callId) {
Log.i(this, "hold %s", callId);
if (mConnectionById.containsKey(callId)) {
findConnectionForAction(callId, "hold").onHold();
@@ -2292,7 +2295,8 @@ public abstract class ConnectionService extends Service {
}
}
- private void unhold(String callId) {
+ /** {@hide} */
+ protected void unhold(String callId) {
Log.i(this, "unhold %s", callId);
if (mConnectionById.containsKey(callId)) {
findConnectionForAction(callId, "unhold").onUnhold();
@@ -3348,7 +3352,8 @@ public abstract class ConnectionService extends Service {
}
}
- private Connection findConnectionForAction(String callId, String action) {
+ /** {@hide} */
+ protected Connection findConnectionForAction(String callId, String action) {
if (callId != null && mConnectionById.containsKey(callId)) {
return mConnectionById.get(callId);
}
@@ -3363,7 +3368,8 @@ public abstract class ConnectionService extends Service {
return sNullConnection;
}
- private Conference findConferenceForAction(String conferenceId, String action) {
+ /** {@hide} */
+ protected Conference findConferenceForAction(String conferenceId, String action) {
if (mConferenceById.containsKey(conferenceId)) {
return mConferenceById.get(conferenceId);
}
@@ -3409,7 +3415,8 @@ public abstract class ConnectionService extends Service {
return ids;
}
- private Conference getNullConference() {
+ /** {@hide} */
+ protected Conference getNullConference() {
if (sNullConference == null) {
sNullConference = new Conference(null) {};
}
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 4cdeb0b07187..b2714e692972 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -190,6 +190,17 @@ public class TelecomManager {
"android.telecom.action.DEFAULT_DIALER_CHANGED";
/**
+ *@hide Broadcast intent action indicating the call type(CS call or Non-CS call).
+ * The string extra {@link #EXTRA_CALL_TYPE_CS} will contain the
+ * boolean value true if call is CS call else false.
+ *
+ * @see #EXTRA_CALL_TYPE_CS
+ */
+ public static final String ACTION_CALL_TYPE =
+ "codeaurora.telecom.action.CALL_TYPE";
+
+
+ /**
* Extra value used to provide the package name for {@link #ACTION_CHANGE_DEFAULT_DIALER}.
*/
public static final String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME =
@@ -480,6 +491,13 @@ public class TelecomManager {
"android.telecom.extra.CALL_NETWORK_TYPE";
/**
+ *@hide Extra value used to provide the call type for {@link #ACTION_CALL_TYPE}.
+ */
+ public static final String EXTRA_CALL_TYPE_CS =
+ "codeaurora.telecom.extra.CALL_TYPE_CS";
+
+
+ /**
* An optional {@link android.content.Intent#ACTION_CALL} intent extra denoting the
* package name of the app specifying an alternative gateway for the call.
* The value is a string.
diff --git a/telephony/api/system-current.txt b/telephony/api/system-current.txt
new file mode 100644
index 000000000000..fc2ef2137c7b
--- /dev/null
+++ b/telephony/api/system-current.txt
@@ -0,0 +1,2073 @@
+// Signature format: 2.0
+package android.telephony {
+
+ public final class AccessNetworkConstants {
+ field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
+ }
+
+ public static final class AccessNetworkConstants.NgranBands {
+ method public static int getFrequencyRangeGroup(int);
+ field public static final int FREQUENCY_RANGE_GROUP_1 = 1; // 0x1
+ field public static final int FREQUENCY_RANGE_GROUP_2 = 2; // 0x2
+ field public static final int FREQUENCY_RANGE_GROUP_UNKNOWN = 0; // 0x0
+ }
+
+ public final class BarringInfo implements android.os.Parcelable {
+ ctor public BarringInfo();
+ method @NonNull public android.telephony.BarringInfo createLocationInfoSanitizedCopy();
+ }
+
+ public final class CallAttributes implements android.os.Parcelable {
+ ctor public CallAttributes(@NonNull android.telephony.PreciseCallState, int, @NonNull android.telephony.CallQuality);
+ method public int describeContents();
+ method @NonNull public android.telephony.CallQuality getCallQuality();
+ method public int getNetworkType();
+ method @NonNull public android.telephony.PreciseCallState getPreciseCallState();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
+ }
+
+ public final class CallForwardingInfo implements android.os.Parcelable {
+ ctor public CallForwardingInfo(boolean, int, @Nullable String, int);
+ method public int describeContents();
+ method @Nullable public String getNumber();
+ method public int getReason();
+ method public int getTimeoutSeconds();
+ method public boolean isEnabled();
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
+ field public static final int REASON_ALL = 4; // 0x4
+ field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int REASON_BUSY = 1; // 0x1
+ field public static final int REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int REASON_NO_REPLY = 2; // 0x2
+ field public static final int REASON_UNCONDITIONAL = 0; // 0x0
+ }
+
+ public final class CallQuality implements android.os.Parcelable {
+ ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
+ ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
+ method public int describeContents();
+ method public int getAverageRelativeJitter();
+ method public int getAverageRoundTripTime();
+ method public int getCallDuration();
+ method public int getCodecType();
+ method public int getDownlinkCallQualityLevel();
+ method public int getMaxRelativeJitter();
+ method public int getNumRtpPacketsNotReceived();
+ method public int getNumRtpPacketsReceived();
+ method public int getNumRtpPacketsTransmitted();
+ method public int getNumRtpPacketsTransmittedLost();
+ method public int getUplinkCallQualityLevel();
+ method public boolean isIncomingSilenceDetectedAtCallSetup();
+ method public boolean isOutgoingSilenceDetectedAtCallSetup();
+ method public boolean isRtpInactivityDetected();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALL_QUALITY_BAD = 4; // 0x4
+ field public static final int CALL_QUALITY_EXCELLENT = 0; // 0x0
+ field public static final int CALL_QUALITY_FAIR = 2; // 0x2
+ field public static final int CALL_QUALITY_GOOD = 1; // 0x1
+ field public static final int CALL_QUALITY_NOT_AVAILABLE = 5; // 0x5
+ field public static final int CALL_QUALITY_POOR = 3; // 0x3
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallQuality> CREATOR;
+ }
+
+ public class CarrierConfigManager {
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDefaultCarrierServicePackageName();
+ method @NonNull public static android.os.PersistableBundle getDefaultConfig();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void overrideConfig(int, @Nullable android.os.PersistableBundle);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void updateConfigForPhoneId(int, String);
+ field public static final String KEY_CARRIER_SETUP_APP_STRING = "carrier_setup_app_string";
+ field public static final String KEY_SUPPORT_CDMA_1X_VOICE_CALLS_BOOL = "support_cdma_1x_voice_calls_bool";
+ }
+
+ public static final class CarrierConfigManager.Wifi {
+ field public static final String KEY_HOTSPOT_MAX_CLIENT_COUNT = "wifi.hotspot_maximum_client_count";
+ field public static final String KEY_PREFIX = "wifi.";
+ }
+
+ public final class CarrierRestrictionRules implements android.os.Parcelable {
+ method @NonNull public java.util.List<java.lang.Boolean> areCarrierIdentifiersAllowed(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method public int describeContents();
+ method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers();
+ method public int getDefaultCarrierRestriction();
+ method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getExcludedCarriers();
+ method public int getMultiSimPolicy();
+ method public boolean isAllCarriersAllowed();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CARRIER_RESTRICTION_DEFAULT_ALLOWED = 1; // 0x1
+ field public static final int CARRIER_RESTRICTION_DEFAULT_NOT_ALLOWED = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CarrierRestrictionRules> CREATOR;
+ field public static final int MULTISIM_POLICY_NONE = 0; // 0x0
+ field public static final int MULTISIM_POLICY_ONE_VALID_SIM_MUST_BE_PRESENT = 1; // 0x1
+ }
+
+ public static final class CarrierRestrictionRules.Builder {
+ ctor public CarrierRestrictionRules.Builder();
+ method @NonNull public android.telephony.CarrierRestrictionRules build();
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllCarriersAllowed();
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllowedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setDefaultCarrierRestriction(int);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setExcludedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @NonNull public android.telephony.CarrierRestrictionRules.Builder setMultiSimPolicy(int);
+ }
+
+ public class CbGeoUtils {
+ }
+
+ public static class CbGeoUtils.Circle implements android.telephony.CbGeoUtils.Geometry {
+ ctor public CbGeoUtils.Circle(@NonNull android.telephony.CbGeoUtils.LatLng, double);
+ method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
+ method @NonNull public android.telephony.CbGeoUtils.LatLng getCenter();
+ method public double getRadius();
+ }
+
+ public static interface CbGeoUtils.Geometry {
+ method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
+ }
+
+ public static class CbGeoUtils.LatLng {
+ ctor public CbGeoUtils.LatLng(double, double);
+ method public double distance(@NonNull android.telephony.CbGeoUtils.LatLng);
+ method @NonNull public android.telephony.CbGeoUtils.LatLng subtract(@NonNull android.telephony.CbGeoUtils.LatLng);
+ field public final double lat;
+ field public final double lng;
+ }
+
+ public static class CbGeoUtils.Polygon implements android.telephony.CbGeoUtils.Geometry {
+ ctor public CbGeoUtils.Polygon(@NonNull java.util.List<android.telephony.CbGeoUtils.LatLng>);
+ method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
+ method @NonNull public java.util.List<android.telephony.CbGeoUtils.LatLng> getVertices();
+ }
+
+ public abstract class CellBroadcastService extends android.app.Service {
+ ctor public CellBroadcastService();
+ method @NonNull @WorkerThread public abstract CharSequence getCellBroadcastAreaInfo(int);
+ method public android.os.IBinder onBind(@Nullable android.content.Intent);
+ method public abstract void onCdmaCellBroadcastSms(int, @NonNull byte[], int);
+ method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>);
+ method public abstract void onGsmCellBroadcastSms(int, @NonNull byte[]);
+ field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService";
+ }
+
+ public abstract class CellIdentity implements android.os.Parcelable {
+ method @NonNull public abstract android.telephony.CellLocation asCellLocation();
+ method @NonNull public abstract android.telephony.CellIdentity sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityCdma extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.cdma.CdmaCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityCdma sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityGsm extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityGsm sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityLte extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityLte sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityNr extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.CellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityNr sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityTdscdma sanitizeLocationInfo();
+ }
+
+ public final class CellIdentityWcdma extends android.telephony.CellIdentity {
+ method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
+ method @NonNull public android.telephony.CellIdentityWcdma sanitizeLocationInfo();
+ }
+
+ public final class DataFailCause {
+ field @Deprecated public static final int VSNCP_APN_UNATHORIZED = 2238; // 0x8be
+ }
+
+ public final class DataSpecificRegistrationInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.DataSpecificRegistrationInfo> CREATOR;
+ }
+
+ public final class ImsiEncryptionInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @Nullable public String getKeyIdentifier();
+ method @Nullable public java.security.PublicKey getPublicKey();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ImsiEncryptionInfo> CREATOR;
+ }
+
+ public final class LteVopsSupportInfo implements android.os.Parcelable {
+ ctor public LteVopsSupportInfo(int, int);
+ method public int describeContents();
+ method public int getEmcBearerSupport();
+ method public int getVopsSupport();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.LteVopsSupportInfo> CREATOR;
+ field public static final int LTE_STATUS_NOT_AVAILABLE = 1; // 0x1
+ field public static final int LTE_STATUS_NOT_SUPPORTED = 3; // 0x3
+ field public static final int LTE_STATUS_SUPPORTED = 2; // 0x2
+ }
+
+ public class MbmsDownloadSession implements java.lang.AutoCloseable {
+ field public static final String MBMS_DOWNLOAD_SERVICE_ACTION = "android.telephony.action.EmbmsDownload";
+ }
+
+ public class MbmsGroupCallSession implements java.lang.AutoCloseable {
+ field public static final String MBMS_GROUP_CALL_SERVICE_ACTION = "android.telephony.action.EmbmsGroupCall";
+ }
+
+ public class MbmsStreamingSession implements java.lang.AutoCloseable {
+ field public static final String MBMS_STREAMING_SERVICE_ACTION = "android.telephony.action.EmbmsStreaming";
+ }
+
+ public final class ModemActivityInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public android.telephony.ModemActivityInfo getDelta(@NonNull android.telephony.ModemActivityInfo);
+ method public long getIdleTimeMillis();
+ method public static int getNumTxPowerLevels();
+ method public long getReceiveTimeMillis();
+ method public long getSleepTimeMillis();
+ method public long getTimestampMillis();
+ method public long getTransmitDurationMillisAtPowerLevel(int);
+ method @NonNull public android.util.Range<java.lang.Integer> getTransmitPowerRange(int);
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ModemActivityInfo> CREATOR;
+ field public static final int TX_POWER_LEVEL_0 = 0; // 0x0
+ field public static final int TX_POWER_LEVEL_1 = 1; // 0x1
+ field public static final int TX_POWER_LEVEL_2 = 2; // 0x2
+ field public static final int TX_POWER_LEVEL_3 = 3; // 0x3
+ field public static final int TX_POWER_LEVEL_4 = 4; // 0x4
+ }
+
+ public final class NetworkRegistrationInfo implements android.os.Parcelable {
+ method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
+ method public int getRegistrationState();
+ method public int getRejectCause();
+ method public int getRoamingType();
+ method public boolean isEmergencyEnabled();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int REGISTRATION_STATE_DENIED = 3; // 0x3
+ field public static final int REGISTRATION_STATE_HOME = 1; // 0x1
+ field public static final int REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING = 0; // 0x0
+ field public static final int REGISTRATION_STATE_NOT_REGISTERED_SEARCHING = 2; // 0x2
+ field public static final int REGISTRATION_STATE_ROAMING = 5; // 0x5
+ field public static final int REGISTRATION_STATE_UNKNOWN = 4; // 0x4
+ }
+
+ public static final class NetworkRegistrationInfo.Builder {
+ ctor public NetworkRegistrationInfo.Builder();
+ method @NonNull public android.telephony.NetworkRegistrationInfo build();
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAccessNetworkTechnology(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAvailableServices(@NonNull java.util.List<java.lang.Integer>);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setDomain(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setEmergencyOnly(boolean);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegisteredPlmn(@Nullable String);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegistrationState(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRejectCause(int);
+ method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setTransportType(int);
+ }
+
+ public abstract class NetworkService extends android.app.Service {
+ ctor public NetworkService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public abstract android.telephony.NetworkService.NetworkServiceProvider onCreateNetworkServiceProvider(int);
+ field public static final String SERVICE_INTERFACE = "android.telephony.NetworkService";
+ }
+
+ public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable {
+ ctor public NetworkService.NetworkServiceProvider(int);
+ method public abstract void close();
+ method public final int getSlotIndex();
+ method public final void notifyNetworkRegistrationInfoChanged();
+ method public void requestNetworkRegistrationInfo(int, @NonNull android.telephony.NetworkServiceCallback);
+ }
+
+ public class NetworkServiceCallback {
+ method public void onRequestNetworkRegistrationInfoComplete(int, @Nullable android.telephony.NetworkRegistrationInfo);
+ field public static final int RESULT_ERROR_BUSY = 3; // 0x3
+ field public static final int RESULT_ERROR_FAILED = 5; // 0x5
+ field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
+ field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
+ field public static final int RESULT_ERROR_UNSUPPORTED = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ public interface NumberVerificationCallback {
+ method public default void onCallReceived(@NonNull String);
+ method public default void onVerificationFailed(int);
+ field public static final int REASON_CONCURRENT_REQUESTS = 4; // 0x4
+ field public static final int REASON_IN_ECBM = 5; // 0x5
+ field public static final int REASON_IN_EMERGENCY_CALL = 6; // 0x6
+ field public static final int REASON_NETWORK_NOT_AVAILABLE = 2; // 0x2
+ field public static final int REASON_TIMED_OUT = 1; // 0x1
+ field public static final int REASON_TOO_MANY_CALLS = 3; // 0x3
+ field public static final int REASON_UNSPECIFIED = 0; // 0x0
+ }
+
+ public final class PhoneNumberRange implements android.os.Parcelable {
+ ctor public PhoneNumberRange(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
+ method public int describeContents();
+ method public boolean matches(@NonNull String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneNumberRange> CREATOR;
+ }
+
+ public class PhoneNumberUtils {
+ method @NonNull public static String getUsernameFromUriNumber(@NonNull String);
+ method public static boolean isUriNumber(@Nullable String);
+ method public static boolean isVoiceMailNumber(@NonNull android.content.Context, int, @Nullable String);
+ }
+
+ public final class PhysicalChannelConfig implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getCellBandwidthDownlink();
+ method public int getChannelNumber();
+ method public int getConnectionStatus();
+ method public int getNetworkType();
+ method @IntRange(from=0, to=1007) public int getPhysicalCellId();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field public static final int CHANNEL_NUMBER_UNKNOWN = -1; // 0xffffffff
+ field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
+ field public static final int CONNECTION_SECONDARY_SERVING = 2; // 0x2
+ field public static final int CONNECTION_UNKNOWN = -1; // 0xffffffff
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhysicalChannelConfig> CREATOR;
+ field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public final class PreciseCallState implements android.os.Parcelable {
+ ctor public PreciseCallState(int, int, int, int, int);
+ method public int describeContents();
+ method public int getBackgroundCallState();
+ method public int getForegroundCallState();
+ method public int getRingingCallState();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PreciseCallState> CREATOR;
+ field public static final int PRECISE_CALL_STATE_ACTIVE = 1; // 0x1
+ field public static final int PRECISE_CALL_STATE_ALERTING = 4; // 0x4
+ field public static final int PRECISE_CALL_STATE_DIALING = 3; // 0x3
+ field public static final int PRECISE_CALL_STATE_DISCONNECTED = 7; // 0x7
+ field public static final int PRECISE_CALL_STATE_DISCONNECTING = 8; // 0x8
+ field public static final int PRECISE_CALL_STATE_HOLDING = 2; // 0x2
+ field public static final int PRECISE_CALL_STATE_IDLE = 0; // 0x0
+ field public static final int PRECISE_CALL_STATE_INCOMING = 5; // 0x5
+ field public static final int PRECISE_CALL_STATE_NOT_VALID = -1; // 0xffffffff
+ field public static final int PRECISE_CALL_STATE_WAITING = 6; // 0x6
+ }
+
+ public final class PreciseDataConnectionState implements android.os.Parcelable {
+ method @Deprecated @NonNull public String getDataConnectionApn();
+ method @Deprecated public int getDataConnectionApnTypeBitMask();
+ method @Deprecated public int getDataConnectionFailCause();
+ method @Deprecated public int getDataConnectionState();
+ method public int getId();
+ }
+
+ public final class PreciseDisconnectCause {
+ field public static final int ACCESS_CLASS_BLOCKED = 260; // 0x104
+ field public static final int ACCESS_INFORMATION_DISCARDED = 43; // 0x2b
+ field public static final int ACM_LIMIT_EXCEEDED = 68; // 0x44
+ field public static final int BEARER_CAPABILITY_NOT_AUTHORIZED = 57; // 0x39
+ field public static final int BEARER_NOT_AVAIL = 58; // 0x3a
+ field public static final int BEARER_SERVICE_NOT_IMPLEMENTED = 65; // 0x41
+ field public static final int BUSY = 17; // 0x11
+ field public static final int CALL_BARRED = 240; // 0xf0
+ field public static final int CALL_REJECTED = 21; // 0x15
+ field public static final int CDMA_ACCESS_BLOCKED = 1009; // 0x3f1
+ field public static final int CDMA_ACCESS_FAILURE = 1006; // 0x3ee
+ field public static final int CDMA_DROP = 1001; // 0x3e9
+ field public static final int CDMA_INTERCEPT = 1002; // 0x3ea
+ field public static final int CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000; // 0x3e8
+ field public static final int CDMA_NOT_EMERGENCY = 1008; // 0x3f0
+ field public static final int CDMA_PREEMPTED = 1007; // 0x3ef
+ field public static final int CDMA_REORDER = 1003; // 0x3eb
+ field public static final int CDMA_RETRY_ORDER = 1005; // 0x3ed
+ field public static final int CDMA_SO_REJECT = 1004; // 0x3ec
+ field public static final int CHANNEL_NOT_AVAIL = 44; // 0x2c
+ field public static final int CHANNEL_UNACCEPTABLE = 6; // 0x6
+ field public static final int CONDITIONAL_IE_ERROR = 100; // 0x64
+ field public static final int DESTINATION_OUT_OF_ORDER = 27; // 0x1b
+ field public static final int ERROR_UNSPECIFIED = 65535; // 0xffff
+ field public static final int FACILITY_REJECTED = 29; // 0x1d
+ field public static final int FDN_BLOCKED = 241; // 0xf1
+ field public static final int IMEI_NOT_ACCEPTED = 243; // 0xf3
+ field public static final int IMSI_UNKNOWN_IN_VLR = 242; // 0xf2
+ field public static final int INCOMING_CALLS_BARRED_WITHIN_CUG = 55; // 0x37
+ field public static final int INCOMPATIBLE_DESTINATION = 88; // 0x58
+ field public static final int INFORMATION_ELEMENT_NON_EXISTENT = 99; // 0x63
+ field public static final int INTERWORKING_UNSPECIFIED = 127; // 0x7f
+ field public static final int INVALID_MANDATORY_INFORMATION = 96; // 0x60
+ field public static final int INVALID_NUMBER_FORMAT = 28; // 0x1c
+ field public static final int INVALID_TRANSACTION_IDENTIFIER = 81; // 0x51
+ field public static final int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101; // 0x65
+ field public static final int MESSAGE_TYPE_NON_IMPLEMENTED = 97; // 0x61
+ field public static final int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98; // 0x62
+ field public static final int NETWORK_DETACH = 261; // 0x105
+ field public static final int NETWORK_OUT_OF_ORDER = 38; // 0x26
+ field public static final int NETWORK_REJECT = 252; // 0xfc
+ field public static final int NETWORK_RESP_TIMEOUT = 251; // 0xfb
+ field public static final int NORMAL = 16; // 0x10
+ field public static final int NORMAL_UNSPECIFIED = 31; // 0x1f
+ field public static final int NOT_VALID = -1; // 0xffffffff
+ field public static final int NO_ANSWER_FROM_USER = 19; // 0x13
+ field public static final int NO_CIRCUIT_AVAIL = 34; // 0x22
+ field public static final int NO_DISCONNECT_CAUSE_AVAILABLE = 0; // 0x0
+ field public static final int NO_ROUTE_TO_DESTINATION = 3; // 0x3
+ field public static final int NO_USER_RESPONDING = 18; // 0x12
+ field public static final int NO_VALID_SIM = 249; // 0xf9
+ field public static final int NUMBER_CHANGED = 22; // 0x16
+ field public static final int OEM_CAUSE_1 = 61441; // 0xf001
+ field public static final int OEM_CAUSE_10 = 61450; // 0xf00a
+ field public static final int OEM_CAUSE_11 = 61451; // 0xf00b
+ field public static final int OEM_CAUSE_12 = 61452; // 0xf00c
+ field public static final int OEM_CAUSE_13 = 61453; // 0xf00d
+ field public static final int OEM_CAUSE_14 = 61454; // 0xf00e
+ field public static final int OEM_CAUSE_15 = 61455; // 0xf00f
+ field public static final int OEM_CAUSE_2 = 61442; // 0xf002
+ field public static final int OEM_CAUSE_3 = 61443; // 0xf003
+ field public static final int OEM_CAUSE_4 = 61444; // 0xf004
+ field public static final int OEM_CAUSE_5 = 61445; // 0xf005
+ field public static final int OEM_CAUSE_6 = 61446; // 0xf006
+ field public static final int OEM_CAUSE_7 = 61447; // 0xf007
+ field public static final int OEM_CAUSE_8 = 61448; // 0xf008
+ field public static final int OEM_CAUSE_9 = 61449; // 0xf009
+ field public static final int ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70; // 0x46
+ field public static final int OPERATOR_DETERMINED_BARRING = 8; // 0x8
+ field public static final int OUT_OF_SRV = 248; // 0xf8
+ field public static final int PREEMPTION = 25; // 0x19
+ field public static final int PROTOCOL_ERROR_UNSPECIFIED = 111; // 0x6f
+ field public static final int QOS_NOT_AVAIL = 49; // 0x31
+ field public static final int RADIO_ACCESS_FAILURE = 253; // 0xfd
+ field public static final int RADIO_INTERNAL_ERROR = 250; // 0xfa
+ field public static final int RADIO_LINK_FAILURE = 254; // 0xfe
+ field public static final int RADIO_LINK_LOST = 255; // 0xff
+ field public static final int RADIO_OFF = 247; // 0xf7
+ field public static final int RADIO_RELEASE_ABNORMAL = 259; // 0x103
+ field public static final int RADIO_RELEASE_NORMAL = 258; // 0x102
+ field public static final int RADIO_SETUP_FAILURE = 257; // 0x101
+ field public static final int RADIO_UPLINK_FAILURE = 256; // 0x100
+ field public static final int RECOVERY_ON_TIMER_EXPIRED = 102; // 0x66
+ field public static final int REQUESTED_FACILITY_NOT_IMPLEMENTED = 69; // 0x45
+ field public static final int REQUESTED_FACILITY_NOT_SUBSCRIBED = 50; // 0x32
+ field public static final int RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47; // 0x2f
+ field public static final int SEMANTICALLY_INCORRECT_MESSAGE = 95; // 0x5f
+ field public static final int SERVICE_OPTION_NOT_AVAILABLE = 63; // 0x3f
+ field public static final int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79; // 0x4f
+ field public static final int STATUS_ENQUIRY = 30; // 0x1e
+ field public static final int SWITCHING_CONGESTION = 42; // 0x2a
+ field public static final int TEMPORARY_FAILURE = 41; // 0x29
+ field public static final int UNOBTAINABLE_NUMBER = 1; // 0x1
+ field public static final int USER_NOT_MEMBER_OF_CUG = 87; // 0x57
+ }
+
+ public class ServiceState implements android.os.Parcelable {
+ method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(int);
+ method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(int);
+ field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
+ field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
+ field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
+ field public static final int ROAMING_TYPE_UNKNOWN = 1; // 0x1
+ }
+
+ public final class SmsCbCmasInfo implements android.os.Parcelable {
+ ctor public SmsCbCmasInfo(int, int, int, int, int, int);
+ method public int describeContents();
+ method public int getCategory();
+ method public int getCertainty();
+ method public int getMessageClass();
+ method public int getResponseType();
+ method public int getSeverity();
+ method public int getUrgency();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CMAS_CATEGORY_CBRNE = 10; // 0xa
+ field public static final int CMAS_CATEGORY_ENV = 7; // 0x7
+ field public static final int CMAS_CATEGORY_FIRE = 5; // 0x5
+ field public static final int CMAS_CATEGORY_GEO = 0; // 0x0
+ field public static final int CMAS_CATEGORY_HEALTH = 6; // 0x6
+ field public static final int CMAS_CATEGORY_INFRA = 9; // 0x9
+ field public static final int CMAS_CATEGORY_MET = 1; // 0x1
+ field public static final int CMAS_CATEGORY_OTHER = 11; // 0xb
+ field public static final int CMAS_CATEGORY_RESCUE = 4; // 0x4
+ field public static final int CMAS_CATEGORY_SAFETY = 2; // 0x2
+ field public static final int CMAS_CATEGORY_SECURITY = 3; // 0x3
+ field public static final int CMAS_CATEGORY_TRANSPORT = 8; // 0x8
+ field public static final int CMAS_CATEGORY_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_CERTAINTY_LIKELY = 1; // 0x1
+ field public static final int CMAS_CERTAINTY_OBSERVED = 0; // 0x0
+ field public static final int CMAS_CERTAINTY_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_CLASS_CHILD_ABDUCTION_EMERGENCY = 3; // 0x3
+ field public static final int CMAS_CLASS_CMAS_EXERCISE = 5; // 0x5
+ field public static final int CMAS_CLASS_EXTREME_THREAT = 1; // 0x1
+ field public static final int CMAS_CLASS_OPERATOR_DEFINED_USE = 6; // 0x6
+ field public static final int CMAS_CLASS_PRESIDENTIAL_LEVEL_ALERT = 0; // 0x0
+ field public static final int CMAS_CLASS_REQUIRED_MONTHLY_TEST = 4; // 0x4
+ field public static final int CMAS_CLASS_SEVERE_THREAT = 2; // 0x2
+ field public static final int CMAS_CLASS_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_RESPONSE_TYPE_ASSESS = 6; // 0x6
+ field public static final int CMAS_RESPONSE_TYPE_AVOID = 5; // 0x5
+ field public static final int CMAS_RESPONSE_TYPE_EVACUATE = 1; // 0x1
+ field public static final int CMAS_RESPONSE_TYPE_EXECUTE = 3; // 0x3
+ field public static final int CMAS_RESPONSE_TYPE_MONITOR = 4; // 0x4
+ field public static final int CMAS_RESPONSE_TYPE_NONE = 7; // 0x7
+ field public static final int CMAS_RESPONSE_TYPE_PREPARE = 2; // 0x2
+ field public static final int CMAS_RESPONSE_TYPE_SHELTER = 0; // 0x0
+ field public static final int CMAS_RESPONSE_TYPE_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_SEVERITY_EXTREME = 0; // 0x0
+ field public static final int CMAS_SEVERITY_SEVERE = 1; // 0x1
+ field public static final int CMAS_SEVERITY_UNKNOWN = -1; // 0xffffffff
+ field public static final int CMAS_URGENCY_EXPECTED = 1; // 0x1
+ field public static final int CMAS_URGENCY_IMMEDIATE = 0; // 0x0
+ field public static final int CMAS_URGENCY_UNKNOWN = -1; // 0xffffffff
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbCmasInfo> CREATOR;
+ }
+
+ public final class SmsCbEtwsInfo implements android.os.Parcelable {
+ ctor public SmsCbEtwsInfo(int, boolean, boolean, boolean, @Nullable byte[]);
+ method public int describeContents();
+ method @Nullable public byte[] getPrimaryNotificationSignature();
+ method public long getPrimaryNotificationTimestamp();
+ method public int getWarningType();
+ method public boolean isEmergencyUserAlert();
+ method public boolean isPopupAlert();
+ method public boolean isPrimary();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbEtwsInfo> CREATOR;
+ field public static final int ETWS_WARNING_TYPE_EARTHQUAKE = 0; // 0x0
+ field public static final int ETWS_WARNING_TYPE_EARTHQUAKE_AND_TSUNAMI = 2; // 0x2
+ field public static final int ETWS_WARNING_TYPE_OTHER_EMERGENCY = 4; // 0x4
+ field public static final int ETWS_WARNING_TYPE_TEST_MESSAGE = 3; // 0x3
+ field public static final int ETWS_WARNING_TYPE_TSUNAMI = 1; // 0x1
+ field public static final int ETWS_WARNING_TYPE_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public final class SmsCbLocation implements android.os.Parcelable {
+ ctor public SmsCbLocation(@NonNull String, int, int);
+ method public int describeContents();
+ method public int getCid();
+ method public int getLac();
+ method @NonNull public String getPlmn();
+ method public boolean isInLocationArea(@NonNull android.telephony.SmsCbLocation);
+ method public boolean isInLocationArea(@Nullable String, int, int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbLocation> CREATOR;
+ }
+
+ public final class SmsCbMessage implements android.os.Parcelable {
+ ctor public SmsCbMessage(int, int, int, @NonNull android.telephony.SmsCbLocation, int, @Nullable String, int, @Nullable String, int, @Nullable android.telephony.SmsCbEtwsInfo, @Nullable android.telephony.SmsCbCmasInfo, int, @Nullable java.util.List<android.telephony.CbGeoUtils.Geometry>, long, int, int);
+ method @NonNull public static android.telephony.SmsCbMessage createFromCursor(@NonNull android.database.Cursor);
+ method public int describeContents();
+ method @Nullable public android.telephony.SmsCbCmasInfo getCmasWarningInfo();
+ method @NonNull public android.content.ContentValues getContentValues();
+ method public int getDataCodingScheme();
+ method @Nullable public android.telephony.SmsCbEtwsInfo getEtwsWarningInfo();
+ method public int getGeographicalScope();
+ method @NonNull public java.util.List<android.telephony.CbGeoUtils.Geometry> getGeometries();
+ method @Nullable public String getLanguageCode();
+ method @NonNull public android.telephony.SmsCbLocation getLocation();
+ method public int getMaximumWaitingDuration();
+ method @Nullable public String getMessageBody();
+ method public int getMessageFormat();
+ method public int getMessagePriority();
+ method public long getReceivedTime();
+ method public int getSerialNumber();
+ method public int getServiceCategory();
+ method public int getSlotIndex();
+ method public int getSubscriptionId();
+ method public boolean isCmasMessage();
+ method public boolean isEmergencyMessage();
+ method public boolean isEtwsMessage();
+ method public boolean needGeoFencingCheck();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbMessage> CREATOR;
+ field public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE = 3; // 0x3
+ field public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE_IMMEDIATE = 0; // 0x0
+ field public static final int GEOGRAPHICAL_SCOPE_LOCATION_AREA_WIDE = 2; // 0x2
+ field public static final int GEOGRAPHICAL_SCOPE_PLMN_WIDE = 1; // 0x1
+ field public static final int MAXIMUM_WAIT_TIME_NOT_SET = 255; // 0xff
+ field public static final int MESSAGE_FORMAT_3GPP = 1; // 0x1
+ field public static final int MESSAGE_FORMAT_3GPP2 = 2; // 0x2
+ field public static final int MESSAGE_PRIORITY_EMERGENCY = 3; // 0x3
+ field public static final int MESSAGE_PRIORITY_INTERACTIVE = 1; // 0x1
+ field public static final int MESSAGE_PRIORITY_NORMAL = 0; // 0x0
+ field public static final int MESSAGE_PRIORITY_URGENT = 2; // 0x2
+ }
+
+ public final class SmsManager {
+ method public boolean disableCellBroadcastRange(int, int, int);
+ method public boolean enableCellBroadcastRange(int, int, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getPremiumSmsConsent(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void sendMultipartTextMessageWithoutPersisting(String, String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPremiumSmsConsent(@NonNull String, int);
+ field public static final int PREMIUM_SMS_CONSENT_ALWAYS_ALLOW = 3; // 0x3
+ field public static final int PREMIUM_SMS_CONSENT_ASK_USER = 1; // 0x1
+ field public static final int PREMIUM_SMS_CONSENT_NEVER_ALLOW = 2; // 0x2
+ field public static final int PREMIUM_SMS_CONSENT_UNKNOWN = 0; // 0x0
+ }
+
+ public class SmsMessage {
+ method @Nullable public static android.telephony.SmsMessage createFromNativeSmsSubmitPdu(@NonNull byte[], boolean);
+ method @Nullable public static android.telephony.SmsMessage.SubmitPdu getSmsPdu(int, int, @Nullable String, @NonNull String, @NonNull String, long);
+ method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static byte[] getSubmitPduEncodedMessage(boolean, @NonNull String, @NonNull String, int, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0, to=255) int, @IntRange(from=1, to=255) int, @IntRange(from=1, to=255) int);
+ }
+
+ public class SubscriptionInfo implements android.os.Parcelable {
+ method public boolean areUiccApplicationsEnabled();
+ method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
+ method public int getProfileClass();
+ method public boolean isGroupDisabled();
+ }
+
+ public class SubscriptionManager {
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean canDisablePhysicalSubscription();
+ method public boolean canManageSubscription(@NonNull android.telephony.SubscriptionInfo, @NonNull String);
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int[] getActiveSubscriptionIdList();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForIcc(@NonNull String);
+ method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int[] getCompleteActiveSubscriptionIdList();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
+ method @NonNull public static android.content.res.Resources getResourcesForSubId(@NonNull android.content.Context, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int);
+ method public void requestEmbeddedSubscriptionInfoListRefresh();
+ method public void requestEmbeddedSubscriptionInfoListRefresh(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultDataSubId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultSmsSubId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultVoiceSubscriptionId(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUiccApplicationsEnabled(int, boolean);
+ field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED";
+ field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
+ field @Deprecated public static final int PROFILE_CLASS_DEFAULT;
+ field public static final int PROFILE_CLASS_OPERATIONAL;
+ field public static final int PROFILE_CLASS_PROVISIONING;
+ field public static final int PROFILE_CLASS_TESTING;
+ field public static final int PROFILE_CLASS_UNSET;
+ field @NonNull public static final android.net.Uri VT_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_MODE_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ROAMING_ENABLED_CONTENT_URI;
+ field @NonNull public static final android.net.Uri WFC_ROAMING_MODE_CONTENT_URI;
+ }
+
+ public final class TelephonyHistogram implements android.os.Parcelable {
+ ctor public TelephonyHistogram(int, int, int);
+ ctor public TelephonyHistogram(android.telephony.TelephonyHistogram);
+ ctor public TelephonyHistogram(android.os.Parcel);
+ method public void addTimeTaken(int);
+ method public int describeContents();
+ method public int getAverageTime();
+ method public int getBucketCount();
+ method public int[] getBucketCounters();
+ method public int[] getBucketEndPoints();
+ method public int getCategory();
+ method public int getId();
+ method public int getMaxTime();
+ method public int getMinTime();
+ method public int getSampleCount();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.TelephonyHistogram> CREATOR;
+ field public static final int TELEPHONY_CATEGORY_RIL = 1; // 0x1
+ }
+
+ public class TelephonyManager {
+ method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String);
+ method public int checkCarrierPrivilegesForPackage(String);
+ method public int checkCarrierPrivilegesForPackageAnyPhone(String);
+ method public void dial(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean disableDataConnectivity();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableDataConnectivity();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableModemForSlot(int, boolean);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableVideoCalling(boolean);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
+ method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getAndUpdateDefaultRespondViaMessageApplication();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallForwarding(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CallForwardingInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getCallWaitingStatus(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(int);
+ method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
+ method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCarrierPrivilegeStatus(int);
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<java.lang.String> getCarrierPrivilegedPackagesForAllActiveSubscriptions();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CarrierRestrictionRules getCarrierRestrictionRules();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin(int);
+ method public String getCdmaPrlVersion();
+ method public int getCurrentPhoneType();
+ method public int getCurrentPhoneType(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getDataActivationState();
+ method @Deprecated public boolean getDataEnabled();
+ method @Deprecated public boolean getDataEnabled(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getDefaultRespondViaMessageApplication();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
+ method public int getMaxNumberOfSimultaneouslyActiveSims();
+ method public static long getMaxNumberVerificationTimeoutMillis();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String[] getMergedImsisFromGroup();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmask();
+ method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
+ method public int getSimApplicationState();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimApplicationState(int);
+ method public int getSimCardState();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimCardState(int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Locale getSimLocale();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getSupportedRadioAccessFamily();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.UiccSlotInfo[] getUiccSlotsInfo();
+ method @Nullable public android.os.Bundle getVisualVoicemailSettings();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoiceActivationState();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handlePinMmi(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handlePinMmiForSubscriber(int, String);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean iccCloseLogicalChannelBySlot(int, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannelBySlot(int, @Nullable String, int);
+ method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduBasicChannelBySlot(int, int, int, int, int, int, @Nullable String);
+ method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduLogicalChannelBySlot(int, int, int, int, int, int, int, @Nullable String);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAnyRadioPoweredOn();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApnMetered(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApplicationOnUicc(int);
+ method public boolean isDataConnectivityPossible();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean isIccLockEnabled();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isLteCdmaEvdoGsmWcdmaEnabled();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isMobileDataPolicyEnabled(int);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isOpportunisticNetworkEnabled();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isTetheringApnRequired();
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean matchesCurrentSimOperator(@NonNull String, int, @Nullable String);
+ method public boolean needsOtaServiceProvisioning();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void reportDefaultNetworkStatus(boolean);
+ method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.MODIFY_PHONE_STATE}) public void requestCellInfoUpdate(@NonNull android.os.WorkSource, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetAllCarrierActions();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetCarrierKeysForImsiEncryption();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void resetIms(int);
+ method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void resetOtaEmergencyNumberDbFilePath();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean resetRadioConfig();
+ method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallForwarding(@NonNull android.telephony.CallForwardingInfo, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCallWaitingEnabled(boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabledStatus(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunisticNetworkState(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmask(long);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRadioEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadioPower(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>);
+ method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff();
+ method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateOtaEmergencyNumberDbFilePath(@NonNull android.os.ParcelFileDescriptor);
+ method public void updateServiceLocation();
+ field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED";
+ field public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
+ field public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
+ field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE";
+ field public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
+ field public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
+ field public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE = "com.android.omadm.service.CONFIGURATION_UPDATE";
+ field public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS = "android.telephony.action.SHOW_NOTICE_ECM_BLOCK_OTHERS";
+ field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
+ field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
+ field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
+ field public static final int CALL_WAITING_STATUS_DISABLED = 2; // 0x2
+ field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
+ field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
+ field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
+ field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
+ field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
+ field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
+ field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
+ field public static final String EXTRA_ANOMALY_DESCRIPTION = "android.telephony.extra.ANOMALY_DESCRIPTION";
+ field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID";
+ field public static final String EXTRA_PHONE_IN_ECM_STATE = "android.telephony.extra.PHONE_IN_ECM_STATE";
+ field public static final String EXTRA_PHONE_IN_EMERGENCY_CALL = "android.telephony.extra.PHONE_IN_EMERGENCY_CALL";
+ field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
+ field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
+ field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
+ field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
+ field public static final int KEY_TYPE_EPDG = 1; // 0x1
+ field public static final int KEY_TYPE_WLAN = 2; // 0x2
+ field public static final int MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL = 1; // 0x1
+ field public static final int MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED = 2; // 0x2
+ field public static final long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L
+ field public static final long NETWORK_TYPE_BITMASK_CDMA = 8L; // 0x8L
+ field public static final long NETWORK_TYPE_BITMASK_EDGE = 2L; // 0x2L
+ field public static final long NETWORK_TYPE_BITMASK_EHRPD = 8192L; // 0x2000L
+ field public static final long NETWORK_TYPE_BITMASK_EVDO_0 = 16L; // 0x10L
+ field public static final long NETWORK_TYPE_BITMASK_EVDO_A = 32L; // 0x20L
+ field public static final long NETWORK_TYPE_BITMASK_EVDO_B = 2048L; // 0x800L
+ field public static final long NETWORK_TYPE_BITMASK_GPRS = 1L; // 0x1L
+ field public static final long NETWORK_TYPE_BITMASK_GSM = 32768L; // 0x8000L
+ field public static final long NETWORK_TYPE_BITMASK_HSDPA = 128L; // 0x80L
+ field public static final long NETWORK_TYPE_BITMASK_HSPA = 512L; // 0x200L
+ field public static final long NETWORK_TYPE_BITMASK_HSPAP = 16384L; // 0x4000L
+ field public static final long NETWORK_TYPE_BITMASK_HSUPA = 256L; // 0x100L
+ field public static final long NETWORK_TYPE_BITMASK_IWLAN = 131072L; // 0x20000L
+ field public static final long NETWORK_TYPE_BITMASK_LTE = 4096L; // 0x1000L
+ field public static final long NETWORK_TYPE_BITMASK_LTE_CA = 262144L; // 0x40000L
+ field public static final long NETWORK_TYPE_BITMASK_NR = 524288L; // 0x80000L
+ field public static final long NETWORK_TYPE_BITMASK_TD_SCDMA = 65536L; // 0x10000L
+ field public static final long NETWORK_TYPE_BITMASK_UMTS = 4L; // 0x4L
+ field public static final long NETWORK_TYPE_BITMASK_UNKNOWN = 0L; // 0x0L
+ field public static final int RADIO_POWER_OFF = 0; // 0x0
+ field public static final int RADIO_POWER_ON = 1; // 0x1
+ field public static final int RADIO_POWER_UNAVAILABLE = 2; // 0x2
+ field public static final int SET_CARRIER_RESTRICTION_ERROR = 2; // 0x2
+ field public static final int SET_CARRIER_RESTRICTION_NOT_SUPPORTED = 1; // 0x1
+ field public static final int SET_CARRIER_RESTRICTION_SUCCESS = 0; // 0x0
+ field public static final int SIM_ACTIVATION_STATE_ACTIVATED = 2; // 0x2
+ field public static final int SIM_ACTIVATION_STATE_ACTIVATING = 1; // 0x1
+ field public static final int SIM_ACTIVATION_STATE_DEACTIVATED = 3; // 0x3
+ field public static final int SIM_ACTIVATION_STATE_RESTRICTED = 4; // 0x4
+ field public static final int SIM_ACTIVATION_STATE_UNKNOWN = 0; // 0x0
+ field public static final int SIM_STATE_LOADED = 10; // 0xa
+ field public static final int SIM_STATE_PRESENT = 11; // 0xb
+ field public static final int SRVCC_STATE_HANDOVER_CANCELED = 3; // 0x3
+ field public static final int SRVCC_STATE_HANDOVER_COMPLETED = 1; // 0x1
+ field public static final int SRVCC_STATE_HANDOVER_FAILED = 2; // 0x2
+ field public static final int SRVCC_STATE_HANDOVER_NONE = -1; // 0xffffffff
+ field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
+ }
+
+ public static interface TelephonyManager.CallForwardingInfoCallback {
+ method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
+ method public void onError(int);
+ field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 2; // 0x2
+ field public static final int RESULT_ERROR_NOT_SUPPORTED = 3; // 0x3
+ field public static final int RESULT_ERROR_UNKNOWN = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ public final class UiccAccessRule implements android.os.Parcelable {
+ ctor public UiccAccessRule(byte[], @Nullable String, long);
+ method public int describeContents();
+ method public int getCarrierPrivilegeStatus(android.content.pm.PackageInfo);
+ method public int getCarrierPrivilegeStatus(android.content.pm.Signature, String);
+ method public String getCertificateHexString();
+ method @Nullable public String getPackageName();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.UiccAccessRule> CREATOR;
+ }
+
+ public class UiccSlotInfo implements android.os.Parcelable {
+ ctor @Deprecated public UiccSlotInfo(boolean, boolean, String, int, int, boolean);
+ method public int describeContents();
+ method public String getCardId();
+ method public int getCardStateInfo();
+ method public boolean getIsActive();
+ method public boolean getIsEuicc();
+ method public boolean getIsExtendedApduSupported();
+ method public int getLogicalSlotIdx();
+ method public boolean isRemovable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CARD_STATE_INFO_ABSENT = 1; // 0x1
+ field public static final int CARD_STATE_INFO_ERROR = 3; // 0x3
+ field public static final int CARD_STATE_INFO_PRESENT = 2; // 0x2
+ field public static final int CARD_STATE_INFO_RESTRICTED = 4; // 0x4
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.UiccSlotInfo> CREATOR;
+ }
+
+ public abstract class VisualVoicemailService extends android.app.Service {
+ method public static final void sendVisualVoicemailSms(android.content.Context, android.telecom.PhoneAccountHandle, String, short, String, android.app.PendingIntent);
+ method public static final void setSmsFilterSettings(android.content.Context, android.telecom.PhoneAccountHandle, android.telephony.VisualVoicemailSmsFilterSettings);
+ }
+
+}
+
+package android.telephony.cdma {
+
+ public final class CdmaSmsCbProgramData implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getCategory();
+ method public int getOperation();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY = 4099; // 0x1003
+ field public static final int CATEGORY_CMAS_EXTREME_THREAT = 4097; // 0x1001
+ field public static final int CATEGORY_CMAS_LAST_RESERVED_VALUE = 4351; // 0x10ff
+ field public static final int CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT = 4096; // 0x1000
+ field public static final int CATEGORY_CMAS_SEVERE_THREAT = 4098; // 0x1002
+ field public static final int CATEGORY_CMAS_TEST_MESSAGE = 4100; // 0x1004
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.cdma.CdmaSmsCbProgramData> CREATOR;
+ field public static final int OPERATION_ADD_CATEGORY = 1; // 0x1
+ field public static final int OPERATION_CLEAR_CATEGORIES = 2; // 0x2
+ field public static final int OPERATION_DELETE_CATEGORY = 0; // 0x0
+ }
+
+}
+
+package android.telephony.data {
+
+ public final class DataCallResponse implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public java.util.List<android.net.LinkAddress> getAddresses();
+ method public int getCause();
+ method @NonNull public java.util.List<java.net.InetAddress> getDnsAddresses();
+ method @NonNull public java.util.List<java.net.InetAddress> getGatewayAddresses();
+ method public int getHandoverFailureMode();
+ method public int getId();
+ method @NonNull public String getInterfaceName();
+ method public int getLinkStatus();
+ method @Deprecated public int getMtu();
+ method public int getMtuV4();
+ method public int getMtuV6();
+ method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
+ method public int getProtocolType();
+ method public int getSuggestedRetryTime();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
+ field public static final int HANDOVER_FAILURE_MODE_DO_FALLBACK = 1; // 0x1
+ field public static final int HANDOVER_FAILURE_MODE_LEGACY = 0; // 0x0
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_HANDOVER = 2; // 0x2
+ field public static final int HANDOVER_FAILURE_MODE_NO_FALLBACK_RETRY_SETUP_NORMAL = 3; // 0x3
+ field public static final int HANDOVER_FAILURE_MODE_UNKNOWN = -1; // 0xffffffff
+ field public static final int LINK_STATUS_ACTIVE = 2; // 0x2
+ field public static final int LINK_STATUS_DORMANT = 1; // 0x1
+ field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
+ field public static final int LINK_STATUS_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public static final class DataCallResponse.Builder {
+ ctor public DataCallResponse.Builder();
+ method @NonNull public android.telephony.data.DataCallResponse build();
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setAddresses(@NonNull java.util.List<android.net.LinkAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setCause(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setDnsAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setGatewayAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setHandoverFailureMode(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setId(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setInterfaceName(@NonNull String);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setLinkStatus(int);
+ method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setMtu(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV4(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
+ method @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
+ }
+
+ public final class DataProfile implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public String getApn();
+ method public int getAuthType();
+ method public int getBearerBitmask();
+ method @Deprecated public int getMtu();
+ method public int getMtuV4();
+ method public int getMtuV6();
+ method @Nullable public String getPassword();
+ method public int getProfileId();
+ method public int getProtocolType();
+ method public int getRoamingProtocolType();
+ method public int getSupportedApnTypesBitmask();
+ method public int getType();
+ method @Nullable public String getUserName();
+ method public boolean isEnabled();
+ method public boolean isPersistent();
+ method public boolean isPreferred();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataProfile> CREATOR;
+ field public static final int TYPE_3GPP = 1; // 0x1
+ field public static final int TYPE_3GPP2 = 2; // 0x2
+ field public static final int TYPE_COMMON = 0; // 0x0
+ }
+
+ public static final class DataProfile.Builder {
+ ctor public DataProfile.Builder();
+ method @NonNull public android.telephony.data.DataProfile build();
+ method @NonNull public android.telephony.data.DataProfile.Builder enable(boolean);
+ method @NonNull public android.telephony.data.DataProfile.Builder setApn(@NonNull String);
+ method @NonNull public android.telephony.data.DataProfile.Builder setAuthType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setBearerBitmask(int);
+ method @Deprecated @NonNull public android.telephony.data.DataProfile.Builder setMtu(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setMtuV4(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setMtuV6(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setPassword(@NonNull String);
+ method @NonNull public android.telephony.data.DataProfile.Builder setPersistent(boolean);
+ method @NonNull public android.telephony.data.DataProfile.Builder setPreferred(boolean);
+ method @NonNull public android.telephony.data.DataProfile.Builder setProfileId(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setProtocolType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setRoamingProtocolType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setSupportedApnTypesBitmask(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setType(int);
+ method @NonNull public android.telephony.data.DataProfile.Builder setUserName(@NonNull String);
+ }
+
+ public abstract class DataService extends android.app.Service {
+ ctor public DataService();
+ method public android.os.IBinder onBind(android.content.Intent);
+ method @Nullable public abstract android.telephony.data.DataService.DataServiceProvider onCreateDataServiceProvider(int);
+ field public static final int REQUEST_REASON_HANDOVER = 3; // 0x3
+ field public static final int REQUEST_REASON_NORMAL = 1; // 0x1
+ field public static final int REQUEST_REASON_SHUTDOWN = 2; // 0x2
+ field public static final int REQUEST_REASON_UNKNOWN = 0; // 0x0
+ field public static final String SERVICE_INTERFACE = "android.telephony.data.DataService";
+ }
+
+ public abstract class DataService.DataServiceProvider implements java.lang.AutoCloseable {
+ ctor public DataService.DataServiceProvider(int);
+ method public abstract void close();
+ method public void deactivateDataCall(int, int, @Nullable android.telephony.data.DataServiceCallback);
+ method public final int getSlotIndex();
+ method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
+ method public void requestDataCallList(@NonNull android.telephony.data.DataServiceCallback);
+ method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @NonNull android.telephony.data.DataServiceCallback);
+ method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @NonNull android.telephony.data.DataServiceCallback);
+ method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @NonNull android.telephony.data.DataServiceCallback);
+ }
+
+ public class DataServiceCallback {
+ method public void onDataCallListChanged(@NonNull java.util.List<android.telephony.data.DataCallResponse>);
+ method public void onDeactivateDataCallComplete(int);
+ method public void onRequestDataCallListComplete(int, @NonNull java.util.List<android.telephony.data.DataCallResponse>);
+ method public void onSetDataProfileComplete(int);
+ method public void onSetInitialAttachApnComplete(int);
+ method public void onSetupDataCallComplete(int, @Nullable android.telephony.data.DataCallResponse);
+ field public static final int RESULT_ERROR_BUSY = 3; // 0x3
+ field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
+ field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
+ field public static final int RESULT_ERROR_UNSUPPORTED = 1; // 0x1
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ public abstract class QualifiedNetworksService extends android.app.Service {
+ ctor public QualifiedNetworksService();
+ method @NonNull public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityProvider onCreateNetworkAvailabilityProvider(int);
+ field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService";
+ }
+
+ public abstract class QualifiedNetworksService.NetworkAvailabilityProvider implements java.lang.AutoCloseable {
+ ctor public QualifiedNetworksService.NetworkAvailabilityProvider(int);
+ method public abstract void close();
+ method public final int getSlotIndex();
+ method public final void updateQualifiedNetworkTypes(int, @NonNull java.util.List<java.lang.Integer>);
+ }
+
+}
+
+package android.telephony.euicc {
+
+ public final class DownloadableSubscription implements android.os.Parcelable {
+ method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
+ method @Nullable public String getCarrierName();
+ }
+
+ public static final class DownloadableSubscription.Builder {
+ ctor public DownloadableSubscription.Builder();
+ ctor public DownloadableSubscription.Builder(android.telephony.euicc.DownloadableSubscription);
+ method public android.telephony.euicc.DownloadableSubscription build();
+ method public android.telephony.euicc.DownloadableSubscription.Builder setAccessRules(java.util.List<android.telephony.UiccAccessRule>);
+ method public android.telephony.euicc.DownloadableSubscription.Builder setCarrierName(String);
+ method public android.telephony.euicc.DownloadableSubscription.Builder setConfirmationCode(String);
+ method public android.telephony.euicc.DownloadableSubscription.Builder setEncodedActivationCode(String);
+ }
+
+ public class EuiccCardManager {
+ method public void authenticateServer(String, String, byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void cancelSession(String, byte[], @android.telephony.euicc.EuiccCardManager.CancelReason int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void deleteProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void disableProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void listNotifications(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
+ method public void loadBoundProfilePackage(String, byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void prepareDownload(String, @Nullable byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void removeNotificationFromList(String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void requestAllProfiles(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo[]>);
+ method public void requestDefaultSmdpAddress(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
+ method public void requestEuiccChallenge(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void requestEuiccInfo1(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void requestEuiccInfo2(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
+ method public void requestProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
+ method public void requestRulesAuthTable(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccRulesAuthTable>);
+ method public void requestSmdsAddress(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
+ method public void resetMemory(String, @android.telephony.euicc.EuiccCardManager.ResetOption int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void retrieveNotification(String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification>);
+ method public void retrieveNotificationList(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
+ method public void setDefaultSmdpAddress(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void setNickname(String, String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
+ method public void switchToProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
+ field public static final int CANCEL_REASON_END_USER_REJECTED = 0; // 0x0
+ field public static final int CANCEL_REASON_POSTPONED = 1; // 0x1
+ field public static final int CANCEL_REASON_PPR_NOT_ALLOWED = 3; // 0x3
+ field public static final int CANCEL_REASON_TIMEOUT = 2; // 0x2
+ field public static final int RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES = 2; // 0x2
+ field public static final int RESET_OPTION_DELETE_OPERATIONAL_PROFILES = 1; // 0x1
+ field public static final int RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS = 4; // 0x4
+ field public static final int RESULT_CALLER_NOT_ALLOWED = -3; // 0xfffffffd
+ field public static final int RESULT_EUICC_NOT_FOUND = -2; // 0xfffffffe
+ field public static final int RESULT_OK = 0; // 0x0
+ field public static final int RESULT_UNKNOWN_ERROR = -1; // 0xffffffff
+ }
+
+ @IntDef(prefix={"CANCEL_REASON_"}, value={android.telephony.euicc.EuiccCardManager.CANCEL_REASON_END_USER_REJECTED, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_POSTPONED, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_TIMEOUT, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_PPR_NOT_ALLOWED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccCardManager.CancelReason {
+ }
+
+ @IntDef(flag=true, prefix={"RESET_OPTION_"}, value={android.telephony.euicc.EuiccCardManager.RESET_OPTION_DELETE_OPERATIONAL_PROFILES, android.telephony.euicc.EuiccCardManager.RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES, android.telephony.euicc.EuiccCardManager.RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccCardManager.ResetOption {
+ }
+
+ public static interface EuiccCardManager.ResultCallback<T> {
+ method public void onComplete(int, T);
+ }
+
+ public class EuiccManager {
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void continueOperation(android.content.Intent, android.os.Bundle);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(@NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(@android.telephony.euicc.EuiccCardManager.ResetOption int, @NonNull android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDefaultDownloadableSubscriptionList(android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDownloadableSubscriptionMetadata(android.telephony.euicc.DownloadableSubscription, android.app.PendingIntent);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public int getOtaStatus();
+ method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List<java.lang.String> getSupportedCountries();
+ method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List<java.lang.String> getUnsupportedCountries();
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public boolean isSupportedCountry(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setSupportedCountries(@NonNull java.util.List<java.lang.String>);
+ method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setUnsupportedCountries(@NonNull java.util.List<java.lang.String>);
+ field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
+ field @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public static final String ACTION_OTA_STATUS_CHANGED = "android.telephony.euicc.action.OTA_STATUS_CHANGED";
+ field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
+ field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
+ field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
+ field public static final int EUICC_ACTIVATION_TYPE_ACCOUNT_REQUIRED = 4; // 0x4
+ field public static final int EUICC_ACTIVATION_TYPE_BACKUP = 2; // 0x2
+ field public static final int EUICC_ACTIVATION_TYPE_DEFAULT = 1; // 0x1
+ field public static final int EUICC_ACTIVATION_TYPE_TRANSFER = 3; // 0x3
+ field public static final int EUICC_OTA_FAILED = 2; // 0x2
+ field public static final int EUICC_OTA_IN_PROGRESS = 1; // 0x1
+ field public static final int EUICC_OTA_NOT_NEEDED = 4; // 0x4
+ field public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5; // 0x5
+ field public static final int EUICC_OTA_SUCCEEDED = 3; // 0x3
+ field public static final String EXTRA_ACTIVATION_TYPE = "android.telephony.euicc.extra.ACTIVATION_TYPE";
+ field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
+ field public static final String EXTRA_ENABLE_SUBSCRIPTION = "android.telephony.euicc.extra.ENABLE_SUBSCRIPTION";
+ field public static final String EXTRA_FORCE_PROVISION = "android.telephony.euicc.extra.FORCE_PROVISION";
+ field public static final String EXTRA_FROM_SUBSCRIPTION_ID = "android.telephony.euicc.extra.FROM_SUBSCRIPTION_ID";
+ field public static final String EXTRA_PHYSICAL_SLOT_ID = "android.telephony.euicc.extra.PHYSICAL_SLOT_ID";
+ field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.euicc.extra.SUBSCRIPTION_ID";
+ field public static final String EXTRA_SUBSCRIPTION_NICKNAME = "android.telephony.euicc.extra.SUBSCRIPTION_NICKNAME";
+ }
+
+ @IntDef(prefix={"EUICC_OTA_"}, value={android.telephony.euicc.EuiccManager.EUICC_OTA_IN_PROGRESS, android.telephony.euicc.EuiccManager.EUICC_OTA_FAILED, android.telephony.euicc.EuiccManager.EUICC_OTA_SUCCEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_NOT_NEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_STATUS_UNAVAILABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccManager.OtaStatus {
+ }
+
+ public final class EuiccNotification implements android.os.Parcelable {
+ ctor public EuiccNotification(int, String, @android.telephony.euicc.EuiccNotification.Event int, @Nullable byte[]);
+ method public int describeContents();
+ method @Nullable public byte[] getData();
+ method @android.telephony.euicc.EuiccNotification.Event public int getEvent();
+ method public int getSeq();
+ method public String getTargetAddr();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @android.telephony.euicc.EuiccNotification.Event public static final int ALL_EVENTS = 15; // 0xf
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccNotification> CREATOR;
+ field public static final int EVENT_DELETE = 8; // 0x8
+ field public static final int EVENT_DISABLE = 4; // 0x4
+ field public static final int EVENT_ENABLE = 2; // 0x2
+ field public static final int EVENT_INSTALL = 1; // 0x1
+ }
+
+ @IntDef(flag=true, prefix={"EVENT_"}, value={android.telephony.euicc.EuiccNotification.EVENT_INSTALL, android.telephony.euicc.EuiccNotification.EVENT_ENABLE, android.telephony.euicc.EuiccNotification.EVENT_DISABLE, android.telephony.euicc.EuiccNotification.EVENT_DELETE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccNotification.Event {
+ }
+
+ public final class EuiccRulesAuthTable implements android.os.Parcelable {
+ method public int describeContents();
+ method public int findIndex(@android.service.euicc.EuiccProfileInfo.PolicyRule int, android.service.carrier.CarrierIdentifier);
+ method public boolean hasPolicyRuleFlag(int, @android.telephony.euicc.EuiccRulesAuthTable.PolicyRuleFlag int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccRulesAuthTable> CREATOR;
+ field public static final int POLICY_RULE_FLAG_CONSENT_REQUIRED = 1; // 0x1
+ }
+
+ public static final class EuiccRulesAuthTable.Builder {
+ ctor public EuiccRulesAuthTable.Builder(int);
+ method public android.telephony.euicc.EuiccRulesAuthTable.Builder add(int, java.util.List<android.service.carrier.CarrierIdentifier>, int);
+ method public android.telephony.euicc.EuiccRulesAuthTable build();
+ }
+
+ @IntDef(flag=true, prefix={"POLICY_RULE_FLAG_"}, value={android.telephony.euicc.EuiccRulesAuthTable.POLICY_RULE_FLAG_CONSENT_REQUIRED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccRulesAuthTable.PolicyRuleFlag {
+ }
+
+}
+
+package android.telephony.ims {
+
+ public final class ImsCallForwardInfo implements android.os.Parcelable {
+ ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
+ method public int describeContents();
+ method public int getCondition();
+ method public String getNumber();
+ method public int getServiceClass();
+ method public int getStatus();
+ method public int getTimeSeconds();
+ method public int getToA();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CDIV_CF_REASON_ALL = 4; // 0x4
+ field public static final int CDIV_CF_REASON_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int CDIV_CF_REASON_BUSY = 1; // 0x1
+ field public static final int CDIV_CF_REASON_NOT_LOGGED_IN = 6; // 0x6
+ field public static final int CDIV_CF_REASON_NOT_REACHABLE = 3; // 0x3
+ field public static final int CDIV_CF_REASON_NO_REPLY = 2; // 0x2
+ field public static final int CDIV_CF_REASON_UNCONDITIONAL = 0; // 0x0
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallForwardInfo> CREATOR;
+ field public static final int STATUS_ACTIVE = 1; // 0x1
+ field public static final int STATUS_NOT_ACTIVE = 0; // 0x0
+ field public static final int TYPE_OF_ADDRESS_INTERNATIONAL = 145; // 0x91
+ field public static final int TYPE_OF_ADDRESS_UNKNOWN = 129; // 0x81
+ }
+
+ public final class ImsCallProfile implements android.os.Parcelable {
+ ctor public ImsCallProfile();
+ ctor public ImsCallProfile(int, int);
+ ctor public ImsCallProfile(int, int, android.os.Bundle, android.telephony.ims.ImsStreamMediaProfile);
+ method public int describeContents();
+ method public String getCallExtra(String);
+ method public String getCallExtra(String, String);
+ method public boolean getCallExtraBoolean(String);
+ method public boolean getCallExtraBoolean(String, boolean);
+ method public int getCallExtraInt(String);
+ method public int getCallExtraInt(String, int);
+ method public android.os.Bundle getCallExtras();
+ method public int getCallType();
+ method public static int getCallTypeFromVideoState(int);
+ method public int getCallerNumberVerificationStatus();
+ method public int getEmergencyCallRouting();
+ method public int getEmergencyServiceCategories();
+ method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
+ method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile();
+ method @NonNull public android.os.Bundle getProprietaryCallExtras();
+ method public int getRestrictCause();
+ method public int getServiceType();
+ method public static int getVideoStateFromCallType(int);
+ method public static int getVideoStateFromImsCallProfile(android.telephony.ims.ImsCallProfile);
+ method public boolean hasKnownUserIntentEmergency();
+ method public boolean isEmergencyCallTesting();
+ method public boolean isVideoCall();
+ method public boolean isVideoPaused();
+ method public static int presentationToOir(int);
+ method public void setCallExtra(String, String);
+ method public void setCallExtraBoolean(String, boolean);
+ method public void setCallExtraInt(String, int);
+ method public void setCallRestrictCause(int);
+ method public void setCallerNumberVerificationStatus(int);
+ method public void setEmergencyCallRouting(int);
+ method public void setEmergencyCallTesting(boolean);
+ method public void setEmergencyServiceCategories(int);
+ method public void setEmergencyUrns(@NonNull java.util.List<java.lang.String>);
+ method public void setHasKnownUserIntentEmergency(boolean);
+ method public void updateCallExtras(android.telephony.ims.ImsCallProfile);
+ method public void updateCallType(android.telephony.ims.ImsCallProfile);
+ method public void updateMediaProfile(android.telephony.ims.ImsCallProfile);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALL_RESTRICT_CAUSE_DISABLED = 2; // 0x2
+ field public static final int CALL_RESTRICT_CAUSE_HD = 3; // 0x3
+ field public static final int CALL_RESTRICT_CAUSE_NONE = 0; // 0x0
+ field public static final int CALL_RESTRICT_CAUSE_RAT = 1; // 0x1
+ field public static final int CALL_TYPE_VIDEO_N_VOICE = 3; // 0x3
+ field public static final int CALL_TYPE_VOICE = 2; // 0x2
+ field public static final int CALL_TYPE_VOICE_N_VIDEO = 1; // 0x1
+ field public static final int CALL_TYPE_VS = 8; // 0x8
+ field public static final int CALL_TYPE_VS_RX = 10; // 0xa
+ field public static final int CALL_TYPE_VS_TX = 9; // 0x9
+ field public static final int CALL_TYPE_VT = 4; // 0x4
+ field public static final int CALL_TYPE_VT_NODIR = 7; // 0x7
+ field public static final int CALL_TYPE_VT_RX = 6; // 0x6
+ field public static final int CALL_TYPE_VT_TX = 5; // 0x5
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallProfile> CREATOR;
+ field public static final int DIALSTRING_NORMAL = 0; // 0x0
+ field public static final int DIALSTRING_SS_CONF = 1; // 0x1
+ field public static final int DIALSTRING_USSD = 2; // 0x2
+ field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo";
+ field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS";
+ field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE";
+ field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE";
+ field @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech";
+ field public static final String EXTRA_CHILD_NUMBER = "ChildNum";
+ field public static final String EXTRA_CNA = "cna";
+ field public static final String EXTRA_CNAP = "cnap";
+ field public static final String EXTRA_CODEC = "Codec";
+ field public static final String EXTRA_DIALSTRING = "dialstring";
+ field public static final String EXTRA_DISPLAY_TEXT = "DisplayText";
+ field public static final String EXTRA_EMERGENCY_CALL = "e_call";
+ field public static final String EXTRA_FORWARDED_NUMBER = "android.telephony.ims.extra.FORWARDED_NUMBER";
+ field public static final String EXTRA_IS_CALL_PULL = "CallPull";
+ field public static final String EXTRA_OI = "oi";
+ field public static final String EXTRA_OIR = "oir";
+ field public static final String EXTRA_REMOTE_URI = "remote_uri";
+ field public static final String EXTRA_USSD = "ussd";
+ field public static final int OIR_DEFAULT = 0; // 0x0
+ field public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2; // 0x2
+ field public static final int OIR_PRESENTATION_PAYPHONE = 4; // 0x4
+ field public static final int OIR_PRESENTATION_RESTRICTED = 1; // 0x1
+ field public static final int OIR_PRESENTATION_UNKNOWN = 3; // 0x3
+ field public static final int SERVICE_TYPE_EMERGENCY = 2; // 0x2
+ field public static final int SERVICE_TYPE_NONE = 0; // 0x0
+ field public static final int SERVICE_TYPE_NORMAL = 1; // 0x1
+ field public static final int VERIFICATION_STATUS_FAILED = 2; // 0x2
+ field public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0; // 0x0
+ field public static final int VERIFICATION_STATUS_PASSED = 1; // 0x1
+ }
+
+ public class ImsCallSessionListener {
+ method public void callQualityChanged(@NonNull android.telephony.CallQuality);
+ method public void callSessionConferenceExtendFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionConferenceExtendReceived(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
+ method public void callSessionConferenceExtended(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
+ method public void callSessionConferenceStateUpdated(android.telephony.ims.ImsConferenceState);
+ method @Deprecated public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo);
+ method @Deprecated public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo);
+ method public void callSessionHeld(android.telephony.ims.ImsCallProfile);
+ method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionInitiated(android.telephony.ims.ImsCallProfile);
+ method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionInviteParticipantsRequestDelivered();
+ method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
+ method @Deprecated public void callSessionMayHandover(int, int);
+ method public void callSessionMergeComplete(android.telephony.ims.stub.ImsCallSessionImplBase);
+ method public void callSessionMergeFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionMergeStarted(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
+ method public void callSessionMultipartyStateChanged(boolean);
+ method public void callSessionProgressing(android.telephony.ims.ImsStreamMediaProfile);
+ method public void callSessionRemoveParticipantsRequestDelivered();
+ method public void callSessionRemoveParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionResumeFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionResumeReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionResumed(android.telephony.ims.ImsCallProfile);
+ method public void callSessionRttAudioIndicatorChanged(@NonNull android.telephony.ims.ImsStreamMediaProfile);
+ method public void callSessionRttMessageReceived(String);
+ method public void callSessionRttModifyRequestReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionRttModifyResponseReceived(int);
+ method public void callSessionSuppServiceReceived(android.telephony.ims.ImsSuppServiceNotification);
+ method public void callSessionTerminated(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionTtyModeReceived(int);
+ method public void callSessionUpdateFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionUpdateReceived(android.telephony.ims.ImsCallProfile);
+ method public void callSessionUpdated(android.telephony.ims.ImsCallProfile);
+ method public void callSessionUssdMessageReceived(int, String);
+ method public void onHandover(int, int, @Nullable android.telephony.ims.ImsReasonInfo);
+ method public void onHandoverFailed(int, int, @NonNull android.telephony.ims.ImsReasonInfo);
+ method public void onMayHandover(int, int);
+ }
+
+ public final class ImsConferenceState implements android.os.Parcelable {
+ method public int describeContents();
+ method public static int getConnectionStateForStatus(String);
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsConferenceState> CREATOR;
+ field public static final String DISPLAY_TEXT = "display-text";
+ field public static final String ENDPOINT = "endpoint";
+ field public static final String SIP_STATUS_CODE = "sipstatuscode";
+ field public static final String STATUS = "status";
+ field public static final String STATUS_ALERTING = "alerting";
+ field public static final String STATUS_CONNECTED = "connected";
+ field public static final String STATUS_CONNECT_FAIL = "connect-fail";
+ field public static final String STATUS_DIALING_IN = "dialing-in";
+ field public static final String STATUS_DIALING_OUT = "dialing-out";
+ field public static final String STATUS_DISCONNECTED = "disconnected";
+ field public static final String STATUS_DISCONNECTING = "disconnecting";
+ field public static final String STATUS_MUTED_VIA_FOCUS = "muted-via-focus";
+ field public static final String STATUS_ON_HOLD = "on-hold";
+ field public static final String STATUS_PENDING = "pending";
+ field public static final String STATUS_SEND_ONLY = "sendonly";
+ field public static final String STATUS_SEND_RECV = "sendrecv";
+ field public static final String USER = "user";
+ field public final java.util.HashMap<java.lang.String,android.os.Bundle> mParticipants;
+ }
+
+ public final class ImsException extends java.lang.Exception {
+ ctor public ImsException(@Nullable String);
+ ctor public ImsException(@Nullable String, int);
+ ctor public ImsException(@Nullable String, int, @Nullable Throwable);
+ }
+
+ public final class ImsExternalCallState implements android.os.Parcelable {
+ ctor public ImsExternalCallState(@NonNull String, @NonNull android.net.Uri, @Nullable android.net.Uri, boolean, int, int, boolean);
+ method public int describeContents();
+ method @NonNull public android.net.Uri getAddress();
+ method public int getCallId();
+ method public int getCallState();
+ method public int getCallType();
+ method @Nullable public android.net.Uri getLocalAddress();
+ method public boolean isCallHeld();
+ method public boolean isCallPullable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALL_STATE_CONFIRMED = 1; // 0x1
+ field public static final int CALL_STATE_TERMINATED = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsExternalCallState> CREATOR;
+ }
+
+ public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
+ method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getFeatureState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getRegistrationState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAvailable(int, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCapable(int, int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void isSupported(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>) throws android.telephony.ims.ImsException;
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRttCapabilitySetting(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiModeSetting(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiNonPersistent(boolean, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingModeSetting(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSettingEnabled(boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSettingEnabled(boolean);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback);
+ }
+
+ @Deprecated public static class ImsMmTelManager.RegistrationCallback extends android.telephony.ims.RegistrationManager.RegistrationCallback {
+ ctor @Deprecated public ImsMmTelManager.RegistrationCallback();
+ }
+
+ public final class ImsReasonInfo implements android.os.Parcelable {
+ field public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED = "Forbidden. Not Authorized for Service";
+ }
+
+ public class ImsService extends android.app.Service {
+ ctor public ImsService();
+ method public android.telephony.ims.feature.MmTelFeature createMmTelFeature(int);
+ method public android.telephony.ims.feature.RcsFeature createRcsFeature(int);
+ method public void disableIms(int);
+ method public void enableIms(int);
+ method public android.telephony.ims.stub.ImsConfigImplBase getConfig(int);
+ method public android.telephony.ims.stub.ImsRegistrationImplBase getRegistration(int);
+ method public final void onUpdateSupportedImsFeatures(android.telephony.ims.stub.ImsFeatureConfiguration) throws android.os.RemoteException;
+ method public android.telephony.ims.stub.ImsFeatureConfiguration querySupportedImsFeatures();
+ method public void readyForFeatureCreation();
+ }
+
+ public final class ImsSsData implements android.os.Parcelable {
+ ctor public ImsSsData(int, int, int, int, int);
+ method public int describeContents();
+ method @Nullable public java.util.List<android.telephony.ims.ImsCallForwardInfo> getCallForwardInfo();
+ method public int getRequestType();
+ method public int getResult();
+ method public int getServiceClass();
+ method public int getServiceType();
+ method @NonNull public java.util.List<android.telephony.ims.ImsSsInfo> getSuppServiceInfo();
+ method public int getTeleserviceType();
+ method public boolean isTypeBarring();
+ method public boolean isTypeCf();
+ method public boolean isTypeClip();
+ method public boolean isTypeClir();
+ method public boolean isTypeColp();
+ method public boolean isTypeColr();
+ method public boolean isTypeCw();
+ method public boolean isTypeIcb();
+ method public boolean isTypeInterrogation();
+ method public boolean isTypeUnConditional();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsData> CREATOR;
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final int SERVICE_CLASS_DATA = 2; // 0x2
+ field public static final int SERVICE_CLASS_DATA_CIRCUIT_ASYNC = 32; // 0x20
+ field public static final int SERVICE_CLASS_DATA_CIRCUIT_SYNC = 16; // 0x10
+ field public static final int SERVICE_CLASS_DATA_PACKET_ACCESS = 64; // 0x40
+ field public static final int SERVICE_CLASS_DATA_PAD = 128; // 0x80
+ field public static final int SERVICE_CLASS_FAX = 4; // 0x4
+ field public static final int SERVICE_CLASS_NONE = 0; // 0x0
+ field public static final int SERVICE_CLASS_SMS = 8; // 0x8
+ field public static final int SERVICE_CLASS_VOICE = 1; // 0x1
+ field public static final int SS_ACTIVATION = 0; // 0x0
+ field public static final int SS_ALL_BARRING = 18; // 0x12
+ field public static final int SS_ALL_DATA_TELESERVICES = 3; // 0x3
+ field public static final int SS_ALL_TELESERVICES_EXCEPT_SMS = 5; // 0x5
+ field public static final int SS_ALL_TELESEVICES = 1; // 0x1
+ field public static final int SS_ALL_TELE_AND_BEARER_SERVICES = 0; // 0x0
+ field public static final int SS_BAIC = 16; // 0x10
+ field public static final int SS_BAIC_ROAMING = 17; // 0x11
+ field public static final int SS_BAOC = 13; // 0xd
+ field public static final int SS_BAOIC = 14; // 0xe
+ field public static final int SS_BAOIC_EXC_HOME = 15; // 0xf
+ field public static final int SS_CFU = 0; // 0x0
+ field public static final int SS_CFUT = 6; // 0x6
+ field public static final int SS_CF_ALL = 4; // 0x4
+ field public static final int SS_CF_ALL_CONDITIONAL = 5; // 0x5
+ field public static final int SS_CF_BUSY = 1; // 0x1
+ field public static final int SS_CF_NOT_REACHABLE = 3; // 0x3
+ field public static final int SS_CF_NO_REPLY = 2; // 0x2
+ field public static final int SS_CLIP = 7; // 0x7
+ field public static final int SS_CLIR = 8; // 0x8
+ field public static final int SS_CNAP = 11; // 0xb
+ field public static final int SS_COLP = 9; // 0x9
+ field public static final int SS_COLR = 10; // 0xa
+ field public static final int SS_DEACTIVATION = 1; // 0x1
+ field public static final int SS_ERASURE = 4; // 0x4
+ field public static final int SS_INCOMING_BARRING = 20; // 0x14
+ field public static final int SS_INCOMING_BARRING_ANONYMOUS = 22; // 0x16
+ field public static final int SS_INCOMING_BARRING_DN = 21; // 0x15
+ field public static final int SS_INTERROGATION = 2; // 0x2
+ field public static final int SS_OUTGOING_BARRING = 19; // 0x13
+ field public static final int SS_REGISTRATION = 3; // 0x3
+ field public static final int SS_SMS_SERVICES = 4; // 0x4
+ field public static final int SS_TELEPHONY = 2; // 0x2
+ field public static final int SS_WAIT = 12; // 0xc
+ }
+
+ public static final class ImsSsData.Builder {
+ ctor public ImsSsData.Builder(int, int, int, int, int);
+ method @NonNull public android.telephony.ims.ImsSsData build();
+ method @NonNull public android.telephony.ims.ImsSsData.Builder setCallForwardingInfo(@NonNull java.util.List<android.telephony.ims.ImsCallForwardInfo>);
+ method @NonNull public android.telephony.ims.ImsSsData.Builder setSuppServiceInfo(@NonNull java.util.List<android.telephony.ims.ImsSsInfo>);
+ }
+
+ public final class ImsSsInfo implements android.os.Parcelable {
+ ctor @Deprecated public ImsSsInfo(int, @Nullable String);
+ method public int describeContents();
+ method public int getClirInterrogationStatus();
+ method public int getClirOutgoingState();
+ method @Deprecated public String getIcbNum();
+ method @Nullable public String getIncomingCommunicationBarringNumber();
+ method public int getProvisionStatus();
+ method public int getStatus();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CLIR_OUTGOING_DEFAULT = 0; // 0x0
+ field public static final int CLIR_OUTGOING_INVOCATION = 1; // 0x1
+ field public static final int CLIR_OUTGOING_SUPPRESSION = 2; // 0x2
+ field public static final int CLIR_STATUS_NOT_PROVISIONED = 0; // 0x0
+ field public static final int CLIR_STATUS_PROVISIONED_PERMANENT = 1; // 0x1
+ field public static final int CLIR_STATUS_TEMPORARILY_ALLOWED = 4; // 0x4
+ field public static final int CLIR_STATUS_TEMPORARILY_RESTRICTED = 3; // 0x3
+ field public static final int CLIR_STATUS_UNKNOWN = 2; // 0x2
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsInfo> CREATOR;
+ field public static final int DISABLED = 0; // 0x0
+ field public static final int ENABLED = 1; // 0x1
+ field public static final int NOT_REGISTERED = -1; // 0xffffffff
+ field public static final int SERVICE_NOT_PROVISIONED = 0; // 0x0
+ field public static final int SERVICE_PROVISIONED = 1; // 0x1
+ field public static final int SERVICE_PROVISIONING_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public static final class ImsSsInfo.Builder {
+ ctor public ImsSsInfo.Builder(int);
+ method @NonNull public android.telephony.ims.ImsSsInfo build();
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirInterrogationStatus(int);
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirOutgoingState(int);
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setIncomingCommunicationBarringNumber(@NonNull String);
+ method @NonNull public android.telephony.ims.ImsSsInfo.Builder setProvisionStatus(int);
+ }
+
+ public final class ImsStreamMediaProfile implements android.os.Parcelable {
+ ctor public ImsStreamMediaProfile(int, int, int, int, int);
+ method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
+ method public int describeContents();
+ method public int getAudioDirection();
+ method public int getAudioQuality();
+ method public int getRttMode();
+ method public int getVideoDirection();
+ method public int getVideoQuality();
+ method public boolean isReceivingRttAudio();
+ method public boolean isRttCall();
+ method public void setReceivingRttAudio(boolean);
+ method public void setRttMode(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final int AUDIO_QUALITY_AMR = 1; // 0x1
+ field public static final int AUDIO_QUALITY_AMR_WB = 2; // 0x2
+ field public static final int AUDIO_QUALITY_EVRC = 4; // 0x4
+ field public static final int AUDIO_QUALITY_EVRC_B = 5; // 0x5
+ field public static final int AUDIO_QUALITY_EVRC_NW = 7; // 0x7
+ field public static final int AUDIO_QUALITY_EVRC_WB = 6; // 0x6
+ field public static final int AUDIO_QUALITY_EVS_FB = 20; // 0x14
+ field public static final int AUDIO_QUALITY_EVS_NB = 17; // 0x11
+ field public static final int AUDIO_QUALITY_EVS_SWB = 19; // 0x13
+ field public static final int AUDIO_QUALITY_EVS_WB = 18; // 0x12
+ field public static final int AUDIO_QUALITY_G711A = 13; // 0xd
+ field public static final int AUDIO_QUALITY_G711AB = 15; // 0xf
+ field public static final int AUDIO_QUALITY_G711U = 11; // 0xb
+ field public static final int AUDIO_QUALITY_G722 = 14; // 0xe
+ field public static final int AUDIO_QUALITY_G723 = 12; // 0xc
+ field public static final int AUDIO_QUALITY_G729 = 16; // 0x10
+ field public static final int AUDIO_QUALITY_GSM_EFR = 8; // 0x8
+ field public static final int AUDIO_QUALITY_GSM_FR = 9; // 0x9
+ field public static final int AUDIO_QUALITY_GSM_HR = 10; // 0xa
+ field public static final int AUDIO_QUALITY_NONE = 0; // 0x0
+ field public static final int AUDIO_QUALITY_QCELP13K = 3; // 0x3
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsStreamMediaProfile> CREATOR;
+ field public static final int DIRECTION_INACTIVE = 0; // 0x0
+ field public static final int DIRECTION_INVALID = -1; // 0xffffffff
+ field public static final int DIRECTION_RECEIVE = 1; // 0x1
+ field public static final int DIRECTION_SEND = 2; // 0x2
+ field public static final int DIRECTION_SEND_RECEIVE = 3; // 0x3
+ field public static final int RTT_MODE_DISABLED = 0; // 0x0
+ field public static final int RTT_MODE_FULL = 1; // 0x1
+ field public static final int VIDEO_QUALITY_NONE = 0; // 0x0
+ field public static final int VIDEO_QUALITY_QCIF = 1; // 0x1
+ field public static final int VIDEO_QUALITY_QVGA_LANDSCAPE = 2; // 0x2
+ field public static final int VIDEO_QUALITY_QVGA_PORTRAIT = 4; // 0x4
+ field public static final int VIDEO_QUALITY_VGA_LANDSCAPE = 8; // 0x8
+ field public static final int VIDEO_QUALITY_VGA_PORTRAIT = 16; // 0x10
+ }
+
+ public final class ImsSuppServiceNotification implements android.os.Parcelable {
+ ctor public ImsSuppServiceNotification(int, int, int, int, String, String[]);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSuppServiceNotification> CREATOR;
+ field public final int code;
+ field public final String[] history;
+ field public final int index;
+ field public final int notificationType;
+ field public final String number;
+ field public final int type;
+ }
+
+ public class ImsUtListener {
+ method public void onLineIdentificationSupplementaryServiceResponse(int, @NonNull android.telephony.ims.ImsSsInfo);
+ method public void onSupplementaryServiceIndication(android.telephony.ims.ImsSsData);
+ method public void onUtConfigurationCallBarringQueried(int, android.telephony.ims.ImsSsInfo[]);
+ method public void onUtConfigurationCallForwardQueried(int, android.telephony.ims.ImsCallForwardInfo[]);
+ method public void onUtConfigurationCallWaitingQueried(int, android.telephony.ims.ImsSsInfo[]);
+ method @Deprecated public void onUtConfigurationQueried(int, android.os.Bundle);
+ method public void onUtConfigurationQueryFailed(int, android.telephony.ims.ImsReasonInfo);
+ method public void onUtConfigurationUpdateFailed(int, android.telephony.ims.ImsReasonInfo);
+ method public void onUtConfigurationUpdated(int);
+ field @Deprecated public static final String BUNDLE_KEY_CLIR = "queryClir";
+ field @Deprecated public static final String BUNDLE_KEY_SSINFO = "imsSsInfo";
+ }
+
+ public abstract class ImsVideoCallProvider {
+ ctor public ImsVideoCallProvider();
+ method public void changeCallDataUsage(long);
+ method public void changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities);
+ method public void changePeerDimensions(int, int);
+ method public void changeVideoQuality(int);
+ method public void handleCallSessionEvent(int);
+ method public abstract void onRequestCallDataUsage();
+ method public abstract void onRequestCameraCapabilities();
+ method public abstract void onSendSessionModifyRequest(android.telecom.VideoProfile, android.telecom.VideoProfile);
+ method public abstract void onSendSessionModifyResponse(android.telecom.VideoProfile);
+ method public abstract void onSetCamera(String);
+ method public void onSetCamera(String, int);
+ method public abstract void onSetDeviceOrientation(int);
+ method public abstract void onSetDisplaySurface(android.view.Surface);
+ method public abstract void onSetPauseImage(android.net.Uri);
+ method public abstract void onSetPreviewSurface(android.view.Surface);
+ method public abstract void onSetZoom(float);
+ method public void receiveSessionModifyRequest(android.telecom.VideoProfile);
+ method public void receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile);
+ }
+
+ public class ProvisioningManager {
+ method @NonNull public static android.telephony.ims.ProvisioningManager createForSubscriptionId(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public int getProvisioningIntValue(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean getProvisioningStatusForCapability(int, int);
+ method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public String getProvisioningStringValue(int);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean getRcsProvisioningStatusForCapability(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerProvisioningChangedCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ProvisioningManager.Callback) throws android.telephony.ims.ImsException;
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningIntValue(int, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void setProvisioningStatusForCapability(int, int, boolean);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningStringValue(int, @NonNull String);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void setRcsProvisioningStatusForCapability(int, boolean);
+ method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterProvisioningChangedCallback(@NonNull android.telephony.ims.ProvisioningManager.Callback);
+ field public static final int KEY_VOICE_OVER_WIFI_ENTITLEMENT_ID = 67; // 0x43
+ field public static final int KEY_VOICE_OVER_WIFI_MODE_OVERRIDE = 27; // 0x1b
+ field public static final int KEY_VOICE_OVER_WIFI_ROAMING_ENABLED_OVERRIDE = 26; // 0x1a
+ field public static final int PROVISIONING_VALUE_DISABLED = 0; // 0x0
+ field public static final int PROVISIONING_VALUE_ENABLED = 1; // 0x1
+ field public static final String STRING_QUERY_RESULT_ERROR_GENERIC = "STRING_QUERY_RESULT_ERROR_GENERIC";
+ field public static final String STRING_QUERY_RESULT_ERROR_NOT_READY = "STRING_QUERY_RESULT_ERROR_NOT_READY";
+ }
+
+ public static class ProvisioningManager.Callback {
+ ctor public ProvisioningManager.Callback();
+ method public void onProvisioningIntChanged(int, int);
+ method public void onProvisioningStringChanged(int, @NonNull String);
+ }
+
+ public class RcsUceAdapter {
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
+ }
+
+}
+
+package android.telephony.ims.feature {
+
+ public final class CapabilityChangeRequest implements android.os.Parcelable {
+ method public void addCapabilitiesToDisableForTech(int, int);
+ method public void addCapabilitiesToEnableForTech(int, int);
+ method public int describeContents();
+ method public java.util.List<android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair> getCapabilitiesToDisable();
+ method public java.util.List<android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair> getCapabilitiesToEnable();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.feature.CapabilityChangeRequest> CREATOR;
+ }
+
+ public static class CapabilityChangeRequest.CapabilityPair {
+ ctor public CapabilityChangeRequest.CapabilityPair(int, int);
+ method public int getCapability();
+ method public int getRadioTech();
+ }
+
+ public abstract class ImsFeature {
+ ctor public ImsFeature();
+ method public abstract void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method public int getFeatureState();
+ method public final int getSlotIndex();
+ method public abstract void onFeatureReady();
+ method public abstract void onFeatureRemoved();
+ method public final void setFeatureState(int);
+ field public static final int CAPABILITY_ERROR_GENERIC = -1; // 0xffffffff
+ field public static final int CAPABILITY_SUCCESS = 0; // 0x0
+ field public static final int FEATURE_EMERGENCY_MMTEL = 0; // 0x0
+ field public static final int FEATURE_MMTEL = 1; // 0x1
+ field public static final int FEATURE_RCS = 2; // 0x2
+ field public static final int STATE_INITIALIZING = 1; // 0x1
+ field public static final int STATE_READY = 2; // 0x2
+ field public static final int STATE_UNAVAILABLE = 0; // 0x0
+ }
+
+ @Deprecated public static class ImsFeature.Capabilities {
+ field @Deprecated protected int mCapabilities;
+ }
+
+ protected static class ImsFeature.CapabilityCallbackProxy {
+ method public void onChangeCapabilityConfigurationError(int, int, int);
+ }
+
+ public class MmTelFeature extends android.telephony.ims.feature.ImsFeature {
+ ctor public MmTelFeature();
+ method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method @Nullable public android.telephony.ims.ImsCallProfile createCallProfile(int, int);
+ method @Nullable public android.telephony.ims.stub.ImsCallSessionImplBase createCallSession(@NonNull android.telephony.ims.ImsCallProfile);
+ method @NonNull public android.telephony.ims.stub.ImsEcbmImplBase getEcbm();
+ method @NonNull public android.telephony.ims.stub.ImsMultiEndpointImplBase getMultiEndpoint();
+ method @NonNull public android.telephony.ims.stub.ImsSmsImplBase getSmsImplementation();
+ method @NonNull public android.telephony.ims.stub.ImsUtImplBase getUt();
+ method public final void notifyCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
+ method public final void notifyIncomingCall(@NonNull android.telephony.ims.stub.ImsCallSessionImplBase, @NonNull android.os.Bundle);
+ method public final void notifyRejectedCall(@NonNull android.telephony.ims.ImsCallProfile, @NonNull android.telephony.ims.ImsReasonInfo);
+ method public final void notifyVoiceMessageCountUpdate(int);
+ method public void onFeatureReady();
+ method public void onFeatureRemoved();
+ method public boolean queryCapabilityConfiguration(int, int);
+ method @NonNull public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus();
+ method public void setUiTtyMode(int, @Nullable android.os.Message);
+ method public int shouldProcessCall(@NonNull String[]);
+ field public static final String EXTRA_IS_UNKNOWN_CALL = "android.telephony.ims.feature.extra.IS_UNKNOWN_CALL";
+ field public static final String EXTRA_IS_USSD = "android.telephony.ims.feature.extra.IS_USSD";
+ field public static final int PROCESS_CALL_CSFB = 1; // 0x1
+ field public static final int PROCESS_CALL_IMS = 0; // 0x0
+ }
+
+ public static class MmTelFeature.MmTelCapabilities extends android.telephony.ims.feature.ImsFeature.Capabilities {
+ ctor public MmTelFeature.MmTelCapabilities();
+ ctor @Deprecated public MmTelFeature.MmTelCapabilities(android.telephony.ims.feature.ImsFeature.Capabilities);
+ ctor public MmTelFeature.MmTelCapabilities(int);
+ method public final void addCapabilities(int);
+ method public final void removeCapabilities(int);
+ }
+
+ public class RcsFeature extends android.telephony.ims.feature.ImsFeature {
+ ctor public RcsFeature();
+ method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
+ method public void onFeatureReady();
+ method public void onFeatureRemoved();
+ }
+
+}
+
+package android.telephony.ims.stub {
+
+ public class ImsCallSessionImplBase implements java.lang.AutoCloseable {
+ ctor public ImsCallSessionImplBase();
+ method public void accept(int, android.telephony.ims.ImsStreamMediaProfile);
+ method public void close();
+ method public void deflect(String);
+ method public void extendToConference(String[]);
+ method public String getCallId();
+ method public android.telephony.ims.ImsCallProfile getCallProfile();
+ method public android.telephony.ims.ImsVideoCallProvider getImsVideoCallProvider();
+ method public android.telephony.ims.ImsCallProfile getLocalCallProfile();
+ method public String getProperty(String);
+ method public android.telephony.ims.ImsCallProfile getRemoteCallProfile();
+ method public int getState();
+ method public void hold(android.telephony.ims.ImsStreamMediaProfile);
+ method public void inviteParticipants(String[]);
+ method public boolean isInCall();
+ method public boolean isMultiparty();
+ method public void merge();
+ method public void reject(int);
+ method public void removeParticipants(String[]);
+ method public void resume(android.telephony.ims.ImsStreamMediaProfile);
+ method public void sendDtmf(char, android.os.Message);
+ method public void sendRttMessage(String);
+ method public void sendRttModifyRequest(android.telephony.ims.ImsCallProfile);
+ method public void sendRttModifyResponse(boolean);
+ method public void sendUssd(String);
+ method public void setListener(android.telephony.ims.ImsCallSessionListener);
+ method public void setMute(boolean);
+ method public void start(String, android.telephony.ims.ImsCallProfile);
+ method public void startConference(String[], android.telephony.ims.ImsCallProfile);
+ method public void startDtmf(char);
+ method public void stopDtmf();
+ method public void terminate(int);
+ method public void update(int, android.telephony.ims.ImsStreamMediaProfile);
+ field public static final int USSD_MODE_NOTIFY = 0; // 0x0
+ field public static final int USSD_MODE_REQUEST = 1; // 0x1
+ }
+
+ public static class ImsCallSessionImplBase.State {
+ method public static String toString(int);
+ field public static final int ESTABLISHED = 4; // 0x4
+ field public static final int ESTABLISHING = 3; // 0x3
+ field public static final int IDLE = 0; // 0x0
+ field public static final int INITIATED = 1; // 0x1
+ field public static final int INVALID = -1; // 0xffffffff
+ field public static final int NEGOTIATING = 2; // 0x2
+ field public static final int REESTABLISHING = 6; // 0x6
+ field public static final int RENEGOTIATING = 5; // 0x5
+ field public static final int TERMINATED = 8; // 0x8
+ field public static final int TERMINATING = 7; // 0x7
+ }
+
+ public class ImsConfigImplBase {
+ ctor public ImsConfigImplBase();
+ method public int getConfigInt(int);
+ method public String getConfigString(int);
+ method public final void notifyProvisionedValueChanged(int, int);
+ method public final void notifyProvisionedValueChanged(int, String);
+ method public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);
+ method public int setConfig(int, int);
+ method public int setConfig(int, String);
+ field public static final int CONFIG_RESULT_FAILED = 1; // 0x1
+ field public static final int CONFIG_RESULT_SUCCESS = 0; // 0x0
+ field public static final int CONFIG_RESULT_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public class ImsEcbmImplBase {
+ ctor public ImsEcbmImplBase();
+ method public final void enteredEcbm();
+ method public void exitEmergencyCallbackMode();
+ method public final void exitedEcbm();
+ }
+
+ public final class ImsFeatureConfiguration implements android.os.Parcelable {
+ method public int describeContents();
+ method public java.util.Set<android.telephony.ims.stub.ImsFeatureConfiguration.FeatureSlotPair> getServiceFeatures();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.stub.ImsFeatureConfiguration> CREATOR;
+ }
+
+ public static class ImsFeatureConfiguration.Builder {
+ ctor public ImsFeatureConfiguration.Builder();
+ method public android.telephony.ims.stub.ImsFeatureConfiguration.Builder addFeature(int, int);
+ method public android.telephony.ims.stub.ImsFeatureConfiguration build();
+ }
+
+ public static final class ImsFeatureConfiguration.FeatureSlotPair {
+ ctor public ImsFeatureConfiguration.FeatureSlotPair(int, int);
+ field public final int featureType;
+ field public final int slotId;
+ }
+
+ public class ImsMultiEndpointImplBase {
+ ctor public ImsMultiEndpointImplBase();
+ method public final void onImsExternalCallStateUpdate(java.util.List<android.telephony.ims.ImsExternalCallState>);
+ method public void requestImsExternalCallStateInfo();
+ }
+
+ public class ImsRegistrationImplBase {
+ ctor public ImsRegistrationImplBase();
+ method public final void onDeregistered(android.telephony.ims.ImsReasonInfo);
+ method public final void onRegistered(int);
+ method public final void onRegistering(int);
+ method public final void onSubscriberAssociatedUriChanged(android.net.Uri[]);
+ method public final void onTechnologyChangeFailed(int, android.telephony.ims.ImsReasonInfo);
+ field public static final int REGISTRATION_TECH_IWLAN = 1; // 0x1
+ field public static final int REGISTRATION_TECH_LTE = 0; // 0x0
+ field public static final int REGISTRATION_TECH_NONE = -1; // 0xffffffff
+ }
+
+ public class ImsSmsImplBase {
+ ctor public ImsSmsImplBase();
+ method public void acknowledgeSms(int, @IntRange(from=0, to=65535) int, int);
+ method public void acknowledgeSmsReport(int, @IntRange(from=0, to=65535) int, int);
+ method public String getSmsFormat();
+ method public void onReady();
+ method @Deprecated public final void onSendSmsResult(int, @IntRange(from=0, to=65535) int, int, int) throws java.lang.RuntimeException;
+ method public final void onSendSmsResultError(int, @IntRange(from=0, to=65535) int, int, int, int) throws java.lang.RuntimeException;
+ method public final void onSendSmsResultSuccess(int, @IntRange(from=0, to=65535) int) throws java.lang.RuntimeException;
+ method public final void onSmsReceived(int, String, byte[]) throws java.lang.RuntimeException;
+ method @Deprecated public final void onSmsStatusReportReceived(int, @IntRange(from=0, to=65535) int, String, byte[]) throws java.lang.RuntimeException;
+ method public final void onSmsStatusReportReceived(int, String, byte[]) throws java.lang.RuntimeException;
+ method public void sendSms(int, @IntRange(from=0, to=65535) int, String, String, boolean, byte[]);
+ field public static final int DELIVER_STATUS_ERROR_GENERIC = 2; // 0x2
+ field public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3; // 0x3
+ field public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4; // 0x4
+ field public static final int DELIVER_STATUS_OK = 1; // 0x1
+ field public static final int RESULT_NO_NETWORK_ERROR = -1; // 0xffffffff
+ field public static final int SEND_STATUS_ERROR = 2; // 0x2
+ field public static final int SEND_STATUS_ERROR_FALLBACK = 4; // 0x4
+ field public static final int SEND_STATUS_ERROR_RETRY = 3; // 0x3
+ field public static final int SEND_STATUS_OK = 1; // 0x1
+ field public static final int STATUS_REPORT_STATUS_ERROR = 2; // 0x2
+ field public static final int STATUS_REPORT_STATUS_OK = 1; // 0x1
+ }
+
+ public class ImsUtImplBase {
+ ctor public ImsUtImplBase();
+ method public void close();
+ method public int queryCFForServiceClass(int, String, int);
+ method public int queryCallBarring(int);
+ method public int queryCallBarringForServiceClass(int, int);
+ method public int queryCallForward(int, String);
+ method public int queryCallWaiting();
+ method public int queryClip();
+ method public int queryClir();
+ method public int queryColp();
+ method public int queryColr();
+ method public void setListener(android.telephony.ims.ImsUtListener);
+ method public int transact(android.os.Bundle);
+ method public int updateCallBarring(int, int, String[]);
+ method public int updateCallBarringForServiceClass(int, int, String[], int);
+ method public int updateCallForward(int, int, String, int, int);
+ method public int updateCallWaiting(boolean, int);
+ method public int updateClip(boolean);
+ method public int updateClir(int);
+ method public int updateColp(boolean);
+ method public int updateColr(int);
+ }
+
+}
+
+package android.telephony.mbms {
+
+ public static class DownloadRequest.Builder {
+ method public android.telephony.mbms.DownloadRequest.Builder setServiceId(String);
+ }
+
+ public final class FileInfo implements android.os.Parcelable {
+ ctor public FileInfo(android.net.Uri, String);
+ }
+
+ public final class FileServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
+ ctor public FileServiceInfo(java.util.Map<java.util.Locale,java.lang.String>, String, java.util.List<java.util.Locale>, String, java.util.Date, java.util.Date, java.util.List<android.telephony.mbms.FileInfo>);
+ }
+
+ public class MbmsDownloadReceiver extends android.content.BroadcastReceiver {
+ field public static final int RESULT_APP_NOTIFICATION_ERROR = 6; // 0x6
+ field public static final int RESULT_BAD_TEMP_FILE_ROOT = 3; // 0x3
+ field public static final int RESULT_DOWNLOAD_FINALIZATION_ERROR = 4; // 0x4
+ field public static final int RESULT_INVALID_ACTION = 1; // 0x1
+ field public static final int RESULT_MALFORMED_INTENT = 2; // 0x2
+ field public static final int RESULT_OK = 0; // 0x0
+ field public static final int RESULT_TEMP_FILE_GENERATION_ERROR = 5; // 0x5
+ }
+
+ public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
+ ctor public StreamingServiceInfo(java.util.Map<java.util.Locale,java.lang.String>, String, java.util.List<java.util.Locale>, String, java.util.Date, java.util.Date);
+ }
+
+ public final class UriPathPair implements android.os.Parcelable {
+ method public int describeContents();
+ method public android.net.Uri getContentUri();
+ method public android.net.Uri getFilePathUri();
+ method public void writeToParcel(android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.mbms.UriPathPair> CREATOR;
+ }
+
+}
+
+package android.telephony.mbms.vendor {
+
+ public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
+ ctor public MbmsDownloadServiceBase();
+ method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
+ method public int addServiceAnnouncement(int, @NonNull byte[]);
+ method public int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
+ method public android.os.IBinder asBinder();
+ method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
+ method public void dispose(int) throws android.os.RemoteException;
+ method public int download(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
+ method public int initialize(int, android.telephony.mbms.MbmsDownloadSessionCallback) throws android.os.RemoteException;
+ method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(int) throws android.os.RemoteException;
+ method public void onAppCallbackDied(int, int);
+ method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
+ method public int removeProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
+ method public int removeStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
+ method public int requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
+ method public int requestUpdateFileServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
+ method public int resetDownloadKnowledge(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
+ method public int setTempFileRootDirectory(int, String) throws android.os.RemoteException;
+ }
+
+ public class MbmsGroupCallServiceBase extends android.app.Service {
+ ctor public MbmsGroupCallServiceBase();
+ method public void dispose(int) throws android.os.RemoteException;
+ method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
+ method public void onAppCallbackDied(int, int);
+ method public android.os.IBinder onBind(android.content.Intent);
+ method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
+ method public void stopGroupCall(int, long);
+ method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
+ }
+
+ public class MbmsStreamingServiceBase extends android.os.Binder implements android.os.IInterface {
+ ctor public MbmsStreamingServiceBase();
+ method public android.os.IBinder asBinder();
+ method public void dispose(int) throws android.os.RemoteException;
+ method @Nullable public android.net.Uri getPlaybackUri(int, String) throws android.os.RemoteException;
+ method public int initialize(android.telephony.mbms.MbmsStreamingSessionCallback, int) throws android.os.RemoteException;
+ method public void onAppCallbackDied(int, int);
+ method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
+ method public int requestUpdateStreamingServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
+ method public int startStreaming(int, String, android.telephony.mbms.StreamingServiceCallback) throws android.os.RemoteException;
+ method public void stopStreaming(int, String) throws android.os.RemoteException;
+ }
+
+ public class VendorUtils {
+ ctor public VendorUtils();
+ method public static android.content.ComponentName getAppReceiverFromPackageName(android.content.Context, String);
+ field public static final String ACTION_CLEANUP = "android.telephony.mbms.action.CLEANUP";
+ field public static final String ACTION_DOWNLOAD_RESULT_INTERNAL = "android.telephony.mbms.action.DOWNLOAD_RESULT_INTERNAL";
+ field public static final String ACTION_FILE_DESCRIPTOR_REQUEST = "android.telephony.mbms.action.FILE_DESCRIPTOR_REQUEST";
+ field public static final String EXTRA_FD_COUNT = "android.telephony.mbms.extra.FD_COUNT";
+ field public static final String EXTRA_FINAL_URI = "android.telephony.mbms.extra.FINAL_URI";
+ field public static final String EXTRA_FREE_URI_LIST = "android.telephony.mbms.extra.FREE_URI_LIST";
+ field public static final String EXTRA_PAUSED_LIST = "android.telephony.mbms.extra.PAUSED_LIST";
+ field public static final String EXTRA_PAUSED_URI_LIST = "android.telephony.mbms.extra.PAUSED_URI_LIST";
+ field public static final String EXTRA_SERVICE_ID = "android.telephony.mbms.extra.SERVICE_ID";
+ field public static final String EXTRA_TEMP_FILES_IN_USE = "android.telephony.mbms.extra.TEMP_FILES_IN_USE";
+ field public static final String EXTRA_TEMP_FILE_ROOT = "android.telephony.mbms.extra.TEMP_FILE_ROOT";
+ field public static final String EXTRA_TEMP_LIST = "android.telephony.mbms.extra.TEMP_LIST";
+ }
+
+}
+
diff --git a/telephony/java/android/service/carrier/CarrierIdentifier.java b/telephony/java/android/service/carrier/CarrierIdentifier.java
index bc0f909e1331..c6b9ea200382 100644
--- a/telephony/java/android/service/carrier/CarrierIdentifier.java
+++ b/telephony/java/android/service/carrier/CarrierIdentifier.java
@@ -55,12 +55,13 @@ public class CarrierIdentifier implements Parcelable {
private @Nullable String mImsi;
private @Nullable String mGid1;
private @Nullable String mGid2;
+ private @Nullable String mIccid;
private int mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
private int mSpecificCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
public CarrierIdentifier(String mcc, String mnc, @Nullable String spn, @Nullable String imsi,
@Nullable String gid1, @Nullable String gid2) {
- this(mcc, mnc, spn, imsi, gid1, gid2, TelephonyManager.UNKNOWN_CARRIER_ID,
+ this(mcc, mnc, spn, imsi, gid1, gid2, null, TelephonyManager.UNKNOWN_CARRIER_ID,
TelephonyManager.UNKNOWN_CARRIER_ID);
}
@@ -79,16 +80,31 @@ public class CarrierIdentifier implements Parcelable {
public CarrierIdentifier(@NonNull String mcc, @NonNull String mnc, @Nullable String spn,
@Nullable String imsi, @Nullable String gid1, @Nullable String gid2,
int carrierid, int specificCarrierId) {
+ this(mcc, mnc, spn, imsi, gid1, gid2, null, carrierid, specificCarrierId);
+ }
+
+ /** @hide */
+ public CarrierIdentifier(String mcc, String mnc, @Nullable String spn,
+ @Nullable String imsi, @Nullable String gid1, @Nullable String gid2,
+ @Nullable String iccid, int carrierid, int specificCarrierId) {
mMcc = mcc;
mMnc = mnc;
mSpn = spn;
mImsi = imsi;
mGid1 = gid1;
mGid2 = gid2;
+ mIccid = iccid;
mCarrierId = carrierid;
mSpecificCarrierId = specificCarrierId;
}
+ /** @hide */
+ public CarrierIdentifier(String mcc, String mnc, @Nullable String spn, @Nullable String imsi,
+ @Nullable String gid1, @Nullable String gid2I, @Nullable String iccid) {
+ this(mcc, mnc, spn, imsi, gid1, gid2I);
+ mIccid = iccid;
+ }
+
/**
* Creates a carrier identifier instance.
*
@@ -113,6 +129,7 @@ public class CarrierIdentifier implements Parcelable {
mGid2 = gid2;
mSpn = null;
mImsi = null;
+ mIccid = null;
}
/** @hide */
@@ -154,6 +171,13 @@ public class CarrierIdentifier implements Parcelable {
return mGid2;
}
+ /** Get the ICCID.
+ * @hide */
+ @Nullable
+ public String getIccid() {
+ return mIccid;
+ }
+
/**
* Returns the carrier id.
* @see TelephonyManager#getSimCarrierId()
@@ -192,13 +216,14 @@ public class CarrierIdentifier implements Parcelable {
&& Objects.equals(mImsi, that.mImsi)
&& Objects.equals(mGid1, that.mGid1)
&& Objects.equals(mGid2, that.mGid2)
+ && Objects.equals(mIccid, that.mIccid)
&& Objects.equals(mCarrierId, that.mCarrierId)
&& Objects.equals(mSpecificCarrierId, that.mSpecificCarrierId);
}
@Override
public int hashCode(){
- return Objects.hash(mMcc, mMnc, mSpn, mImsi, mGid1, mGid2, mCarrierId, mSpecificCarrierId);
+ return Objects.hash(mMcc, mMnc, mSpn, mImsi, mGid1, mGid2, mIccid, mCarrierId, mSpecificCarrierId);
}
@Override
@@ -214,6 +239,7 @@ public class CarrierIdentifier implements Parcelable {
out.writeString(mImsi);
out.writeString(mGid1);
out.writeString(mGid2);
+ out.writeString(mIccid);
out.writeInt(mCarrierId);
out.writeInt(mSpecificCarrierId);
}
@@ -227,6 +253,7 @@ public class CarrierIdentifier implements Parcelable {
+ ",imsi=" + Rlog.pii(false, mImsi)
+ ",gid1=" + mGid1
+ ",gid2=" + mGid2
+ + ",iccid=" + mIccid
+ ",carrierid=" + mCarrierId
+ ",specificCarrierId=" + mSpecificCarrierId
+ "}";
@@ -240,6 +267,7 @@ public class CarrierIdentifier implements Parcelable {
mImsi = in.readString();
mGid1 = in.readString();
mGid2 = in.readString();
+ mIccid = in.readString();
mCarrierId = in.readInt();
mSpecificCarrierId = in.readInt();
}
@@ -251,5 +279,6 @@ public class CarrierIdentifier implements Parcelable {
int IMSI_PREFIX = 2;
int GID1 = 3;
int GID2 = 4;
+ int ICCID = 5;
}
}
diff --git a/telephony/java/android/telephony/AccessNetworkConstants.java b/telephony/java/android/telephony/AccessNetworkConstants.java
index 1d7a4761dec6..ac50d101feb9 100644
--- a/telephony/java/android/telephony/AccessNetworkConstants.java
+++ b/telephony/java/android/telephony/AccessNetworkConstants.java
@@ -19,6 +19,7 @@ package android.telephony;
import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.hardware.radio.V1_5.AccessNetwork;
+import android.hardware.radio.V1_5.RadioAccessNetworks;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -108,6 +109,28 @@ public final class AccessNetworkConstants {
default: return Integer.toString(type);
}
}
+
+ /**
+ * Converts from RadioAccessNetworks in HAL to AccessNetworkType in frameworks.
+ * @hide
+ */
+ public static int convertRanToAnt(int ran) {
+ switch (ran) {
+ case RadioAccessNetworks.GERAN:
+ return AccessNetworkType.GERAN;
+ case RadioAccessNetworks.UTRAN:
+ return AccessNetworkType.UTRAN;
+ case RadioAccessNetworks.EUTRAN:
+ return AccessNetworkType.EUTRAN;
+ case RadioAccessNetworks.NGRAN:
+ return AccessNetworkType.NGRAN;
+ case RadioAccessNetworks.CDMA2000:
+ return AccessNetworkType.CDMA2000;
+ case RadioAccessNetworks.UNKNOWN:
+ default:
+ return AccessNetworkType.UNKNOWN;
+ }
+ }
}
/**
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 1ca251d370ab..beb01d8a6d75 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -229,6 +229,19 @@ public class CarrierConfigManager {
"call_forwarding_when_busy_supported_bool";
/**
+ * Boolean indicating if carrier supports call forwarding option "When not logged in".
+ *
+ * {@code true}: Call forwarding option "When not logged in" is supported.
+ * {@code false}: Call forwarding option "When not logged in" is not supported. Option will be
+ * removed in the UI.
+ *
+ * By default this value is true.
+ * @hide
+ */
+ public static final String KEY_CALL_FORWARDING_WHEN_NOT_LOGGED_IN_SUPPORTED_BOOL =
+ "call_forwarding_when_not_logged_in_supported_bool";
+
+ /**
* Boolean indicating if the "Caller ID" item is visible in the Additional Settings menu.
* true means visible. false means gone.
* @hide
@@ -771,6 +784,14 @@ public class CarrierConfigManager {
public static final String KEY_VILTE_DATA_IS_METERED_BOOL = "vilte_data_is_metered_bool";
/**
+ * Flag indicating whether we should reset UT capability or not for IMS deregistration
+ * and for IMS feature state not ready
+ * @hide
+ */
+ public static final String KEY_IGNORE_RESET_UT_CAPABILITY_BOOL =
+ "ignore_reset_ut_capability_bool";
+
+ /**
* Flag specifying whether WFC over IMS should be available for carrier: independent of
* carrier provisioning. If false: hard disabled. If true: then depends on carrier
* provisioning, availability etc.
@@ -806,6 +827,18 @@ public class CarrierConfigManager {
"carrier_wfc_supports_wifi_only_bool";
/**
+ * Flag specifying whether WFC over IMS supports the "ims preferred" option. If false, the wifi
+ * calling settings will not include an option for "ims preferred". If true, the wifi calling
+ * settings will include an option for "ims preferred"
+ * <p>
+ * By default, it is assumed that WFC does not support "ims preferred".
+ * @hide
+ */
+ public static final String KEY_CARRIER_WFC_SUPPORTS_IMS_PREFERRED_BOOL =
+ "carrier_wfc_supports_ims_preferred_bool";
+
+
+ /**
* Default mode for WFC over IMS on home network:
* <ul>
* <li>0: Wi-Fi only
@@ -935,6 +968,13 @@ public class CarrierConfigManager {
public static final String KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL
= "carrier_volte_tty_supported_bool";
+ /**
+ * Flag indicating whether VT tty is supported
+ * @hide
+ */
+ public static final String KEY_CARRIER_VT_TTY_SUPPORT_BOOL =
+ "carrier_vt_tty_support_bool";
+
/**
* Flag specifying whether IMS service can be turned off. If false then the service will not be
* turned-off completely, but individual features can be disabled.
@@ -1464,6 +1504,15 @@ public class CarrierConfigManager {
public static final String KEY_HIDE_ENHANCED_4G_LTE_BOOL = "hide_enhanced_4g_lte_bool";
/**
+ * Determines whether the Enabled 5G toggle will be shown in the settings. When this
+ * option is {@code true}, the toggle will be hidden regardless of whether the device and
+ * carrier supports 5G or not.
+ *
+ * @hide
+ */
+ public static final String KEY_HIDE_ENABLED_5G_BOOL = "hide_enabled_5g_bool";
+
+ /**
* Sets the default state for the "Enhanced 4G LTE" or "Advanced Calling" mode toggle set by the
* user. When this is {@code true}, this mode by default is on, otherwise if {@code false},
* this mode by default is off.
@@ -1926,6 +1975,7 @@ public class CarrierConfigManager {
public static final String KEY_SHOW_PRECISE_FAILED_CAUSE_BOOL =
"show_precise_failed_cause_bool";
+
/**
* A list of carrier nr availability is used to determine whether the carrier enable the
* non-standalone (NSA) mode of 5G NR, standalone (SA) mode of 5G NR
@@ -1943,6 +1993,12 @@ public class CarrierConfigManager {
"carrier_nr_availabilities_int_array";
/**
+ * Flag specifying whether CDMA call waiting and call forwarding are enabled
+ * @hide
+ */
+ public static final String KEY_CDMA_CW_CF_ENABLED_BOOL = "cdma_cw_cf_enabled_bool";
+
+ /**
* Boolean to decide whether LTE is enabled.
*/
public static final String KEY_LTE_ENABLED_BOOL = "lte_enabled_bool";
@@ -1969,8 +2025,8 @@ public class CarrierConfigManager {
public static final String KEY_CARRIER_SETTINGS_ACTIVITY_COMPONENT_NAME_STRING =
"carrier_settings_activity_component_name_string";
- // These variables are used by the MMS service and exposed through another API,
- // SmsManager. The variable names and string values are copied from there.
+ // These variables are used by the MMS service and exposed through another API, {@link
+ // SmsManager}. The variable names and string values are copied from there.
public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled";
public static final String KEY_MMS_ALLOW_ATTACH_AUDIO_BOOL = "allowAttachAudio";
public static final String KEY_MMS_APPEND_TRANSACTION_ID_BOOL = "enabledTransID";
@@ -2413,6 +2469,13 @@ public class CarrierConfigManager {
"allow_hold_video_call_bool";
/**
+ * When true, indicates that concurrent call is allowed when there is an ongoing video call.
+ * @hide
+ */
+ public static final String KEY_ALLOW_CONCURRENT_CALL_DURING_VIDEO_CALL_BOOL =
+ "allow_concurrent_call_during_video_call";
+
+ /**
* When true, indicates that the HD audio icon in the in-call screen should not be shown for
* VoWifi calls.
* @hide
@@ -5393,6 +5456,45 @@ public class CarrierConfigManager {
public static final String KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL =
"unthrottle_data_retry_when_tac_changes_bool";
+ /**
+ * Flag indicating whether carrier supports multianchor conference.
+ * In multianchor conference, a participant of a conference can add
+ * other participants to the call using merge button thereby resulting
+ * in a conference with multi anchors.
+ * @hide
+ */
+ public static final String KEY_CARRIER_SUPPORTS_MULTIANCHOR_CONFERENCE =
+ "carrier_supports_multianchor_conference";
+
+ /**
+ * String array of APN configurations of same MVNO type GID.
+ * The entries should be of form "GID data:all supported apn types:devicecapability:apnname".
+ * example: 52FF:default,mms:SA:nrphone
+ *
+ * @hide
+ */
+ public static final String KEY_MULTI_APN_ARRAY_FOR_SAME_GID = "multi_apn_array_for_same_gid";
+
+ /**
+ * Flag indicating if APN filtering required.
+ *
+ * @hide
+ */
+ public static final String KEY_REQUIRE_APN_FILTERING_WITH_RADIO_CAPABILITY =
+ "require_apn_filtering_with_radio_capability_bool";
+
+ /**
+ * Determines whether carrier supports Sms Callback Mode.
+ * When {@code true}, modem can enter/exit SMS callback mode (SCBM) after sending e911 SMS.
+ * When user tries to make a following e911 call and modem is in SCBM, the same sub will be
+ * selected to place the e911 call over IMS.
+ * When {@code false}, follows the current slot selection logic to place the e911 call.
+ *
+ * @hide
+ */
+ public static final String KEY_USE_SMS_CALLBACK_MODE_BOOL =
+ "use_sms_callback_mode_bool";
+
/** The default value for every variable. */
private final static PersistableBundle sDefaults;
@@ -5426,9 +5528,11 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_CONFIG_TELEPHONY_USE_OWN_NUMBER_FOR_VOICEMAIL_BOOL, false);
sDefaults.putBoolean(KEY_IGNORE_DATA_ENABLED_CHANGED_FOR_VIDEO_CALLS, true);
sDefaults.putBoolean(KEY_VILTE_DATA_IS_METERED_BOOL, true);
+ sDefaults.putBoolean(KEY_IGNORE_RESET_UT_CAPABILITY_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_CROSS_SIM_IMS_AVAILABLE_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL, false);
+ sDefaults.putBoolean(KEY_CARRIER_WFC_SUPPORTS_IMS_PREFERRED_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_DEFAULT_WFC_IMS_ENABLED_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_DEFAULT_WFC_IMS_ROAMING_ENABLED_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_PROMOTE_WFC_ON_CALL_FAIL_BOOL, false);
@@ -5441,6 +5545,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_CARRIER_SUPPORTS_SS_OVER_UT_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_VOLTE_OVERRIDE_WFC_PROVISIONING_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, true);
+ sDefaults.putBoolean(KEY_CARRIER_VT_TTY_SUPPORT_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_ALLOW_TURNOFF_IMS_BOOL, true);
sDefaults.putBoolean(KEY_CARRIER_IMS_GBA_REQUIRED_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_INSTANT_LETTERING_AVAILABLE_BOOL, false);
@@ -5467,7 +5572,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_HIDE_SIM_LOCK_SETTINGS_BOOL, false);
sDefaults.putBoolean(KEY_CARRIER_VOLTE_PROVISIONED_BOOL, false);
- sDefaults.putBoolean(KEY_CALL_BARRING_VISIBILITY_BOOL, false);
+ sDefaults.putBoolean(KEY_CALL_BARRING_VISIBILITY_BOOL, true);
sDefaults.putBoolean(KEY_CALL_BARRING_SUPPORTS_PASSWORD_CHANGE_BOOL, true);
sDefaults.putBoolean(KEY_CALL_BARRING_SUPPORTS_DEACTIVATE_ALL_BOOL, true);
sDefaults.putInt(KEY_CALL_BARRING_DEFAULT_SERVICE_CLASS_INT, SERVICE_CLASS_VOICE);
@@ -5476,6 +5581,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_CALL_FORWARDING_WHEN_UNREACHABLE_SUPPORTED_BOOL, true);
sDefaults.putBoolean(KEY_CALL_FORWARDING_WHEN_UNANSWERED_SUPPORTED_BOOL, true);
sDefaults.putBoolean(KEY_CALL_FORWARDING_WHEN_BUSY_SUPPORTED_BOOL, true);
+ sDefaults.putBoolean(KEY_CALL_FORWARDING_WHEN_NOT_LOGGED_IN_SUPPORTED_BOOL, false);
sDefaults.putBoolean(KEY_ADDITIONAL_SETTINGS_CALLER_ID_VISIBILITY_BOOL, true);
sDefaults.putBoolean(KEY_ADDITIONAL_SETTINGS_CALL_WAITING_VISIBILITY_BOOL, true);
sDefaults.putBoolean(KEY_DISABLE_SUPPLEMENTARY_SERVICES_IN_AIRPLANE_MODE_BOOL, false);
@@ -5547,6 +5653,7 @@ public class CarrierConfigManager {
new String[]{"default", "mms", "dun", "supl"});
sDefaults.putStringArray(KEY_CARRIER_METERED_ROAMING_APN_TYPES_STRINGS,
new String[]{"default", "mms", "dun", "supl"});
+ sDefaults.putBoolean(KEY_CDMA_CW_CF_ENABLED_BOOL, false);
sDefaults.putStringArray(KEY_CARRIER_WWAN_DISALLOWED_APN_TYPES_STRING_ARRAY,
new String[]{""});
sDefaults.putStringArray(KEY_CARRIER_WLAN_DISALLOWED_APN_TYPES_STRING_ARRAY,
@@ -5592,6 +5699,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_DISPLAY_HD_AUDIO_PROPERTY_BOOL, true);
sDefaults.putBoolean(KEY_EDITABLE_ENHANCED_4G_LTE_BOOL, true);
sDefaults.putBoolean(KEY_HIDE_ENHANCED_4G_LTE_BOOL, false);
+ sDefaults.putBoolean(KEY_HIDE_ENABLED_5G_BOOL, true);
sDefaults.putBoolean(KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL, true);
sDefaults.putBoolean(KEY_HIDE_IMS_APN_BOOL, false);
sDefaults.putBoolean(KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL, false);
@@ -5719,6 +5827,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_ALLOW_MERGE_WIFI_CALLS_WHEN_VOWIFI_OFF_BOOL, true);
sDefaults.putBoolean(KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL, true);
sDefaults.putBoolean(KEY_ALLOW_HOLD_VIDEO_CALL_BOOL, true);
+ sDefaults.putBoolean(KEY_ALLOW_CONCURRENT_CALL_DURING_VIDEO_CALL_BOOL, true);
sDefaults.putBoolean(KEY_WIFI_CALLS_CAN_BE_HD_AUDIO, true);
sDefaults.putBoolean(KEY_VIDEO_CALLS_CAN_BE_HD_AUDIO, true);
sDefaults.putBoolean(KEY_GSM_CDMA_CALLS_CAN_BE_HD_AUDIO, false);
@@ -5992,6 +6101,27 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL, false);
sDefaults.putBoolean(KEY_VONR_SETTING_VISIBILITY_BOOL, true);
sDefaults.putBoolean(KEY_VONR_ENABLED_BOOL, false);
+ sDefaults.putStringArray(KEY_MULTI_APN_ARRAY_FOR_SAME_GID, new String[] {
+ "52FF:mms,supl,hipri,default,fota:SA:nrphone",
+ "52FF:mms,supl,hipri,default,fota:NSA:nxtgenphone",
+ "52FF:mms,supl,hipri,default,fota:LTE:nxtgenphone",
+ "52FF:mms,supl,hipri,default,fota:TD_SCDMA:nxtgenphone",
+ "52FF:mms,supl,hipri,default,fota:UMTS:nxtgenphone",
+ "52FF:mms,supl,hipri,default,fota:GSM:nxtgenphone",
+ "52FF:mms,supl,hipri,default,fota:HDR:nxtgenphone",
+ "52FF:mms,supl,hipri,default,fota:1xRTT:nxtgenphone",
+ "53FF:mms,supl,hipri,default,fota:SA:enhancedphone",
+ "53FF:mms,supl,hipri,default,fota:NSA:enhancedphone",
+ "53FF:mms,supl,hipri,default,fota:LTE:nxtgenphone",
+ "53FF:mms,supl,hipri,default,fota:TD_SCDMA:nxtgenphone",
+ "53FF:mms,supl,hipri,default,fota:UMTS:nxtgenphone",
+ "53FF:mms,supl,hipri,default,fota:GSM:nxtgenphone",
+ "53FF:mms,supl,hipri,default,fota:HDR:nxtgenphone",
+ "53FF:mms,supl,hipri,default,fota:1xRTT:nxtgenphone",
+ });
+ sDefaults.putBoolean(KEY_REQUIRE_APN_FILTERING_WITH_RADIO_CAPABILITY, false);
+ sDefaults.putBoolean(KEY_USE_SMS_CALLBACK_MODE_BOOL, false);
+ sDefaults.putBoolean(KEY_VONR_ENABLED_BOOL, false);
}
/**
@@ -6242,7 +6372,7 @@ public class CarrierConfigManager {
return;
}
loader.updateConfigForPhoneId(phoneId, simState);
- } catch (RemoteException ex) {
+ } catch (RemoteException | IllegalArgumentException ex) {
Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString());
}
}
diff --git a/telephony/java/android/telephony/DisconnectCause.java b/telephony/java/android/telephony/DisconnectCause.java
index 2704418935d9..2cf2511cd632 100644
--- a/telephony/java/android/telephony/DisconnectCause.java
+++ b/telephony/java/android/telephony/DisconnectCause.java
@@ -361,12 +361,126 @@ public final class DisconnectCause {
public static final int INCOMING_AUTO_REJECTED = 81;
+ /** @hide */
+ public static final int INCOMING_CALLS_BARRED_WITHIN_CUG = 82;
+ /** @hide */
+ public static final int BEARER_CAPABILITY_UNAVAILABLE = 83;
+ /** @hide */
+ public static final int SERVICE_OPTION_NOT_AVAILABLE = 84;
+ /** @hide */
+ public static final int BEARER_SERVICE_NOT_IMPLEMENTED = 85;
+ /** @hide */
+ public static final int REQUESTED_FACILITY_NOT_IMPLEMENTED = 86;
+ /** @hide */
+ public static final int ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 87;
+ /** @hide */
+ public static final int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 88;
+ /** @hide */
+ public static final int INVALID_TRANSACTION_IDENTIFIER = 89;
+ /** @hide */
+ public static final int USER_NOT_MEMBER_OF_CUG = 90;
+ /** @hide */
+ public static final int INCOMPATIBLE_DESTINATION = 91;
+ /** @hide */
+ public static final int INVALID_TRANSIT_NW_SELECTION = 92;
+ /** @hide */
+ public static final int SEMANTICALLY_INCORRECT_MESSAGE = 93;
+ /** @hide */
+ public static final int INVALID_MANDATORY_INFORMATION = 94;
+ /** @hide */
+ public static final int MESSAGE_TYPE_NON_IMPLEMENTED = 95;
+ /** @hide */
+ public static final int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 96;
+ /** @hide */
+ public static final int INFORMATION_ELEMENT_NON_EXISTENT = 97;
+ /** @hide */
+ public static final int CONDITIONAL_IE_ERROR = 98;
+ /** @hide */
+ public static final int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 99;
+ /** @hide */
+ public static final int RECOVERY_ON_TIMER_EXPIRED = 100;
+ /** @hide */
+ public static final int PROTOCOL_ERROR_UNSPECIFIED = 101;
+ /** @hide */
+ public static final int INTERWORKING_UNSPECIFIED = 102;
+ /** @hide */
+ public static final int LOCAL_LOW_BATTERY = 103;
+ /** @hide */
+ public static final int NO_CIRCUIT_AVAIL = 104;
+ /** @hide */
+ public static final int NO_ROUTE_TO_DESTINATION = 105;
+ /** @hide */
+ public static final int OPERATOR_DETERMINED_BARRING = 106;
+ /** @hide */
+ public static final int CALL_FAIL_NO_USER_RESPONDING = 107;
+ /** @hide */
+ public static final int CALL_FAIL_NO_ANSWER_FROM_USER = 108;
+ /** @hide */
+ public static final int CALL_FAIL_DESTINATION_OUT_OF_ORDER = 109;
+ /** @hide */
+ public static final int BEARER_CAPABILITY_NOT_AUTHORIZED = 110;
+ /** @hide */
+ public static final int CHANNEL_UNACCEPTABLE = 111;
+ /** @hide */
+ public static final int CALL_REJECTED = 112;
+ /** @hide */
+ public static final int NUMBER_CHANGED = 113;
+ /** @hide */
+ public static final int PREEMPTION = 114;
+ /** @hide */
+ public static final int FACILITY_REJECTED = 115;
+ /** @hide */
+ public static final int RESP_TO_STATUS_ENQUIRY = 116;
+ /** @hide */
+ public static final int NETWORK_OUT_OF_ORDER = 117;
+ /** @hide */
+ public static final int TEMPORARY_FAILURE = 118;
+ /** @hide */
+ public static final int SWITCHING_EQUIPMENT_CONGESTION = 119;
+ /** @hide */
+ public static final int ACCESS_INFORMATION_DISCARDED = 120;
+ /** @hide */
+ public static final int REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 121;
+ /** @hide */
+ public static final int RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 122;
+ /** @hide */
+ public static final int QOS_UNAVAILABLE = 123;
+ /** @hide */
+ public static final int REQUESTED_FACILITY_NOT_SUBSCRIBED = 124;
+
+ /**
+ * call failed due to LTE to 3G/2G handover not feasible
+ * @hide
+ */
+ public static final int HO_NOT_FEASIBLE = 125;
+ /** @hide */
+ public static final int NON_SELECTED_USER_CLEARING = 126;
+ /** @hide */
+ public static final int CONCURRENT_CALLS_NOT_POSSIBLE = 127;
+
//*********************************************************************************************
// When adding a disconnect type:
- // 1) Update toString() with the newly added disconnect type.
- // 2) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause.
+ // 1) Please assign the new type the next id value below.
+ // 2) Increment the next id value below to a new value.
+ // 3) Update MAXIMUM_VALID_VALUE to the new disconnect type.
+ // 4) Update toString() with the newly added disconnect type.
+ // 5) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause.
+ //
+ // NextId: 128
//*********************************************************************************************
+ /**
+ * Smallest valid value for call disconnect codes.
+ * @hide
+ */
+ public static final int MINIMUM_VALID_VALUE = NOT_DISCONNECTED;
+
+ /**
+ * Largest valid value for call disconnect codes.
+ * @hide
+ */
+ public static final int MAXIMUM_VALID_VALUE = CONCURRENT_CALLS_NOT_POSSIBLE;
+
/** Private constructor to avoid class instantiation. */
private DisconnectCause() {
// Do nothing.
@@ -515,6 +629,32 @@ public final class DisconnectCause {
return "EMERGENCY_TEMP_FAILURE";
case EMERGENCY_PERM_FAILURE:
return "EMERGENCY_PERM_FAILURE";
+ case NO_CIRCUIT_AVAIL:
+ return "NO_CIRCUIT_AVAIL";
+ case NO_ROUTE_TO_DESTINATION:
+ return "NO_ROUTE_TO_DESTINATION";
+ case OPERATOR_DETERMINED_BARRING:
+ return "OPERATOR_DETERMINED_BARRING";
+ case CALL_FAIL_NO_USER_RESPONDING:
+ return "CALL_FAIL_NO_USER_RESPONDING";
+ case CALL_FAIL_NO_ANSWER_FROM_USER:
+ return "CALL_FAIL_NO_ANSWER_FROM_USER";
+ case CALL_FAIL_DESTINATION_OUT_OF_ORDER:
+ return "CALL_FAIL_DESTINATION_OUT_OF_ORDER";
+ case BEARER_CAPABILITY_NOT_AUTHORIZED:
+ return "BEARER_CAPABILITY_NOT_AUTHORIZED";
+ case CHANNEL_UNACCEPTABLE:
+ return "CHANNEL_UNACCEPTABLE";
+ case CALL_REJECTED:
+ return "CALL_REJECTED";
+ case NUMBER_CHANGED:
+ return "NUMBER_CHANGED";
+ case PREEMPTION:
+ return "PREEMPTION";
+ case FACILITY_REJECTED:
+ return "FACILITY_REJECTED";
+ case RESP_TO_STATUS_ENQUIRY:
+ return "RESP_TO_STATUS_ENQUIRY";
case NORMAL_UNSPECIFIED:
return "NORMAL_UNSPECIFIED";
case IMS_SIP_ALTERNATE_EMERGENCY_CALL:
@@ -539,6 +679,72 @@ public final class DisconnectCause {
return "OUTGOING_EMERGENCY_CALL_PLACED";
case INCOMING_AUTO_REJECTED:
return "INCOMING_AUTO_REJECTED";
+ case NETWORK_OUT_OF_ORDER:
+ return "NETWORK_OUT_OF_ORDER";
+ case TEMPORARY_FAILURE:
+ return "TEMPORARY_FAILURE";
+ case SWITCHING_EQUIPMENT_CONGESTION:
+ return "SWITCHING_EQUIPMENT_CONGESTION";
+ case ACCESS_INFORMATION_DISCARDED:
+ return "ACCESS_INFORMATION_DISCARDED";
+ case REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE:
+ return "REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE";
+ case RESOURCES_UNAVAILABLE_OR_UNSPECIFIED:
+ return "RESOURCES_UNAVAILABLE_OR_UNSPECIFIED";
+ case QOS_UNAVAILABLE:
+ return "QOS_UNAVAILABLE";
+ case REQUESTED_FACILITY_NOT_SUBSCRIBED:
+ return "REQUESTED_FACILITY_NOT_SUBSCRIBED";
+ case INCOMING_CALLS_BARRED_WITHIN_CUG:
+ return "INCOMING_CALLS_BARRED_WITHIN_CUG";
+ case BEARER_CAPABILITY_UNAVAILABLE:
+ return "BEARER_CAPABILITY_UNAVAILABLE";
+ case SERVICE_OPTION_NOT_AVAILABLE:
+ return "SERVICE_OPTION_NOT_AVAILABLE";
+ case BEARER_SERVICE_NOT_IMPLEMENTED:
+ return "BEARER_SERVICE_NOT_IMPLEMENTED";
+ case REQUESTED_FACILITY_NOT_IMPLEMENTED:
+ return "REQUESTED_FACILITY_NOT_IMPLEMENTED";
+ case ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE:
+ return "ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE";
+ case SERVICE_OR_OPTION_NOT_IMPLEMENTED:
+ return "SERVICE_OR_OPTION_NOT_IMPLEMENTED";
+ case INVALID_TRANSACTION_IDENTIFIER:
+ return "INVALID_TRANSACTION_IDENTIFIER";
+ case USER_NOT_MEMBER_OF_CUG:
+ return "USER_NOT_MEMBER_OF_CUG";
+ case INCOMPATIBLE_DESTINATION:
+ return "INCOMPATIBLE_DESTINATION";
+ case INVALID_TRANSIT_NW_SELECTION:
+ return "INVALID_TRANSIT_NW_SELECTION";
+ case SEMANTICALLY_INCORRECT_MESSAGE:
+ return "SEMANTICALLY_INCORRECT_MESSAGE";
+ case INVALID_MANDATORY_INFORMATION:
+ return "INVALID_MANDATORY_INFORMATION";
+ case MESSAGE_TYPE_NON_IMPLEMENTED:
+ return "MESSAGE_TYPE_NON_IMPLEMENTED";
+ case MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE:
+ return "MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE";
+ case INFORMATION_ELEMENT_NON_EXISTENT:
+ return "INFORMATION_ELEMENT_NON_EXISTENT";
+ case CONDITIONAL_IE_ERROR:
+ return "CONDITIONAL_IE_ERROR";
+ case MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE:
+ return "MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE";
+ case RECOVERY_ON_TIMER_EXPIRED:
+ return "RECOVERY_ON_TIMER_EXPIRED";
+ case PROTOCOL_ERROR_UNSPECIFIED:
+ return "PROTOCOL_ERROR_UNSPECIFIED";
+ case INTERWORKING_UNSPECIFIED:
+ return "INTERWORKING_UNSPECIFIED";
+ case LOCAL_LOW_BATTERY:
+ return "LOCAL_LOW_BATTERY";
+ case HO_NOT_FEASIBLE:
+ return "HO_NOT_FEASIBLE";
+ case NON_SELECTED_USER_CLEARING:
+ return "NON_SELECTED_USER_CLEARING";
+ case CONCURRENT_CALLS_NOT_POSSIBLE:
+ return "CONCURRENT_CALLS_NOT_POSSIBLE";
default:
return "INVALID: " + cause;
}
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index d745dc215f34..5e01253b2676 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -1810,6 +1810,13 @@ public class ServiceState implements Parcelable {
}
/** @hide */
+ public static boolean isPsTech(int radioTechnology) {
+ return radioTechnology == RIL_RADIO_TECHNOLOGY_LTE ||
+ radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA ||
+ radioTechnology == RIL_RADIO_TECHNOLOGY_NR;
+ }
+
+ /** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public static boolean bearerBitmapHasCdma(int networkTypeBitmask) {
return (RIL_RADIO_CDMA_TECHNOLOGY_BITMASK
diff --git a/telephony/java/android/telephony/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index 5171cf9dcea7..e9796083a270 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -461,6 +461,7 @@ public final class SmsManager {
public void sendTextMessage(
String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent) {
+ android.util.SeempLog.record_str(75, destinationAddress);
sendTextMessageInternal(destinationAddress, scAddress, text, sentIntent, deliveryIntent,
true /* persistMessage*/, getOpPackageName(), getAttributionTag(),
0L /* messageId */);
@@ -1427,6 +1428,7 @@ public final class SmsManager {
public void sendDataMessage(
String destinationAddress, String scAddress, short destinationPort,
byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) {
+ android.util.SeempLog.record_str(73, destinationAddress);
if (TextUtils.isEmpty(destinationAddress)) {
throw new IllegalArgumentException("Invalid destinationAddress");
}
@@ -1757,6 +1759,7 @@ public final class SmsManager {
@RequiresPermission(Manifest.permission.ACCESS_MESSAGES_ON_ICC)
public boolean copyMessageToIcc(
@Nullable byte[] smsc, @NonNull byte[] pdu, @StatusOnIcc int status) {
+ android.util.SeempLog.record(79);
boolean success = false;
if (pdu == null) {
@@ -1800,6 +1803,7 @@ public final class SmsManager {
@UnsupportedAppUsage
@RequiresPermission(Manifest.permission.ACCESS_MESSAGES_ON_ICC)
public boolean deleteMessageFromIcc(int messageIndex) {
+ android.util.SeempLog.record(80);
boolean success = false;
try {
@@ -1843,6 +1847,7 @@ public final class SmsManager {
@UnsupportedAppUsage
@RequiresPermission(Manifest.permission.ACCESS_MESSAGES_ON_ICC)
public boolean updateMessageOnIcc(int messageIndex, int newStatus, byte[] pdu) {
+ android.util.SeempLog.record(81);
boolean success = false;
try {
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 8bc4d381e2dd..943e5072775b 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -472,6 +472,35 @@ public class TelephonyManager {
}
/**
+ * The allowed values for multi sim voice capability
+ *
+ * @hide
+ */
+ public interface MultiSimVoiceCapability {
+ /** default */
+ static final int UNKNOWN = 0;
+ /** Concurrent calls on both subscriptions are not possbile. */
+ static final int DSDS = 1;
+ /** Concurrent calls on both subscriptions are not possible but user will have option to
+ * accept MT call on one subscription when there is an ongoing call on another subscription.
+ */
+ static final int PSEUDO_DSDA = 2;
+ /** Concurrent calls on both subscriptions are possible */
+ static final int DSDA = 3;
+ }
+
+ /**
+ * Returns true if concurrent calls on both subscriptions are possible (ex: DSDA).
+ * Returns false for other cases.
+ */
+ /** {@hide} */
+ public static boolean isConcurrentCallsPossible() {
+ int mSimVoiceConfig = TelephonyProperties.multi_sim_voice_capability().orElse(
+ MultiSimVoiceCapability.UNKNOWN);
+ return mSimVoiceConfig == MultiSimVoiceCapability.DSDA;
+ }
+
+ /**
* Returns the number of phones available.
* Returns 0 if none of voice, sms, data is not supported
* Returns 1 for Single standby mode (Single SIM functionality).
@@ -2017,6 +2046,7 @@ public class TelephonyManager {
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public String getDeviceId(int slotIndex) {
// FIXME this assumes phoneId == slotIndex
+ android.util.SeempLog.record_str(8, ""+slotIndex);
try {
IPhoneSubInfo info = getSubscriberInfoService();
if (info == null)
@@ -2348,6 +2378,7 @@ public class TelephonyManager {
@Deprecated
@RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
public CellLocation getCellLocation() {
+ android.util.SeempLog.record(49);
try {
ITelephony telephony = getITelephony();
if (telephony == null) {
@@ -2383,6 +2414,7 @@ public class TelephonyManager {
@Deprecated
@RequiresPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION)
public List<NeighboringCellInfo> getNeighboringCellInfo() {
+ android.util.SeempLog.record(50);
try {
ITelephony telephony = getITelephony();
if (telephony == null)
@@ -3831,6 +3863,7 @@ public class TelephonyManager {
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@UnsupportedAppUsage
public String getSimSerialNumber(int subId) {
+ android.util.SeempLog.record_str(388, ""+subId);
try {
IPhoneSubInfo info = getSubscriberInfoService();
if (info == null)
@@ -4099,6 +4132,7 @@ public class TelephonyManager {
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
public String getSubscriberId(int subId) {
+ android.util.SeempLog.record_str(389, ""+subId);
try {
IPhoneSubInfo info = getSubscriberInfoService();
if (info == null)
@@ -4705,6 +4739,7 @@ public class TelephonyManager {
})
@UnsupportedAppUsage
public String getLine1Number(int subId) {
+ android.util.SeempLog.record_str(9, ""+subId);
String number = null;
try {
ITelephony telephony = getITelephony();
diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java
index be1502ad49f2..442681ee71b2 100644
--- a/telephony/java/android/telephony/data/ApnSetting.java
+++ b/telephony/java/android/telephony/data/ApnSetting.java
@@ -1447,8 +1447,8 @@ public class ApnSetting implements Parcelable {
&& !typeSameAny(this, other)
&& xorEqualsString(this.mProxyAddress, other.mProxyAddress)
&& xorEqualsInt(this.mProxyPort, other.mProxyPort)
- && xorEquals(this.mProtocol, other.mProtocol)
- && xorEquals(this.mRoamingProtocol, other.mRoamingProtocol)
+ && xorEqualsInt(this.mProtocol, other.mProtocol)
+ && xorEqualsInt(this.mRoamingProtocol, other.mRoamingProtocol)
&& Objects.equals(this.mCarrierEnabled, other.mCarrierEnabled)
&& Objects.equals(this.mProfileId, other.mProfileId)
&& Objects.equals(this.mMvnoType, other.mMvnoType)
diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java
index 486f74632ca2..5bfa1194962e 100644
--- a/telephony/java/android/telephony/ims/ImsCallProfile.java
+++ b/telephony/java/android/telephony/ims/ImsCallProfile.java
@@ -120,6 +120,11 @@ public final class ImsCallProfile implements Parcelable {
* VideoShare (video RX one way)
*/
public static final int CALL_TYPE_VS_RX = 10;
+ /**
+ * Unknown (audio / video inactive)
+ * @hide
+ */
+ public static final int CALL_TYPE_UNKNOWN = (-1);
/**
* Extra properties for IMS call.
diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java
index 0aff99709a52..32a65660121f 100755..100644
--- a/telephony/java/android/telephony/ims/ImsCallSession.java
+++ b/telephony/java/android/telephony/ims/ImsCallSession.java
@@ -1307,7 +1307,9 @@ public class ImsCallSession {
if (mListener != null) {
if (newSession != null) {
// New session created after conference
- mListener.callSessionMergeComplete(new ImsCallSession(newSession));
+ ImsCallSession confSession = new ImsCallSession(newSession);
+ confSession.mListener = mListener;
+ mListener.callSessionMergeComplete(confSession);
} else {
// Session already exists. Hence no need to pass
mListener.callSessionMergeComplete(null);
diff --git a/telephony/java/android/telephony/ims/ImsReasonInfo.java b/telephony/java/android/telephony/ims/ImsReasonInfo.java
index dda021e6172f..31ede00955da 100644
--- a/telephony/java/android/telephony/ims/ImsReasonInfo.java
+++ b/telephony/java/android/telephony/ims/ImsReasonInfo.java
@@ -902,6 +902,14 @@ public final class ImsReasonInfo implements Parcelable {
*/
public static final int CODE_RETRY_ON_IMS_WITHOUT_RTT = 3001;
+ /**
+ * Call failed due to concurrent calls not possible, this value should be in sync with {link@
+ * QtiCallConstants.CODE_CONCURRENT_CALLS_NOT_POSSIBLE}.
+ *
+ * @hide
+ */
+ public static final int CODE_CONCURRENT_CALLS_NOT_POSSIBLE = 3002;
+
/*
* OEM specific error codes. To be used by OEMs when they don't want to reveal error code which
* would be replaced by ERROR_UNSPECIFIED.
@@ -1084,6 +1092,7 @@ public final class ImsReasonInfo implements Parcelable {
CODE_REJECT_ONGOING_CS_CALL,
CODE_NETWORK_CONGESTION,
CODE_RETRY_ON_IMS_WITHOUT_RTT,
+ CODE_CONCURRENT_CALLS_NOT_POSSIBLE,
CODE_OEM_CAUSE_1,
CODE_OEM_CAUSE_2,
CODE_OEM_CAUSE_3,
@@ -1277,6 +1286,7 @@ public final class ImsReasonInfo implements Parcelable {
sImsCodeMap.put(CODE_REJECT_ONGOING_CS_CALL, "CODE_REJECT_ONGOING_CS_CALL");
sImsCodeMap.put(CODE_NETWORK_CONGESTION, "CODE_NETWORK_CONGESTION");
sImsCodeMap.put(CODE_RETRY_ON_IMS_WITHOUT_RTT, "CODE_RETRY_ON_IMS_WITHOUT_RTT");
+ sImsCodeMap.put(CODE_CONCURRENT_CALLS_NOT_POSSIBLE, "CODE_CONCURRENT_CALLS_NOT_POSSIBLE");
sImsCodeMap.put(CODE_OEM_CAUSE_1, "CODE_OEM_CAUSE_1");
sImsCodeMap.put(CODE_OEM_CAUSE_2, "CODE_OEM_CAUSE_2");
sImsCodeMap.put(CODE_OEM_CAUSE_3, "CODE_OEM_CAUSE_3");
diff --git a/telephony/java/android/telephony/ims/stub/ImsUtImplBase.java b/telephony/java/android/telephony/ims/stub/ImsUtImplBase.java
index eb3e8ed5a8e4..7694f5ee9981 100644
--- a/telephony/java/android/telephony/ims/stub/ImsUtImplBase.java
+++ b/telephony/java/android/telephony/ims/stub/ImsUtImplBase.java
@@ -19,6 +19,7 @@ package android.telephony.ims.stub;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.os.Bundle;
import android.os.RemoteException;
@@ -139,6 +140,12 @@ public class ImsUtImplBase {
}
@Override
+ public int queryCFForServiceClass(int condition, String number, int serviceClass) throws
+ RemoteException {
+ return ImsUtImplBase.this.queryCFForServiceClass(condition, number, serviceClass);
+ }
+
+ @Override
public int queryCallWaiting() throws RemoteException {
return ImsUtImplBase.this.queryCallWaiting();
}
@@ -286,6 +293,15 @@ public class ImsUtImplBase {
}
/**
+ * Retrieves the configuration of the call forward for specified service class.
+ */
+ @SuppressLint("AcronymName")
+ public int queryCFForServiceClass(int condition, String number,
+ int serviceClass) {
+ return -1;
+ }
+
+ /**
* Retrieves the configuration of the call waiting.
*/
public int queryCallWaiting() {
diff --git a/telephony/java/com/android/ims/ImsConfig.java b/telephony/java/com/android/ims/ImsConfig.java
index 487786045b8e..314ea6a6f44c 100644
--- a/telephony/java/com/android/ims/ImsConfig.java
+++ b/telephony/java/com/android/ims/ImsConfig.java
@@ -783,6 +783,7 @@ public class ImsConfig {
public static final int WIFI_ONLY = 0;
public static final int CELLULAR_PREFERRED = 1;
public static final int WIFI_PREFERRED = 2;
+ public static final int IMS_PREFERRED = 10;
}
public ImsConfig(IImsConfig iconfig) {
diff --git a/telephony/java/com/android/ims/ImsUtInterface.java b/telephony/java/com/android/ims/ImsUtInterface.java
index 5dfbce3dd65f..417f18788e94 100644
--- a/telephony/java/com/android/ims/ImsUtInterface.java
+++ b/telephony/java/com/android/ims/ImsUtInterface.java
@@ -129,6 +129,12 @@ public interface ImsUtInterface {
public void queryCallForward(int condition, String number, Message result);
/**
+ * Retrieves the configuration of the call forward for the specified service class.
+ * The return value of ((AsyncResult)result.obj) is an array of {@link ImsCallForwardInfo}.
+ */
+ public void queryCallForward(int condition, String number,
+ int serviceClass, Message result);
+ /**
* Retrieves the configuration of the call waiting.
* The return value of ((AsyncResult)result.obj) is an array of {@link ImsSsInfo}.
*/
diff --git a/telephony/java/com/android/ims/internal/IImsUt.aidl b/telephony/java/com/android/ims/internal/IImsUt.aidl
index 302be65070f7..51729b78b0b8 100644
--- a/telephony/java/com/android/ims/internal/IImsUt.aidl
+++ b/telephony/java/com/android/ims/internal/IImsUt.aidl
@@ -128,4 +128,12 @@ interface IImsUt {
*/
int updateCallBarringWithPassword(int cbType, int action, in String[] barrList,
int serviceClass, String password);
+
+ /**
+ * Retrieves the configuration of the call forward for specified service class.
+ * Returns an integer value to indicate the requestId of the UT request.
+ * -1 is returned if the "condition" is invalid for the queryCallForward,
+ * otherwise, integer greater than -1 will be returned.
+ */
+ int queryCFForServiceClass(int condition, String number, int serviceClass);
}
diff --git a/telephony/java/com/android/internal/telephony/DctConstants.java b/telephony/java/com/android/internal/telephony/DctConstants.java
index 409c838cb3e3..d775e41a7e7b 100644
--- a/telephony/java/com/android/internal/telephony/DctConstants.java
+++ b/telephony/java/com/android/internal/telephony/DctConstants.java
@@ -114,6 +114,11 @@ public class DctConstants {
public static final int EVENT_CARRIER_CONFIG_CHANGED = BASE + 54;
public static final int EVENT_SIM_STATE_UPDATED = BASE + 55;
public static final int EVENT_APN_UNTHROTTLED = BASE + 56;
+ public static final int EVENT_AIRPLANE_MODE_CHANGED = BASE + 57;
+ public static final int EVENT_GET_ENHANCED_RADIO_CAPABILITY = BASE + 58;
+ public static final int EVENT_GET_ENHANCED_RADIO_CAPABILITY_RETRY = BASE + 59;
+ public static final int EVENT_RECONNECT_EXT_TELEPHONY_SERVICE = BASE + 60;
+ public static final int EVENT_TRAFFIC_DESCRIPTORS_UPDATED = BASE + 61;
/***** Constants *****/
diff --git a/telephony/java/com/android/internal/telephony/ISmsSecurityAgent.aidl b/telephony/java/com/android/internal/telephony/ISmsSecurityAgent.aidl
new file mode 100644
index 000000000000..3b525292cb2d
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/ISmsSecurityAgent.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.internal.telephony;
+
+import com.android.internal.telephony.SmsAuthorizationRequest;
+
+/**
+ * ISmsSecurityAgent enhances the security of outgoing SMS messages by allowing trusted system
+ * components to inspect and authorize or reject outgoing SMS messages.
+ *
+ * @hide
+ **/
+interface ISmsSecurityAgent {
+ /**
+ * Called when a SMS message is queued for dispatch allowing a registered
+ * agent to decide on whether to accept/reject the request to send an SMS message.
+ * <b>Unless the agent rejects the request within the OEM specific timeout, the SMS
+ * will be sent.</b>
+ * @param request the object containing information regarding the message and
+ * through which the agent can accept/reject the request.
+ */
+ void onAuthorize(in SmsAuthorizationRequest request);
+
+}
diff --git a/telephony/java/com/android/internal/telephony/ISmsSecurityService.aidl b/telephony/java/com/android/internal/telephony/ISmsSecurityService.aidl
new file mode 100644
index 000000000000..e479f0c1f678
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/ISmsSecurityService.aidl
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.internal.telephony;
+
+import com.android.internal.telephony.ISmsSecurityAgent;
+import com.android.internal.telephony.SmsAuthorizationRequest;
+
+/**
+ * ISmsSecurityService exposes a service that monitors the dispatch of outgoing SMS messages
+ * and notifies a registered ISmsSecurityAgent in order to authorize or reject the dispatch
+ * of each outgoing SMS message.
+ *
+ * @hide
+ */
+interface ISmsSecurityService {
+ /**
+ * Registers an agent in order to receive requests for outgoing SMS messages on which
+ * it can accept or reject the request for the dispatch of each SMS message.
+ * <b>Only one agent can be registered at one time.</b>
+ * @param agent the agent to be registered.
+ * @return true if the registration succeeds, false otherwise.
+ */
+ boolean register(in ISmsSecurityAgent agent);
+
+ /**
+ * Unregisters the previously registered agent and causes the security
+ * service to no longer rely on the agent for a decision regarding
+ * successive SMS messages being dispatched allowing all successive messages to be dispatched.
+ *
+ * @param agent the agent to be unregistered.
+ * @return true if the unregistration succeeds, false otherwise.
+ */
+ boolean unregister(in ISmsSecurityAgent agent);
+
+ /**
+ * Allows the registered ISmsSecurityAgent implementation to asynchronously send a response
+ * on whether it will accept/reject the dispatch of the SMS message.
+ * <b>If the agent responds after the OEM defined timeout it may not be able to
+ * interfere on whether the SMS was sent or not.</b>
+ * @param request the request related to an outgoing SMS message to accept/reject.
+ * @param accepted true to accept, false to reject.
+ * return true if the response took effect, false if a response has already been sent for this
+ * request or an OEM specific timeout already happened.
+ */
+ boolean sendResponse(in SmsAuthorizationRequest request, boolean authorized);
+}
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index fadc23b315d6..e65624cb0ffd 100644
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -531,6 +531,9 @@ public interface RILConstants {
int RIL_REQUEST_ENABLE_VONR = 225;
int RIL_REQUEST_IS_VONR_ENABLED = 225;
+ /* RIL Request to get newly supported radio
+ capabilities include 5G SA*/
+ int RIL_REQUEST_GET_ENHANCED_RADIO_CAPABILITY = 600;
/* Responses begin */
int RIL_RESPONSE_ACKNOWLEDGEMENT = 800;
diff --git a/telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.aidl b/telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.aidl
new file mode 100644
index 000000000000..a2f7020f9b90
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.internal.telephony;
+
+/** @hide */
+parcelable SmsAuthorizationRequest;
diff --git a/telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.java b/telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.java
new file mode 100644
index 000000000000..bc64fa802903
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/SmsAuthorizationRequest.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.android.internal.telephony;
+
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.RemoteException;
+
+/**
+ * This class represents a request from the {@link ISmsSecurityService} to trusted parties
+ * in order to allow third party components to participate in the decision process to accept
+ * or reject a request to send an SMS message.
+ *
+ * @hide
+ */
+public class SmsAuthorizationRequest implements Parcelable {
+
+ private final ISmsSecurityService service;
+
+ private final IBinder token;
+
+ public final String packageName;
+
+ public final String destinationAddress;
+
+ public final String message;
+
+ public SmsAuthorizationRequest(final Parcel source) {
+ this.service = ISmsSecurityService.Stub.asInterface(source.readStrongBinder());
+ this.token = source.readStrongBinder();
+ this.packageName = source.readString();
+ this.destinationAddress = source.readString();
+ this.message = source.readString();
+ }
+
+ public SmsAuthorizationRequest(final ISmsSecurityService service,
+ final IBinder binderToken,
+ final String packageName,
+ final String destinationAddress,
+ final String message) {
+ this.service = service;
+ this.token = binderToken;
+ this.packageName = packageName;
+ this.destinationAddress = destinationAddress;
+ this.message = message;
+ }
+
+ @Override
+ public void writeToParcel(final Parcel dest, final int flags) {
+ dest.writeStrongBinder(service.asBinder());
+ dest.writeStrongBinder(token);
+ dest.writeString(packageName);
+ dest.writeString(destinationAddress);
+ dest.writeString(message);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public static Parcelable.Creator<SmsAuthorizationRequest> CREATOR =
+ new Creator<SmsAuthorizationRequest>() {
+ @Override
+ public SmsAuthorizationRequest[] newArray(final int size) {
+ return new SmsAuthorizationRequest[size];
+ }
+
+ @Override
+ public SmsAuthorizationRequest createFromParcel(final Parcel source) {
+ return new SmsAuthorizationRequest(source);
+ }
+ };
+
+ public void accept() throws RemoteException{
+ service.sendResponse(this, true);
+ }
+
+ public void reject() throws RemoteException {
+ service.sendResponse(this, false);
+ }
+
+ public IBinder getToken() {
+ return token;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("[%s] (%s) # %s",
+ this.packageName,
+ this.destinationAddress,
+ this.message);
+ }
+}
diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
index b905212a9100..c90b06338d21 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
@@ -323,6 +323,26 @@ public class TelephonyIntents {
"android.intent.action.USER_ACTIVITY_NOTIFICATION";
/**
+ * <p>Broadcast sent to show Emergency notification due to Voice Over Wifi availability
+ *
+ * <p class="note">
+ * You can <em>not</em> receive this through components declared
+ * in manifests, only by explicitly registering for it with
+ * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
+ * android.content.IntentFilter) Context.registerReceiver()}.
+ *
+ * <p class="note">
+ * Requires no permission.
+ *
+ * <p class="note">This is a protected intent that can only be sent
+ * by the system.
+ *
+ * @hide
+ */
+ public static final String ACTION_VOWIFI_ENABLED
+ = "org.codeaurora.telephony.VOWIFI_ENABLED";
+
+ /**
* Kept for backwards compatibility.
* @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_REDIRECTED
*/
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
index 29286e8f429e..4a8d414ae446 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
@@ -241,4 +241,10 @@ public interface TelephonyProperties
* Type: int
*/
static final String PROPERTY_MAX_ACTIVE_MODEMS = "telephony.active_modems.max_count";
+
+ /**
+ * Property to store multi sim voice capability configuration.
+ * Type: int posssible values are @link TelephonyManager#MultiSimVoiceCapability.
+ */
+ static final String PROPERTY_MULTISIM_VOICE_CAPABILITY = "ril.multisim.voice_capability";
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index f636276f11b8..f636276f11b8 100644..100755
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java b/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
index 9e2d29cd12e9..c6db36c45d87 100644
--- a/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/SmsEnvelope.java
@@ -38,6 +38,7 @@ public final class SmsEnvelope {
static public final int TELESERVICE_WAP = 0x1004;
static public final int TELESERVICE_WEMT = 0x1005;
static public final int TELESERVICE_SCPT = 0x1006;
+ static public final int TELESERVICE_CT_WAP = 0xFDEA;
/** Carriers specific Teleservice IDs. */
public static final int TELESERVICE_FDEA_WAP = 0xFDEA; // 65002
diff --git a/telephony/java/com/android/internal/telephony/uicc/IccUtils.java b/telephony/java/com/android/internal/telephony/uicc/IccUtils.java
index ec1204042260..c27c42667187 100644
--- a/telephony/java/com/android/internal/telephony/uicc/IccUtils.java
+++ b/telephony/java/com/android/internal/telephony/uicc/IccUtils.java
@@ -25,10 +25,12 @@ import android.graphics.Color;
import android.os.Build;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.telephony.EncodeException;
import com.android.internal.telephony.GsmAlphabet;
import com.android.telephony.Rlog;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.List;
@@ -962,5 +964,6 @@ public class IccUtils {
serializedFplmns[offset++] = (byte) 0xff;
}
return serializedFplmns;
+
}
}
diff --git a/tests/net/java/android/net/NetworkStatsHistoryTest.java b/tests/net/java/android/net/NetworkStatsHistoryTest.java
new file mode 100644
index 000000000000..96529a681cb4
--- /dev/null
+++ b/tests/net/java/android/net/NetworkStatsHistoryTest.java
@@ -0,0 +1,620 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net;
+
+import static android.net.NetworkStatsHistory.DataStreamUtils.readVarLong;
+import static android.net.NetworkStatsHistory.DataStreamUtils.writeVarLong;
+import static android.net.NetworkStatsHistory.Entry.UNKNOWN;
+import static android.net.NetworkStatsHistory.FIELD_ALL;
+import static android.net.NetworkStatsHistory.FIELD_OPERATIONS;
+import static android.net.NetworkStatsHistory.FIELD_RX_BYTES;
+import static android.net.NetworkStatsHistory.FIELD_RX_PACKETS;
+import static android.net.NetworkStatsHistory.FIELD_TX_BYTES;
+import static android.net.NetworkStatsHistory.multiplySafe;
+import static android.net.TrafficStats.GB_IN_BYTES;
+import static android.net.TrafficStats.MB_IN_BYTES;
+import static android.text.format.DateUtils.DAY_IN_MILLIS;
+import static android.text.format.DateUtils.HOUR_IN_MILLIS;
+import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
+import static android.text.format.DateUtils.SECOND_IN_MILLIS;
+import static android.text.format.DateUtils.WEEK_IN_MILLIS;
+import static android.text.format.DateUtils.YEAR_IN_MILLIS;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.content.Context;
+import android.util.Log;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.frameworks.tests.net.R;
+
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.util.Random;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class NetworkStatsHistoryTest {
+ private static final String TAG = "NetworkStatsHistoryTest";
+
+ private static final long TEST_START = 1194220800000L;
+
+ private NetworkStatsHistory stats;
+
+ @After
+ public void tearDown() throws Exception {
+ if (stats != null) {
+ assertConsistent(stats);
+ }
+ }
+
+ @Test
+ public void testReadOriginalVersion() throws Exception {
+ final Context context = InstrumentationRegistry.getContext();
+ final DataInputStream in =
+ new DataInputStream(context.getResources().openRawResource(R.raw.history_v1));
+
+ NetworkStatsHistory.Entry entry = null;
+ try {
+ final NetworkStatsHistory history = new NetworkStatsHistory(in);
+ assertEquals(15 * SECOND_IN_MILLIS, history.getBucketDuration());
+
+ entry = history.getValues(0, entry);
+ assertEquals(29143L, entry.rxBytes);
+ assertEquals(6223L, entry.txBytes);
+
+ entry = history.getValues(history.size() - 1, entry);
+ assertEquals(1476L, entry.rxBytes);
+ assertEquals(838L, entry.txBytes);
+
+ entry = history.getValues(Long.MIN_VALUE, Long.MAX_VALUE, entry);
+ assertEquals(332401L, entry.rxBytes);
+ assertEquals(64314L, entry.txBytes);
+
+ } finally {
+ in.close();
+ }
+ }
+
+ @Test
+ public void testRecordSingleBucket() throws Exception {
+ final long BUCKET_SIZE = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ // record data into narrow window to get single bucket
+ stats.recordData(TEST_START, TEST_START + SECOND_IN_MILLIS,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+
+ assertEquals(1, stats.size());
+ assertValues(stats, 0, SECOND_IN_MILLIS, 1024L, 10L, 2048L, 20L, 2L);
+ }
+
+ @Test
+ public void testRecordEqualBuckets() throws Exception {
+ final long bucketDuration = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(bucketDuration);
+
+ // split equally across two buckets
+ final long recordStart = TEST_START + (bucketDuration / 2);
+ stats.recordData(recordStart, recordStart + bucketDuration,
+ new NetworkStats.Entry(1024L, 10L, 128L, 2L, 2L));
+
+ assertEquals(2, stats.size());
+ assertValues(stats, 0, HOUR_IN_MILLIS / 2, 512L, 5L, 64L, 1L, 1L);
+ assertValues(stats, 1, HOUR_IN_MILLIS / 2, 512L, 5L, 64L, 1L, 1L);
+ }
+
+ @Test
+ public void testRecordTouchingBuckets() throws Exception {
+ final long BUCKET_SIZE = 15 * MINUTE_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ // split almost completely into middle bucket, but with a few minutes
+ // overlap into neighboring buckets. total record is 20 minutes.
+ final long recordStart = (TEST_START + BUCKET_SIZE) - MINUTE_IN_MILLIS;
+ final long recordEnd = (TEST_START + (BUCKET_SIZE * 2)) + (MINUTE_IN_MILLIS * 4);
+ stats.recordData(recordStart, recordEnd,
+ new NetworkStats.Entry(1000L, 2000L, 5000L, 10000L, 100L));
+
+ assertEquals(3, stats.size());
+ // first bucket should have (1/20 of value)
+ assertValues(stats, 0, MINUTE_IN_MILLIS, 50L, 100L, 250L, 500L, 5L);
+ // second bucket should have (15/20 of value)
+ assertValues(stats, 1, 15 * MINUTE_IN_MILLIS, 750L, 1500L, 3750L, 7500L, 75L);
+ // final bucket should have (4/20 of value)
+ assertValues(stats, 2, 4 * MINUTE_IN_MILLIS, 200L, 400L, 1000L, 2000L, 20L);
+ }
+
+ @Test
+ public void testRecordGapBuckets() throws Exception {
+ final long BUCKET_SIZE = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ // record some data today and next week with large gap
+ final long firstStart = TEST_START;
+ final long lastStart = TEST_START + WEEK_IN_MILLIS;
+ stats.recordData(firstStart, firstStart + SECOND_IN_MILLIS,
+ new NetworkStats.Entry(128L, 2L, 256L, 4L, 1L));
+ stats.recordData(lastStart, lastStart + SECOND_IN_MILLIS,
+ new NetworkStats.Entry(64L, 1L, 512L, 8L, 2L));
+
+ // we should have two buckets, far apart from each other
+ assertEquals(2, stats.size());
+ assertValues(stats, 0, SECOND_IN_MILLIS, 128L, 2L, 256L, 4L, 1L);
+ assertValues(stats, 1, SECOND_IN_MILLIS, 64L, 1L, 512L, 8L, 2L);
+
+ // now record something in middle, spread across two buckets
+ final long middleStart = TEST_START + DAY_IN_MILLIS;
+ final long middleEnd = middleStart + (HOUR_IN_MILLIS * 2);
+ stats.recordData(middleStart, middleEnd,
+ new NetworkStats.Entry(2048L, 4L, 2048L, 4L, 2L));
+
+ // now should have four buckets, with new record in middle two buckets
+ assertEquals(4, stats.size());
+ assertValues(stats, 0, SECOND_IN_MILLIS, 128L, 2L, 256L, 4L, 1L);
+ assertValues(stats, 1, HOUR_IN_MILLIS, 1024L, 2L, 1024L, 2L, 1L);
+ assertValues(stats, 2, HOUR_IN_MILLIS, 1024L, 2L, 1024L, 2L, 1L);
+ assertValues(stats, 3, SECOND_IN_MILLIS, 64L, 1L, 512L, 8L, 2L);
+ }
+
+ @Test
+ public void testRecordOverlapBuckets() throws Exception {
+ final long BUCKET_SIZE = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ // record some data in one bucket, and another overlapping buckets
+ stats.recordData(TEST_START, TEST_START + SECOND_IN_MILLIS,
+ new NetworkStats.Entry(256L, 2L, 256L, 2L, 1L));
+ final long midStart = TEST_START + (HOUR_IN_MILLIS / 2);
+ stats.recordData(midStart, midStart + HOUR_IN_MILLIS,
+ new NetworkStats.Entry(1024L, 10L, 1024L, 10L, 10L));
+
+ // should have two buckets, with some data mixed together
+ assertEquals(2, stats.size());
+ assertValues(stats, 0, SECOND_IN_MILLIS + (HOUR_IN_MILLIS / 2), 768L, 7L, 768L, 7L, 6L);
+ assertValues(stats, 1, (HOUR_IN_MILLIS / 2), 512L, 5L, 512L, 5L, 5L);
+ }
+
+ @Test
+ public void testRecordEntireGapIdentical() throws Exception {
+ // first, create two separate histories far apart
+ final NetworkStatsHistory stats1 = new NetworkStatsHistory(HOUR_IN_MILLIS);
+ stats1.recordData(TEST_START, TEST_START + 2 * HOUR_IN_MILLIS, 2000L, 1000L);
+
+ final long TEST_START_2 = TEST_START + DAY_IN_MILLIS;
+ final NetworkStatsHistory stats2 = new NetworkStatsHistory(HOUR_IN_MILLIS);
+ stats2.recordData(TEST_START_2, TEST_START_2 + 2 * HOUR_IN_MILLIS, 1000L, 500L);
+
+ // combine together with identical bucket size
+ stats = new NetworkStatsHistory(HOUR_IN_MILLIS);
+ stats.recordEntireHistory(stats1);
+ stats.recordEntireHistory(stats2);
+
+ // first verify that totals match up
+ assertValues(stats, TEST_START - WEEK_IN_MILLIS, TEST_START + WEEK_IN_MILLIS, 3000L, 1500L);
+
+ // now inspect internal buckets
+ assertValues(stats, 0, 1000L, 500L);
+ assertValues(stats, 1, 1000L, 500L);
+ assertValues(stats, 2, 500L, 250L);
+ assertValues(stats, 3, 500L, 250L);
+ }
+
+ @Test
+ public void testRecordEntireOverlapVaryingBuckets() throws Exception {
+ // create history just over hour bucket boundary
+ final NetworkStatsHistory stats1 = new NetworkStatsHistory(HOUR_IN_MILLIS);
+ stats1.recordData(TEST_START, TEST_START + MINUTE_IN_MILLIS * 60, 600L, 600L);
+
+ final long TEST_START_2 = TEST_START + MINUTE_IN_MILLIS;
+ final NetworkStatsHistory stats2 = new NetworkStatsHistory(MINUTE_IN_MILLIS);
+ stats2.recordData(TEST_START_2, TEST_START_2 + MINUTE_IN_MILLIS * 5, 50L, 50L);
+
+ // combine together with minute bucket size
+ stats = new NetworkStatsHistory(MINUTE_IN_MILLIS);
+ stats.recordEntireHistory(stats1);
+ stats.recordEntireHistory(stats2);
+
+ // first verify that totals match up
+ assertValues(stats, TEST_START - WEEK_IN_MILLIS, TEST_START + WEEK_IN_MILLIS, 650L, 650L);
+
+ // now inspect internal buckets
+ assertValues(stats, 0, 10L, 10L);
+ assertValues(stats, 1, 20L, 20L);
+ assertValues(stats, 2, 20L, 20L);
+ assertValues(stats, 3, 20L, 20L);
+ assertValues(stats, 4, 20L, 20L);
+ assertValues(stats, 5, 20L, 20L);
+ assertValues(stats, 6, 10L, 10L);
+
+ // now combine using 15min buckets
+ stats = new NetworkStatsHistory(HOUR_IN_MILLIS / 4);
+ stats.recordEntireHistory(stats1);
+ stats.recordEntireHistory(stats2);
+
+ // first verify that totals match up
+ assertValues(stats, TEST_START - WEEK_IN_MILLIS, TEST_START + WEEK_IN_MILLIS, 650L, 650L);
+
+ // and inspect buckets
+ assertValues(stats, 0, 200L, 200L);
+ assertValues(stats, 1, 150L, 150L);
+ assertValues(stats, 2, 150L, 150L);
+ assertValues(stats, 3, 150L, 150L);
+ }
+
+ @Test
+ public void testRemove() throws Exception {
+ stats = new NetworkStatsHistory(HOUR_IN_MILLIS);
+
+ // record some data across 24 buckets
+ stats.recordData(TEST_START, TEST_START + DAY_IN_MILLIS, 24L, 24L);
+ assertEquals(24, stats.size());
+
+ // try removing invalid data; should be no change
+ stats.removeBucketsBefore(0 - DAY_IN_MILLIS);
+ assertEquals(24, stats.size());
+
+ // try removing far before buckets; should be no change
+ stats.removeBucketsBefore(TEST_START - YEAR_IN_MILLIS);
+ assertEquals(24, stats.size());
+
+ // try removing just moments into first bucket; should be no change
+ // since that bucket contains data beyond the cutoff
+ stats.removeBucketsBefore(TEST_START + SECOND_IN_MILLIS);
+ assertEquals(24, stats.size());
+
+ // try removing single bucket
+ stats.removeBucketsBefore(TEST_START + HOUR_IN_MILLIS);
+ assertEquals(23, stats.size());
+
+ // try removing multiple buckets
+ stats.removeBucketsBefore(TEST_START + (4 * HOUR_IN_MILLIS));
+ assertEquals(20, stats.size());
+
+ // try removing all buckets
+ stats.removeBucketsBefore(TEST_START + YEAR_IN_MILLIS);
+ assertEquals(0, stats.size());
+ }
+
+ @Test
+ public void testTotalData() throws Exception {
+ final long BUCKET_SIZE = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ // record uniform data across day
+ stats.recordData(TEST_START, TEST_START + DAY_IN_MILLIS, 2400L, 4800L);
+
+ // verify that total outside range is 0
+ assertValues(stats, TEST_START - WEEK_IN_MILLIS, TEST_START - DAY_IN_MILLIS, 0L, 0L);
+
+ // verify total in first hour
+ assertValues(stats, TEST_START, TEST_START + HOUR_IN_MILLIS, 100L, 200L);
+
+ // verify total across 1.5 hours
+ assertValues(stats, TEST_START, TEST_START + (long) (1.5 * HOUR_IN_MILLIS), 150L, 300L);
+
+ // verify total beyond end
+ assertValues(stats, TEST_START + (23 * HOUR_IN_MILLIS), TEST_START + WEEK_IN_MILLIS, 100L, 200L);
+
+ // verify everything total
+ assertValues(stats, TEST_START - WEEK_IN_MILLIS, TEST_START + WEEK_IN_MILLIS, 2400L, 4800L);
+
+ }
+
+ @Test
+ public void testFuzzing() throws Exception {
+ try {
+ // fuzzing with random events, looking for crashes
+ final NetworkStats.Entry entry = new NetworkStats.Entry();
+ final Random r = new Random();
+ for (int i = 0; i < 500; i++) {
+ stats = new NetworkStatsHistory(r.nextLong());
+ for (int j = 0; j < 10000; j++) {
+ if (r.nextBoolean()) {
+ // add range
+ final long start = r.nextLong();
+ final long end = start + r.nextInt();
+ entry.rxBytes = nextPositiveLong(r);
+ entry.rxPackets = nextPositiveLong(r);
+ entry.txBytes = nextPositiveLong(r);
+ entry.txPackets = nextPositiveLong(r);
+ entry.operations = nextPositiveLong(r);
+ stats.recordData(start, end, entry);
+ } else {
+ // trim something
+ stats.removeBucketsBefore(r.nextLong());
+ }
+ }
+ assertConsistent(stats);
+ }
+ } catch (Throwable e) {
+ Log.e(TAG, String.valueOf(stats));
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static long nextPositiveLong(Random r) {
+ final long value = r.nextLong();
+ return value < 0 ? -value : value;
+ }
+
+ @Test
+ public void testIgnoreFields() throws Exception {
+ final NetworkStatsHistory history = new NetworkStatsHistory(
+ MINUTE_IN_MILLIS, 0, FIELD_RX_BYTES | FIELD_TX_BYTES);
+
+ history.recordData(0, MINUTE_IN_MILLIS,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 4L));
+ history.recordData(0, 2 * MINUTE_IN_MILLIS,
+ new NetworkStats.Entry(2L, 2L, 2L, 2L, 2L));
+
+ assertFullValues(history, UNKNOWN, 1026L, UNKNOWN, 2050L, UNKNOWN, UNKNOWN);
+ }
+
+ @Test
+ public void testIgnoreFieldsRecordIn() throws Exception {
+ final NetworkStatsHistory full = new NetworkStatsHistory(MINUTE_IN_MILLIS, 0, FIELD_ALL);
+ final NetworkStatsHistory partial = new NetworkStatsHistory(
+ MINUTE_IN_MILLIS, 0, FIELD_RX_PACKETS | FIELD_OPERATIONS);
+
+ full.recordData(0, MINUTE_IN_MILLIS,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 4L));
+ partial.recordEntireHistory(full);
+
+ assertFullValues(partial, UNKNOWN, UNKNOWN, 10L, UNKNOWN, UNKNOWN, 4L);
+ }
+
+ @Test
+ public void testIgnoreFieldsRecordOut() throws Exception {
+ final NetworkStatsHistory full = new NetworkStatsHistory(MINUTE_IN_MILLIS, 0, FIELD_ALL);
+ final NetworkStatsHistory partial = new NetworkStatsHistory(
+ MINUTE_IN_MILLIS, 0, FIELD_RX_PACKETS | FIELD_OPERATIONS);
+
+ partial.recordData(0, MINUTE_IN_MILLIS,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 4L));
+ full.recordEntireHistory(partial);
+
+ assertFullValues(full, MINUTE_IN_MILLIS, 0L, 10L, 0L, 0L, 4L);
+ }
+
+ @Test
+ public void testSerialize() throws Exception {
+ final NetworkStatsHistory before = new NetworkStatsHistory(MINUTE_IN_MILLIS, 40, FIELD_ALL);
+ before.recordData(0, 4 * MINUTE_IN_MILLIS,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 4L));
+ before.recordData(DAY_IN_MILLIS, DAY_IN_MILLIS + MINUTE_IN_MILLIS,
+ new NetworkStats.Entry(10L, 20L, 30L, 40L, 50L));
+
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
+ before.writeToStream(new DataOutputStream(out));
+ out.close();
+
+ final ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+ final NetworkStatsHistory after = new NetworkStatsHistory(new DataInputStream(in));
+
+ // must have identical totals before and after
+ assertFullValues(before, 5 * MINUTE_IN_MILLIS, 1034L, 30L, 2078L, 60L, 54L);
+ assertFullValues(after, 5 * MINUTE_IN_MILLIS, 1034L, 30L, 2078L, 60L, 54L);
+ }
+
+ @Test
+ public void testVarLong() throws Exception {
+ assertEquals(0L, performVarLong(0L));
+ assertEquals(-1L, performVarLong(-1L));
+ assertEquals(1024L, performVarLong(1024L));
+ assertEquals(-1024L, performVarLong(-1024L));
+ assertEquals(40 * MB_IN_BYTES, performVarLong(40 * MB_IN_BYTES));
+ assertEquals(512 * GB_IN_BYTES, performVarLong(512 * GB_IN_BYTES));
+ assertEquals(Long.MIN_VALUE, performVarLong(Long.MIN_VALUE));
+ assertEquals(Long.MAX_VALUE, performVarLong(Long.MAX_VALUE));
+ assertEquals(Long.MIN_VALUE + 40, performVarLong(Long.MIN_VALUE + 40));
+ assertEquals(Long.MAX_VALUE - 40, performVarLong(Long.MAX_VALUE - 40));
+ }
+
+ @Test
+ public void testIndexBeforeAfter() throws Exception {
+ final long BUCKET_SIZE = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ final long FIRST_START = TEST_START;
+ final long FIRST_END = FIRST_START + (2 * HOUR_IN_MILLIS);
+ final long SECOND_START = TEST_START + WEEK_IN_MILLIS;
+ final long SECOND_END = SECOND_START + HOUR_IN_MILLIS;
+ final long THIRD_START = TEST_START + (2 * WEEK_IN_MILLIS);
+ final long THIRD_END = THIRD_START + (2 * HOUR_IN_MILLIS);
+
+ stats.recordData(FIRST_START, FIRST_END,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+ stats.recordData(SECOND_START, SECOND_END,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+ stats.recordData(THIRD_START, THIRD_END,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+
+ // should have buckets: 2+1+2
+ assertEquals(5, stats.size());
+
+ assertIndexBeforeAfter(stats, 0, 0, Long.MIN_VALUE);
+ assertIndexBeforeAfter(stats, 0, 1, FIRST_START);
+ assertIndexBeforeAfter(stats, 0, 1, FIRST_START + MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 0, 2, FIRST_START + HOUR_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 1, 2, FIRST_START + HOUR_IN_MILLIS + MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 1, 2, FIRST_END - MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 1, 2, FIRST_END);
+ assertIndexBeforeAfter(stats, 1, 2, FIRST_END + MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 1, 2, SECOND_START - MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 1, 3, SECOND_START);
+ assertIndexBeforeAfter(stats, 2, 3, SECOND_END);
+ assertIndexBeforeAfter(stats, 2, 3, SECOND_END + MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 2, 3, THIRD_START - MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 2, 4, THIRD_START);
+ assertIndexBeforeAfter(stats, 3, 4, THIRD_START + MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 3, 4, THIRD_START + HOUR_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 4, 4, THIRD_END);
+ assertIndexBeforeAfter(stats, 4, 4, THIRD_END + MINUTE_IN_MILLIS);
+ assertIndexBeforeAfter(stats, 4, 4, Long.MAX_VALUE);
+ }
+
+ @Test
+ public void testIntersects() throws Exception {
+ final long BUCKET_SIZE = HOUR_IN_MILLIS;
+ stats = new NetworkStatsHistory(BUCKET_SIZE);
+
+ final long FIRST_START = TEST_START;
+ final long FIRST_END = FIRST_START + (2 * HOUR_IN_MILLIS);
+ final long SECOND_START = TEST_START + WEEK_IN_MILLIS;
+ final long SECOND_END = SECOND_START + HOUR_IN_MILLIS;
+ final long THIRD_START = TEST_START + (2 * WEEK_IN_MILLIS);
+ final long THIRD_END = THIRD_START + (2 * HOUR_IN_MILLIS);
+
+ stats.recordData(FIRST_START, FIRST_END,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+ stats.recordData(SECOND_START, SECOND_END,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+ stats.recordData(THIRD_START, THIRD_END,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+
+ assertFalse(stats.intersects(10, 20));
+ assertFalse(stats.intersects(TEST_START + YEAR_IN_MILLIS, TEST_START + YEAR_IN_MILLIS + 1));
+ assertFalse(stats.intersects(Long.MAX_VALUE, Long.MIN_VALUE));
+
+ assertTrue(stats.intersects(Long.MIN_VALUE, Long.MAX_VALUE));
+ assertTrue(stats.intersects(10, TEST_START + YEAR_IN_MILLIS));
+ assertTrue(stats.intersects(TEST_START, TEST_START));
+ assertTrue(stats.intersects(TEST_START + DAY_IN_MILLIS, TEST_START + DAY_IN_MILLIS + 1));
+ assertTrue(stats.intersects(TEST_START + DAY_IN_MILLIS, Long.MAX_VALUE));
+ assertTrue(stats.intersects(TEST_START + 1, Long.MAX_VALUE));
+
+ assertFalse(stats.intersects(Long.MIN_VALUE, TEST_START - 1));
+ assertTrue(stats.intersects(Long.MIN_VALUE, TEST_START));
+ assertTrue(stats.intersects(Long.MIN_VALUE, TEST_START + 1));
+ }
+
+ @Test
+ public void testSetValues() throws Exception {
+ stats = new NetworkStatsHistory(HOUR_IN_MILLIS);
+ stats.recordData(TEST_START, TEST_START + 1,
+ new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L));
+
+ assertEquals(1024L + 2048L, stats.getTotalBytes());
+
+ final NetworkStatsHistory.Entry entry = stats.getValues(0, null);
+ entry.rxBytes /= 2;
+ entry.txBytes *= 2;
+ stats.setValues(0, entry);
+
+ assertEquals(512L + 4096L, stats.getTotalBytes());
+ }
+
+ @Test
+ public void testMultiplySafe() {
+ assertEquals(25, multiplySafe(50, 1, 2));
+ assertEquals(100, multiplySafe(50, 2, 1));
+
+ assertEquals(-10, multiplySafe(30, -1, 3));
+ assertEquals(0, multiplySafe(30, 0, 3));
+ assertEquals(10, multiplySafe(30, 1, 3));
+ assertEquals(20, multiplySafe(30, 2, 3));
+ assertEquals(30, multiplySafe(30, 3, 3));
+ assertEquals(40, multiplySafe(30, 4, 3));
+
+ assertEquals(100_000_000_000L,
+ multiplySafe(300_000_000_000L, 10_000_000_000L, 30_000_000_000L));
+ assertEquals(100_000_000_010L,
+ multiplySafe(300_000_000_000L, 10_000_000_001L, 30_000_000_000L));
+ assertEquals(823_202_048L,
+ multiplySafe(4_939_212_288L, 2_121_815_528L, 12_730_893_165L));
+ }
+
+ private static void assertIndexBeforeAfter(
+ NetworkStatsHistory stats, int before, int after, long time) {
+ assertEquals("unexpected before", before, stats.getIndexBefore(time));
+ assertEquals("unexpected after", after, stats.getIndexAfter(time));
+ }
+
+ private static long performVarLong(long before) throws Exception {
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
+ writeVarLong(new DataOutputStream(out), before);
+
+ final ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+ return readVarLong(new DataInputStream(in));
+ }
+
+ private static void assertConsistent(NetworkStatsHistory stats) {
+ // verify timestamps are monotonic
+ long lastStart = Long.MIN_VALUE;
+ NetworkStatsHistory.Entry entry = null;
+ for (int i = 0; i < stats.size(); i++) {
+ entry = stats.getValues(i, entry);
+ assertTrue(lastStart < entry.bucketStart);
+ lastStart = entry.bucketStart;
+ }
+ }
+
+ private static void assertValues(
+ NetworkStatsHistory stats, int index, long rxBytes, long txBytes) {
+ final NetworkStatsHistory.Entry entry = stats.getValues(index, null);
+ assertEquals("unexpected rxBytes", rxBytes, entry.rxBytes);
+ assertEquals("unexpected txBytes", txBytes, entry.txBytes);
+ }
+
+ private static void assertValues(
+ NetworkStatsHistory stats, long start, long end, long rxBytes, long txBytes) {
+ final NetworkStatsHistory.Entry entry = stats.getValues(start, end, null);
+ assertEquals("unexpected rxBytes", rxBytes, entry.rxBytes);
+ assertEquals("unexpected txBytes", txBytes, entry.txBytes);
+ }
+
+ private static void assertValues(NetworkStatsHistory stats, int index, long activeTime,
+ long rxBytes, long rxPackets, long txBytes, long txPackets, long operations) {
+ final NetworkStatsHistory.Entry entry = stats.getValues(index, null);
+ assertEquals("unexpected activeTime", activeTime, entry.activeTime);
+ assertEquals("unexpected rxBytes", rxBytes, entry.rxBytes);
+ assertEquals("unexpected rxPackets", rxPackets, entry.rxPackets);
+ assertEquals("unexpected txBytes", txBytes, entry.txBytes);
+ assertEquals("unexpected txPackets", txPackets, entry.txPackets);
+ assertEquals("unexpected operations", operations, entry.operations);
+ }
+
+ private static void assertFullValues(NetworkStatsHistory stats, long activeTime, long rxBytes,
+ long rxPackets, long txBytes, long txPackets, long operations) {
+ assertValues(stats, Long.MIN_VALUE, Long.MAX_VALUE, activeTime, rxBytes, rxPackets, txBytes,
+ txPackets, operations);
+ }
+
+ private static void assertValues(NetworkStatsHistory stats, long start, long end,
+ long activeTime, long rxBytes, long rxPackets, long txBytes, long txPackets,
+ long operations) {
+ final NetworkStatsHistory.Entry entry = stats.getValues(start, end, null);
+ assertEquals("unexpected activeTime", activeTime, entry.activeTime);
+ assertEquals("unexpected rxBytes", rxBytes, entry.rxBytes);
+ assertEquals("unexpected rxPackets", rxPackets, entry.rxPackets);
+ assertEquals("unexpected txBytes", txBytes, entry.txBytes);
+ assertEquals("unexpected txPackets", txPackets, entry.txPackets);
+ assertEquals("unexpected operations", operations, entry.operations);
+ }
+}
diff --git a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
index 3b7566051fae..e2568fe4a0f2 100644
--- a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
+++ b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
@@ -452,18 +452,7 @@ public class WifiNl80211Manager {
@Override
public void onConnectedClientsChanged(NativeWifiClient client, boolean isConnected) {
- if (mVerboseLoggingEnabled) {
- Log.d(TAG, "onConnectedClientsChanged called with "
- + client.getMacAddress() + " isConnected: " + isConnected);
- }
-
- final long token = Binder.clearCallingIdentity();
- try {
- mExecutor.execute(
- () -> mSoftApListener.onConnectedClientsChanged(client, isConnected));
- } finally {
- Binder.restoreCallingIdentity(token);
- }
+ // Ignore event from wificond. This is handled from hostapd now.
}
@Override