Merge "Add UserQuotaTracker to IpSecService"
diff --git a/Android.mk b/Android.mk
index 28ff5c1..eedbbe6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -106,35 +106,35 @@
 	core/java/android/app/timezone/ICallback.aidl \
 	core/java/android/app/timezone/IRulesManager.aidl \
 	core/java/android/app/usage/IUsageStatsManager.aidl \
-	core/java/android/bluetooth/IBluetooth.aidl \
-	core/java/android/bluetooth/IBluetoothA2dp.aidl \
-	core/java/android/bluetooth/IBluetoothA2dpSink.aidl \
-	core/java/android/bluetooth/IBluetoothAvrcpController.aidl \
-	core/java/android/bluetooth/IBluetoothCallback.aidl \
-	core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl \
-	core/java/android/bluetooth/IBluetoothHeadset.aidl \
-	core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl \
-	core/java/android/bluetooth/IBluetoothHealth.aidl \
-	core/java/android/bluetooth/IBluetoothHealthCallback.aidl \
-	core/java/android/bluetooth/IBluetoothInputDevice.aidl \
-	core/java/android/bluetooth/IBluetoothPan.aidl \
-	core/java/android/bluetooth/IBluetoothManager.aidl \
-	core/java/android/bluetooth/IBluetoothManagerCallback.aidl \
-	core/java/android/bluetooth/IBluetoothMap.aidl \
-	core/java/android/bluetooth/IBluetoothMapClient.aidl \
-	core/java/android/bluetooth/IBluetoothPbap.aidl \
-	core/java/android/bluetooth/IBluetoothPbapClient.aidl \
-	core/java/android/bluetooth/IBluetoothSap.aidl \
-	core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \
-	core/java/android/bluetooth/IBluetoothHeadsetClient.aidl \
-	core/java/android/bluetooth/IBluetoothInputHost.aidl \
-	core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl \
-	core/java/android/bluetooth/IBluetoothGatt.aidl \
-	core/java/android/bluetooth/IBluetoothGattCallback.aidl \
-	core/java/android/bluetooth/IBluetoothGattServerCallback.aidl \
-	core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl \
-	core/java/android/bluetooth/le/IPeriodicAdvertisingCallback.aidl \
-	core/java/android/bluetooth/le/IScannerCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetooth.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothA2dp.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothA2dpSink.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothAvrcpController.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothProfileServiceConnection.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothHeadset.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothHeadsetPhone.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothHealth.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothHealthCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothInputDevice.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothPan.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothManager.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothManagerCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothMap.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothMapClient.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothPbap.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothPbapClient.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothSap.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothStateChangeCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothHeadsetClient.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothInputHost.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothHidDeviceCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothGatt.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothGattCallback.aidl \
+	../../system/bt/binder/android/bluetooth/IBluetoothGattServerCallback.aidl \
+	../../system/bt/binder/android/bluetooth/le/IAdvertisingSetCallback.aidl \
+	../../system/bt/binder/android/bluetooth/le/IPeriodicAdvertisingCallback.aidl \
+	../../system/bt/binder/android/bluetooth/le/IScannerCallback.aidl \
 	core/java/android/content/IClipboard.aidl \
 	core/java/android/content/IContentService.aidl \
 	core/java/android/content/IIntentReceiver.aidl \
@@ -510,7 +510,8 @@
 LOCAL_AIDL_INCLUDES += \
 	frameworks/av/camera/aidl \
 	frameworks/native/aidl/gui \
-	system/netd/server/binder
+	system/netd/server/binder \
+	system/bt/binder
 
 LOCAL_INTERMEDIATE_SOURCES := \
 			$(framework_res_source_path)/android/R.java \
@@ -752,16 +753,16 @@
 	frameworks/base/core/java/android/nfc/Tag.aidl \
 	frameworks/base/core/java/android/nfc/NdefRecord.aidl \
 	frameworks/base/core/java/android/nfc/NdefMessage.aidl \
-	frameworks/base/core/java/android/bluetooth/BluetoothHealthAppConfiguration.aidl \
-	frameworks/base/core/java/android/bluetooth/le/AdvertiseSettings.aidl \
-	frameworks/base/core/java/android/bluetooth/le/ScanSettings.aidl \
-	frameworks/base/core/java/android/bluetooth/le/AdvertiseData.aidl \
-	frameworks/base/core/java/android/bluetooth/le/ScanFilter.aidl \
-	frameworks/base/core/java/android/bluetooth/le/ScanResult.aidl \
-	frameworks/base/core/java/android/bluetooth/BluetoothDevice.aidl \
 	frameworks/base/core/java/android/database/CursorWindow.aidl \
 	frameworks/base/core/java/android/service/quicksettings/Tile.aidl \
 	frameworks/native/aidl/binder/android/os/PersistableBundle.aidl \
+	system/bt/binder/android/bluetooth/BluetoothHealthAppConfiguration.aidl \
+	system/bt/binder/android/bluetooth/le/AdvertiseSettings.aidl \
+	system/bt/binder/android/bluetooth/le/ScanSettings.aidl \
+	system/bt/binder/android/bluetooth/le/AdvertiseData.aidl \
+	system/bt/binder/android/bluetooth/le/ScanFilter.aidl \
+	system/bt/binder/android/bluetooth/le/ScanResult.aidl \
+	system/bt/binder/android/bluetooth/BluetoothDevice.aidl \
 	system/netd/server/binder/android/net/UidRange.aidl \
 	frameworks/base/telephony/java/android/telephony/PcoData.aidl \
 
diff --git a/cmds/svc/src/com/android/commands/svc/WifiCommand.java b/cmds/svc/src/com/android/commands/svc/WifiCommand.java
index 633dd97..e31cb53 100644
--- a/cmds/svc/src/com/android/commands/svc/WifiCommand.java
+++ b/cmds/svc/src/com/android/commands/svc/WifiCommand.java
@@ -51,6 +51,10 @@
             if (validCommand) {
                 IWifiManager wifiMgr
                         = IWifiManager.Stub.asInterface(ServiceManager.getService(Context.WIFI_SERVICE));
+                if (wifiMgr == null) {
+                    System.err.println("Wi-Fi service is not ready");
+                    return;
+                }
                 try {
                     wifiMgr.setWifiEnabled("com.android.shell", flag);
                 }
diff --git a/core/java/android/app/DexLoadReporter.java b/core/java/android/app/DexLoadReporter.java
index 13f288a..5f61e07 100644
--- a/core/java/android/app/DexLoadReporter.java
+++ b/core/java/android/app/DexLoadReporter.java
@@ -28,6 +28,8 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -86,29 +88,46 @@
     }
 
     @Override
-    public void report(List<String> dexPaths) {
-        if (dexPaths.isEmpty()) {
+    public void report(List<BaseDexClassLoader> classLoadersChain, List<String> classPaths) {
+        if (classLoadersChain.size() != classPaths.size()) {
+            Slog.wtf(TAG, "Bad call to DexLoadReporter: argument size mismatch");
             return;
         }
+        if (classPaths.isEmpty()) {
+            Slog.wtf(TAG, "Bad call to DexLoadReporter: empty dex paths");
+            return;
+        }
+
+        // The first element of classPaths is the list of dex files that should be registered.
+        // The classpath is represented as a list of dex files separated by File.pathSeparator.
+        String[] dexPathsForRegistration = classPaths.get(0).split(File.pathSeparator);
+        if (dexPathsForRegistration.length == 0) {
+            // No dex files to register.
+            return;
+        }
+
         // Notify the package manager about the dex loads unconditionally.
         // The load might be for either a primary or secondary dex file.
-        notifyPackageManager(dexPaths);
-        // Check for secondary dex files and register them for profiling if
-        // possible.
-        registerSecondaryDexForProfiling(dexPaths);
+        notifyPackageManager(classLoadersChain, classPaths);
+        // Check for secondary dex files and register them for profiling if possible.
+        // Note that we only register the dex paths belonging to the first class loader.
+        registerSecondaryDexForProfiling(dexPathsForRegistration);
     }
 
-    private void notifyPackageManager(List<String> dexPaths) {
+    private void notifyPackageManager(List<BaseDexClassLoader> ignored,
+            List<String> classPaths) {
         String packageName = ActivityThread.currentPackageName();
         try {
+            // Notify only the paths of the first class loader for now.
             ActivityThread.getPackageManager().notifyDexLoad(
-                    packageName, dexPaths, VMRuntime.getRuntime().vmInstructionSet());
+                    packageName, Arrays.asList(classPaths.get(0).split(File.pathSeparator)),
+                    VMRuntime.getRuntime().vmInstructionSet());
         } catch (RemoteException re) {
             Slog.e(TAG, "Failed to notify PM about dex load for package " + packageName, re);
         }
     }
 
-    private void registerSecondaryDexForProfiling(List<String> dexPaths) {
+    private void registerSecondaryDexForProfiling(String[] dexPaths) {
         if (!SystemProperties.getBoolean("dalvik.vm.dexopt.secondary", false)) {
             return;
         }
diff --git a/core/java/android/bluetooth/BluetoothActivityEnergyInfo.aidl b/core/java/android/bluetooth/BluetoothActivityEnergyInfo.aidl
deleted file mode 100644
index 60cbf9f..0000000
--- a/core/java/android/bluetooth/BluetoothActivityEnergyInfo.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 android.bluetooth;
-
-parcelable BluetoothActivityEnergyInfo;
diff --git a/core/java/android/bluetooth/BluetoothAudioConfig.aidl b/core/java/android/bluetooth/BluetoothAudioConfig.aidl
deleted file mode 100644
index 63be5cf..0000000
--- a/core/java/android/bluetooth/BluetoothAudioConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2009 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;
-
-parcelable BluetoothAudioConfig;
diff --git a/core/java/android/bluetooth/BluetoothAvrcpPlayerSettings.aidl b/core/java/android/bluetooth/BluetoothAvrcpPlayerSettings.aidl
deleted file mode 100644
index 590fd63..0000000
--- a/core/java/android/bluetooth/BluetoothAvrcpPlayerSettings.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.bluetooth;
-
-parcelable BluetoothAvrcpPlayerSettings;
diff --git a/core/java/android/bluetooth/BluetoothCodecConfig.aidl b/core/java/android/bluetooth/BluetoothCodecConfig.aidl
deleted file mode 100644
index 553e66e..0000000
--- a/core/java/android/bluetooth/BluetoothCodecConfig.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-parcelable BluetoothCodecConfig;
diff --git a/core/java/android/bluetooth/BluetoothCodecStatus.aidl b/core/java/android/bluetooth/BluetoothCodecStatus.aidl
deleted file mode 100644
index f9c3a3d..0000000
--- a/core/java/android/bluetooth/BluetoothCodecStatus.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.bluetooth;
-
-parcelable BluetoothCodecStatus;
diff --git a/core/java/android/bluetooth/BluetoothDevice.aidl b/core/java/android/bluetooth/BluetoothDevice.aidl
deleted file mode 100644
index daae74d..0000000
--- a/core/java/android/bluetooth/BluetoothDevice.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2009 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;
-
-parcelable BluetoothDevice;
diff --git a/core/java/android/bluetooth/BluetoothGattCharacteristic.aidl b/core/java/android/bluetooth/BluetoothGattCharacteristic.aidl
deleted file mode 100644
index bbb8623..0000000
--- a/core/java/android/bluetooth/BluetoothGattCharacteristic.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-parcelable BluetoothGattCharacteristic;
diff --git a/core/java/android/bluetooth/BluetoothGattDescriptor.aidl b/core/java/android/bluetooth/BluetoothGattDescriptor.aidl
deleted file mode 100644
index 4393273..0000000
--- a/core/java/android/bluetooth/BluetoothGattDescriptor.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-parcelable BluetoothGattDescriptor;
diff --git a/core/java/android/bluetooth/BluetoothGattIncludedService.aidl b/core/java/android/bluetooth/BluetoothGattIncludedService.aidl
deleted file mode 100644
index 1ef427e..0000000
--- a/core/java/android/bluetooth/BluetoothGattIncludedService.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-parcelable BluetoothGattIncludedService;
diff --git a/core/java/android/bluetooth/BluetoothGattService.aidl b/core/java/android/bluetooth/BluetoothGattService.aidl
deleted file mode 100644
index 84314d2..0000000
--- a/core/java/android/bluetooth/BluetoothGattService.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-parcelable BluetoothGattService;
diff --git a/core/java/android/bluetooth/BluetoothHeadsetClientCall.aidl b/core/java/android/bluetooth/BluetoothHeadsetClientCall.aidl
deleted file mode 100644
index 35f7923..0000000
--- a/core/java/android/bluetooth/BluetoothHeadsetClientCall.aidl
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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 android.bluetooth;
-
-parcelable BluetoothHeadsetClientCall;
diff --git a/core/java/android/bluetooth/BluetoothHealthAppConfiguration.aidl b/core/java/android/bluetooth/BluetoothHealthAppConfiguration.aidl
deleted file mode 100644
index bc9e54f..0000000
--- a/core/java/android/bluetooth/BluetoothHealthAppConfiguration.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-** Copyright 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.bluetooth;
-
-parcelable BluetoothHealthAppConfiguration;
diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.aidl b/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.aidl
deleted file mode 100644
index 283a717..0000000
--- a/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-** Copyright 2016, 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;
-
-parcelable BluetoothHidDeviceAppConfiguration;
diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.aidl b/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.aidl
deleted file mode 100644
index 14f9114..0000000
--- a/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-** Copyright 2016, 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;
-
-parcelable BluetoothHidDeviceAppQosSettings;
diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.aidl b/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.aidl
deleted file mode 100644
index 87dd10e..0000000
--- a/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-** Copyright 2016, 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;
-
-parcelable BluetoothHidDeviceAppSdpSettings;
diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl
deleted file mode 100644
index 1d7cfc9..0000000
--- a/core/java/android/bluetooth/IBluetooth.aidl
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2008, 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.bluetooth.IBluetoothCallback;
-import android.bluetooth.IBluetoothStateChangeCallback;
-import android.bluetooth.BluetoothActivityEnergyInfo;
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.OobData;
-import android.os.ParcelUuid;
-import android.os.ParcelFileDescriptor;
-import android.os.ResultReceiver;
-
-/**
- * System private API for talking with the Bluetooth service.
- *
- * {@hide}
- */
-interface IBluetooth
-{
-    boolean isEnabled();
-    int getState();
-    boolean enable();
-    boolean enableNoAutoConnect();
-    boolean disable();
-
-    String getAddress();
-    ParcelUuid[] getUuids();
-    boolean setName(in String name);
-    String getName();
-
-    int getScanMode();
-    boolean setScanMode(int mode, int duration);
-
-    int getDiscoverableTimeout();
-    boolean setDiscoverableTimeout(int timeout);
-
-    boolean startDiscovery();
-    boolean cancelDiscovery();
-    boolean isDiscovering();
-    long getDiscoveryEndMillis();
-
-    int getAdapterConnectionState();
-    int getProfileConnectionState(int profile);
-
-    BluetoothDevice[] getBondedDevices();
-    boolean createBond(in BluetoothDevice device, in int transport);
-    boolean createBondOutOfBand(in BluetoothDevice device, in int transport, in OobData oobData);
-    boolean cancelBondProcess(in BluetoothDevice device);
-    boolean removeBond(in BluetoothDevice device);
-    int getBondState(in BluetoothDevice device);
-    boolean isBondingInitiatedLocally(in BluetoothDevice device);
-    long getSupportedProfiles();
-    int getConnectionState(in BluetoothDevice device);
-
-    String getRemoteName(in BluetoothDevice device);
-    int getRemoteType(in BluetoothDevice device);
-    String getRemoteAlias(in BluetoothDevice device);
-    boolean setRemoteAlias(in BluetoothDevice device, in String name);
-    int getRemoteClass(in BluetoothDevice device);
-    ParcelUuid[] getRemoteUuids(in BluetoothDevice device);
-    boolean fetchRemoteUuids(in BluetoothDevice device);
-    boolean sdpSearch(in BluetoothDevice device, in ParcelUuid uuid);
-    int getBatteryLevel(in BluetoothDevice device);
-
-    boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode);
-    boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[]
-    passkey);
-    boolean setPairingConfirmation(in BluetoothDevice device, boolean accept);
-
-    int getPhonebookAccessPermission(in BluetoothDevice device);
-    boolean setPhonebookAccessPermission(in BluetoothDevice device, int value);
-    int getMessageAccessPermission(in BluetoothDevice device);
-    boolean setMessageAccessPermission(in BluetoothDevice device, int value);
-    int getSimAccessPermission(in BluetoothDevice device);
-    boolean setSimAccessPermission(in BluetoothDevice device, int value);
-
-    void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState);
-
-    void registerCallback(in IBluetoothCallback callback);
-    void unregisterCallback(in IBluetoothCallback callback);
-
-    // For Socket
-    ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag);
-    ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag);
-
-    boolean factoryReset();
-
-    boolean isMultiAdvertisementSupported();
-    boolean isOffloadedFilteringSupported();
-    boolean isOffloadedScanBatchingSupported();
-    boolean isActivityAndEnergyReportingSupported();
-    boolean isLe2MPhySupported();
-    boolean isLeCodedPhySupported();
-    boolean isLeExtendedAdvertisingSupported();
-    boolean isLePeriodicAdvertisingSupported();
-    int getLeMaximumAdvertisingDataLength();
-    BluetoothActivityEnergyInfo reportActivityInfo();
-
-    /**
-     * Requests the controller activity info asynchronously.
-     * The implementor is expected to reply with the
-     * {@link android.bluetooth.BluetoothActivityEnergyInfo} object placed into the Bundle with the
-     * key {@link android.os.BatteryStats#RESULT_RECEIVER_CONTROLLER_KEY}.
-     * The result code is ignored.
-     */
-    oneway void requestActivityInfo(in ResultReceiver result);
-
-    void onLeServiceUp();
-    void onBrEdrDown();
-}
diff --git a/core/java/android/bluetooth/IBluetoothA2dp.aidl b/core/java/android/bluetooth/IBluetoothA2dp.aidl
deleted file mode 100644
index a775a1f..0000000
--- a/core/java/android/bluetooth/IBluetoothA2dp.aidl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2008 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.bluetooth.BluetoothCodecConfig;
-import android.bluetooth.BluetoothCodecStatus;
-import android.bluetooth.BluetoothDevice;
-
-/**
- * APIs for Bluetooth A2DP service
- *
- * @hide
- */
-interface IBluetoothA2dp {
-    // Public API
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-    boolean isAvrcpAbsoluteVolumeSupported();
-    oneway void adjustAvrcpAbsoluteVolume(int direction);
-    oneway void setAvrcpAbsoluteVolume(int volume);
-    boolean isA2dpPlaying(in BluetoothDevice device);
-    BluetoothCodecStatus getCodecStatus();
-    oneway void setCodecConfigPreference(in BluetoothCodecConfig codecConfig);
-    oneway void enableOptionalCodecs();
-    oneway void disableOptionalCodecs();
-}
diff --git a/core/java/android/bluetooth/IBluetoothA2dpSink.aidl b/core/java/android/bluetooth/IBluetoothA2dpSink.aidl
deleted file mode 100755
index d1458246..0000000
--- a/core/java/android/bluetooth/IBluetoothA2dpSink.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 android.bluetooth;
-
-import android.bluetooth.BluetoothAudioConfig;
-import android.bluetooth.BluetoothDevice;
-
-/**
- * APIs for Bluetooth A2DP sink service
- *
- * @hide
- */
-interface IBluetoothA2dpSink {
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    BluetoothAudioConfig getAudioConfig(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-    boolean isA2dpPlaying(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothAvrcpController.aidl b/core/java/android/bluetooth/IBluetoothAvrcpController.aidl
deleted file mode 100644
index cfa11ca..0000000
--- a/core/java/android/bluetooth/IBluetoothAvrcpController.aidl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 android.bluetooth;
-
-import android.bluetooth.BluetoothAvrcpPlayerSettings;
-import android.bluetooth.BluetoothDevice;
-import android.media.MediaMetadata;
-import android.media.session.PlaybackState;
-
-/**
- * APIs for Bluetooth AVRCP controller service
- *
- * @hide
- */
-interface IBluetoothAvrcpController {
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    BluetoothAvrcpPlayerSettings getPlayerSettings(in BluetoothDevice device);
-    boolean setPlayerApplicationSetting(in BluetoothAvrcpPlayerSettings plAppSetting);
-    void sendGroupNavigationCmd(in BluetoothDevice device, int keyCode, int keyState);
-}
diff --git a/core/java/android/bluetooth/IBluetoothCallback.aidl b/core/java/android/bluetooth/IBluetoothCallback.aidl
deleted file mode 100644
index e280978..0000000
--- a/core/java/android/bluetooth/IBluetoothCallback.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2009, 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;
-
-/**
- * System private API for Bluetooth service callbacks.
- *
- * {@hide}
- */
-interface IBluetoothCallback
-{
-    //void onRfcommChannelFound(int channel);
-    void onBluetoothStateChange(int prevState, int newState);
-}
diff --git a/core/java/android/bluetooth/IBluetoothGatt.aidl b/core/java/android/bluetooth/IBluetoothGatt.aidl
deleted file mode 100644
index 05cef60..0000000
--- a/core/java/android/bluetooth/IBluetoothGatt.aidl
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2013 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.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothGattService;
-import android.bluetooth.le.AdvertiseSettings;
-import android.bluetooth.le.AdvertiseData;
-import android.bluetooth.le.AdvertisingSetParameters;
-import android.bluetooth.le.PeriodicAdvertisingParameters;
-import android.bluetooth.le.ScanFilter;
-import android.bluetooth.le.ScanResult;
-import android.bluetooth.le.ScanSettings;
-import android.bluetooth.le.ResultStorageDescriptor;
-import android.os.ParcelUuid;
-import android.os.WorkSource;
-
-import android.bluetooth.IBluetoothGattCallback;
-import android.bluetooth.IBluetoothGattServerCallback;
-import android.bluetooth.le.IAdvertisingSetCallback;
-import android.bluetooth.le.IPeriodicAdvertisingCallback;
-import android.bluetooth.le.IScannerCallback;
-
-/**
- * API for interacting with BLE / GATT
- * @hide
- */
-interface IBluetoothGatt {
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-
-    void registerScanner(in IScannerCallback callback, in WorkSource workSource);
-    void unregisterScanner(in int scannerId);
-    void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters,
-                   in List scanStorages, in String callingPackage);
-    void stopScan(in int scannerId);
-    void flushPendingBatchResults(in int scannerId);
-
-    void startAdvertisingSet(in AdvertisingSetParameters parameters, in AdvertiseData advertiseData,
-                                in AdvertiseData scanResponse, in PeriodicAdvertisingParameters periodicParameters,
-                                in AdvertiseData periodicData, in int duration, in int maxExtAdvEvents,
-                                in IAdvertisingSetCallback callback);
-    void stopAdvertisingSet(in IAdvertisingSetCallback callback);
-
-    void getOwnAddress(in int advertiserId);
-    void enableAdvertisingSet(in int advertiserId, in boolean enable, in int duration, in int maxExtAdvEvents);
-    void setAdvertisingData(in int advertiserId, in AdvertiseData data);
-    void setScanResponseData(in int advertiserId, in AdvertiseData data);
-    void setAdvertisingParameters(in int advertiserId, in AdvertisingSetParameters parameters);
-    void setPeriodicAdvertisingParameters(in int advertiserId, in PeriodicAdvertisingParameters parameters);
-    void setPeriodicAdvertisingData(in int advertiserId, in AdvertiseData data);
-    void setPeriodicAdvertisingEnable(in int advertiserId, in boolean enable);
-
-    void registerSync(in ScanResult scanResult, in int skip, in int timeout, in IPeriodicAdvertisingCallback callback);
-    void unregisterSync(in IPeriodicAdvertisingCallback callback);
-
-    void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback);
-
-    void unregisterClient(in int clientIf);
-    void clientConnect(in int clientIf, in String address, in boolean isDirect, in int transport, in boolean opportunistic, in int phy);
-    void clientDisconnect(in int clientIf, in String address);
-    void clientSetPreferredPhy(in int clientIf, in String address, in int txPhy, in int rxPhy, in int phyOptions);
-    void clientReadPhy(in int clientIf, in String address);
-    void refreshDevice(in int clientIf, in String address);
-    void discoverServices(in int clientIf, in String address);
-    void discoverServiceByUuid(in int clientIf, in String address, in ParcelUuid uuid);
-    void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq);
-    void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid,
-                           in int startHandle, in int endHandle, in int authReq);
-    void writeCharacteristic(in int clientIf, in String address, in int handle,
-                            in int writeType, in int authReq, in byte[] value);
-    void readDescriptor(in int clientIf, in String address, in int handle, in int authReq);
-    void writeDescriptor(in int clientIf, in String address, in int handle,
-                            in int authReq, in byte[] value);
-    void registerForNotification(in int clientIf, in String address, in int handle, in boolean enable);
-    void beginReliableWrite(in int clientIf, in String address);
-    void endReliableWrite(in int clientIf, in String address, in boolean execute);
-    void readRemoteRssi(in int clientIf, in String address);
-    void configureMTU(in int clientIf, in String address, in int mtu);
-    void connectionParameterUpdate(in int clientIf, in String address, in int connectionPriority);
-
-    void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback);
-    void unregisterServer(in int serverIf);
-    void serverConnect(in int serverIf, in String address, in boolean isDirect, in int transport);
-    void serverDisconnect(in int serverIf, in String address);
-    void serverSetPreferredPhy(in int clientIf, in String address, in int txPhy, in int rxPhy, in int phyOptions);
-    void serverReadPhy(in int clientIf, in String address);
-    void addService(in int serverIf, in BluetoothGattService service);
-    void removeService(in int serverIf, in int handle);
-    void clearServices(in int serverIf);
-    void sendResponse(in int serverIf, in String address, in int requestId,
-                            in int status, in int offset, in byte[] value);
-    void sendNotification(in int serverIf, in String address, in int handle,
-                            in boolean confirm, in byte[] value);
-    void disconnectAll();
-    void unregAll();
-    int numHwTrackFiltersAvailable();
-}
diff --git a/core/java/android/bluetooth/IBluetoothGattCallback.aidl b/core/java/android/bluetooth/IBluetoothGattCallback.aidl
deleted file mode 100644
index 4f85cdd..0000000
--- a/core/java/android/bluetooth/IBluetoothGattCallback.aidl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2013 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.os.ParcelUuid;
-import android.bluetooth.BluetoothGattService;
-
-/**
- * Callback definitions for interacting with BLE / GATT
- * @hide
- */
-oneway interface IBluetoothGattCallback {
-    void onClientRegistered(in int status, in int clientIf);
-    void onClientConnectionState(in int status, in int clientIf,
-                                 in boolean connected, in String address);
-    void onPhyUpdate(in String address, in int txPhy, in int rxPhy, in int status);
-    void onPhyRead(in String address, in int txPhy, in int rxPhy, in int status);
-    void onSearchComplete(in String address, in List<BluetoothGattService> services, in int status);
-    void onCharacteristicRead(in String address, in int status, in int handle, in byte[] value);
-    void onCharacteristicWrite(in String address, in int status, in int handle);
-    void onExecuteWrite(in String address, in int status);
-    void onDescriptorRead(in String address, in int status, in int handle, in byte[] value);
-    void onDescriptorWrite(in String address, in int status, in int handle);
-    void onNotify(in String address, in int handle, in byte[] value);
-    void onReadRemoteRssi(in String address, in int rssi, in int status);
-    void onConfigureMTU(in String address, in int mtu, in int status);
-    void onConnectionUpdated(in String address, in int interval, in int latency,
-                             in int timeout, in int status);
-}
diff --git a/core/java/android/bluetooth/IBluetoothGattServerCallback.aidl b/core/java/android/bluetooth/IBluetoothGattServerCallback.aidl
deleted file mode 100644
index 74ee11f..0000000
--- a/core/java/android/bluetooth/IBluetoothGattServerCallback.aidl
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.bluetooth;
-
-import android.bluetooth.BluetoothGattService;
-
-/**
- * Callback definitions for interacting with BLE / GATT
- * @hide
- */
-oneway interface IBluetoothGattServerCallback {
-    void onServerRegistered(in int status, in int serverIf);
-    void onServerConnectionState(in int status, in int serverIf,
-                                 in boolean connected, in String address);
-    void onServiceAdded(in int status, in BluetoothGattService service);
-    void onCharacteristicReadRequest(in String address, in int transId, in int offset,
-                                     in boolean isLong, in int handle);
-    void onDescriptorReadRequest(in String address, in int transId,
-                                     in int offset, in boolean isLong,
-                                     in int handle);
-    void onCharacteristicWriteRequest(in String address, in int transId, in int offset,
-                                     in int length, in boolean isPrep, in boolean needRsp,
-                                     in int handle, in byte[] value);
-    void onDescriptorWriteRequest(in String address, in int transId, in int offset,
-                                     in int length, in boolean isPrep, in boolean needRsp,
-                                     in int handle, in byte[] value);
-    void onExecuteWrite(in String address, in int transId, in boolean execWrite);
-    void onNotificationSent(in String address, in int status);
-    void onMtuChanged(in String address, in int mtu);
-    void onPhyUpdate(in String address, in int txPhy, in int rxPhy, in int status);
-    void onPhyRead(in String address, in int txPhy, in int rxPhy, in int status);
-    void onConnectionUpdated(in String address, in int interval, in int latency,
-                             in int timeout, in int status);
-}
diff --git a/core/java/android/bluetooth/IBluetoothHeadset.aidl b/core/java/android/bluetooth/IBluetoothHeadset.aidl
deleted file mode 100755
index 6bd0d7f..0000000
--- a/core/java/android/bluetooth/IBluetoothHeadset.aidl
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2008 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.bluetooth.BluetoothDevice;
-
-/**
- * API for Bluetooth Headset service
- *
- * {@hide}
- */
-interface IBluetoothHeadset {
-    // Public API
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-    boolean startVoiceRecognition(in BluetoothDevice device);
-    boolean stopVoiceRecognition(in BluetoothDevice device);
-    boolean isAudioConnected(in BluetoothDevice device);
-    boolean sendVendorSpecificResultCode(in BluetoothDevice device,
-                                         in String command,
-                                         in String arg);
-
-    // APIs that can be made public in future
-    int getBatteryUsageHint(in BluetoothDevice device);
-
-    // Internal functions, not be made public
-    boolean acceptIncomingConnect(in BluetoothDevice device);
-    boolean rejectIncomingConnect(in BluetoothDevice device);
-    int getAudioState(in BluetoothDevice device);
-
-    boolean isAudioOn();
-    boolean connectAudio();
-    boolean disconnectAudio();
-    void setAudioRouteAllowed(boolean allowed);
-    boolean getAudioRouteAllowed();
-    void setForceScoAudio(boolean forced);
-    boolean startScoUsingVirtualVoiceCall(in BluetoothDevice device);
-    boolean stopScoUsingVirtualVoiceCall(in BluetoothDevice device);
-    void phoneStateChanged(int numActive, int numHeld, int callState, String number, int type);
-    void clccResponse(int index, int direction, int status, int mode, boolean mpty,
-                      String number, int type);
-    boolean enableWBS();
-    boolean disableWBS();
-    void bindResponse(int ind_id, boolean ind_status);
-}
diff --git a/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl b/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl
deleted file mode 100644
index e571b00..0000000
--- a/core/java/android/bluetooth/IBluetoothHeadsetClient.aidl
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 android.bluetooth;
-
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothHeadsetClientCall;
-import android.os.Bundle;
-
-/**
- * API for Bluetooth Headset Client service (HFP HF Role)
- *
- * {@hide}
- */
-interface IBluetoothHeadsetClient {
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-
-    boolean startVoiceRecognition(in BluetoothDevice device);
-    boolean stopVoiceRecognition(in BluetoothDevice device);
-
-    List<BluetoothHeadsetClientCall> getCurrentCalls(in BluetoothDevice device);
-    Bundle getCurrentAgEvents(in BluetoothDevice device);
-
-    boolean acceptCall(in BluetoothDevice device, int flag);
-    boolean holdCall(in BluetoothDevice device);
-    boolean rejectCall(in BluetoothDevice device);
-    boolean terminateCall(in BluetoothDevice device, in BluetoothHeadsetClientCall call);
-
-    boolean enterPrivateMode(in BluetoothDevice device, int index);
-    boolean explicitCallTransfer(in BluetoothDevice device);
-
-    BluetoothHeadsetClientCall dial(in BluetoothDevice device, String number);
-
-    boolean sendDTMF(in BluetoothDevice device, byte code);
-    boolean getLastVoiceTagNumber(in BluetoothDevice device);
-
-    int getAudioState(in BluetoothDevice device);
-    boolean connectAudio(in BluetoothDevice device);
-    boolean disconnectAudio(in BluetoothDevice device);
-    void setAudioRouteAllowed(in BluetoothDevice device, boolean allowed);
-    boolean getAudioRouteAllowed(in BluetoothDevice device);
-
-    Bundle getCurrentAgFeatures(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl b/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl
deleted file mode 100644
index d5e64f6..0000000
--- a/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2012 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;
-
-/**
- * API for Bluetooth Headset Phone Service in phone app
- *
- * {@hide}
- */
-interface IBluetoothHeadsetPhone {
-  // Internal functions, not be made public
-  boolean answerCall();
-  boolean hangupCall();
-  boolean sendDtmf(int dtmf);
-  boolean processChld(int chld);
-  String getNetworkOperator();
-  String getSubscriberNumber();
-  boolean listCurrentCalls();
-  boolean queryPhoneState();
-
-  // Internal for phone app to call
-  void updateBtHandsfreeAfterRadioTechnologyChange();
-  void cdmaSwapSecondCallState();
-  void cdmaSetSecondCallState(boolean state);
-}
diff --git a/core/java/android/bluetooth/IBluetoothHealth.aidl b/core/java/android/bluetooth/IBluetoothHealth.aidl
deleted file mode 100644
index a84a42c..0000000
--- a/core/java/android/bluetooth/IBluetoothHealth.aidl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothHealthAppConfiguration;
-import android.bluetooth.IBluetoothHealthCallback;
-import android.os.ParcelFileDescriptor;
-
-/**
- * API for Bluetooth Health service
- *
- * {@hide}
- */
-interface IBluetoothHealth
-{
-    boolean registerAppConfiguration(in BluetoothHealthAppConfiguration config,
-        in IBluetoothHealthCallback callback);
-    boolean unregisterAppConfiguration(in BluetoothHealthAppConfiguration config);
-    boolean connectChannelToSource(in BluetoothDevice device, in BluetoothHealthAppConfiguration config);
-    boolean connectChannelToSink(in BluetoothDevice device, in BluetoothHealthAppConfiguration config,
-        int channelType);
-    boolean disconnectChannel(in BluetoothDevice device, in BluetoothHealthAppConfiguration config, int id);
-    ParcelFileDescriptor getMainChannelFd(in BluetoothDevice device, in BluetoothHealthAppConfiguration config);
-    List<BluetoothDevice> getConnectedHealthDevices();
-    List<BluetoothDevice> getHealthDevicesMatchingConnectionStates(in int[] states);
-    int getHealthDeviceConnectionState(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothHealthCallback.aidl b/core/java/android/bluetooth/IBluetoothHealthCallback.aidl
deleted file mode 100644
index 0ace9fe..0000000
--- a/core/java/android/bluetooth/IBluetoothHealthCallback.aidl
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.bluetooth;
-
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothHealthAppConfiguration;
-import android.os.ParcelFileDescriptor;
-
-/**
- *@hide
- */
-interface IBluetoothHealthCallback
-{
-    void onHealthAppConfigurationStatusChange(in BluetoothHealthAppConfiguration config, int status);
-    void onHealthChannelStateChange(in BluetoothHealthAppConfiguration config,
-        in BluetoothDevice device, int prevState, int newState, in
-        ParcelFileDescriptor fd, int id);
-}
diff --git a/core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl b/core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl
deleted file mode 100644
index a737198..0000000
--- a/core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2016, 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.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothHidDeviceAppConfiguration;
-
-/** @hide */
-interface IBluetoothHidDeviceCallback {
-   void onAppStatusChanged(in BluetoothDevice device, in BluetoothHidDeviceAppConfiguration config, boolean registered);
-   void onConnectionStateChanged(in BluetoothDevice device, in int state);
-   void onGetReport(in BluetoothDevice device, in byte type, in byte id, in int bufferSize);
-   void onSetReport(in BluetoothDevice device, in byte type, in byte id, in byte[] data);
-   void onSetProtocol(in BluetoothDevice device, in byte protocol);
-   void onIntrData(in BluetoothDevice device, in byte reportId, in byte[] data);
-   void onVirtualCableUnplug(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothInputDevice.aidl b/core/java/android/bluetooth/IBluetoothInputDevice.aidl
deleted file mode 100644
index 5bd3f78..0000000
--- a/core/java/android/bluetooth/IBluetoothInputDevice.aidl
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2012 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.bluetooth.BluetoothDevice;
-
-/**
- * API for Bluetooth HID service
- *
- * {@hide}
- */
-interface IBluetoothInputDevice {
-    // Public API
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-    /**
-    * @hide
-    */
-    boolean getProtocolMode(in BluetoothDevice device);
-    /**
-    * @hide
-    */
-    boolean virtualUnplug(in BluetoothDevice device);
-    /**
-    * @hide
-    */
-    boolean setProtocolMode(in BluetoothDevice device, int protocolMode);
-    /**
-    * @hide
-    */
-    boolean getReport(in BluetoothDevice device, byte reportType, byte reportId, int bufferSize);
-    /**
-    * @hide
-    */
-    boolean setReport(in BluetoothDevice device, byte reportType, String report);
-    /**
-    * @hide
-    */
-    boolean sendData(in BluetoothDevice device, String report);
-    /**
-    * @hide
-    */
-    boolean getIdleTime(in BluetoothDevice device);
-    /**
-    * @hide
-    */
-    boolean setIdleTime(in BluetoothDevice device, byte idleTime);
-}
diff --git a/core/java/android/bluetooth/IBluetoothInputHost.aidl b/core/java/android/bluetooth/IBluetoothInputHost.aidl
deleted file mode 100644
index 6c4993f..0000000
--- a/core/java/android/bluetooth/IBluetoothInputHost.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2016 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.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothHidDeviceAppConfiguration;
-import android.bluetooth.IBluetoothHidDeviceCallback;
-import android.bluetooth.BluetoothHidDeviceAppSdpSettings;
-import android.bluetooth.BluetoothHidDeviceAppQosSettings;
-
-/** @hide */
-interface IBluetoothInputHost {
-    boolean registerApp(in BluetoothHidDeviceAppConfiguration config,
-            in BluetoothHidDeviceAppSdpSettings sdp, in BluetoothHidDeviceAppQosSettings inQos,
-            in BluetoothHidDeviceAppQosSettings outQos, in IBluetoothHidDeviceCallback callback);
-    boolean unregisterApp(in BluetoothHidDeviceAppConfiguration config);
-    boolean sendReport(in BluetoothDevice device, in int id, in byte[] data);
-    boolean replyReport(in BluetoothDevice device, in byte type, in byte id, in byte[] data);
-    boolean reportError(in BluetoothDevice device, byte error);
-    boolean unplug(in BluetoothDevice device);
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothManager.aidl b/core/java/android/bluetooth/IBluetoothManager.aidl
deleted file mode 100644
index 5afd774..0000000
--- a/core/java/android/bluetooth/IBluetoothManager.aidl
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 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.bluetooth.IBluetooth;
-import android.bluetooth.IBluetoothGatt;
-import android.bluetooth.IBluetoothManagerCallback;
-import android.bluetooth.IBluetoothProfileServiceConnection;
-import android.bluetooth.IBluetoothStateChangeCallback;
-
-/**
- * System private API for talking with the Bluetooth service.
- *
- * {@hide}
- */
-interface IBluetoothManager
-{
-    IBluetooth registerAdapter(in IBluetoothManagerCallback callback);
-    void unregisterAdapter(in IBluetoothManagerCallback callback);
-    void registerStateChangeCallback(in IBluetoothStateChangeCallback callback);
-    void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback);
-    boolean isEnabled();
-    boolean enable(String packageName);
-    boolean enableNoAutoConnect(String packageName);
-    boolean disable(String packageName, boolean persist);
-    int getState();
-    IBluetoothGatt getBluetoothGatt();
-
-    boolean bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy);
-    void unbindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy);
-
-    String getAddress();
-    String getName();
-
-    boolean isBleScanAlwaysAvailable();
-    int updateBleAppCount(IBinder b, boolean enable, String packageName);
-    boolean isBleAppPresent();
-}
diff --git a/core/java/android/bluetooth/IBluetoothManagerCallback.aidl b/core/java/android/bluetooth/IBluetoothManagerCallback.aidl
deleted file mode 100644
index 8104d21..0000000
--- a/core/java/android/bluetooth/IBluetoothManagerCallback.aidl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2012 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.bluetooth.IBluetooth;
-
-/**
- * API for Communication between BluetoothAdapter and BluetoothManager
- *
- * {@hide}
- */
-oneway interface IBluetoothManagerCallback {
-    void onBluetoothServiceUp(in IBluetooth bluetoothService);
-    void onBluetoothServiceDown();
-    void onBrEdrDown();
-}
diff --git a/core/java/android/bluetooth/IBluetoothMap.aidl b/core/java/android/bluetooth/IBluetoothMap.aidl
deleted file mode 100644
index d4af63d..0000000
--- a/core/java/android/bluetooth/IBluetoothMap.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2008 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.bluetooth.BluetoothDevice;
-
-/**
- * System private API for Bluetooth MAP service
- *
- * {@hide}
- */
-interface IBluetoothMap {
-    int getState();
-    BluetoothDevice getClient();
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    boolean isConnected(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothMapClient.aidl b/core/java/android/bluetooth/IBluetoothMapClient.aidl
deleted file mode 100644
index df45af9..0000000
--- a/core/java/android/bluetooth/IBluetoothMapClient.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2016 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.app.PendingIntent;
-import android.bluetooth.BluetoothDevice;
-import android.net.Uri;
-
-/**
- * System private API for Bluetooth MAP MCE service
- *
- * {@hide}
- */
-interface IBluetoothMapClient {
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    boolean isConnected(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device,in int priority);
-    int getPriority(in BluetoothDevice device);
-    boolean sendMessage(in BluetoothDevice device, in Uri[] contacts, in  String message,
-        in PendingIntent sentIntent, in PendingIntent deliveryIntent);
-    boolean getUnreadMessages(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothPan.aidl b/core/java/android/bluetooth/IBluetoothPan.aidl
deleted file mode 100644
index 5a32347..0000000
--- a/core/java/android/bluetooth/IBluetoothPan.aidl
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2012 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.bluetooth.BluetoothDevice;
-
-/**
- * API for Bluetooth Pan service
- *
- * {@hide}
- */
-interface IBluetoothPan {
-    // Public API
-    boolean isTetheringOn();
-    void setBluetoothTethering(boolean value);
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothPbap.aidl b/core/java/android/bluetooth/IBluetoothPbap.aidl
deleted file mode 100644
index 7cc77d1..0000000
--- a/core/java/android/bluetooth/IBluetoothPbap.aidl
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008 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.bluetooth.BluetoothDevice;
-
-/**
- * System private API for Bluetooth pbap service
- *
- * {@hide}
- */
-interface IBluetoothPbap {
-    int getState();
-    BluetoothDevice getClient();
-    boolean connect(in BluetoothDevice device);
-    void disconnect();
-    boolean isConnected(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothPbapClient.aidl b/core/java/android/bluetooth/IBluetoothPbapClient.aidl
deleted file mode 100644
index 6d4c5a6..0000000
--- a/core/java/android/bluetooth/IBluetoothPbapClient.aidl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2016 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.bluetooth.BluetoothDevice;
-
-/**
- * API for Bluetooth Phone Book Access Provile Client Side
- *
- * {@hide}
- */
-interface IBluetoothPbapClient {
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl b/core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl
deleted file mode 100755
index 96c59e2..0000000
--- a/core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 android.bluetooth;
-
-import android.content.ComponentName;
-import android.os.IBinder;
-
-/**
- * Callback for bluetooth profile connections.
- *
- * {@hide}
- */
-interface IBluetoothProfileServiceConnection {
-    void onServiceConnected(in ComponentName comp, in IBinder service);
-    void onServiceDisconnected(in ComponentName comp);
-}
diff --git a/core/java/android/bluetooth/IBluetoothSap.aidl b/core/java/android/bluetooth/IBluetoothSap.aidl
deleted file mode 100644
index 8970639..0000000
--- a/core/java/android/bluetooth/IBluetoothSap.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2013 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.bluetooth.BluetoothDevice;
-
-/**
- * System private API for Bluetooth SAP service
- *
- * {@hide}
- */
-interface IBluetoothSap {
-    int getState();
-    BluetoothDevice getClient();
-    boolean connect(in BluetoothDevice device);
-    boolean disconnect(in BluetoothDevice device);
-    boolean isConnected(in BluetoothDevice device);
-    List<BluetoothDevice> getConnectedDevices();
-    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
-    int getConnectionState(in BluetoothDevice device);
-    boolean setPriority(in BluetoothDevice device, int priority);
-    int getPriority(in BluetoothDevice device);
-}
diff --git a/core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl b/core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl
deleted file mode 100644
index 0da4e88..0000000
--- a/core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.bluetooth;
-
-/**
- * System private API for Bluetooth state change callback.
- *
- * {@hide}
- */
-oneway interface IBluetoothStateChangeCallback
-{
-    void onBluetoothStateChange(boolean on);
-}
diff --git a/core/java/android/bluetooth/OobData.aidl b/core/java/android/bluetooth/OobData.aidl
deleted file mode 100644
index d831c64..0000000
--- a/core/java/android/bluetooth/OobData.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2016 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;
-
-parcelable OobData;
diff --git a/core/java/android/bluetooth/le/AdvertiseData.aidl b/core/java/android/bluetooth/le/AdvertiseData.aidl
deleted file mode 100644
index bcbf224..0000000
--- a/core/java/android/bluetooth/le/AdvertiseData.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 android.bluetooth.le;
-
-parcelable AdvertiseData;
diff --git a/core/java/android/bluetooth/le/AdvertiseSettings.aidl b/core/java/android/bluetooth/le/AdvertiseSettings.aidl
deleted file mode 100644
index 9f47d74..0000000
--- a/core/java/android/bluetooth/le/AdvertiseSettings.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 android.bluetooth.le;
-
-parcelable AdvertiseSettings;
\ No newline at end of file
diff --git a/core/java/android/bluetooth/le/AdvertisingSetParameters.aidl b/core/java/android/bluetooth/le/AdvertisingSetParameters.aidl
deleted file mode 100644
index 39034a0..0000000
--- a/core/java/android/bluetooth/le/AdvertisingSetParameters.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.bluetooth.le;
-
-parcelable AdvertisingSetParameters;
diff --git a/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl b/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl
deleted file mode 100644
index 3628c77..0000000
--- a/core/java/android/bluetooth/le/IAdvertisingSetCallback.aidl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.bluetooth.le;
-
-/**
- * Callback definitions for interacting with Advertiser
- * @hide
- */
-oneway interface IAdvertisingSetCallback {
-  void onAdvertisingSetStarted(in int advertiserId, in int tx_power, in int status);
-  void onOwnAddressRead(in int advertiserId, in int addressType, in String address);
-  void onAdvertisingSetStopped(in int advertiserId);
-  void onAdvertisingEnabled(in int advertiserId, in boolean enable, in int status);
-  void onAdvertisingDataSet(in int advertiserId, in int status);
-  void onScanResponseDataSet(in int advertiserId, in int status);
-  void onAdvertisingParametersUpdated(in int advertiserId, in int tx_power, in int status);
-  void onPeriodicAdvertisingParametersUpdated(in int advertiserId, in int status);
-  void onPeriodicAdvertisingDataSet(in int advertiserId, in int status);
-  void onPeriodicAdvertisingEnabled(in int advertiserId, in boolean enable, in int status);
-}
diff --git a/core/java/android/bluetooth/le/IPeriodicAdvertisingCallback.aidl b/core/java/android/bluetooth/le/IPeriodicAdvertisingCallback.aidl
deleted file mode 100644
index a76c54d..0000000
--- a/core/java/android/bluetooth/le/IPeriodicAdvertisingCallback.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.bluetooth.le;
-
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.le.PeriodicAdvertisingReport;
-
-/**
- * Callback definitions for interacting with Periodic Advertising
- * @hide
- */
-oneway interface IPeriodicAdvertisingCallback {
-
-  void onSyncEstablished(in int syncHandle, in BluetoothDevice device, in int advertisingSid,
-                         in int skip, in int timeout, in int status);
-  void onPeriodicAdvertisingReport(in PeriodicAdvertisingReport report);
-  void onSyncLost(in int syncHandle);
-}
diff --git a/core/java/android/bluetooth/le/IScannerCallback.aidl b/core/java/android/bluetooth/le/IScannerCallback.aidl
deleted file mode 100644
index 8cbbaef..0000000
--- a/core/java/android/bluetooth/le/IScannerCallback.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2016 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.le;
-
-import android.bluetooth.le.ScanResult;
-
-/**
- * Callback definitions for interacting with Advertiser
- * @hide
- */
-oneway interface IScannerCallback {
-    void onScannerRegistered(in int status, in int scannerId);
-
-    void onScanResult(in ScanResult scanResult);
-    void onBatchScanResults(in List<ScanResult> batchResults);
-    void onFoundOrLost(in boolean onFound, in ScanResult scanResult);
-    void onScanManagerErrorCallback(in int errorCode);
-}
diff --git a/core/java/android/bluetooth/le/PeriodicAdvertisingParameters.aidl b/core/java/android/bluetooth/le/PeriodicAdvertisingParameters.aidl
deleted file mode 100644
index f4bea22..0000000
--- a/core/java/android/bluetooth/le/PeriodicAdvertisingParameters.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.bluetooth.le;
-
-parcelable PeriodicAdvertisingParameters;
diff --git a/core/java/android/bluetooth/le/PeriodicAdvertisingReport.aidl b/core/java/android/bluetooth/le/PeriodicAdvertisingReport.aidl
deleted file mode 100644
index 547d096..0000000
--- a/core/java/android/bluetooth/le/PeriodicAdvertisingReport.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.bluetooth.le;
-
-parcelable PeriodicAdvertisingReport;
diff --git a/core/java/android/bluetooth/le/ResultStorageDescriptor.aidl b/core/java/android/bluetooth/le/ResultStorageDescriptor.aidl
deleted file mode 100644
index f218a01..0000000
--- a/core/java/android/bluetooth/le/ResultStorageDescriptor.aidl
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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 android.bluetooth.le;
-
-/**
- * {@hide}
- */
-
-parcelable ResultStorageDescriptor;
diff --git a/core/java/android/bluetooth/le/ScanFilter.aidl b/core/java/android/bluetooth/le/ScanFilter.aidl
deleted file mode 100644
index 4cecfe6..0000000
--- a/core/java/android/bluetooth/le/ScanFilter.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 android.bluetooth.le;
-
-parcelable ScanFilter;
diff --git a/core/java/android/bluetooth/le/ScanResult.aidl b/core/java/android/bluetooth/le/ScanResult.aidl
deleted file mode 100644
index 3943035..0000000
--- a/core/java/android/bluetooth/le/ScanResult.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 android.bluetooth.le;
-
-parcelable ScanResult;
\ No newline at end of file
diff --git a/core/java/android/bluetooth/le/ScanSettings.aidl b/core/java/android/bluetooth/le/ScanSettings.aidl
deleted file mode 100644
index eb169c1..0000000
--- a/core/java/android/bluetooth/le/ScanSettings.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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 android.bluetooth.le;
-
-parcelable ScanSettings;
diff --git a/core/java/com/android/internal/annotations/VisibleForTesting.java b/core/java/com/android/internal/annotations/VisibleForTesting.java
index bc3121c..99512ac6 100644
--- a/core/java/com/android/internal/annotations/VisibleForTesting.java
+++ b/core/java/com/android/internal/annotations/VisibleForTesting.java
@@ -27,7 +27,7 @@
  * visibility should have been if it had not been made public or package-private for testing.
  * The default is to consider the element private.
  */
-@Retention(RetentionPolicy.SOURCE)
+@Retention(RetentionPolicy.CLASS)
 public @interface VisibleForTesting {
     /**
      * Intended visibility if the element had not been made public or package-private for
diff --git a/core/res/res/values-mcc310-mnc030/strings.xml b/core/res/res/values-mcc310-mnc030/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc030/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc310-mnc170 b/core/res/res/values-mcc310-mnc170
deleted file mode 120000
index cfced17..0000000
--- a/core/res/res/values-mcc310-mnc170
+++ /dev/null
@@ -1 +0,0 @@
-./values-mcc310-mnc150
\ No newline at end of file
diff --git a/core/res/res/values-mcc310-mnc170/strings.xml b/core/res/res/values-mcc310-mnc170/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc170/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc310-mnc280/strings.xml b/core/res/res/values-mcc310-mnc280/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc280/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc310-mnc380 b/core/res/res/values-mcc310-mnc380
deleted file mode 120000
index cfced17..0000000
--- a/core/res/res/values-mcc310-mnc380
+++ /dev/null
@@ -1 +0,0 @@
-./values-mcc310-mnc150
\ No newline at end of file
diff --git a/core/res/res/values-mcc310-mnc380/strings.xml b/core/res/res/values-mcc310-mnc380/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc380/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc310-mnc410/strings.xml b/core/res/res/values-mcc310-mnc410/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc410/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc310-mnc560/strings.xml b/core/res/res/values-mcc310-mnc560/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc560/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc310-mnc950/strings.xml b/core/res/res/values-mcc310-mnc950/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc310-mnc950/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/res/res/values-mcc311-mnc180/strings.xml b/core/res/res/values-mcc311-mnc180/strings.xml
new file mode 100644
index 0000000..a3fea29
--- /dev/null
+++ b/core/res/res/values-mcc311-mnc180/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/assets/res/any/strings.xml
+**
+** Copyright 2006, 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.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="mmcc_imsi_unknown_in_hlr">SIM not provisioned MM#2</string>
+    <string name="mmcc_illegal_ms">SIM not allowed MM#3</string>
+</resources>
diff --git a/core/tests/coretests/src/android/net/IpPrefixTest.java b/core/tests/coretests/src/android/net/IpPrefixTest.java
index fcc6389..4f2387d 100644
--- a/core/tests/coretests/src/android/net/IpPrefixTest.java
+++ b/core/tests/coretests/src/android/net/IpPrefixTest.java
@@ -18,14 +18,14 @@
 
 import android.net.IpPrefix;
 import android.os.Parcel;
-import static android.test.MoreAsserts.assertNotEqual;
 import android.test.suitebuilder.annotation.SmallTest;
-
-import static org.junit.Assert.assertArrayEquals;
 import java.net.InetAddress;
 import java.util.Random;
 import junit.framework.TestCase;
 
+import static android.test.MoreAsserts.assertNotEqual;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
 
 public class IpPrefixTest extends TestCase {
 
@@ -242,25 +242,42 @@
 
     @SmallTest
     public void testHashCode() {
-        IpPrefix p;
-        int oldCode = -1;
+        IpPrefix p = new IpPrefix(new byte[4], 0);
         Random random = new Random();
         for (int i = 0; i < 100; i++) {
+            final IpPrefix oldP = p;
             if (random.nextBoolean()) {
                 // IPv4.
                 byte[] b = new byte[4];
                 random.nextBytes(b);
                 p = new IpPrefix(b, random.nextInt(33));
-                assertNotEqual(oldCode, p.hashCode());
-                oldCode = p.hashCode();
             } else {
                 // IPv6.
                 byte[] b = new byte[16];
                 random.nextBytes(b);
                 p = new IpPrefix(b, random.nextInt(129));
-                assertNotEqual(oldCode, p.hashCode());
-                oldCode = p.hashCode();
             }
+            if (p.equals(oldP)) {
+              assertEquals(p.hashCode(), oldP.hashCode());
+            }
+            if (p.hashCode() != oldP.hashCode()) {
+              assertNotEqual(p, oldP);
+            }
+        }
+    }
+
+    @SmallTest
+    public void testHashCodeIsNotConstant() {
+        IpPrefix[] prefixes = {
+            new IpPrefix("2001:db8:f00::ace:d00d/127"),
+            new IpPrefix("192.0.2.0/23"),
+            new IpPrefix("::/0"),
+            new IpPrefix("0.0.0.0/0"),
+        };
+        for (int i = 0; i < prefixes.length; i++) {
+          for (int j = i + 1; j < prefixes.length; j++) {
+            assertNotEqual(prefixes[i].hashCode(), prefixes[j].hashCode());
+          }
         }
     }
 
diff --git a/media/mca/filterpacks/java/android/filterpacks/imageproc/FisheyeFilter.java b/media/mca/filterpacks/java/android/filterpacks/imageproc/FisheyeFilter.java
index 2ff6588..e0dbd57 100644
--- a/media/mca/filterpacks/java/android/filterpacks/imageproc/FisheyeFilter.java
+++ b/media/mca/filterpacks/java/android/filterpacks/imageproc/FisheyeFilter.java
@@ -49,6 +49,8 @@
     private int mHeight = 0;
     private int mTarget = FrameFormat.TARGET_UNSPECIFIED;
 
+    // The constant min_dist, below, is an arbitrary number that gives good enough precision in
+    // the center of the picture without affecting the fisheye effect noticeably.
     private static final String mFisheyeShader =
             "precision mediump float;\n" +
             "uniform sampler2D tex_sampler_0;\n" +
@@ -59,8 +61,10 @@
             "varying vec2 v_texcoord;\n" +
             "void main() {\n" +
             "  const float m_pi_2 = 1.570963;\n" +
+            "  const float min_dist = 0.01;\n" +
             "  vec2 coord = v_texcoord - vec2(0.5, 0.5);\n" +
             "  float dist = length(coord * scale);\n" +
+            "  dist = max(dist, min_dist);\n" +
             "  float radian = m_pi_2 - atan(alpha * sqrt(radius2 - dist * dist), dist);\n" +
             "  float scalar = radian * factor / dist;\n" +
             "  vec2 new_coord = coord * scalar + vec2(0.5, 0.5);\n" +
diff --git a/packages/CaptivePortalLogin/OWNERS b/packages/CaptivePortalLogin/OWNERS
index fa26997..2d71c20 100644
--- a/packages/CaptivePortalLogin/OWNERS
+++ b/packages/CaptivePortalLogin/OWNERS
@@ -1,6 +1,9 @@
 set noparent
 
 per-file Android.mk = build.master@android.com
+per-file Android.mk = ek@google.com
+per-file Android.mk = hugobenichi@google.com
+per-file Android.mk = lorenzo@google.com
 
 ek@google.com
 hugobenichi@google.com
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 3ee844c..8005ea7 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -358,6 +358,7 @@
             android:finishOnCloseSystemDialogs="true"
             android:launchMode="singleTop"
             android:taskAffinity="com.android.systemui.net"
+            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
             android:excludeFromRecents="true" />
 
         <!-- started from MediaProjectionManager -->
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index aaec642..097202b 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -64,6 +64,7 @@
 import android.net.NetworkUtils;
 import android.net.RouteInfo;
 import android.net.UidRange;
+import android.net.util.NetdService;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiConfiguration.KeyMgmt;
 import android.os.BatteryStats;
@@ -340,7 +341,9 @@
         if (DBG) Slog.d(TAG, "Awaiting socket connection");
         connectedSignal.await();
         if (DBG) Slog.d(TAG, "Connected");
+        if (DBG) Slog.d(TAG, "Connecting native netd service");
         service.connectNativeNetdService();
+        if (DBG) Slog.d(TAG, "Connected");
         return service;
     }
 
@@ -549,14 +552,7 @@
     }
 
     private void connectNativeNetdService() {
-        boolean nativeServiceAvailable = false;
-        try {
-            mNetdService = INetd.Stub.asInterface(ServiceManager.getService(NETD_SERVICE_NAME));
-            nativeServiceAvailable = mNetdService.isAlive();
-        } catch (RemoteException e) {}
-        if (!nativeServiceAvailable) {
-            Slog.wtf(TAG, "Can't connect to NativeNetdService " + NETD_SERVICE_NAME);
-        }
+        mNetdService = NetdService.get();
     }
 
     /**
@@ -569,37 +565,31 @@
 
         // only enable bandwidth control when support exists
         final boolean hasKernelSupport = new File("/proc/net/xt_qtaguid/ctrl").exists();
-        if (hasKernelSupport) {
-            Slog.d(TAG, "enabling bandwidth control");
-            try {
-                mConnector.execute("bandwidth", "enable");
-                mBandwidthControlEnabled = true;
-            } catch (NativeDaemonConnectorException e) {
-                Log.wtf(TAG, "problem enabling bandwidth controls", e);
-            }
-        } else {
-            Slog.i(TAG, "not enabling bandwidth control");
-        }
-
-        SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0");
-
-        if (mBandwidthControlEnabled) {
-            try {
-                getBatteryStats().noteNetworkStatsEnabled();
-            } catch (RemoteException e) {
-            }
-        }
-
-        try {
-            mConnector.execute("strict", "enable");
-            mStrictEnabled = true;
-        } catch (NativeDaemonConnectorException e) {
-            Log.wtf(TAG, "Failed strict enable", e);
-        }
 
         // push any existing quota or UID rules
         synchronized (mQuotaLock) {
 
+            if (hasKernelSupport) {
+                Slog.d(TAG, "enabling bandwidth control");
+                try {
+                    mConnector.execute("bandwidth", "enable");
+                    mBandwidthControlEnabled = true;
+                } catch (NativeDaemonConnectorException e) {
+                    Log.wtf(TAG, "problem enabling bandwidth controls", e);
+                }
+            } else {
+                Slog.i(TAG, "not enabling bandwidth control");
+            }
+
+            SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0");
+
+            try {
+                mConnector.execute("strict", "enable");
+                mStrictEnabled = true;
+            } catch (NativeDaemonConnectorException e) {
+                Log.wtf(TAG, "Failed strict enable", e);
+            }
+
             setDataSaverModeEnabled(mDataSaverMode);
 
             int size = mActiveQuotas.size();
@@ -672,6 +662,14 @@
                 setFirewallChainEnabled(FIREWALL_CHAIN_POWERSAVE, true);
             }
         }
+
+        if (mBandwidthControlEnabled) {
+            try {
+                getBatteryStats().noteNetworkStatsEnabled();
+            } catch (RemoteException e) {
+            }
+        }
+
     }
 
     /**
@@ -1716,6 +1714,30 @@
         }
     }
 
+    private void applyUidCleartextNetworkPolicy(int uid, int policy) {
+        final String policyString;
+        switch (policy) {
+            case StrictMode.NETWORK_POLICY_ACCEPT:
+                policyString = "accept";
+                break;
+            case StrictMode.NETWORK_POLICY_LOG:
+                policyString = "log";
+                break;
+            case StrictMode.NETWORK_POLICY_REJECT:
+                policyString = "reject";
+                break;
+            default:
+                throw new IllegalArgumentException("Unknown policy " + policy);
+        }
+
+        try {
+            mConnector.execute("strict", "set_uid_cleartext_policy", uid, policyString);
+            mUidCleartextPolicy.put(uid, policy);
+        } catch (NativeDaemonConnectorException e) {
+            throw e.rethrowAsParcelableException();
+        }
+    }
+
     @Override
     public void setUidCleartextNetworkPolicy(int uid, int policy) {
         if (Binder.getCallingUid() != uid) {
@@ -1725,6 +1747,8 @@
         synchronized (mQuotaLock) {
             final int oldPolicy = mUidCleartextPolicy.get(uid, StrictMode.NETWORK_POLICY_ACCEPT);
             if (oldPolicy == policy) {
+                // This also ensures we won't needlessly apply an ACCEPT policy if we've just
+                // enabled strict and the underlying iptables rules are empty.
                 return;
             }
 
@@ -1735,28 +1759,15 @@
                 return;
             }
 
-            final String policyString;
-            switch (policy) {
-                case StrictMode.NETWORK_POLICY_ACCEPT:
-                    policyString = "accept";
-                    break;
-                case StrictMode.NETWORK_POLICY_LOG:
-                    policyString = "log";
-                    break;
-                case StrictMode.NETWORK_POLICY_REJECT:
-                    policyString = "reject";
-                    break;
-                default:
-                    throw new IllegalArgumentException("Unknown policy " + policy);
-            }
-
-            try {
-                mConnector.execute("strict", "set_uid_cleartext_policy", uid, policyString);
-                mUidCleartextPolicy.put(uid, policy);
-            } catch (NativeDaemonConnectorException e) {
-                throw e.rethrowAsParcelableException();
+            // netd does not keep state on strict mode policies, and cannot replace a non-accept
+            // policy without deleting it first. Rather than add state to netd, just always send
+            // it an accept policy when switching between two non-accept policies.
+            if (oldPolicy != StrictMode.NETWORK_POLICY_ACCEPT &&
+                    policy != StrictMode.NETWORK_POLICY_ACCEPT) {
+                applyUidCleartextNetworkPolicy(uid, policy);
             }
         }
+        applyUidCleartextNetworkPolicy(uid, policy);
     }
 
     @Override
diff --git a/services/core/java/com/android/server/net/OWNERS b/services/core/java/com/android/server/net/OWNERS
new file mode 100644
index 0000000..061fd8d
--- /dev/null
+++ b/services/core/java/com/android/server/net/OWNERS
@@ -0,0 +1,10 @@
+set noparent
+
+ek@google.com
+hugobenichi@google.com
+jsharkey@google.com
+lorenzo@google.com
+satk@google.com
+silberst@google.com
+sudheersai@google.com
+yamasani@google.com
diff --git a/services/net/OWNERS b/services/net/OWNERS
index fa26997..2d71c20 100644
--- a/services/net/OWNERS
+++ b/services/net/OWNERS
@@ -1,6 +1,9 @@
 set noparent
 
 per-file Android.mk = build.master@android.com
+per-file Android.mk = ek@google.com
+per-file Android.mk = hugobenichi@google.com
+per-file Android.mk = lorenzo@google.com
 
 ek@google.com
 hugobenichi@google.com
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index ecfdbaa..eb53d4b 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -880,13 +880,6 @@
             "broadcast_emergency_call_state_changes_bool";
 
     /**
-     * Cell broadcast additional channels enbled by the carrier
-     * @hide
-     */
-    public static final String KEY_CARRIER_ADDITIONAL_CBS_CHANNELS_STRINGS =
-            "carrier_additional_cbs_channels_strings";
-
-    /**
       * Indicates whether STK LAUNCH_BROWSER command is disabled.
       * If {@code true}, then the browser will not be launched
       * on UI for the LAUNCH_BROWSER STK command.
@@ -1056,6 +1049,13 @@
             "carrier_app_no_wake_signal_config";
 
     /**
+     * Default value for {@link Settings.Global#DATA_ROAMING}
+     * @hide
+     */
+    public static final String KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL =
+            "carrier_default_data_roaming_enabled_bool";
+
+    /**
      * Determines whether the carrier supports making non-emergency phone calls while the phone is
      * in emergency callback mode.  Default value is {@code true}, meaning that non-emergency calls
      * are allowed in emergency callback mode.
@@ -1537,6 +1537,7 @@
         sDefaults.putBoolean(KEY_CARRIER_NAME_OVERRIDE_BOOL, false);
         sDefaults.putString(KEY_CARRIER_NAME_STRING, "");
         sDefaults.putBoolean(KEY_SUPPORT_DIRECT_FDN_DIALING_BOOL, false);
+        sDefaults.putBoolean(KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL, false);
 
         // MMS defaults
         sDefaults.putBoolean(KEY_MMS_ALIAS_ENABLED_BOOL, false);
diff --git a/telephony/java/com/android/internal/telephony/gsm/SmsCbConstants.java b/telephony/java/com/android/internal/telephony/gsm/SmsCbConstants.java
index bce5680..f28d126 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SmsCbConstants.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SmsCbConstants.java
@@ -34,18 +34,6 @@
     public static final int MESSAGE_ID_GSMA_ALLOCATED_CHANNEL_50
             = 0x0032;
 
-    /** Channel 911 required by Taiwan NCC. ID 0~999 is allocated by GSMA */
-    public static final int MESSAGE_ID_GSMA_ALLOCATED_CHANNEL_911
-            = 0x038F; // 911
-
-    /** Channel 919 required by Taiwan NCC and Israel. ID 0~999 is allocated by GSMA */
-    public static final int MESSAGE_ID_GSMA_ALLOCATED_CHANNEL_919
-            = 0x0397; // 919
-
-    /** Channel 928 required by Israel. ID 0~999 is allocated by GSMA */
-    public static final int MESSAGE_ID_GSMA_ALLOCATED_CHANNEL_928
-            = 0x03A0; // 928
-
     /** Start of PWS Message Identifier range (includes ETWS and CMAS). */
     public static final int MESSAGE_ID_PWS_FIRST_IDENTIFIER
             = 0x1100; // 4352
diff --git a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
index 582506a..d4098d9 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
@@ -278,6 +278,10 @@
                 scAddress, destinationAddress, mtiByte,
                 statusReportRequested, ret);
 
+        // Skip encoding pdu if error occurs when create pdu head and the error will be handled
+        // properly later on encodedMessage sanity check.
+        if (bo == null) return ret;
+
         // User Data (and length)
         byte[] userData;
         try {
@@ -420,6 +424,9 @@
                 scAddress, destinationAddress, (byte) 0x41, // MTI = SMS-SUBMIT,
                                                             // TP-UDHI = true
                 statusReportRequested, ret);
+        // Skip encoding pdu if error occurs when create pdu head and the error will be handled
+        // properly later on encodedMessage sanity check.
+        if (bo == null) return ret;
 
         // TP-Data-Coding-Scheme
         // No class, 8 bit data
@@ -451,7 +458,7 @@
      * @param destinationAddress the address of the destination for the message
      * @param mtiByte
      * @param ret <code>SubmitPdu</code> containing the encoded SC
-     *        address, if applicable, and the encoded message
+     *        address, if applicable, and the encoded message. Returns null on encode error.
      */
     private static ByteArrayOutputStream getSubmitPduHead(
             String scAddress, String destinationAddress, byte mtiByte,
@@ -482,6 +489,9 @@
 
         daBytes = PhoneNumberUtils.networkPortionToCalledPartyBCD(destinationAddress);
 
+        // return empty pduHead for invalid destination address
+        if (daBytes == null) return null;
+
         // destination address length in BCD digits, ignoring TON byte and pad
         // TODO Should be better.
         bo.write((daBytes.length - 1) * 2
diff --git a/tests/net/Android.mk b/tests/net/Android.mk
index 8aa27a9..bf558c2 100644
--- a/tests/net/Android.mk
+++ b/tests/net/Android.mk
@@ -40,7 +40,8 @@
     libnetdaidl \
     libui \
     libunwind \
-    libutils
+    libutils \
+    libunwindstack
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
diff --git a/tests/net/OWNERS b/tests/net/OWNERS
index fa26997..2d71c20 100644
--- a/tests/net/OWNERS
+++ b/tests/net/OWNERS
@@ -1,6 +1,9 @@
 set noparent
 
 per-file Android.mk = build.master@android.com
+per-file Android.mk = ek@google.com
+per-file Android.mk = hugobenichi@google.com
+per-file Android.mk = lorenzo@google.com
 
 ek@google.com
 hugobenichi@google.com