aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guest/hals/ril/reference-ril/reference-ril.c6
-rw-r--r--tests/powerwash/src/com/android/cuttlefish/tests/PowerwashTest.java29
2 files changed, 10 insertions, 25 deletions
diff --git a/guest/hals/ril/reference-ril/reference-ril.c b/guest/hals/ril/reference-ril/reference-ril.c
index 9fdf80d3d..762f1e44e 100644
--- a/guest/hals/ril/reference-ril/reference-ril.c
+++ b/guest/hals/ril/reference-ril/reference-ril.c
@@ -845,8 +845,8 @@ static void requestOrSendDataCallList(int cid, RIL_Token *t)
p_cur = p_cur->p_next)
n++;
- RIL_Data_Call_Response_v11 *responses =
- alloca(n * sizeof(RIL_Data_Call_Response_v11));
+ RIL_Data_Call_Response_v11 *responses = (n == 0) ? NULL :
+ alloca(n * sizeof(RIL_Data_Call_Response_v11));
int i;
for (i = 0; i < n; i++) {
@@ -996,7 +996,7 @@ static void requestOrSendDataCallList(int cid, RIL_Token *t)
// If cid = -1, return the data call list without processing CGCONTRDP (setupDataCall)
if (cid == -1) {
if (t != NULL)
- RIL_onRequestComplete(*t, RIL_E_SUCCESS, &responses[0],
+ RIL_onRequestComplete(*t, RIL_E_SUCCESS, responses,
sizeof(RIL_Data_Call_Response_v11));
else
RIL_onUnsolicitedResponse(RIL_UNSOL_DATA_CALL_LIST_CHANGED, responses,
diff --git a/tests/powerwash/src/com/android/cuttlefish/tests/PowerwashTest.java b/tests/powerwash/src/com/android/cuttlefish/tests/PowerwashTest.java
index 50993dab3..9730c1ad6 100644
--- a/tests/powerwash/src/com/android/cuttlefish/tests/PowerwashTest.java
+++ b/tests/powerwash/src/com/android/cuttlefish/tests/PowerwashTest.java
@@ -19,7 +19,6 @@ import static org.junit.Assert.assertTrue;
import com.android.tradefed.config.Option;
import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.RemoteAndroidDevice;
import com.android.tradefed.device.cloud.RemoteAndroidVirtualDevice;
import com.android.tradefed.device.internal.DeviceResetHandler;
import com.android.tradefed.log.LogUtil.CLog;
@@ -83,27 +82,13 @@ public class PowerwashTest extends BaseHostJUnit4Test {
CLog.d("Powerwash attempt #%d", i);
long start = System.currentTimeMillis();
boolean success = false;
- if (getDevice() instanceof RemoteAndroidVirtualDevice) {
- mCuttlefishHostUser = ((RemoteAndroidVirtualDevice) getDevice()).getInitialUser();
- mCuttlefishDeviceNumOffset = ((RemoteAndroidVirtualDevice) getDevice())
- .getInitialDeviceNumOffset();
- if (mCuttlefishDeviceNumOffset != null && mCuttlefishHostUser != null) {
- success = ((RemoteAndroidVirtualDevice) getDevice())
- .powerwashGce(mCuttlefishHostUser, mCuttlefishDeviceNumOffset)
- .getStatus().equals(CommandStatus.SUCCESS);
- } else {
- success = ((RemoteAndroidVirtualDevice) getDevice())
- .powerwash().getStatus().equals(CommandStatus.SUCCESS);
- }
- } else {
- // We don't usually expect tests to use our feature server, but in this case we are
- // validating the feature itself so it's fine
- DeviceResetHandler handler = new DeviceResetHandler(getInvocationContext());
- try {
- success = handler.resetDevice(getDevice());
- } catch (DeviceNotAvailableException e) {
- CLog.e(e);
- }
+ // We don't usually expect tests to use our feature server, but in this case we are
+ // validating the feature itself so it's fine
+ DeviceResetHandler handler = new DeviceResetHandler(getInvocationContext());
+ try {
+ success = handler.resetDevice(getDevice());
+ } catch (DeviceNotAvailableException e) {
+ CLog.e(e);
}
assertTrue(String.format("Powerwash reset failed during attemt #%d", i), success);
long duration = System.currentTimeMillis() - start;