Merge "Workaround for corner case in TransitionManager" into klp-dev
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 5822e46..d789a944 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -322,7 +322,7 @@
 
     /**
      * Broadcast Action: This intent is used to broadcast PAIRING REQUEST
-     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} to
+     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} to
      * receive.
      */
     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
@@ -465,7 +465,7 @@
 
     /**
      * The user will be prompted to enter a pin or
-     * a privileged app will enter a pin for user.
+     * an app will enter a pin for user.
      */
     public static final int PAIRING_VARIANT_PIN = 0;
 
@@ -477,7 +477,7 @@
 
     /**
      * The user will be prompted to confirm the passkey displayed on the screen or
-     * a privileged app will confirm the passkey for the user.
+     * an app will confirm the passkey for the user.
      */
     public static final int PAIRING_VARIANT_PASSKEY_CONFIRMATION = 2;
 
@@ -725,7 +725,7 @@
      * the bonding process completes, and its result.
      * <p>Android system services will handle the necessary user interactions
      * to confirm and complete the bonding process.
-     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
+     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
      *
      * @return false on immediate error, true if bonding will begin
      */
@@ -965,7 +965,7 @@
 
     /**
      * Set the pin during pairing when the pairing method is {@link #PAIRING_VARIANT_PIN}
-     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
+     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
      *
      * @return true pin has been set
      *         false for error
@@ -993,7 +993,7 @@
 
     /**
      * Confirm passkey for {@link #PAIRING_VARIANT_PASSKEY_CONFIRMATION} pairing.
-     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
+     * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
      *
      * @return true confirmation has been sent out
      *         false for error
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index e3c664b..f6143ed 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -581,6 +581,10 @@
         return countryIso;
     }
 
+    protected static String getCurrentCountryIso(Context context) {
+        return getCurrentCountryIso(context, Locale.getDefault());
+    }
+
     /**
      * @return a string debug representation of this instance.
      */
diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
index dd5f644..c63be91 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
@@ -20,7 +20,6 @@
 import android.content.Context;
 import android.database.Cursor;
 import android.database.SQLException;
-import android.location.CountryDetector;
 import android.net.Uri;
 import android.os.Handler;
 import android.os.Looper;
@@ -271,11 +270,9 @@
 
                     // Use the number entered by the user for display.
                     if (!TextUtils.isEmpty(cw.number)) {
-                        CountryDetector detector = (CountryDetector) mQueryContext.getSystemService(
-                                Context.COUNTRY_DETECTOR);
                         mCallerInfo.phoneNumber = PhoneNumberUtils.formatNumber(cw.number,
                                 mCallerInfo.normalizedNumber,
-                                detector.detectCountry().getCountryIso());
+                                CallerInfo.getCurrentCountryIso(mQueryContext));
                     }
                 }