1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.adservices.shared.testing;
17 
18 import com.google.errorprone.annotations.FormatMethod;
19 import com.google.errorprone.annotations.FormatString;
20 
21 /** Abstraction for classes that need to interact with the device. */
22 abstract class AbstractDeviceGateway {
23 
24     // TODO(b/294423183): need to refactor it (or implementation) so it doesn't ignore errors.
25     // For example, setSyncDisabledModeForTest() was calling set_sync_disabled_for_tests
26     // instead of set_sync_disabled_for_test
27     @FormatMethod
runShellCommand(@ormatString String cmdFmt, @Nullable Object... cmdArgs)28     protected String runShellCommand(@FormatString String cmdFmt, @Nullable Object... cmdArgs) {
29         throw new UnsupportedOperationException(
30                 "Subclass must either implement this or the methods that use it");
31     }
32 }
33