Merge "Fix needless value boxing/unboxing in Am.java (except the Long unboxing covered by a separate CL)."
This commit is contained in:
@@ -552,7 +552,7 @@ public class Am extends BaseCommand {
|
|||||||
String[] strings = value.split(",");
|
String[] strings = value.split(",");
|
||||||
float[] list = new float[strings.length];
|
float[] list = new float[strings.length];
|
||||||
for (int i = 0; i < strings.length; i++) {
|
for (int i = 0; i < strings.length; i++) {
|
||||||
list[i] = Float.valueOf(strings[i]);
|
list[i] = Float.parseFloat(strings[i]);
|
||||||
}
|
}
|
||||||
intent.putExtra(key, list);
|
intent.putExtra(key, list);
|
||||||
hasIntentInfo = true;
|
hasIntentInfo = true;
|
||||||
@@ -1876,7 +1876,7 @@ public class Am extends BaseCommand {
|
|||||||
|
|
||||||
private void runStackStart() throws Exception {
|
private void runStackStart() throws Exception {
|
||||||
String displayIdStr = nextArgRequired();
|
String displayIdStr = nextArgRequired();
|
||||||
int displayId = Integer.valueOf(displayIdStr);
|
int displayId = Integer.parseInt(displayIdStr);
|
||||||
Intent intent = makeIntent(UserHandle.USER_CURRENT);
|
Intent intent = makeIntent(UserHandle.USER_CURRENT);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1890,9 +1890,9 @@ public class Am extends BaseCommand {
|
|||||||
|
|
||||||
private void runStackMoveTask() throws Exception {
|
private void runStackMoveTask() throws Exception {
|
||||||
String taskIdStr = nextArgRequired();
|
String taskIdStr = nextArgRequired();
|
||||||
int taskId = Integer.valueOf(taskIdStr);
|
int taskId = Integer.parseInt(taskIdStr);
|
||||||
String stackIdStr = nextArgRequired();
|
String stackIdStr = nextArgRequired();
|
||||||
int stackId = Integer.valueOf(stackIdStr);
|
int stackId = Integer.parseInt(stackIdStr);
|
||||||
String toTopStr = nextArgRequired();
|
String toTopStr = nextArgRequired();
|
||||||
final boolean toTop;
|
final boolean toTop;
|
||||||
if ("true".equals(toTopStr)) {
|
if ("true".equals(toTopStr)) {
|
||||||
@@ -1912,7 +1912,7 @@ public class Am extends BaseCommand {
|
|||||||
|
|
||||||
private void runStackResize() throws Exception {
|
private void runStackResize() throws Exception {
|
||||||
String stackIdStr = nextArgRequired();
|
String stackIdStr = nextArgRequired();
|
||||||
int stackId = Integer.valueOf(stackIdStr);
|
int stackId = Integer.parseInt(stackIdStr);
|
||||||
final Rect bounds = getBounds();
|
final Rect bounds = getBounds();
|
||||||
if (bounds == null) {
|
if (bounds == null) {
|
||||||
System.err.println("Error: invalid input bounds");
|
System.err.println("Error: invalid input bounds");
|
||||||
@@ -1938,7 +1938,7 @@ public class Am extends BaseCommand {
|
|||||||
private void runStackInfo() throws Exception {
|
private void runStackInfo() throws Exception {
|
||||||
try {
|
try {
|
||||||
String stackIdStr = nextArgRequired();
|
String stackIdStr = nextArgRequired();
|
||||||
int stackId = Integer.valueOf(stackIdStr);
|
int stackId = Integer.parseInt(stackIdStr);
|
||||||
StackInfo info = mAm.getStackInfo(stackId);
|
StackInfo info = mAm.getStackInfo(stackId);
|
||||||
System.out.println(info);
|
System.out.println(info);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -1946,7 +1946,7 @@ public class Am extends BaseCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void runStackSplit() throws Exception {
|
private void runStackSplit() throws Exception {
|
||||||
final int stackId = Integer.valueOf(nextArgRequired());
|
final int stackId = Integer.parseInt(nextArgRequired());
|
||||||
final String splitDirection = nextArgRequired();
|
final String splitDirection = nextArgRequired();
|
||||||
Intent intent = null;
|
Intent intent = null;
|
||||||
try {
|
try {
|
||||||
@@ -2023,7 +2023,7 @@ public class Am extends BaseCommand {
|
|||||||
if (taskIdStr.equals("stop")) {
|
if (taskIdStr.equals("stop")) {
|
||||||
mAm.stopLockTaskMode();
|
mAm.stopLockTaskMode();
|
||||||
} else {
|
} else {
|
||||||
int taskId = Integer.valueOf(taskIdStr);
|
int taskId = Integer.parseInt(taskIdStr);
|
||||||
mAm.startLockTaskMode(taskId);
|
mAm.startLockTaskMode(taskId);
|
||||||
}
|
}
|
||||||
System.err.println("Activity manager is " + (mAm.isInLockTaskMode() ? "" : "not ") +
|
System.err.println("Activity manager is " + (mAm.isInLockTaskMode() ? "" : "not ") +
|
||||||
@@ -2034,9 +2034,9 @@ public class Am extends BaseCommand {
|
|||||||
|
|
||||||
private void runTaskResizeable() throws Exception {
|
private void runTaskResizeable() throws Exception {
|
||||||
final String taskIdStr = nextArgRequired();
|
final String taskIdStr = nextArgRequired();
|
||||||
final int taskId = Integer.valueOf(taskIdStr);
|
final int taskId = Integer.parseInt(taskIdStr);
|
||||||
final String resizeableStr = nextArgRequired();
|
final String resizeableStr = nextArgRequired();
|
||||||
final boolean resizeable = Boolean.valueOf(resizeableStr);
|
final boolean resizeable = Boolean.parseBoolean(resizeableStr);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mAm.setTaskResizeable(taskId, resizeable);
|
mAm.setTaskResizeable(taskId, resizeable);
|
||||||
@@ -2046,7 +2046,7 @@ public class Am extends BaseCommand {
|
|||||||
|
|
||||||
private void runTaskResize() throws Exception {
|
private void runTaskResize() throws Exception {
|
||||||
final String taskIdStr = nextArgRequired();
|
final String taskIdStr = nextArgRequired();
|
||||||
final int taskId = Integer.valueOf(taskIdStr);
|
final int taskId = Integer.parseInt(taskIdStr);
|
||||||
final Rect bounds = getBounds();
|
final Rect bounds = getBounds();
|
||||||
if (bounds == null) {
|
if (bounds == null) {
|
||||||
System.err.println("Error: invalid input bounds");
|
System.err.println("Error: invalid input bounds");
|
||||||
@@ -2248,13 +2248,13 @@ public class Am extends BaseCommand {
|
|||||||
|
|
||||||
private Rect getBounds() {
|
private Rect getBounds() {
|
||||||
String leftStr = nextArgRequired();
|
String leftStr = nextArgRequired();
|
||||||
int left = Integer.valueOf(leftStr);
|
int left = Integer.parseInt(leftStr);
|
||||||
String topStr = nextArgRequired();
|
String topStr = nextArgRequired();
|
||||||
int top = Integer.valueOf(topStr);
|
int top = Integer.parseInt(topStr);
|
||||||
String rightStr = nextArgRequired();
|
String rightStr = nextArgRequired();
|
||||||
int right = Integer.valueOf(rightStr);
|
int right = Integer.parseInt(rightStr);
|
||||||
String bottomStr = nextArgRequired();
|
String bottomStr = nextArgRequired();
|
||||||
int bottom = Integer.valueOf(bottomStr);
|
int bottom = Integer.parseInt(bottomStr);
|
||||||
if (left < 0) {
|
if (left < 0) {
|
||||||
System.err.println("Error: bad left arg: " + leftStr);
|
System.err.println("Error: bad left arg: " + leftStr);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user