summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-24 18:31:21 -0700
committerMathias Agopian <mathias@google.com>2009-06-24 18:31:21 -0700
commitf31868e59fbf59a8d479587c80b648fb37a166fc (patch)
tree5a0aa67a76d6b0e48041f557eefd764e57eb97cf /cmds
parentc6603951d45fc9b0d1776fec9444b6f31af92840 (diff)
parentecf2b68d834d334de218dc427615b4ca05c0293a (diff)
downloadframeworks_base-f31868e59fbf59a8d479587c80b648fb37a166fc.zip
frameworks_base-f31868e59fbf59a8d479587c80b648fb37a166fc.tar.gz
frameworks_base-f31868e59fbf59a8d479587c80b648fb37a166fc.tar.bz2
merge master in master_gl
Diffstat (limited to 'cmds')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 2a4a672..3782136 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -26,10 +26,13 @@ import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.view.IWindowManager;
+import java.io.File;
+import java.io.FileNotFoundException;
import java.util.Iterator;
import java.util.Set;
@@ -446,6 +449,8 @@ public class Am {
return;
}
+ ParcelFileDescriptor fd = null;
+
String cmd = nextArg();
if ("start".equals(cmd)) {
start = true;
@@ -455,6 +460,16 @@ public class Am {
showUsage();
return;
}
+ try {
+ fd = ParcelFileDescriptor.open(
+ new File(profileFile),
+ ParcelFileDescriptor.MODE_CREATE |
+ ParcelFileDescriptor.MODE_TRUNCATE |
+ ParcelFileDescriptor.MODE_READ_WRITE);
+ } catch (FileNotFoundException e) {
+ System.err.println("Error: Unable to open file: " + profileFile);
+ return;
+ }
} else if (!"stop".equals(cmd)) {
System.err.println("Error: Profile command " + cmd + " not valid");
showUsage();
@@ -462,8 +477,8 @@ public class Am {
}
try {
- if (!mAm.profileControl(process, start, profileFile)) {
- System.out.println("PROFILE FAILED on process " + process);
+ if (!mAm.profileControl(process, start, profileFile, fd)) {
+ System.err.println("PROFILE FAILED on process " + process);
return;
}
} catch (IllegalArgumentException e) {