Loading src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -61,9 +61,10 @@ public class UsbDefaultFragment extends RadioButtonPickerFragment { long mCurrentFunctions; @VisibleForTesting boolean mIsStartTethering = false; @VisibleForTesting Handler mHandler; private UsbConnectionBroadcastReceiver mUsbReceiver; private Handler mHandler; private boolean mIsConnected = false; @VisibleForTesting Loading tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.util.Pair; import com.android.settings.connecteddevice.DevicePreferenceCallback; import com.android.settings.dashboard.DashboardFragment; Loading Loading @@ -62,6 +64,8 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { private CachedBluetoothDevice mCachedBluetoothDevice; @Mock private BluetoothDevice mBluetoothDevice; @Mock private Drawable mDrawable; private Context mContext; private AvailableMediaBluetoothDeviceUpdater mBluetoothDeviceUpdater; Loading @@ -83,10 +87,12 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { Utils.getLocalBtManager(mContext).getCachedDeviceManager()); mCachedDevices = new ArrayList<>(); mShadowCachedBluetoothDeviceManager.setCachedDevicesCopy(mCachedDevices); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); doReturn(mContext).when(mDashboardFragment).getContext(); when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mBluetoothDeviceUpdater = spy(new AvailableMediaBluetoothDeviceUpdater(mContext, mDashboardFragment, mDevicePreferenceCallback)); Loading tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; import android.util.Pair; import androidx.preference.Preference; Loading Loading @@ -78,6 +80,8 @@ public class BluetoothDeviceUpdaterTest { private LocalBluetoothManager mLocalManager; @Mock private CachedBluetoothDeviceManager mCachedDeviceManager; @Mock private Drawable mDrawable; private Context mContext; private BluetoothDeviceUpdater mBluetoothDeviceUpdater; Loading @@ -89,6 +93,7 @@ public class BluetoothDeviceUpdaterTest { public void setUp() { MockitoAnnotations.initMocks(this); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); mContext = RuntimeEnvironment.application; mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()); mCachedDevices.add(mCachedBluetoothDevice); Loading @@ -99,6 +104,7 @@ public class BluetoothDeviceUpdaterTest { when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(mCachedDevices); when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); when(mSubBluetoothDevice.getAddress()).thenReturn(SUB_MAC_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mPreference = new BluetoothDevicePreference(mContext, mCachedBluetoothDevice, false, BluetoothDevicePreference.SortType.TYPE_DEFAULT); Loading tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.util.Pair; import androidx.preference.PreferenceGroup; Loading Loading @@ -70,6 +72,9 @@ public class BluetoothPairingDetailTest { private PreferenceGroup mPreferenceGroup; @Mock private CachedBluetoothDevice mCachedBluetoothDevice; @Mock private Drawable mDrawable; private BluetoothPairingDetail mFragment; private Context mContext; private BluetoothProgressCategory mAvailableDevicesCategory; Loading @@ -82,11 +87,13 @@ public class BluetoothPairingDetailTest { public void setUp() { MockitoAnnotations.initMocks(this); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); mContext = RuntimeEnvironment.application; mFragment = spy(new BluetoothPairingDetail()); doReturn(mContext).when(mFragment).getContext(); doReturn(mResource).when(mFragment).getResources(); when(mCachedBluetoothDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mAvailableDevicesCategory = spy(new BluetoothProgressCategory(mContext)); mFooterPreference = new FooterPreference(mContext); Loading tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.util.Pair; import com.android.settings.connecteddevice.DevicePreferenceCallback; import com.android.settings.dashboard.DashboardFragment; Loading Loading @@ -65,6 +67,8 @@ public class ConnectedBluetoothDeviceUpdaterTest { private CachedBluetoothDevice mCachedBluetoothDevice; @Mock private BluetoothDevice mBluetoothDevice; @Mock private Drawable mDrawable; private Context mContext; private ConnectedBluetoothDeviceUpdater mBluetoothDeviceUpdater; Loading @@ -77,6 +81,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { public void setUp() { MockitoAnnotations.initMocks(this); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); mContext = RuntimeEnvironment.application; mAudioManager = mContext.getSystemService(AudioManager.class); mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()); Loading @@ -88,6 +93,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mShadowCachedBluetoothDeviceManager.setCachedDevicesCopy(mCachedDevices); mBluetoothDeviceUpdater = spy(new ConnectedBluetoothDeviceUpdater(mContext, mDashboardFragment, mDevicePreferenceCallback)); Loading Loading
src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java +2 −1 Original line number Diff line number Diff line Loading @@ -61,9 +61,10 @@ public class UsbDefaultFragment extends RadioButtonPickerFragment { long mCurrentFunctions; @VisibleForTesting boolean mIsStartTethering = false; @VisibleForTesting Handler mHandler; private UsbConnectionBroadcastReceiver mUsbReceiver; private Handler mHandler; private boolean mIsConnected = false; @VisibleForTesting Loading
tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.util.Pair; import com.android.settings.connecteddevice.DevicePreferenceCallback; import com.android.settings.dashboard.DashboardFragment; Loading Loading @@ -62,6 +64,8 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { private CachedBluetoothDevice mCachedBluetoothDevice; @Mock private BluetoothDevice mBluetoothDevice; @Mock private Drawable mDrawable; private Context mContext; private AvailableMediaBluetoothDeviceUpdater mBluetoothDeviceUpdater; Loading @@ -83,10 +87,12 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { Utils.getLocalBtManager(mContext).getCachedDeviceManager()); mCachedDevices = new ArrayList<>(); mShadowCachedBluetoothDeviceManager.setCachedDevicesCopy(mCachedDevices); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); doReturn(mContext).when(mDashboardFragment).getContext(); when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mBluetoothDeviceUpdater = spy(new AvailableMediaBluetoothDeviceUpdater(mContext, mDashboardFragment, mDevicePreferenceCallback)); Loading
tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceUpdaterTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; import android.util.Pair; import androidx.preference.Preference; Loading Loading @@ -78,6 +80,8 @@ public class BluetoothDeviceUpdaterTest { private LocalBluetoothManager mLocalManager; @Mock private CachedBluetoothDeviceManager mCachedDeviceManager; @Mock private Drawable mDrawable; private Context mContext; private BluetoothDeviceUpdater mBluetoothDeviceUpdater; Loading @@ -89,6 +93,7 @@ public class BluetoothDeviceUpdaterTest { public void setUp() { MockitoAnnotations.initMocks(this); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); mContext = RuntimeEnvironment.application; mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()); mCachedDevices.add(mCachedBluetoothDevice); Loading @@ -99,6 +104,7 @@ public class BluetoothDeviceUpdaterTest { when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(mCachedDevices); when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); when(mSubBluetoothDevice.getAddress()).thenReturn(SUB_MAC_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mPreference = new BluetoothDevicePreference(mContext, mCachedBluetoothDevice, false, BluetoothDevicePreference.SortType.TYPE_DEFAULT); Loading
tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDetailTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.util.Pair; import androidx.preference.PreferenceGroup; Loading Loading @@ -70,6 +72,9 @@ public class BluetoothPairingDetailTest { private PreferenceGroup mPreferenceGroup; @Mock private CachedBluetoothDevice mCachedBluetoothDevice; @Mock private Drawable mDrawable; private BluetoothPairingDetail mFragment; private Context mContext; private BluetoothProgressCategory mAvailableDevicesCategory; Loading @@ -82,11 +87,13 @@ public class BluetoothPairingDetailTest { public void setUp() { MockitoAnnotations.initMocks(this); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); mContext = RuntimeEnvironment.application; mFragment = spy(new BluetoothPairingDetail()); doReturn(mContext).when(mFragment).getContext(); doReturn(mResource).when(mFragment).getResources(); when(mCachedBluetoothDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mAvailableDevicesCategory = spy(new BluetoothProgressCategory(mContext)); mFooterPreference = new FooterPreference(mContext); Loading
tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.util.Pair; import com.android.settings.connecteddevice.DevicePreferenceCallback; import com.android.settings.dashboard.DashboardFragment; Loading Loading @@ -65,6 +67,8 @@ public class ConnectedBluetoothDeviceUpdaterTest { private CachedBluetoothDevice mCachedBluetoothDevice; @Mock private BluetoothDevice mBluetoothDevice; @Mock private Drawable mDrawable; private Context mContext; private ConnectedBluetoothDeviceUpdater mBluetoothDeviceUpdater; Loading @@ -77,6 +81,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { public void setUp() { MockitoAnnotations.initMocks(this); Pair<Drawable, String> pairs = new Pair<>(mDrawable, "fake_device"); mContext = RuntimeEnvironment.application; mAudioManager = mContext.getSystemService(AudioManager.class); mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter()); Loading @@ -88,6 +93,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); when(mCachedBluetoothDevice.getAddress()).thenReturn(MAC_ADDRESS); when(mCachedBluetoothDevice.getDrawableWithDescription()).thenReturn(pairs); mShadowCachedBluetoothDeviceManager.setCachedDevicesCopy(mCachedDevices); mBluetoothDeviceUpdater = spy(new ConnectedBluetoothDeviceUpdater(mContext, mDashboardFragment, mDevicePreferenceCallback)); Loading