1497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley/* 2497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * Copyright (C) 2016 The Android Open Source Project 3497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * 4497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * Licensed under the Apache License, Version 2.0 (the "License"); 5497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * you may not use this file except in compliance with the License. 6497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * You may obtain a copy of the License at 7497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * 8497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * http://www.apache.org/licenses/LICENSE-2.0 9497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * 10497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * Unless required by applicable law or agreed to in writing, software 11497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * distributed under the License is distributed on an "AS IS" BASIS, 12497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * See the License for the specific language governing permissions and 14497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley * limitations under the License. 15497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley */ 16497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley 17497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wileypackage com.android.server.connectivity; 18497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley 19497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wileyimport android.os.SystemProperties; 20497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley 21497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wileypublic class MockableSystemProperties { 2242cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti 2342cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti public String get(String key) { 2442cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti return SystemProperties.get(key); 2542cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti } 2642cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti 2742cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti public int getInt(String key, int def) { 2842cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti return SystemProperties.getInt(key, def); 2942cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti } 3042cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti 31497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley public boolean getBoolean(String key, boolean def) { 32497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley return SystemProperties.getBoolean(key, def); 33497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley } 3442cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti 3542cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti public void set(String key, String value) { 3642cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti SystemProperties.set(key, value); 3742cdf577037770a66d27f831d0f9e26532c3628dLorenzo Colitti } 38497c147b821cf1c441f5047a5035281dc23e8bd9Christopher Wiley} 39