diff options
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 5 | ||||
| -rw-r--r-- | cmds/app_process/Android.mk | 2 | ||||
| -rw-r--r-- | cmds/input/src/com/android/commands/input/Input.java | 17 | ||||
| -rw-r--r-- | cmds/svc/src/com/android/commands/svc/PowerCommand.java | 2 |
4 files changed, 20 insertions, 6 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 96c0dbddee41..d64e2707139d 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -106,7 +106,7 @@ public class Am extends BaseCommand { "usage: am [subcommand] [options]\n" + "usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]\n" + " [--sampling INTERVAL] [-R COUNT] [-S] [--opengl-trace]\n" + - " [--user <USER_ID> | current] <INTENT>\n" + + " [--track-allocation] [--user <USER_ID> | current] <INTENT>\n" + " am startservice [--user <USER_ID> | current] <INTENT>\n" + " am stopservice [--user <USER_ID> | current] <INTENT>\n" + " am force-stop [--user <USER_ID> | all | current] <PACKAGE>\n" + @@ -162,6 +162,7 @@ public class Am extends BaseCommand { " the top activity will be finished.\n" + " -S: force stop the target app before starting the activity\n" + " --opengl-trace: enable tracing of OpenGL functions\n" + + " --track-allocation: enable tracking of object allocations\n" + " --user <USER_ID> | current: Specify which user to run as; if not\n" + " specified then run as the current user.\n" + "\n" + @@ -691,6 +692,8 @@ public class Am extends BaseCommand { mStopOption = true; } else if (opt.equals("--opengl-trace")) { mStartFlags |= ActivityManager.START_FLAG_OPENGL_TRACES; + } else if (opt.equals("--track-allocation")) { + mStartFlags |= ActivityManager.START_FLAG_TRACK_ALLOCATION; } else if (opt.equals("--user")) { mUserId = parseUserArg(nextArgRequired()); } else if (opt.equals("--receiver-permission")) { diff --git a/cmds/app_process/Android.mk b/cmds/app_process/Android.mk index 7ce0846f2e7c..51bbb813df65 100644 --- a/cmds/app_process/Android.mk +++ b/cmds/app_process/Android.mk @@ -65,7 +65,7 @@ LOCAL_MULTILIB := both LOCAL_MODULE_STEM_32 := app_process32 LOCAL_MODULE_STEM_64 := app_process64 -LOCAL_ADDRESS_SANITIZER := true +LOCAL_SANITIZE := address LOCAL_CLANG := true LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)/asan 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/cmds/svc/src/com/android/commands/svc/PowerCommand.java b/cmds/svc/src/com/android/commands/svc/PowerCommand.java index 2754f2d270bd..6ce29cb24bc6 100644 --- a/cmds/svc/src/com/android/commands/svc/PowerCommand.java +++ b/cmds/svc/src/com/android/commands/svc/PowerCommand.java @@ -93,7 +93,7 @@ public class PowerCommand extends Svc.Command { } else if ("shutdown".equals(args[1])) { try { // no confirm, wait till device is off - pm.shutdown(false, true); + pm.shutdown(false, null, true); } catch (RemoteException e) { System.err.println("Failed to shutdown."); } |