summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2012-04-12 11:18:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-12 11:18:08 -0700
commit2b23adbc33c888a2c9fa22dd2e967227baa27e5c (patch)
tree4d7aa968bf1b475078ade41ec881c5397f7f51f8 /services
parentb187d52f8adaad068997595118f32cb02d7a9013 (diff)
parent7463adacbd5ccb329b094c5343a0389f4872f5e7 (diff)
downloadframeworks_base-2b23adbc33c888a2c9fa22dd2e967227baa27e5c.zip
frameworks_base-2b23adbc33c888a2c9fa22dd2e967227baa27e5c.tar.gz
frameworks_base-2b23adbc33c888a2c9fa22dd2e967227baa27e5c.tar.bz2
Merge "Make dumpsys activity services work again."
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 78b441a..0c2e6ac 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -8309,7 +8309,7 @@ public final class ActivityManagerService extends ActivityManagerNative
+ android.Manifest.permission.DUMP);
return;
}
-
+
boolean dumpAll = false;
boolean dumpClient = false;
String dumpPackage = null;
@@ -8352,7 +8352,9 @@ public final class ActivityManagerService extends ActivityManagerNative
pw.println("Unknown argument: " + opt + "; use -h for help");
}
}
-
+
+ long origId = Binder.clearCallingIdentity();
+ boolean more = false;
// Is the caller requesting to dump a particular piece of data?
if (opti < args.length) {
String cmd = args[opti];
@@ -8361,7 +8363,6 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (this) {
dumpActivitiesLocked(fd, pw, args, opti, true, dumpClient, null);
}
- return;
} else if ("broadcasts".equals(cmd) || "b".equals(cmd)) {
String[] newArgs;
String name;
@@ -8378,7 +8379,6 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (this) {
dumpBroadcastsLocked(fd, pw, args, opti, true, name);
}
- return;
} else if ("intents".equals(cmd) || "i".equals(cmd)) {
String[] newArgs;
String name;
@@ -8395,7 +8395,6 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (this) {
dumpPendingIntentsLocked(fd, pw, args, opti, true, name);
}
- return;
} else if ("processes".equals(cmd) || "p".equals(cmd)) {
String[] newArgs;
String name;
@@ -8412,12 +8411,10 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (this) {
dumpProcessesLocked(fd, pw, args, opti, true, name);
}
- return;
} else if ("oom".equals(cmd) || "o".equals(cmd)) {
synchronized (this) {
dumpOomLocked(fd, pw, args, opti, true);
}
- return;
} else if ("provider".equals(cmd)) {
String[] newArgs;
String name;
@@ -8434,12 +8431,10 @@ public final class ActivityManagerService extends ActivityManagerNative
pw.println("No providers match: " + name);
pw.println("Use -h for help.");
}
- return;
} else if ("providers".equals(cmd) || "prov".equals(cmd)) {
synchronized (this) {
dumpProvidersLocked(fd, pw, args, opti, true, null);
}
- return;
} else if ("service".equals(cmd)) {
String[] newArgs;
String name;
@@ -8457,13 +8452,11 @@ public final class ActivityManagerService extends ActivityManagerNative
pw.println("No services match: " + name);
pw.println("Use -h for help.");
}
- return;
} else if ("package".equals(cmd)) {
String[] newArgs;
if (opti >= args.length) {
pw.println("package: no package name specified");
pw.println("Use -h for help.");
- return;
} else {
dumpPackage = args[opti];
opti++;
@@ -8472,22 +8465,25 @@ public final class ActivityManagerService extends ActivityManagerNative
args.length - opti);
args = newArgs;
opti = 0;
+ more = true;
}
} else if ("services".equals(cmd) || "s".equals(cmd)) {
synchronized (this) {
dumpServicesLocked(fd, pw, args, opti, true, dumpClient, null);
}
- return;
} else {
// Dumping a single activity?
if (!dumpActivity(fd, pw, cmd, args, opti, dumpAll)) {
pw.println("Bad activity command, or no activities match: " + cmd);
pw.println("Use -h for help.");
}
+ }
+ if (!more) {
+ Binder.restoreCallingIdentity(origId);
return;
}
}
-
+
// No piece of data specified, dump everything.
synchronized (this) {
boolean needSep;
@@ -8528,8 +8524,9 @@ public final class ActivityManagerService extends ActivityManagerNative
}
dumpProcessesLocked(fd, pw, args, opti, dumpAll, dumpPackage);
}
+ Binder.restoreCallingIdentity(origId);
}
-
+
boolean dumpActivitiesLocked(FileDescriptor fd, PrintWriter pw, String[] args,
int opti, boolean dumpAll, boolean dumpClient, String dumpPackage) {
pw.println("ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)");