Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +0 −12 Original line number Diff line number Diff line Loading @@ -169,18 +169,6 @@ public class BluetoothEventManager { } } @VisibleForTesting void registerIntentReceiver() { mContext.registerReceiverAsUser(mBroadcastReceiver, mUserHandle, mAdapterIntentFilter, null, mReceiverHandler); } @VisibleForTesting void registerProfileIntentReceiverForTest() { mContext.registerReceiverAsUser(mProfileBroadcastReceiver, mUserHandle, mProfileIntentFilter, null, mReceiverHandler); } @VisibleForTesting void addProfileHandler(String action, Handler handler) { mHandlerMap.put(action, handler); Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothEventManagerTest.java +0 −11 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ public class BluetoothEventManagerTest { @Test public void intentWithExtraState_audioStateChangedShouldDispatchToRegisterCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED); mContext.sendBroadcast(mIntent); Loading @@ -143,7 +142,6 @@ public class BluetoothEventManagerTest { @Test public void intentWithExtraState_phoneStateChangedShouldDispatchToRegisterCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(TelephonyManager.ACTION_PHONE_STATE_CHANGED); mContext.sendBroadcast(mIntent); Loading @@ -169,7 +167,6 @@ public class BluetoothEventManagerTest { @Test public void dispatchAclConnectionStateChanged_aclDisconnected_shouldDispatchCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -182,7 +179,6 @@ public class BluetoothEventManagerTest { @Test public void dispatchAclConnectionStateChanged_aclConnected_shouldDispatchCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -196,7 +192,6 @@ public class BluetoothEventManagerTest { public void dispatchAclConnectionStateChanged_aclDisconnected_shouldNotCallbackSubDevice() { when(mCachedDeviceManager.isSubDevice(mBluetoothDevice)).thenReturn(true); mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -210,7 +205,6 @@ public class BluetoothEventManagerTest { public void dispatchAclConnectionStateChanged_aclConnected_shouldNotCallbackSubDevice() { when(mCachedDeviceManager.isSubDevice(mBluetoothDevice)).thenReturn(true); mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -224,7 +218,6 @@ public class BluetoothEventManagerTest { public void dispatchAclConnectionStateChanged_findDeviceReturnNull_shouldNotDispatchCallback() { when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(null); mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading Loading @@ -361,7 +354,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonAuthTimeout_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading @@ -377,7 +369,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonRemoteDeviceDown_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading @@ -394,7 +385,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonAuthRejected_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading @@ -410,7 +400,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonAuthFailed_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManagerTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import android.os.ParcelUuid; import com.android.settingslib.testutils.shadow.ShadowBluetoothAdapter; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -85,7 +84,6 @@ public class LocalBluetoothProfileManagerTest { when(mCachedBluetoothDevice.getDevice()).thenReturn(mDevice); mProfileManager = new LocalBluetoothProfileManager(mContext, mLocalBluetoothAdapter, mDeviceManager, mEventManager); mEventManager.registerProfileIntentReceiverForTest(); } /** Loading Loading @@ -152,7 +150,6 @@ public class LocalBluetoothProfileManagerTest { * profile connection state changed callback */ @Test @Ignore public void stateChangedHandler_receiveA2dpConnectionStateChanged_shouldDispatchCallback() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.A2DP})); Loading @@ -174,7 +171,6 @@ public class LocalBluetoothProfileManagerTest { * profile connection state changed callback */ @Test @Ignore public void stateChangedHandler_receiveHeadsetConnectionStateChanged_shouldDispatchCallback() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.HEADSET})); Loading @@ -196,7 +192,6 @@ public class LocalBluetoothProfileManagerTest { * CachedBluetoothDeviceManager method */ @Test @Ignore public void stateChangedHandler_receiveHAPConnectionStateChanged_shouldDispatchDeviceManager() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.HEARING_AID})); Loading @@ -219,7 +214,6 @@ public class LocalBluetoothProfileManagerTest { * profile connection state changed callback */ @Test @Ignore public void stateChangedHandler_receivePanConnectionStateChanged_shouldNotDispatchCallback() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.PAN})); Loading Loading @@ -261,7 +255,6 @@ public class LocalBluetoothProfileManagerTest { * handler and refresh CachedBluetoothDevice */ @Test @Ignore public void stateChangedHandler_receivePanConnectionStateChangedWithProfile_shouldRefresh() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.PAN})); Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +0 −12 Original line number Diff line number Diff line Loading @@ -169,18 +169,6 @@ public class BluetoothEventManager { } } @VisibleForTesting void registerIntentReceiver() { mContext.registerReceiverAsUser(mBroadcastReceiver, mUserHandle, mAdapterIntentFilter, null, mReceiverHandler); } @VisibleForTesting void registerProfileIntentReceiverForTest() { mContext.registerReceiverAsUser(mProfileBroadcastReceiver, mUserHandle, mProfileIntentFilter, null, mReceiverHandler); } @VisibleForTesting void addProfileHandler(String action, Handler handler) { mHandlerMap.put(action, handler); Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothEventManagerTest.java +0 −11 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ public class BluetoothEventManagerTest { @Test public void intentWithExtraState_audioStateChangedShouldDispatchToRegisterCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED); mContext.sendBroadcast(mIntent); Loading @@ -143,7 +142,6 @@ public class BluetoothEventManagerTest { @Test public void intentWithExtraState_phoneStateChangedShouldDispatchToRegisterCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(TelephonyManager.ACTION_PHONE_STATE_CHANGED); mContext.sendBroadcast(mIntent); Loading @@ -169,7 +167,6 @@ public class BluetoothEventManagerTest { @Test public void dispatchAclConnectionStateChanged_aclDisconnected_shouldDispatchCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -182,7 +179,6 @@ public class BluetoothEventManagerTest { @Test public void dispatchAclConnectionStateChanged_aclConnected_shouldDispatchCallback() { mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -196,7 +192,6 @@ public class BluetoothEventManagerTest { public void dispatchAclConnectionStateChanged_aclDisconnected_shouldNotCallbackSubDevice() { when(mCachedDeviceManager.isSubDevice(mBluetoothDevice)).thenReturn(true); mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -210,7 +205,6 @@ public class BluetoothEventManagerTest { public void dispatchAclConnectionStateChanged_aclConnected_shouldNotCallbackSubDevice() { when(mCachedDeviceManager.isSubDevice(mBluetoothDevice)).thenReturn(true); mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading @@ -224,7 +218,6 @@ public class BluetoothEventManagerTest { public void dispatchAclConnectionStateChanged_findDeviceReturnNull_shouldNotDispatchCallback() { when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(null); mBluetoothEventManager.registerCallback(mBluetoothCallback); mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_ACL_CONNECTED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); Loading Loading @@ -361,7 +354,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonAuthTimeout_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading @@ -377,7 +369,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonRemoteDeviceDown_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading @@ -394,7 +385,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonAuthRejected_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading @@ -410,7 +400,6 @@ public class BluetoothEventManagerTest { @Test public void showUnbondMessage_reasonAuthFailed_showCorrectedErrorCode() { mBluetoothEventManager.registerIntentReceiver(); mIntent = new Intent(BluetoothDevice.ACTION_BOND_STATE_CHANGED); mIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, mBluetoothDevice); mIntent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE); Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManagerTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import android.os.ParcelUuid; import com.android.settingslib.testutils.shadow.ShadowBluetoothAdapter; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -85,7 +84,6 @@ public class LocalBluetoothProfileManagerTest { when(mCachedBluetoothDevice.getDevice()).thenReturn(mDevice); mProfileManager = new LocalBluetoothProfileManager(mContext, mLocalBluetoothAdapter, mDeviceManager, mEventManager); mEventManager.registerProfileIntentReceiverForTest(); } /** Loading Loading @@ -152,7 +150,6 @@ public class LocalBluetoothProfileManagerTest { * profile connection state changed callback */ @Test @Ignore public void stateChangedHandler_receiveA2dpConnectionStateChanged_shouldDispatchCallback() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.A2DP})); Loading @@ -174,7 +171,6 @@ public class LocalBluetoothProfileManagerTest { * profile connection state changed callback */ @Test @Ignore public void stateChangedHandler_receiveHeadsetConnectionStateChanged_shouldDispatchCallback() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.HEADSET})); Loading @@ -196,7 +192,6 @@ public class LocalBluetoothProfileManagerTest { * CachedBluetoothDeviceManager method */ @Test @Ignore public void stateChangedHandler_receiveHAPConnectionStateChanged_shouldDispatchDeviceManager() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.HEARING_AID})); Loading @@ -219,7 +214,6 @@ public class LocalBluetoothProfileManagerTest { * profile connection state changed callback */ @Test @Ignore public void stateChangedHandler_receivePanConnectionStateChanged_shouldNotDispatchCallback() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.PAN})); Loading Loading @@ -261,7 +255,6 @@ public class LocalBluetoothProfileManagerTest { * handler and refresh CachedBluetoothDevice */ @Test @Ignore public void stateChangedHandler_receivePanConnectionStateChangedWithProfile_shouldRefresh() { mShadowBluetoothAdapter.setSupportedProfiles(generateList( new int[] {BluetoothProfile.PAN})); Loading