From 234c2895e84f93f579903c1ea4e3d8e637f74572 Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Tue, 30 May 2023 21:51:29 +0000 Subject: [PATCH] Avoid hardcoding BATTERY_PLUGGED_ANY constant. Bug: 284904539 Test: TH Change-Id: I8685f8008fd4a431136ef2900b45509f2ef7cc0b --- .../AbstractRestrictBackgroundNetworkTestCase.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java index a281aed5a1..6b21dac5fa 100644 --- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java +++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java @@ -18,9 +18,7 @@ package com.android.cts.net.hostside; import static android.app.job.JobScheduler.RESULT_SUCCESS; import static android.net.ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED; -import static android.os.BatteryManager.BATTERY_PLUGGED_AC; -import static android.os.BatteryManager.BATTERY_PLUGGED_USB; -import static android.os.BatteryManager.BATTERY_PLUGGED_WIRELESS; +import static android.os.BatteryManager.BATTERY_PLUGGED_ANY; import static com.android.cts.net.hostside.NetworkPolicyTestUtils.executeShellCommand; import static com.android.cts.net.hostside.NetworkPolicyTestUtils.forceRunJob; @@ -119,10 +117,6 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase { protected static final String NOTIFICATION_TYPE_ACTION_BUNDLE = "ACTION_BUNDLE"; protected static final String NOTIFICATION_TYPE_ACTION_REMOTE_INPUT = "ACTION_REMOTE_INPUT"; - // TODO: Update BatteryManager.BATTERY_PLUGGED_ANY as @TestApi - public static final int BATTERY_PLUGGED_ANY = - BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB | BATTERY_PLUGGED_WIRELESS; - private static final String NETWORK_STATUS_SEPARATOR = "\\|"; private static final int SECOND_IN_MS = 1000; static final int NETWORK_TIMEOUT_MS = 15 * SECOND_IN_MS;