Merge "Rename setGlobalPreferredNetworkType to setPreferredNetworkTypeToGlobal per API council." into lmp-mr1-dev
diff --git a/api/current.txt b/api/current.txt
index 7bf2c85..96fccf7 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28619,13 +28619,11 @@
     method public int describeContents();
     method public java.lang.CharSequence getCarrierName();
     method public java.lang.String getCountryIso();
-    method public int getDataRoaming();
     method public java.lang.CharSequence getDisplayName();
     method public java.lang.String getIccId();
     method public int getIconTint();
     method public int getMcc();
     method public int getMnc();
-    method public int getNameSource();
     method public java.lang.String getNumber();
     method public int getSimSlotIndex();
     method public int getSubscriptionId();
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 5b6ca29..f4c8986 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1511,9 +1511,11 @@
         if (mUseFixedVolume) {
             return;
         }
-
+        int streamAlias = mStreamVolumeAlias[streamType];
         for (int stream = 0; stream < mStreamStates.length; stream++) {
-            if (!isStreamAffectedByMute(stream) || stream == streamType) continue;
+            if (!isStreamAffectedByMute(streamAlias) || streamAlias == mStreamVolumeAlias[stream]) {
+                continue;
+            }
             mStreamStates[stream].mute(cb, state);
          }
     }
@@ -1526,17 +1528,21 @@
         if (streamType == AudioManager.USE_DEFAULT_STREAM_TYPE) {
             streamType = getActiveStreamType(streamType);
         }
-
-        if (isStreamAffectedByMute(streamType)) {
-            if (streamType == AudioSystem.STREAM_MUSIC) {
+        int streamAlias = mStreamVolumeAlias[streamType];
+        if (isStreamAffectedByMute(streamAlias)) {
+            if (streamAlias == AudioSystem.STREAM_MUSIC) {
                 setSystemAudioMute(state);
             }
-            mStreamStates[streamType].mute(cb, state);
+            for (int stream = 0; stream < mStreamStates.length; stream++) {
+                if (streamAlias == mStreamVolumeAlias[stream]) {
+                    mStreamStates[stream].mute(cb, state);
 
-            Intent intent = new Intent(AudioManager.STREAM_MUTE_CHANGED_ACTION);
-            intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, streamType);
-            intent.putExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, state);
-            sendBroadcastToAll(intent);
+                    Intent intent = new Intent(AudioManager.STREAM_MUTE_CHANGED_ACTION);
+                    intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, stream);
+                    intent.putExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, state);
+                    sendBroadcastToAll(intent);
+                }
+            }
         }
     }
 
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 4b7fb2b..b107d9a 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -2106,7 +2106,7 @@
         mTrackingAssociations = "1".equals(SystemProperties.get("debug.track-associations"));
 
         mConfiguration.setToDefaults();
-        mConfiguration.setLocale(Locale.getDefault());
+        mConfiguration.locale = Locale.getDefault();
 
         mConfigurationSeq = mConfiguration.seq = 1;
         mProcessCpuTracker.init();
@@ -16605,6 +16605,7 @@
         Configuration ci;
         synchronized(this) {
             ci = new Configuration(mConfiguration);
+            ci.userSetLocale = false;
         }
         return ci;
     }
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index ac17691..fb7a6aa 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -5381,7 +5381,12 @@
 
     @Override
     public boolean isKeyguardSecure() {
-        return mPolicy.isKeyguardSecure();
+        long origId = Binder.clearCallingIdentity();
+        try {
+            return mPolicy.isKeyguardSecure();
+        } finally {
+            Binder.restoreCallingIdentity(origId);
+        }
     }
 
     @Override
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index e57f9e3..f3b6910 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -129,28 +129,28 @@
     }
 
     /**
-     * Returns the subscription ID.
+     * @return the subscription ID.
      */
     public int getSubscriptionId() {
         return this.mId;
     }
 
     /**
-     * Returns the ICC ID.
+     * @return the ICC ID.
      */
     public String getIccId() {
         return this.mIccId;
     }
 
     /**
-     * Returns the slot index of this Subscription's SIM card.
+     * @return the slot index of this Subscription's SIM card.
      */
     public int getSimSlotIndex() {
         return this.mSimSlotIndex;
     }
 
     /**
-     * Returns the name displayed to the user that identifies this subscription
+     * @return the name displayed to the user that identifies this subscription
      */
     public CharSequence getDisplayName() {
         return this.mDisplayName;
@@ -165,7 +165,7 @@
     }
 
     /**
-     * Returns the name displayed to the user that identifies Subscription provider name
+     * @return the name displayed to the user that identifies Subscription provider name
      */
     public CharSequence getCarrierName() {
         return this.mCarrierName;
@@ -180,8 +180,9 @@
     }
 
     /**
-     * Return the source of the name, eg NAME_SOURCE_UNDEFINED, NAME_SOURCE_DEFAULT_SOURCE,
+     * @return the source of the name, eg NAME_SOURCE_UNDEFINED, NAME_SOURCE_DEFAULT_SOURCE,
      * NAME_SOURCE_SIM_SOURCE or NAME_SOURCE_USER_INPUT.
+     * @hide
      */
     public int getNameSource() {
         return this.mNameSource;
@@ -246,35 +247,37 @@
     }
 
     /**
-     * Returns the number of this subscription.
+     * @return the number of this subscription.
      */
     public String getNumber() {
         return mNumber;
     }
 
     /**
-     * Return the data roaming value.
+     * @return the data roaming state for this subscription, either DATA_ROAMING_ENABLE or
+     * DATA_ROAMING_DISABLE.
+     * @hide
      */
     public int getDataRoaming() {
         return this.mDataRoaming;
     }
 
     /**
-     * Returns the MCC.
+     * @return the MCC.
      */
     public int getMcc() {
         return this.mMcc;
     }
 
     /**
-     * Returns the MNC.
+     * @return the MNC.
      */
     public int getMnc() {
         return this.mMnc;
     }
 
     /**
-     * Returns the ISO country code
+     * @return the ISO country code
      */
     public String getCountryIso() {
         return this.mCountryIso;