Show dialog on BT entries in Settings
- When satellite mode is switched on BT entries shall show the warning dialog and avoid user uses these functions. Bug: 337154438 Test: Manual test. Test: atest pass Change-Id: Ic9b6d44731684d1cfba87570d72dcacb905a66d2
This commit is contained in:
@@ -34,6 +34,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.util.AndroidRuntimeException;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
@@ -101,6 +102,19 @@ public class BluetoothEnablerTest {
|
||||
mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onSwitchToggled_satelliteOn_showWarningDialog() {
|
||||
mBluetoothEnabler.mIsSatelliteOn.set(true);
|
||||
|
||||
try {
|
||||
mBluetoothEnabler.onSwitchToggled(true);
|
||||
} catch (AndroidRuntimeException e) {
|
||||
// Catch exception of starting activity .
|
||||
}
|
||||
|
||||
verify(mContext).startActivity(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onSwitchToggled_shouldLogActionWithSuppliedEvent() {
|
||||
// WHEN the switch is toggled...
|
||||
|
Reference in New Issue
Block a user