1 /* 2 * Copyright (C) 2024 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.meta_testing; 17 18 import com.android.adservices.shared.testing.Logger; 19 import com.android.adservices.shared.testing.device.DeviceConfig; 20 import com.android.adservices.shared.testing.device.DeviceConfig.SyncDisabledModeForTest; 21 22 /** Wrapper for real {@link DeviceConfig} implementations. */ 23 public class DeviceConfigWrapper extends Wrapper<DeviceConfig> implements DeviceConfig { 24 25 /** Default constructor, sets logger. */ DeviceConfigWrapper()26 public DeviceConfigWrapper() { 27 super(); 28 } 29 30 /** Constructor with a custom logger. */ DeviceConfigWrapper(Logger logger)31 public DeviceConfigWrapper(Logger logger) { 32 super(logger); 33 } 34 35 @Override setSyncDisabledMode(SyncDisabledModeForTest mode)36 public DeviceConfigWrapper setSyncDisabledMode(SyncDisabledModeForTest mode) { 37 mLog.v("setSyncDisabledMode(%s)", mode); 38 getWrapped().setSyncDisabledMode(mode); 39 return this; 40 } 41 42 @Override getSyncDisabledMode()43 public SyncDisabledModeForTest getSyncDisabledMode() { 44 var mode = getWrapped().getSyncDisabledMode(); 45 mLog.v("getSyncDisabledMode(): returning %s", mode); 46 return mode; 47 } 48 } 49