Merge "Support for changing traces from development settings." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
feecf9d786
@ -39,6 +39,14 @@ public final class Trace {
|
|||||||
public static final long TRACE_TAG_SYNC_MANAGER = 1L << 7;
|
public static final long TRACE_TAG_SYNC_MANAGER = 1L << 7;
|
||||||
public static final long TRACE_TAG_AUDIO = 1L << 8;
|
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 final long sEnabledTags = nativeGetEnabledTags();
|
||||||
|
|
||||||
private static native long nativeGetEnabledTags();
|
private static native long nativeGetEnabledTags();
|
||||||
|
@ -136,10 +136,24 @@ public class MultiCheckPreference extends DialogPreference {
|
|||||||
*
|
*
|
||||||
* @return The array of values.
|
* @return The array of values.
|
||||||
*/
|
*/
|
||||||
public CharSequence[] getEntryValues() {
|
public String[] getEntryValues() {
|
||||||
return mEntryValues;
|
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.
|
* Sets the current values.
|
||||||
*/
|
*/
|
||||||
|
@ -65,6 +65,7 @@ static jint SystemProperties_get_int(JNIEnv *env, jobject clazz,
|
|||||||
int len;
|
int len;
|
||||||
const char* key;
|
const char* key;
|
||||||
char buf[PROPERTY_VALUE_MAX];
|
char buf[PROPERTY_VALUE_MAX];
|
||||||
|
char* end;
|
||||||
jint result = defJ;
|
jint result = defJ;
|
||||||
|
|
||||||
if (keyJ == NULL) {
|
if (keyJ == NULL) {
|
||||||
@ -76,9 +77,10 @@ static jint SystemProperties_get_int(JNIEnv *env, jobject clazz,
|
|||||||
|
|
||||||
len = property_get(key, buf, "");
|
len = property_get(key, buf, "");
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
jint temp;
|
result = strtol(buf, &end, 0);
|
||||||
if (sscanf(buf, "%d", &temp) == 1)
|
if (end == buf) {
|
||||||
result = temp;
|
result = defJ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
env->ReleaseStringUTFChars(keyJ, key);
|
env->ReleaseStringUTFChars(keyJ, key);
|
||||||
@ -93,6 +95,7 @@ static jlong SystemProperties_get_long(JNIEnv *env, jobject clazz,
|
|||||||
int len;
|
int len;
|
||||||
const char* key;
|
const char* key;
|
||||||
char buf[PROPERTY_VALUE_MAX];
|
char buf[PROPERTY_VALUE_MAX];
|
||||||
|
char* end;
|
||||||
jlong result = defJ;
|
jlong result = defJ;
|
||||||
|
|
||||||
if (keyJ == NULL) {
|
if (keyJ == NULL) {
|
||||||
@ -104,9 +107,10 @@ static jlong SystemProperties_get_long(JNIEnv *env, jobject clazz,
|
|||||||
|
|
||||||
len = property_get(key, buf, "");
|
len = property_get(key, buf, "");
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
jlong temp;
|
result = strtoll(buf, &end, 0);
|
||||||
if (sscanf(buf, "%lld", &temp) == 1)
|
if (end == buf) {
|
||||||
result = temp;
|
result = defJ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
env->ReleaseStringUTFChars(keyJ, key);
|
env->ReleaseStringUTFChars(keyJ, key);
|
||||||
|
Reference in New Issue
Block a user