Merge "Fix default compute thread priority"
diff --git a/core/java/com/android/internal/os/WrapperInit.java b/core/java/com/android/internal/os/WrapperInit.java
index af821ba..34ae58a 100644
--- a/core/java/com/android/internal/os/WrapperInit.java
+++ b/core/java/com/android/internal/os/WrapperInit.java
@@ -19,6 +19,7 @@
import android.os.Process;
import android.util.Slog;
+import dalvik.system.VMRuntime;
import java.io.DataOutputStream;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
@@ -96,9 +97,20 @@
* @param args Arguments for {@link RuntimeInit#main}.
*/
public static void execApplication(String invokeWith, String niceName,
- int targetSdkVersion, FileDescriptor pipeFd, String[] args) {
+ int targetSdkVersion, String instructionSet, FileDescriptor pipeFd,
+ String[] args) {
StringBuilder command = new StringBuilder(invokeWith);
- command.append(" /system/bin/app_process /system/bin --application");
+
+ final String appProcess;
+ if (VMRuntime.is64BitInstructionSet(instructionSet)) {
+ appProcess = "/system/bin/app_process64";
+ } else {
+ appProcess = "/system/bin/app_process32";
+ }
+ command.append(' ');
+ command.append(appProcess);
+
+ command.append(" /system/bin --application");
if (niceName != null) {
command.append(" '--nice-name=").append(niceName).append("'");
}
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index 7fac05b..aba4bd0 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -31,6 +31,7 @@
import android.system.Os;
import android.util.Log;
import dalvik.system.PathClassLoader;
+import dalvik.system.VMRuntime;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -858,6 +859,7 @@
if (parsedArgs.invokeWith != null) {
WrapperInit.execApplication(parsedArgs.invokeWith,
parsedArgs.niceName, parsedArgs.targetSdkVersion,
+ VMRuntime.getCurrentInstructionSet(),
pipeFd, parsedArgs.remainingArgs);
} else {
RuntimeInit.zygoteInit(parsedArgs.targetSdkVersion,
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index b8082e1..8107985 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -437,7 +437,7 @@
WrapperInit.execApplication(parsedArgs.invokeWith,
parsedArgs.niceName, parsedArgs.targetSdkVersion,
- null, args);
+ VMRuntime.getCurrentInstructionSet(), null, args);
} else {
ClassLoader cl = null;
if (systemServerClasspath != null) {
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index ce7f0d5..8e2159a 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -357,22 +357,37 @@
}
/*
- * Read the persistent locale.
+ * Read the persistent locale. Attempts to read to persist.sys.locale
+ * and falls back to the default locale (ro.product.locale) if
+ * persist.sys.locale is empty.
*/
-static void readLocale(char* language, char* region)
+static void readLocale(char* locale)
{
- char propLang[PROPERTY_VALUE_MAX], propRegn[PROPERTY_VALUE_MAX];
+ // Allocate 4 extra bytes because we might read a property into
+ // this array at offset 4.
+ char propLocale[PROPERTY_VALUE_MAX + 4];
- property_get("persist.sys.language", propLang, "");
- property_get("persist.sys.country", propRegn, "");
- if (*propLang == 0 && *propRegn == 0) {
- /* Set to ro properties, default is en_US */
- property_get("ro.product.locale.language", propLang, "en");
- property_get("ro.product.locale.region", propRegn, "US");
+ property_get("persist.sys.locale", propLocale, "");
+ if (propLocale[0] == 0) {
+ property_get("ro.product.locale", propLocale, "");
+
+ if (propLocale[0] == 0) {
+ // If persist.sys.locale and ro.product.locale are missing,
+ // construct a locale value from the individual locale components.
+ property_get("ro.product.locale.language", propLocale, "en");
+
+ // The language code is either two or three chars in length. If it
+ // isn't 2 chars long, assume three. Anything else is an error
+ // anyway.
+ const int offset = (propLocale[2] == 0) ? 2 : 3;
+ propLocale[offset] = '-';
+
+ property_get("ro.product.locale.region", propLocale + offset + 1, "US");
+ }
}
- strncat(language, propLang, 3);
- strncat(region, propRegn, 3);
- //ALOGD("language=%s region=%s\n", language, region);
+
+ strncat(locale, propLocale, PROPERTY_VALUE_MAX);
+ // ALOGD("[DEBUG] locale=%s", locale);
}
void AndroidRuntime::addOption(const char* optionString, void* extraInfo)
@@ -559,8 +574,7 @@
PROPERTY_VALUE_MAX];
char profileType[sizeof("-Xprofile-type:")-1 + PROPERTY_VALUE_MAX];
char profileMaxStackDepth[sizeof("-Xprofile-max-stack-depth:")-1 + PROPERTY_VALUE_MAX];
- char langOption[sizeof("-Duser.language=") + 3];
- char regionOption[sizeof("-Duser.region=") + 3];
+ char localeOption[sizeof("-Duser.locale=") + PROPERTY_VALUE_MAX];
char lockProfThresholdBuf[sizeof("-Xlockprofthreshold:")-1 + PROPERTY_VALUE_MAX];
char nativeBridgeLibrary[sizeof("-XX:NativeBridge=") + PROPERTY_VALUE_MAX];
@@ -717,11 +731,9 @@
/* Set the properties for locale */
{
- strcpy(langOption, "-Duser.language=");
- strcpy(regionOption, "-Duser.region=");
- readLocale(langOption, regionOption);
- addOption(langOption);
- addOption(regionOption);
+ strcpy(localeOption, "-Duser.locale=");
+ readLocale(localeOption);
+ addOption(localeOption);
}
/*
diff --git a/core/tests/coretests/apks/install_bad_dex/Android.mk b/core/tests/coretests/apks/install_bad_dex/Android.mk
index 769a1b0..05983aa 100644
--- a/core/tests/coretests/apks/install_bad_dex/Android.mk
+++ b/core/tests/coretests/apks/install_bad_dex/Android.mk
@@ -5,6 +5,7 @@
LOCAL_PACKAGE_NAME := install_bad_dex
-LOCAL_JAVA_RESOURCE_FILES := $(LOCAL_PATH)/classes.dex
-
include $(FrameworkCoreTests_BUILD_PACKAGE)
+
+# Override target specific variable PRIVATE_DEX_FILE to inject bad classes.dex file.
+$(LOCAL_BUILT_MODULE): PRIVATE_DEX_FILE := $(LOCAL_PATH)/classes.dex
diff --git a/rs/java/android/renderscript/Element.java b/rs/java/android/renderscript/Element.java
index c6b5b0d..287b3f1 100644
--- a/rs/java/android/renderscript/Element.java
+++ b/rs/java/android/renderscript/Element.java
@@ -118,7 +118,10 @@
*/
public enum DataType {
NONE (0, 0),
- //FLOAT_16 (1, 2),
+ /**
+ * @hide
+ */
+ FLOAT_16 (1, 2),
FLOAT_32 (2, 4),
FLOAT_64 (3, 8),
SIGNED_8 (4, 1),
@@ -386,6 +389,16 @@
return rs.mElement_I64;
}
+ /**
+ * @hide
+ */
+ public static Element F16(RenderScript rs) {
+ if(rs.mElement_F16 == null) {
+ rs.mElement_F16 = createUser(rs, DataType.FLOAT_16);
+ }
+ return rs.mElement_F16;
+ }
+
public static Element F32(RenderScript rs) {
if(rs.mElement_F32 == null) {
rs.mElement_F32 = createUser(rs, DataType.FLOAT_32);
@@ -520,6 +533,36 @@
return rs.mElement_RGBA_8888;
}
+ /**
+ * @hide
+ */
+ public static Element F16_2(RenderScript rs) {
+ if(rs.mElement_HALF_2 == null) {
+ rs.mElement_HALF_2 = createVector(rs, DataType.FLOAT_16, 2);
+ }
+ return rs.mElement_HALF_2;
+ }
+
+ /**
+ * @hide
+ */
+ public static Element F16_3(RenderScript rs) {
+ if(rs.mElement_FLOAT_3 == null) {
+ rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_16, 3);
+ }
+ return rs.mElement_HALF_3;
+ }
+
+ /**
+ * @hide
+ */
+ public static Element F16_4(RenderScript rs) {
+ if(rs.mElement_HALF_4 == null) {
+ rs.mElement_HALF_4 = createVector(rs, DataType.FLOAT_16, 4);
+ }
+ return rs.mElement_HALF_4;
+ }
+
public static Element F32_2(RenderScript rs) {
if(rs.mElement_FLOAT_2 == null) {
rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2);
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 4dd8faf..271fe05 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -871,6 +871,7 @@
Element mElement_I32;
Element mElement_U64;
Element mElement_I64;
+ Element mElement_F16;
Element mElement_F32;
Element mElement_F64;
Element mElement_BOOLEAN;
@@ -894,6 +895,10 @@
Element mElement_RGBA_4444;
Element mElement_RGBA_8888;
+ Element mElement_HALF_2;
+ Element mElement_HALF_3;
+ Element mElement_HALF_4;
+
Element mElement_FLOAT_2;
Element mElement_FLOAT_3;
Element mElement_FLOAT_4;
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 79cd867..49177fc 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -859,6 +859,10 @@
// Temporary workaround for http://b/17945169.
Slog.d(TAG, "Setting system properties to " + systemLocale + " from mount service");
+ SystemProperties.set("persist.sys.locale", locale.toLanguageTag());
+
+ // TODO: Stop setting these properties once we've removed all
+ // references to them.
SystemProperties.set("persist.sys.language", locale.getLanguage());
SystemProperties.set("persist.sys.country", locale.getCountry());
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 668d62b..f7d6e8a 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -16400,15 +16400,27 @@
}
/**
- * Save the locale. You must be inside a synchronized (this) block.
+ * Save the locale. You must be inside a synchronized (this) block.
*/
private void saveLocaleLocked(Locale l, boolean isDiff, boolean isPersist) {
- if(isDiff) {
+ final String languageTag = l.toLanguageTag();
+ if (isDiff) {
+ SystemProperties.set("user.locale", languageTag);
+
+ // TODO: Who uses these ? There are no references to these system
+ // properties in documents or code. Did the author intend to call
+ // System.setProperty() instead ? Even that wouldn't have any effect.
SystemProperties.set("user.language", l.getLanguage());
SystemProperties.set("user.region", l.getCountry());
- }
+ }
- if(isPersist) {
+ if (isPersist) {
+ SystemProperties.set("persist.sys.locale", languageTag);
+
+ // These values are *deprecated*, use persist.sys.locale instead.
+ //
+ // TODO: Stop setting these values once all code that references
+ // them has been removed.
SystemProperties.set("persist.sys.language", l.getLanguage());
SystemProperties.set("persist.sys.country", l.getCountry());
SystemProperties.set("persist.sys.localevar", l.getVariant());
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index c03dbc2..152f8d7 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1553,14 +1553,14 @@
// Now the task above it has to return to the home task instead.
final int taskNdx = mTaskHistory.indexOf(prevTask) + 1;
mTaskHistory.get(taskNdx).setTaskToReturnTo(HOME_ACTIVITY_TYPE);
- } else {
- if (DEBUG_STATES && isOnHomeDisplay()) Slog.d(TAG,
+ } else if (!isOnHomeDisplay()) {
+ return false;
+ } else if (!isHomeStack()){
+ if (DEBUG_STATES) Slog.d(TAG,
"resumeTopActivityLocked: Launching home next");
- // Only resume home if on home display
final int returnTaskType = prevTask == null || !prevTask.isOverHomeStack() ?
HOME_ACTIVITY_TYPE : prevTask.getTaskToReturnTo();
- return isOnHomeDisplay() &&
- mStackSupervisor.resumeHomeStackTask(returnTaskType, prev);
+ return mStackSupervisor.resumeHomeStackTask(returnTaskType, prev);
}
}
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index 30799f8..86015fc 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -2285,9 +2285,13 @@
}
private static String getCurrentIdp(boolean useNanp) {
- // in case, there is no IDD is found, we shouldn't convert it.
- String ps = SystemProperties.get(
- PROPERTY_OPERATOR_IDP_STRING, useNanp ? NANP_IDP_STRING : PLUS_SIGN_STRING);
+ String ps = null;
+ if(useNanp)
+ ps = NANP_IDP_STRING;
+ else{
+ // in case, there is no IDD is found, we shouldn't convert it.
+ ps = SystemProperties.get(PROPERTY_OPERATOR_IDP_STRING, PLUS_SIGN_STRING);
+ }
return ps;
}