Merge "Import translations. DO NOT MERGE" into mnc-dr-dev
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 3b9aca8..584deff 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -314,8 +314,7 @@
if (path.contains("!/")) {
String[] split = TextUtils.split(path, "!/");
if (split.length == 2) {
- try {
- ZipFile z = new ZipFile(split[0]);
+ try (ZipFile z = new ZipFile(split[0])) {
ZipEntry e = z.getEntry(split[1]);
if (e != null && e.getMethod() == ZipEntry.STORED) {
newVmSize = Math.max(newVmSize, e.getSize());
@@ -355,8 +354,7 @@
String[] abiList,
String nativeLibFileName) {
// Search the APK for a native library conforming to a listed ABI.
- try {
- ZipFile z = new ZipFile(apkPath);
+ try (ZipFile z = new ZipFile(apkPath)) {
for (String abi : abiList) {
final String entry = "lib/" + abi + "/" + nativeLibFileName;
ZipEntry e = z.getEntry(entry);
diff --git a/media/java/android/media/AudioDeviceInfo.java b/media/java/android/media/AudioDeviceInfo.java
index fef65ee..7f22b8a 100644
--- a/media/java/android/media/AudioDeviceInfo.java
+++ b/media/java/android/media/AudioDeviceInfo.java
@@ -111,14 +111,6 @@
* A device type connected over IP.
*/
public static final int TYPE_IP = 20;
- /**
- * @hide
- * A remote-submix device.
- * We need this for CTS, but it is not part of the external API.
- * FIXME It has been suggested that CTS should only be testing public APIs.
- * Consider this for a public API.
- */
- public static final int TYPE_REMOTE_SUBMIX = 0x7FFF;
private final AudioDevicePort mPort;
@@ -286,7 +278,6 @@
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_FM, TYPE_FM);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_AUX_LINE, TYPE_AUX_LINE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_IP, TYPE_IP);
- INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_REMOTE_SUBMIX, TYPE_REMOTE_SUBMIX);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUILTIN_MIC, TYPE_BUILTIN_MIC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET, TYPE_BLUETOOTH_SCO);
@@ -304,7 +295,10 @@
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_SPDIF, TYPE_LINE_DIGITAL);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_A2DP, TYPE_BLUETOOTH_A2DP);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_IP, TYPE_IP);
- INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_REMOTE_SUBMIX, TYPE_REMOTE_SUBMIX);
+
+ // not covered here, legacy
+ //AudioSystem.DEVICE_OUT_REMOTE_SUBMIX
+ //AudioSystem.DEVICE_IN_REMOTE_SUBMIX
// privileges mapping to output device
EXT_TO_INT_DEVICE_MAPPING = new SparseIntArray();
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 5290cac..875e716 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -3757,6 +3757,12 @@
port.role() == AudioPort.ROLE_SOURCE && (flags & GET_DEVICES_INPUTS) != 0;
}
+ private static boolean checkTypes(AudioDevicePort port) {
+ return AudioDeviceInfo.convertInternalDeviceToDeviceType(port.type()) !=
+ AudioDeviceInfo.TYPE_UNKNOWN &&
+ port.type() != AudioSystem.DEVICE_IN_BACK_MIC;
+ }
+
/**
* Returns an array of {@link AudioDeviceInfo} objects corresponding to the audio devices
* currently connected to the system and meeting the criteria specified in the
@@ -3779,7 +3785,7 @@
// figure out how many AudioDeviceInfo we need space for...
int numRecs = 0;
for (AudioDevicePort port : ports) {
- if (checkFlags(port, flags)) {
+ if (checkTypes(port) && checkFlags(port, flags)) {
numRecs++;
}
}
@@ -3788,7 +3794,7 @@
AudioDeviceInfo[] deviceList = new AudioDeviceInfo[numRecs];
int slot = 0;
for (AudioDevicePort port : ports) {
- if (checkFlags(port, flags)) {
+ if (checkTypes(port) && checkFlags(port, flags)) {
deviceList[slot++] = new AudioDeviceInfo(port);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index ed1dca3..b65bf43 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -88,8 +88,10 @@
mapIconSets();
- mLastState.networkName = mCurrentState.networkName = mNetworkNameDefault;
- mLastState.networkNameData = mCurrentState.networkNameData = mNetworkNameDefault;
+ String networkName = info.getCarrierName() != null ? info.getCarrierName().toString()
+ : mNetworkNameDefault;
+ mLastState.networkName = mCurrentState.networkName = networkName;
+ mLastState.networkNameData = mCurrentState.networkNameData = networkName;
mLastState.enabled = mCurrentState.enabled = hasMobileData;
mLastState.iconGroup = mCurrentState.iconGroup = mDefaultIcons;
// Get initial data sim state.