summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/os/Trace.java8
-rw-r--r--core/java/android/preference/MultiCheckPreference.java16
-rw-r--r--core/jni/android_os_SystemProperties.cpp16
3 files changed, 33 insertions, 7 deletions
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
index ac9ee26..7b6fd64 100644
--- a/core/java/android/os/Trace.java
+++ b/core/java/android/os/Trace.java
@@ -39,6 +39,14 @@ public final class Trace {
public static final long TRACE_TAG_SYNC_MANAGER = 1L << 7;
public static final long TRACE_TAG_AUDIO = 1L << 8;
+ public static final int TRACE_FLAGS_START_BIT = 1;
+ public static final String[] TRACE_TAGS = {
+ "Graphics", "Input", "View", "WebView", "Window Manager",
+ "Activity Manager", "Sync Manager", "Audio"
+ };
+
+ public static final String PROPERTY_TRACE_TAG_ENABLEFLAGS = "debug.atrace.tags.enableflags";
+
private static final long sEnabledTags = nativeGetEnabledTags();
private static native long nativeGetEnabledTags();
diff --git a/core/java/android/preference/MultiCheckPreference.java b/core/java/android/preference/MultiCheckPreference.java
index 735f66a..6953075 100644
--- a/core/java/android/preference/MultiCheckPreference.java
+++ b/core/java/android/preference/MultiCheckPreference.java
@@ -136,11 +136,25 @@ public class MultiCheckPreference extends DialogPreference {
*
* @return The array of values.
*/
- public CharSequence[] getEntryValues() {
+ public String[] getEntryValues() {
return mEntryValues;
}
/**
+ * Get the boolean state of a given value.
+ */
+ public boolean getValue(int index) {
+ return mSetValues[index];
+ }
+
+ /**
+ * Set the boolean state of a given value.
+ */
+ public void setValue(int index, boolean state) {
+ mSetValues[index] = state;
+ }
+
+ /**
* Sets the current values.
*/
public void setValues(boolean[] values) {
diff --git a/core/jni/android_os_SystemProperties.cpp b/core/jni/android_os_SystemProperties.cpp
index 66af965..add616e 100644
--- a/core/jni/android_os_SystemProperties.cpp
+++ b/core/jni/android_os_SystemProperties.cpp
@@ -65,6 +65,7 @@ static jint SystemProperties_get_int(JNIEnv *env, jobject clazz,
int len;
const char* key;
char buf[PROPERTY_VALUE_MAX];
+ char* end;
jint result = defJ;
if (keyJ == NULL) {
@@ -76,9 +77,10 @@ static jint SystemProperties_get_int(JNIEnv *env, jobject clazz,
len = property_get(key, buf, "");
if (len > 0) {
- jint temp;
- if (sscanf(buf, "%d", &temp) == 1)
- result = temp;
+ result = strtol(buf, &end, 0);
+ if (end == buf) {
+ result = defJ;
+ }
}
env->ReleaseStringUTFChars(keyJ, key);
@@ -93,6 +95,7 @@ static jlong SystemProperties_get_long(JNIEnv *env, jobject clazz,
int len;
const char* key;
char buf[PROPERTY_VALUE_MAX];
+ char* end;
jlong result = defJ;
if (keyJ == NULL) {
@@ -104,9 +107,10 @@ static jlong SystemProperties_get_long(JNIEnv *env, jobject clazz,
len = property_get(key, buf, "");
if (len > 0) {
- jlong temp;
- if (sscanf(buf, "%lld", &temp) == 1)
- result = temp;
+ result = strtoll(buf, &end, 0);
+ if (end == buf) {
+ result = defJ;
+ }
}
env->ReleaseStringUTFChars(keyJ, key);