Merge "Bind service in onCreate"
This commit is contained in:
committed by
Android (Google) Code Review
commit
38d02fb900
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.settings.network;
|
||||
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothPan;
|
||||
import android.bluetooth.BluetoothProfile;
|
||||
@@ -77,6 +76,14 @@ public class TetherPreferenceControllerTest {
|
||||
ReflectionHelpers.setField(mController, "mPreference", mPreference);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lifeCycle_onCreate_shouldInitBluetoothPan() {
|
||||
mController.onCreate(null);
|
||||
|
||||
verify(mBluetoothAdapter).getProfileProxy(mContext, mController.mBtProfileServiceListener,
|
||||
BluetoothProfile.PAN);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void goThroughLifecycle_shouldDestoryBluetoothProfile() {
|
||||
final BluetoothPan pan = mock(BluetoothPan.class);
|
||||
@@ -161,7 +168,8 @@ public class TetherPreferenceControllerTest {
|
||||
mController.onResume();
|
||||
|
||||
verify(mContext).registerReceiver(
|
||||
any(TetherPreferenceController.TetherBroadcastReceiver.class), any(IntentFilter.class));
|
||||
any(TetherPreferenceController.TetherBroadcastReceiver.class),
|
||||
any(IntentFilter.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -172,7 +180,7 @@ public class TetherPreferenceControllerTest {
|
||||
mController.onPause();
|
||||
|
||||
verify(mContext).unregisterReceiver(
|
||||
any(TetherPreferenceController.TetherBroadcastReceiver.class));
|
||||
any(TetherPreferenceController.TetherBroadcastReceiver.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user