summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tobias Thierer <tobiast@google.com> 2016-04-21 18:51:17 +0100
committer Tobias Thierer <tobiast@google.com> 2016-04-21 18:51:25 +0100
commita1adc6ff8255c5daceff8084e73f85609ec1d100 (patch)
tree377ce0da3c6c977ab60a655c4dedd0e858fec3f4
parent570a13f0cb233b4a216243025a9fed3df3c72849 (diff)
Fix needless value boxing/unboxing in Am.java
(except the Long unboxing covered by a separate CL). Tested: Successfully built frameworks/base Bug: 28289401 Change-Id: I40d09af9c003b7667cb96171747bd355d7a9dc4f
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 74a1fbf1b490..3faacdc25815 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -552,7 +552,7 @@ public class Am extends BaseCommand {
String[] strings = value.split(",");
float[] list = new float[strings.length];
for (int i = 0; i < strings.length; i++) {
- list[i] = Float.valueOf(strings[i]);
+ list[i] = Float.parseFloat(strings[i]);
}
intent.putExtra(key, list);
hasIntentInfo = true;
@@ -1876,7 +1876,7 @@ public class Am extends BaseCommand {
private void runStackStart() throws Exception {
String displayIdStr = nextArgRequired();
- int displayId = Integer.valueOf(displayIdStr);
+ int displayId = Integer.parseInt(displayIdStr);
Intent intent = makeIntent(UserHandle.USER_CURRENT);
try {
@@ -1890,9 +1890,9 @@ public class Am extends BaseCommand {
private void runStackMoveTask() throws Exception {
String taskIdStr = nextArgRequired();
- int taskId = Integer.valueOf(taskIdStr);
+ int taskId = Integer.parseInt(taskIdStr);
String stackIdStr = nextArgRequired();
- int stackId = Integer.valueOf(stackIdStr);
+ int stackId = Integer.parseInt(stackIdStr);
String toTopStr = nextArgRequired();
final boolean toTop;
if ("true".equals(toTopStr)) {
@@ -1912,7 +1912,7 @@ public class Am extends BaseCommand {
private void runStackResize() throws Exception {
String stackIdStr = nextArgRequired();
- int stackId = Integer.valueOf(stackIdStr);
+ int stackId = Integer.parseInt(stackIdStr);
final Rect bounds = getBounds();
if (bounds == null) {
System.err.println("Error: invalid input bounds");
@@ -1938,7 +1938,7 @@ public class Am extends BaseCommand {
private void runStackInfo() throws Exception {
try {
String stackIdStr = nextArgRequired();
- int stackId = Integer.valueOf(stackIdStr);
+ int stackId = Integer.parseInt(stackIdStr);
StackInfo info = mAm.getStackInfo(stackId);
System.out.println(info);
} catch (RemoteException e) {
@@ -1946,7 +1946,7 @@ public class Am extends BaseCommand {
}
private void runStackSplit() throws Exception {
- final int stackId = Integer.valueOf(nextArgRequired());
+ final int stackId = Integer.parseInt(nextArgRequired());
final String splitDirection = nextArgRequired();
Intent intent = null;
try {
@@ -2023,7 +2023,7 @@ public class Am extends BaseCommand {
if (taskIdStr.equals("stop")) {
mAm.stopLockTaskMode();
} else {
- int taskId = Integer.valueOf(taskIdStr);
+ int taskId = Integer.parseInt(taskIdStr);
mAm.startLockTaskMode(taskId);
}
System.err.println("Activity manager is " + (mAm.isInLockTaskMode() ? "" : "not ") +
@@ -2034,9 +2034,9 @@ public class Am extends BaseCommand {
private void runTaskResizeable() throws Exception {
final String taskIdStr = nextArgRequired();
- final int taskId = Integer.valueOf(taskIdStr);
+ final int taskId = Integer.parseInt(taskIdStr);
final String resizeableStr = nextArgRequired();
- final boolean resizeable = Boolean.valueOf(resizeableStr);
+ final boolean resizeable = Boolean.parseBoolean(resizeableStr);
try {
mAm.setTaskResizeable(taskId, resizeable);
@@ -2046,7 +2046,7 @@ public class Am extends BaseCommand {
private void runTaskResize() throws Exception {
final String taskIdStr = nextArgRequired();
- final int taskId = Integer.valueOf(taskIdStr);
+ final int taskId = Integer.parseInt(taskIdStr);
final Rect bounds = getBounds();
if (bounds == null) {
System.err.println("Error: invalid input bounds");
@@ -2248,13 +2248,13 @@ public class Am extends BaseCommand {
private Rect getBounds() {
String leftStr = nextArgRequired();
- int left = Integer.valueOf(leftStr);
+ int left = Integer.parseInt(leftStr);
String topStr = nextArgRequired();
- int top = Integer.valueOf(topStr);
+ int top = Integer.parseInt(topStr);
String rightStr = nextArgRequired();
- int right = Integer.valueOf(rightStr);
+ int right = Integer.parseInt(rightStr);
String bottomStr = nextArgRequired();
- int bottom = Integer.valueOf(bottomStr);
+ int bottom = Integer.parseInt(bottomStr);
if (left < 0) {
System.err.println("Error: bad left arg: " + leftStr);
return null;