summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/input/src/com/android/commands/input/Input.java17
-rw-r--r--core/java/android/app/AlarmManager.java2
-rw-r--r--core/java/android/os/Process.java4
-rw-r--r--core/java/com/android/internal/app/ProcessStats.java3
-rw-r--r--core/java/com/android/internal/os/Zygote.java4
-rw-r--r--core/java/com/android/internal/os/ZygoteConnection.java6
-rw-r--r--core/jni/AndroidRuntime.cpp12
-rw-r--r--core/jni/android_os_Parcel.cpp12
-rw-r--r--data/keyboards/Android.mk2
-rw-r--r--docs/html/tools/debugging/debugging-log.jd18
-rw-r--r--packages/InputDevices/Android.mk2
-rw-r--r--packages/SystemUI/src/com/android/systemui/ImageWallpaper.java4
-rw-r--r--rs/java/android/renderscript/Allocation.java2
-rw-r--r--rs/java/android/renderscript/RenderScript.java9
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp2
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java6
-rw-r--r--services/core/java/com/android/server/job/JobServiceContext.java16
17 files changed, 65 insertions, 56 deletions
diff --git a/cmds/input/src/com/android/commands/input/Input.java b/cmds/input/src/com/android/commands/input/Input.java
index 2a7c79bdfb5b..754d3f510bbd 100644
--- a/cmds/input/src/com/android/commands/input/Input.java
+++ b/cmds/input/src/com/android/commands/input/Input.java
@@ -234,6 +234,18 @@ public class Input {
InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
+ private int getInputDeviceId(int inputSource) {
+ final int DEFAULT_DEVICE_ID = 0;
+ int[] devIds = InputDevice.getDeviceIds();
+ for (int devId : devIds) {
+ InputDevice inputDev = InputDevice.getDevice(devId);
+ if (inputDev.supportsSource(inputSource)) {
+ return devId;
+ }
+ }
+ return DEFAULT_DEVICE_ID;
+ }
+
/**
* Builds a MotionEvent and injects it into the event stream.
*
@@ -249,11 +261,10 @@ public class Input {
final int DEFAULT_META_STATE = 0;
final float DEFAULT_PRECISION_X = 1.0f;
final float DEFAULT_PRECISION_Y = 1.0f;
- final int DEFAULT_DEVICE_ID = 0;
final int DEFAULT_EDGE_FLAGS = 0;
MotionEvent event = MotionEvent.obtain(when, when, action, x, y, pressure, DEFAULT_SIZE,
- DEFAULT_META_STATE, DEFAULT_PRECISION_X, DEFAULT_PRECISION_Y, DEFAULT_DEVICE_ID,
- DEFAULT_EDGE_FLAGS);
+ DEFAULT_META_STATE, DEFAULT_PRECISION_X, DEFAULT_PRECISION_Y,
+ getInputDeviceId(inputSource), DEFAULT_EDGE_FLAGS);
event.setSource(inputSource);
Log.i(TAG, "injectMotionEvent: " + event);
InputManager.getInstance().injectInputEvent(event,
diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java
index 5e7bd0dc39f8..b80fc8632cd8 100644
--- a/core/java/android/app/AlarmManager.java
+++ b/core/java/android/app/AlarmManager.java
@@ -796,7 +796,7 @@ public class AlarmManager {
}
/**
- * Returns an intent intent that can be used to show or edit details of the alarm clock in
+ * Returns an intent that can be used to show or edit details of the alarm clock in
* the application that scheduled it.
*
* <p class="note">Beware that any application can retrieve and send this intent,
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 009649fa0f90..c24c4fe6fe7a 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -634,8 +634,8 @@ public class Process {
if ((debugFlags & Zygote.DEBUG_ENABLE_JIT) != 0) {
argsForZygote.add("--enable-jit");
}
- if ((debugFlags & Zygote.DEBUG_GENERATE_CFI) != 0) {
- argsForZygote.add("--generate-cfi");
+ if ((debugFlags & Zygote.DEBUG_GENERATE_DEBUG_INFO) != 0) {
+ argsForZygote.add("--generate-debug-info");
}
if ((debugFlags & Zygote.DEBUG_ENABLE_ASSERT) != 0) {
argsForZygote.add("--enable-assert");
diff --git a/core/java/com/android/internal/app/ProcessStats.java b/core/java/com/android/internal/app/ProcessStats.java
index fe79effc6ab7..4cd12c67bb8e 100644
--- a/core/java/com/android/internal/app/ProcessStats.java
+++ b/core/java/com/android/internal/app/ProcessStats.java
@@ -3365,10 +3365,11 @@ public final class ProcessStats implements Parcelable {
+ pkgList.keyAt(index) + "/" + proc.mUid
+ " for multi-proc " + proc.mName + " version " + proc.mVersion);
}
+ String savedName = proc.mName;
proc = pkg.mProcesses.get(proc.mName);
if (proc == null) {
throw new IllegalStateException("Didn't create per-package process "
- + proc.mName + " in pkg " + pkg.mPackageName + "/" + pkg.mUid);
+ + savedName + " in pkg " + pkg.mPackageName + "/" + pkg.mUid);
}
holder.state = proc;
}
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 1e7ee5a975bc..544e1e4e8727 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -40,8 +40,8 @@ public final class Zygote {
public static final int DEBUG_ENABLE_JNI_LOGGING = 1 << 4;
/** enable the JIT compiler */
public static final int DEBUG_ENABLE_JIT = 1 << 5;
- /** Force generation of CFI code */
- public static final int DEBUG_GENERATE_CFI = 1 << 6;
+ /** Force generation of native debugging information. */
+ public static final int DEBUG_GENERATE_DEBUG_INFO = 1 << 6;
/** No external storage should be mounted. */
public static final int MOUNT_EXTERNAL_NONE = 0;
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index 969d236784bc..66da59427c28 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -321,7 +321,7 @@ class ZygoteConnection {
/**
* From --enable-debugger, --enable-checkjni, --enable-assert,
- * --enable-safemode, --enable-jit, --generate-cfi and --enable-jni-logging.
+ * --enable-safemode, --enable-jit, --generate-debug-info and --enable-jni-logging.
*/
int debugFlags;
@@ -433,8 +433,8 @@ class ZygoteConnection {
debugFlags |= Zygote.DEBUG_ENABLE_CHECKJNI;
} else if (arg.equals("--enable-jit")) {
debugFlags |= Zygote.DEBUG_ENABLE_JIT;
- } else if (arg.equals("--generate-cfi")) {
- debugFlags |= Zygote.DEBUG_GENERATE_CFI;
+ } else if (arg.equals("--generate-debug-info")) {
+ debugFlags |= Zygote.DEBUG_GENERATE_DEBUG_INFO;
} else if (arg.equals("--enable-jni-logging")) {
debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
} else if (arg.equals("--enable-assert")) {
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 7c2b28dcc2b1..2c35a8be98c2 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -876,16 +876,16 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
"-Xzygote-max-boot-retry=");
/*
- * When running with debug.gencfi, add --include-cfi to the compiler options so that the boot
- * image, if it is compiled on device, will include CFI info, as well as other compilations
- * started by the runtime.
+ * When running with debug.generate-debug-info, add --generate-debug-info to
+ * the compiler options so that the boot image, if it is compiled on device,
+ * will include native debugging information.
*/
- property_get("debug.gencfi", propBuf, "");
+ property_get("debug.generate-debug-info", propBuf, "");
if (strcmp(propBuf, "true") == 0) {
addOption("-Xcompiler-option");
- addOption("--include-cfi");
+ addOption("--generate-debug-info");
addOption("-Ximage-compiler-option");
- addOption("--include-cfi");
+ addOption("--generate-debug-info");
}
initArgs.version = JNI_VERSION_1_4;
diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp
index 2ee9283c0fd4..d2befcae8535 100644
--- a/core/jni/android_os_Parcel.cpp
+++ b/core/jni/android_os_Parcel.cpp
@@ -449,15 +449,11 @@ static jobject android_os_Parcel_openFileDescriptor(JNIEnv* env, jclass clazz,
jniThrowNullPointerException(env, NULL);
return NULL;
}
- const jchar* str = env->GetStringCritical(name, 0);
- if (str == NULL) {
- // Whatever, whatever.
- jniThrowException(env, "java/lang/IllegalStateException", NULL);
+ ScopedUtfChars name8(env, name);
+ if (name8.c_str() == NULL) {
return NULL;
}
- String8 name8(reinterpret_cast<const char16_t*>(str),
- env->GetStringLength(name));
- env->ReleaseStringCritical(name, str);
+
int flags=0;
switch (mode&0x30000000) {
case 0:
@@ -480,7 +476,7 @@ static jobject android_os_Parcel_openFileDescriptor(JNIEnv* env, jclass clazz,
if (mode&0x00000001) realMode |= S_IROTH;
if (mode&0x00000002) realMode |= S_IWOTH;
- int fd = open(name8.string(), flags, realMode);
+ int fd = open(name8.c_str(), flags, realMode);
if (fd < 0) {
jniThrowException(env, "java/io/FileNotFoundException", strerror(errno));
return NULL;
diff --git a/data/keyboards/Android.mk b/data/keyboards/Android.mk
index 898efe8f2dca..461683805058 100644
--- a/data/keyboards/Android.mk
+++ b/data/keyboards/Android.mk
@@ -32,7 +32,7 @@ $(LOCAL_BUILT_MODULE) : $(framework_keylayouts) $(framework_keycharmaps) $(frame
$(hide) mkdir -p $(dir $@) && touch $@
# Run validatekeymaps uncondionally for platform build.
-droidcore all_modules : $(LOCAL_BUILT_MODULE)
+droidcore : $(LOCAL_BUILT_MODULE)
# Reset temp vars.
validatekeymaps :=
diff --git a/docs/html/tools/debugging/debugging-log.jd b/docs/html/tools/debugging/debugging-log.jd
index d2baaf26ce84..e222b2a05cd4 100644
--- a/docs/html/tools/debugging/debugging-log.jd
+++ b/docs/html/tools/debugging/debugging-log.jd
@@ -284,22 +284,8 @@ adb logcat -b radio
<h2 id="viewingStd">Viewing stdout and stderr</h2>
<p>By default, the Android system sends <code>stdout</code> and <code>stderr</code>
- (<code>System.out</code> and <code>System.err</code>) output to <code>/dev/null</code>. In
- processes that run the Dalvik VM, you can have the system write a copy of the output to the log
- file. In this case, the system writes the messages to the log using the log tags
- <code>stdout</code> and <code>stderr</code>, both with priority <code>I</code>.</p>
-
- <p>To route the output in this way, you stop a running emulator/device instance and then use the
- shell command <code>setprop</code> to enable the redirection of output. Here's how you do it:</p>
- <pre>
-$ adb shell stop
-$ adb shell setprop log.redirect-stdio true
-$ adb shell start
-</pre>
-
- <p>The system retains this setting until you terminate the emulator/device instance. To use the
- setting as a default on the emulator/device instance, you can add an entry to
- <code>/data/local.prop</code> on the device.</p>
+ output to <code>/dev/null</code>. (The Java <code>System.out</code> and <code>System.err</code>
+ streams go to the log.)
<h2 id="DebuggingWebPages">Debugging Web Apps</h2>
<p>
diff --git a/packages/InputDevices/Android.mk b/packages/InputDevices/Android.mk
index f537022c6129..e7190dc90843 100644
--- a/packages/InputDevices/Android.mk
+++ b/packages/InputDevices/Android.mk
@@ -42,7 +42,7 @@ $(LOCAL_BUILT_MODULE) : $(input_devices_keymaps) | $(validatekeymaps)
$(hide) mkdir -p $(dir $@) && touch $@
# Run validatekeymaps unconditionally for platform build.
-droidcore all_modules : $(LOCAL_BUILT_MODULE)
+droidcore : $(LOCAL_BUILT_MODULE)
# Reset temp vars.
validatekeymaps :=
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index 6888d0e2487e..428df8d827f1 100644
--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -234,7 +234,9 @@ public class ImageWallpaper extends WallpaperService {
Log.d(TAG, "Visibility changed to visible=" + visible);
}
mVisible = visible;
- drawFrame();
+ if (visible) {
+ drawFrame();
+ }
}
}
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 0a5059390449..a4876b92fadf 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -1505,7 +1505,7 @@ public class Allocation extends BaseObj {
}
final byte[] data = fp.getData();
- int data_length = fp.getPos();
+ int data_length = data.length;
int eSize = mType.mElement.mElements[component_number].getBytesSize();
eSize *= mType.mElement.mArraySizes[component_number];
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 8b1a0324956a..f8028eeccacf 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -88,6 +88,13 @@ public class RenderScript {
*/
public static final int CREATE_FLAG_LOW_POWER = 0x0004;
+ /**
+ * @hide
+ * Context creation flag which instructs the implementation to wait for
+ * a debugger to be attached before continuing execution.
+ */
+ public static final int CREATE_FLAG_WAIT_FOR_ATTACH = 0x0008;
+
/*
* Detect the bitness of the VM to allow FieldPacker to do the right thing.
*/
@@ -1356,7 +1363,7 @@ public class RenderScript {
return null;
}
- if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER)) != 0) {
+ if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER | CREATE_FLAG_WAIT_FOR_ATTACH)) != 0) {
throw new RSIllegalArgumentException("Invalid flags passed.");
}
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 1833a1cd87a1..26af574f32fe 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -1452,7 +1452,7 @@ nAllocationElementRead(JNIEnv *_env, jobject _this, jlong con, jlong alloc,
rsAllocationElementRead((RsContext)con, (RsAllocation)alloc,
xoff, yoff, zoff,
lod, ptr, sizeBytes, compIdx);
- _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
+ _env->ReleaseByteArrayElements(data, ptr, 0);
}
// Copies from the Allocation pointed to by _alloc into the Java object data.
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 1046b2960fdc..4e6549cdfb93 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -3264,9 +3264,9 @@ public final class ActivityManagerService extends ActivityManagerNative
debugFlags |= Zygote.DEBUG_ENABLE_JIT;
}
}
- String genCFIDebugProperty = SystemProperties.get("debug.gencfi");
- if ("true".equals(genCFIDebugProperty)) {
- debugFlags |= Zygote.DEBUG_GENERATE_CFI;
+ String genDebugInfoProperty = SystemProperties.get("debug.generate-debug-info");
+ if ("true".equals(genDebugInfoProperty)) {
+ debugFlags |= Zygote.DEBUG_GENERATE_DEBUG_INFO;
}
if ("1".equals(SystemProperties.get("debug.jni.logging"))) {
debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
diff --git a/services/core/java/com/android/server/job/JobServiceContext.java b/services/core/java/com/android/server/job/JobServiceContext.java
index bb4e38849a56..d26319b5b0b9 100644
--- a/services/core/java/com/android/server/job/JobServiceContext.java
+++ b/services/core/java/com/android/server/job/JobServiceContext.java
@@ -73,7 +73,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
private static final long OP_TIMEOUT_MILLIS = 8 * 1000;
private static final String[] VERB_STRINGS = {
- "VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING"
+ "VERB_BINDING", "VERB_STARTING", "VERB_EXECUTING", "VERB_STOPPING", "VERB_FINISHED"
};
// States that a job occupies while interacting with the client.
@@ -81,6 +81,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
static final int VERB_STARTING = 1;
static final int VERB_EXECUTING = 2;
static final int VERB_STOPPING = 3;
+ static final int VERB_FINISHED = 4;
// Messages that result from interactions with the client service.
/** System timed out waiting for a response. */
@@ -172,6 +173,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
mRunningJob = null;
mParams = null;
mExecutionStartTimeElapsed = 0L;
+ mVerb = VERB_FINISHED;
removeOpTimeOut();
return false;
}
@@ -307,8 +309,8 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
break;
case MSG_CALLBACK:
if (DEBUG) {
- Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob + " v:" +
- (mVerb >= 0 ? VERB_STRINGS[mVerb] : "[invalid]"));
+ Slog.d(TAG, "MSG_CALLBACK of : " + mRunningJob
+ + " v:" + VERB_STRINGS[mVerb]);
}
removeOpTimeOut();
@@ -524,8 +526,12 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
* we want to clean up internally.
*/
private void closeAndCleanupJobH(boolean reschedule) {
- final JobStatus completedJob = mRunningJob;
+ final JobStatus completedJob;
synchronized (mLock) {
+ if (mVerb == VERB_FINISHED) {
+ return;
+ }
+ completedJob = mRunningJob;
try {
mBatteryStats.noteJobFinish(mRunningJob.getName(), mRunningJob.getUid());
} catch (RemoteException e) {
@@ -538,7 +544,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
mWakeLock = null;
mRunningJob = null;
mParams = null;
- mVerb = -1;
+ mVerb = VERB_FINISHED;
mCancelled.set(false);
service = null;
mAvailable = true;