Fixed how ShellCommand show exceptions.
Prior to this change, it was duplicating the exception. Example: $ adb shell cmd car_service create-user --flags 4444 --timeout 100 --hal-only Dude Exception occurred while executing: new user flags mismatch on existing users on {.requestId = 2, .newUserInfo = {.userId = 11, .flags = 0x115c}, .newUserName = Dude, .usersInfo = {.currentUser = {.userId = 11, .flags = NONE}, .numberUsers = 3, .existingUsers = [{.userId = 0, .flags = 0x9}, {.userId = 10, .flags = ADMIN}, {.userId = 11, .flags = NONE}]}} java.lang.IllegalArgumentException: new user flags mismatch on existing users on {.requestId = 2, .newUserInfo = {.userId = 11, .flags = 0x115c}, .newUserName = Dude, .usersInfo = {.currentUser = {.userId = 11, .flags = NONE}, .numberUsers = 3, .existingUsers = [{.userId = 0, .flags = 0x9}, {.userId = 10, .flags = ADMIN}, {.userId = 11, .flags = NONE}]}} at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:69) at android.car.userlib.UserHalHelper.toVehiclePropValue(UserHalHelper.java:503) at com.android.car.hal.UserHalService.createUser(UserHalService.java:339) Now it's showing the failed command instead: Exception occurred while executing 'create-user --flags 4444 --timeout 100 --hal-only Dude': java.lang.IllegalArgumentException: new user flags mismatch on existing users on {.requestId = 2, .newUserInfo = {.userId = 11, .flags = 0x115c}, .newUserName = Dude, .usersInfo = {.currentUser = {.userId = 11, .flags = NONE}, .numberUsers = 3, .existingUsers = [{.userId = 0, .flags = 0x9}, {.userId = 10, .flags = ADMIN}, {.userId = 11, .flags = NONE}]}} at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:69) at android.car.userlib.UserHalHelper.toVehiclePropValue(UserHalHelper.java:503) at com.android.car.hal.UserHalService.createUser(UserHalService.java:339) Test: manual verification Bug: 150408921 Change-Id: I42221fbe2410770b0755c32d16620acc71d8d5d2
Loading
Please register or sign in to comment