1 /* 2 * Copyright (C) 2018 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 17 package com.android.settings.testutils.shadow; 18 19 import android.bluetooth.BluetoothDevice; 20 21 import org.robolectric.annotation.Implementation; 22 import org.robolectric.annotation.Implements; 23 24 @Implements(value = BluetoothDevice.class) 25 public class ShadowBluetoothDevice extends org.robolectric.shadows.ShadowBluetoothDevice { 26 27 private int mMessageAccessPermission = BluetoothDevice.ACCESS_UNKNOWN; 28 private int mPhonebookAccessPermission = BluetoothDevice.ACCESS_UNKNOWN; 29 private int mSimAccessPermission = BluetoothDevice.ACCESS_UNKNOWN; 30 31 @Implementation setMessageAccessPermission(int value)32 protected void setMessageAccessPermission(int value) { 33 mMessageAccessPermission = value; 34 } 35 36 @Implementation getMessageAccessPermission()37 protected int getMessageAccessPermission() { 38 return mMessageAccessPermission; 39 } 40 41 @Implementation setPhonebookAccessPermission(int value)42 protected void setPhonebookAccessPermission(int value) { 43 mPhonebookAccessPermission = value; 44 } 45 46 @Implementation getPhonebookAccessPermission()47 protected int getPhonebookAccessPermission() { 48 return mPhonebookAccessPermission; 49 } 50 51 @Implementation setSimAccessPermission(int value)52 protected void setSimAccessPermission(int value) { 53 mSimAccessPermission = value; 54 } 55 56 @Implementation getSimAccessPermission()57 protected int getSimAccessPermission() { 58 return mSimAccessPermission; 59 } 60 } 61