Clean up legacy bluetooth setting flags
BUG: 359415806 Test: atest SettingsRoboTests Flag: EXEMPT clean up Change-Id: I7c47d80e61cfb0e3b473106e0784cc96ba639452
This commit is contained in:
@@ -8,13 +8,6 @@ flag {
|
|||||||
bug: "305636727"
|
bug: "305636727"
|
||||||
}
|
}
|
||||||
|
|
||||||
flag {
|
|
||||||
name: "enable_bluetooth_profile_toggle_visibility_checker"
|
|
||||||
namespace: "pixel_cross_device_control"
|
|
||||||
description: "Gates whether to enable checker for bluetooth profile toggle visibility"
|
|
||||||
bug: "321178209"
|
|
||||||
}
|
|
||||||
|
|
||||||
flag {
|
flag {
|
||||||
name: "hide_le_audio_toggle_for_le_audio_only_device"
|
name: "hide_le_audio_toggle_for_le_audio_only_device"
|
||||||
namespace: "pixel_cross_device_control"
|
namespace: "pixel_cross_device_control"
|
||||||
|
@@ -30,7 +30,6 @@ import android.net.Uri;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.provider.DeviceConfig;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
|||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||||
@@ -187,11 +185,9 @@ public class BluetoothDetailsCompanionAppsController extends BluetoothDetailsCon
|
|||||||
// If the device is FastPair, remove CDM companion apps.
|
// If the device is FastPair, remove CDM companion apps.
|
||||||
final BluetoothFeatureProvider bluetoothFeatureProvider = FeatureFactory.getFeatureFactory()
|
final BluetoothFeatureProvider bluetoothFeatureProvider = FeatureFactory.getFeatureFactory()
|
||||||
.getBluetoothFeatureProvider();
|
.getBluetoothFeatureProvider();
|
||||||
final boolean sliceEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_SLICE_SETTINGS_ENABLED, true);
|
|
||||||
final Uri settingsUri = bluetoothFeatureProvider.getBluetoothDeviceSettingsUri(
|
final Uri settingsUri = bluetoothFeatureProvider.getBluetoothDeviceSettingsUri(
|
||||||
mCachedDevice.getDevice());
|
mCachedDevice.getDevice());
|
||||||
if (sliceEnabled && settingsUri != null) {
|
if (settingsUri != null) {
|
||||||
container.removeAll();
|
container.removeAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,6 @@ import android.bluetooth.BluetoothDevice;
|
|||||||
import android.bluetooth.BluetoothProfile;
|
import android.bluetooth.BluetoothProfile;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.provider.DeviceConfig;
|
|
||||||
import android.sysprop.BluetoothProperties;
|
import android.sysprop.BluetoothProperties;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -36,7 +35,6 @@ import androidx.preference.SwitchPreferenceCompat;
|
|||||||
import androidx.preference.TwoStatePreference;
|
import androidx.preference.TwoStatePreference;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.flags.Flags;
|
import com.android.settings.flags.Flags;
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
import com.android.settingslib.bluetooth.A2dpProfile;
|
import com.android.settingslib.bluetooth.A2dpProfile;
|
||||||
@@ -92,7 +90,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
private Set<CachedBluetoothDevice> mCachedDeviceGroup;
|
private Set<CachedBluetoothDevice> mCachedDeviceGroup;
|
||||||
private Map<String, List<CachedBluetoothDevice>> mProfileDeviceMap =
|
private Map<String, List<CachedBluetoothDevice>> mProfileDeviceMap =
|
||||||
new HashMap<String, List<CachedBluetoothDevice>>();
|
new HashMap<String, List<CachedBluetoothDevice>>();
|
||||||
private boolean mIsLeContactSharingEnabled = false;
|
|
||||||
private boolean mIsLeAudioToggleEnabled = false;
|
private boolean mIsLeAudioToggleEnabled = false;
|
||||||
private boolean mIsLeAudioOnlyDevice = false;
|
private boolean mIsLeAudioOnlyDevice = false;
|
||||||
|
|
||||||
@@ -172,10 +169,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
boolean isBusy = deviceList != null
|
boolean isBusy = deviceList != null
|
||||||
&& deviceList.stream().anyMatch(item -> item.isBusy());
|
&& deviceList.stream().anyMatch(item -> item.isBusy());
|
||||||
profilePref.setEnabled(!isBusy);
|
profilePref.setEnabled(!isBusy);
|
||||||
} else if (profile instanceof PbapServerProfile
|
|
||||||
&& isLeAudioEnabled
|
|
||||||
&& !mIsLeContactSharingEnabled) {
|
|
||||||
profilePref.setEnabled(false);
|
|
||||||
} else {
|
} else {
|
||||||
profilePref.setEnabled(!mCachedDevice.isBusy());
|
profilePref.setEnabled(!mCachedDevice.isBusy());
|
||||||
}
|
}
|
||||||
@@ -531,15 +524,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateLeAudioConfig() {
|
private void updateLeAudioConfig() {
|
||||||
mIsLeContactSharingEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_LE_AUDIO_CONTACT_SHARING_ENABLED, true);
|
|
||||||
boolean isLeAudioToggleVisible = SystemProperties.getBoolean(
|
boolean isLeAudioToggleVisible = SystemProperties.getBoolean(
|
||||||
LE_AUDIO_TOGGLE_VISIBLE_PROPERTY, LE_AUDIO_TOGGLE_VISIBLE_DEFAULT_VALUE);
|
LE_AUDIO_TOGGLE_VISIBLE_PROPERTY, LE_AUDIO_TOGGLE_VISIBLE_DEFAULT_VALUE);
|
||||||
boolean isLeEnabledByDefault =
|
boolean isLeEnabledByDefault =
|
||||||
SystemProperties.getBoolean(LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY, true);
|
SystemProperties.getBoolean(LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY, true);
|
||||||
mIsLeAudioToggleEnabled = isLeAudioToggleVisible || isLeEnabledByDefault;
|
mIsLeAudioToggleEnabled = isLeAudioToggleVisible || isLeEnabledByDefault;
|
||||||
Log.d(TAG, "BT_LE_AUDIO_CONTACT_SHARING_ENABLED:" + mIsLeContactSharingEnabled
|
Log.d(TAG, "LE_AUDIO_TOGGLE_VISIBLE_PROPERTY:" + isLeAudioToggleVisible
|
||||||
+ ", LE_AUDIO_TOGGLE_VISIBLE_PROPERTY:" + isLeAudioToggleVisible
|
|
||||||
+ ", LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY:" + isLeEnabledByDefault);
|
+ ", LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY:" + isLeEnabledByDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,7 +562,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void refresh() {
|
protected void refresh() {
|
||||||
if (Flags.enableBluetoothProfileToggleVisibilityChecker()) {
|
|
||||||
ThreadUtils.postOnBackgroundThread(
|
ThreadUtils.postOnBackgroundThread(
|
||||||
() -> {
|
() -> {
|
||||||
mInvisiblePreferenceKey.set(
|
mInvisiblePreferenceKey.set(
|
||||||
@@ -582,9 +571,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
mContext, mCachedDevice.getDevice()));
|
mContext, mCachedDevice.getDevice()));
|
||||||
ThreadUtils.postOnMainThread(this::refreshUi);
|
ThreadUtils.postOnMainThread(this::refreshUi);
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
refreshUi();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshUi() {
|
private void refreshUi() {
|
||||||
@@ -619,7 +605,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
mProfilesContainer.addPreference(preference);
|
mProfilesContainer.addPreference(preference);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Flags.enableBluetoothProfileToggleVisibilityChecker()) {
|
|
||||||
Set<String> invisibleKeys = mInvisiblePreferenceKey.get();
|
Set<String> invisibleKeys = mInvisiblePreferenceKey.get();
|
||||||
if (invisibleKeys != null) {
|
if (invisibleKeys != null) {
|
||||||
for (int i = 0; i < mProfilesContainer.getPreferenceCount(); ++i) {
|
for (int i = 0; i < mProfilesContainer.getPreferenceCount(); ++i) {
|
||||||
@@ -628,7 +613,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPreferenceKey() {
|
public String getPreferenceKey() {
|
||||||
|
@@ -30,7 +30,6 @@ import android.hardware.input.InputManager;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.provider.DeviceConfig;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.FeatureFlagUtils;
|
import android.util.FeatureFlagUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -50,7 +49,6 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.bluetooth.ui.view.DeviceDetailsFragmentFormatter;
|
import com.android.settings.bluetooth.ui.view.DeviceDetailsFragmentFormatter;
|
||||||
import com.android.settings.connecteddevice.stylus.StylusDevicesController;
|
import com.android.settings.connecteddevice.stylus.StylusDevicesController;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.dashboard.RestrictedDashboardFragment;
|
import com.android.settings.dashboard.RestrictedDashboardFragment;
|
||||||
import com.android.settings.flags.Flags;
|
import com.android.settings.flags.Flags;
|
||||||
import com.android.settings.inputmethod.KeyboardSettingsPreferenceController;
|
import com.android.settings.inputmethod.KeyboardSettingsPreferenceController;
|
||||||
@@ -232,17 +230,13 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
|
|||||||
|
|
||||||
final BluetoothFeatureProvider featureProvider =
|
final BluetoothFeatureProvider featureProvider =
|
||||||
FeatureFactory.getFeatureFactory().getBluetoothFeatureProvider();
|
FeatureFactory.getFeatureFactory().getBluetoothFeatureProvider();
|
||||||
final boolean sliceEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_SLICE_SETTINGS_ENABLED, true);
|
|
||||||
|
|
||||||
getController(
|
getController(
|
||||||
BlockingPrefWithSliceController.class,
|
BlockingPrefWithSliceController.class,
|
||||||
controller ->
|
controller ->
|
||||||
controller.setSliceUri(
|
controller.setSliceUri(
|
||||||
sliceEnabled
|
featureProvider.getBluetoothDeviceSettingsUri(
|
||||||
? featureProvider.getBluetoothDeviceSettingsUri(
|
mCachedDevice.getDevice())));
|
||||||
mCachedDevice.getDevice())
|
|
||||||
: null));
|
|
||||||
|
|
||||||
mManager.getEventManager().registerCallback(mBluetoothCallback);
|
mManager.getEventManager().registerCallback(mBluetoothCallback);
|
||||||
mBluetoothAdapter.addOnMetadataChangedListener(
|
mBluetoothAdapter.addOnMetadataChangedListener(
|
||||||
@@ -262,8 +256,6 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
|
|||||||
private void updateExtraControlUri(int viewWidth) {
|
private void updateExtraControlUri(int viewWidth) {
|
||||||
BluetoothFeatureProvider featureProvider =
|
BluetoothFeatureProvider featureProvider =
|
||||||
FeatureFactory.getFeatureFactory().getBluetoothFeatureProvider();
|
FeatureFactory.getFeatureFactory().getBluetoothFeatureProvider();
|
||||||
boolean sliceEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_SLICE_SETTINGS_ENABLED, true);
|
|
||||||
Uri controlUri = null;
|
Uri controlUri = null;
|
||||||
String uri = featureProvider.getBluetoothDeviceControlUri(mCachedDevice.getDevice());
|
String uri = featureProvider.getBluetoothDeviceControlUri(mCachedDevice.getDevice());
|
||||||
if (!TextUtils.isEmpty(uri)) {
|
if (!TextUtils.isEmpty(uri)) {
|
||||||
@@ -276,13 +268,14 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
|
|||||||
mExtraControlUriLoaded |= controlUri != null;
|
mExtraControlUriLoaded |= controlUri != null;
|
||||||
|
|
||||||
Uri finalControlUri = controlUri;
|
Uri finalControlUri = controlUri;
|
||||||
getController(SlicePreferenceController.class, controller -> {
|
getController(
|
||||||
controller.setSliceUri(sliceEnabled ? finalControlUri : null);
|
SlicePreferenceController.class,
|
||||||
|
controller -> {
|
||||||
|
controller.setSliceUri(finalControlUri);
|
||||||
controller.onStart();
|
controller.onStart();
|
||||||
controller.displayPreference(getPreferenceScreen());
|
controller.displayPreference(getPreferenceScreen());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Temporarily fix the issue that the page will be automatically scrolled to a wrong
|
// Temporarily fix the issue that the page will be automatically scrolled to a wrong
|
||||||
// position when entering the page. This will make sure the bluetooth header is shown on top
|
// position when entering the page. This will make sure the bluetooth header is shown on top
|
||||||
// of the page.
|
// of the page.
|
||||||
|
@@ -20,7 +20,6 @@ import android.bluetooth.BluetoothDevice;
|
|||||||
import android.bluetooth.BluetoothProfile;
|
import android.bluetooth.BluetoothProfile;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.provider.DeviceConfig;
|
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
@@ -30,7 +29,6 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.bluetooth.BluetoothPairingDialogFragment.BluetoothPairingDialogListener;
|
import com.android.settings.bluetooth.BluetoothPairingDialogFragment.BluetoothPairingDialogListener;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settingslib.bluetooth.BluetoothUtils;
|
import com.android.settingslib.bluetooth.BluetoothUtils;
|
||||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||||
@@ -71,7 +69,6 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
|||||||
private boolean mPbapAllowed;
|
private boolean mPbapAllowed;
|
||||||
private boolean mIsCoordinatedSetMember;
|
private boolean mIsCoordinatedSetMember;
|
||||||
private boolean mIsLeAudio;
|
private boolean mIsLeAudio;
|
||||||
private boolean mIsLeContactSharingEnabled;
|
|
||||||
private boolean mIsLateBonding;
|
private boolean mIsLateBonding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,7 +103,6 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
|||||||
|
|
||||||
mIsCoordinatedSetMember = false;
|
mIsCoordinatedSetMember = false;
|
||||||
mIsLeAudio = false;
|
mIsLeAudio = false;
|
||||||
mIsLeContactSharingEnabled = true;
|
|
||||||
if (cachedDevice != null) {
|
if (cachedDevice != null) {
|
||||||
mIsCoordinatedSetMember = cachedDevice.isCoordinatedSetMemberDevice();
|
mIsCoordinatedSetMember = cachedDevice.isCoordinatedSetMemberDevice();
|
||||||
|
|
||||||
@@ -115,13 +111,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
|||||||
mIsLeAudio = true;
|
mIsLeAudio = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log.d(TAG, "isCooridnatedSetMember: " + mIsCoordinatedSetMember);
|
||||||
mIsLeContactSharingEnabled = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_LE_AUDIO_CONTACT_SHARING_ENABLED, true);
|
|
||||||
Log.d(TAG,
|
|
||||||
"BT_LE_AUDIO_CONTACT_SHARING_ENABLED is "
|
|
||||||
+ mIsLeContactSharingEnabled + " isCooridnatedSetMember "
|
|
||||||
+ mIsCoordinatedSetMember);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,23 +211,13 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
|||||||
return mIsLeAudio;
|
return mIsLeAudio;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
boolean isLeContactSharingEnabled() {
|
|
||||||
return mIsLeContactSharingEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A method whether the device allows to show the le audio's contact sharing.
|
* A method whether the device allows to show the le audio's contact sharing.
|
||||||
*
|
*
|
||||||
* @return A boolean whether the device allows to show the contact sharing.
|
* @return A boolean whether the device allows to show the contact sharing.
|
||||||
*/
|
*/
|
||||||
public boolean isContactSharingVisible() {
|
public boolean isContactSharingVisible() {
|
||||||
boolean isContactSharingVisible = !isProfileReady();
|
return !isProfileReady();
|
||||||
// If device do not support the ContactSharing of LE audio device, hiding ContactSharing UI
|
|
||||||
if (isLeAudio() && !isLeContactSharingEnabled()) {
|
|
||||||
isContactSharingVisible = false;
|
|
||||||
}
|
|
||||||
return isContactSharingVisible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -18,7 +18,6 @@ package com.android.settings.connecteddevice;
|
|||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.provider.DeviceConfig;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -28,7 +27,6 @@ import com.android.settings.R;
|
|||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.connecteddevice.audiosharing.AudioSharingDevicePreferenceController;
|
import com.android.settings.connecteddevice.audiosharing.AudioSharingDevicePreferenceController;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.dashboard.DashboardFragment;
|
import com.android.settings.dashboard.DashboardFragment;
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
import com.android.settings.overlay.SurveyFeatureProvider;
|
import com.android.settings.overlay.SurveyFeatureProvider;
|
||||||
@@ -71,11 +69,6 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
final boolean nearbyEnabled =
|
|
||||||
DeviceConfig.getBoolean(
|
|
||||||
DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_NEAR_BY_SUGGESTION_ENABLED,
|
|
||||||
true);
|
|
||||||
String callingAppPackageName =
|
String callingAppPackageName =
|
||||||
((SettingsActivity) getActivity()).getInitialCallingPackage();
|
((SettingsActivity) getActivity()).getInitialCallingPackage();
|
||||||
String action = getIntent() != null ? getIntent().getAction() : "";
|
String action = getIntent() != null ? getIntent().getAction() : "";
|
||||||
@@ -94,10 +87,7 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
|
|||||||
use(ConnectedDeviceGroupController.class).init(this);
|
use(ConnectedDeviceGroupController.class).init(this);
|
||||||
use(PreviouslyConnectedDevicePreferenceController.class).init(this);
|
use(PreviouslyConnectedDevicePreferenceController.class).init(this);
|
||||||
use(SlicePreferenceController.class)
|
use(SlicePreferenceController.class)
|
||||||
.setSliceUri(
|
.setSliceUri(Uri.parse(getString(R.string.config_nearby_devices_slice_uri)));
|
||||||
nearbyEnabled
|
|
||||||
? Uri.parse(getString(R.string.config_nearby_devices_slice_uri))
|
|
||||||
: null);
|
|
||||||
use(DiscoverableFooterPreferenceController.class)
|
use(DiscoverableFooterPreferenceController.class)
|
||||||
.setAlwaysDiscoverable(isAlwaysDiscoverable(callingAppPackageName, action));
|
.setAlwaysDiscoverable(isAlwaysDiscoverable(callingAppPackageName, action));
|
||||||
|
|
||||||
|
@@ -21,23 +21,6 @@ package com.android.settings.core;
|
|||||||
* {@link android.provider.DeviceConfig}
|
* {@link android.provider.DeviceConfig}
|
||||||
*/
|
*/
|
||||||
public class SettingsUIDeviceConfig {
|
public class SettingsUIDeviceConfig {
|
||||||
/**
|
|
||||||
* {@code true} if slice settings is enabled in BT device detail page
|
|
||||||
*/
|
|
||||||
public static final String BT_SLICE_SETTINGS_ENABLED = "bt_slice_settings_enabled";
|
|
||||||
/**
|
|
||||||
* {@code true} if advanced header is enabled in BT device detail page
|
|
||||||
*/
|
|
||||||
public static final String BT_ADVANCED_HEADER_ENABLED = "bt_advanced_header_enabled";
|
|
||||||
/**
|
|
||||||
* {@code true} if near by device suggestion is enabled in connected device page
|
|
||||||
*/
|
|
||||||
public static final String BT_NEAR_BY_SUGGESTION_ENABLED = "bt_near_by_suggestion_enabled";
|
|
||||||
/**
|
|
||||||
* {@code true} if le audio contact sharing is enabled in BT device detail page
|
|
||||||
*/
|
|
||||||
public static final String BT_LE_AUDIO_CONTACT_SHARING_ENABLED =
|
|
||||||
"bt_le_audio_contact_sharing_enabled";
|
|
||||||
/**
|
/**
|
||||||
* {@code true} whether or not event_log for generic actions is enabled. Default is true.
|
* {@code true} whether or not event_log for generic actions is enabled. Default is true.
|
||||||
*/
|
*/
|
||||||
|
@@ -30,7 +30,6 @@ import android.graphics.Bitmap;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.platform.test.annotations.EnableFlags;
|
import android.platform.test.annotations.EnableFlags;
|
||||||
import android.platform.test.flag.junit.SetFlagsRule;
|
import android.platform.test.flag.junit.SetFlagsRule;
|
||||||
import android.provider.DeviceConfig;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
@@ -44,7 +43,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
|||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
import com.android.settings.core.BasePreferenceController;
|
import com.android.settings.core.BasePreferenceController;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.flags.Flags;
|
import com.android.settings.flags.Flags;
|
||||||
import com.android.settings.fuelgauge.BatteryMeterView;
|
import com.android.settings.fuelgauge.BatteryMeterView;
|
||||||
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
||||||
@@ -339,9 +337,7 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAvailabilityStatus_untetheredHeadsetWithConfigOn_returnAvailable() {
|
public void getAvailabilityStatus_untetheredHeadset_returnAvailable() {
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
||||||
.thenReturn("true".getBytes());
|
.thenReturn("true".getBytes());
|
||||||
|
|
||||||
@@ -350,31 +346,7 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAvailabilityStatus_untetheredHeadsetWithConfigOff_returnUnavailable() {
|
public void getAvailabilityStatus_notUntetheredHeadset_returnUnavailable() {
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "false", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
|
||||||
.thenReturn("true".getBytes());
|
|
||||||
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
|
||||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getAvailabilityStatus_notUntetheredHeadsetWithConfigOn_returnUnavailable() {
|
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
|
||||||
.thenReturn("false".getBytes());
|
|
||||||
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
|
||||||
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getAvailabilityStatus_notUntetheredHeadsetWithConfigOff_returnUnavailable() {
|
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "false", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
||||||
.thenReturn("false".getBytes());
|
.thenReturn("false".getBytes());
|
||||||
|
|
||||||
@@ -393,8 +365,6 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onStart_isAvailable_registerCallback() {
|
public void onStart_isAvailable_registerCallback() {
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
||||||
.thenReturn("true".getBytes());
|
.thenReturn("true".getBytes());
|
||||||
Set<CachedBluetoothDevice> cacheBluetoothDevices = new HashSet<>();
|
Set<CachedBluetoothDevice> cacheBluetoothDevices = new HashSet<>();
|
||||||
@@ -424,8 +394,6 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onStart_isAvailableButNoBluetoothDevice_notNeedToRegisterCallback() {
|
public void onStart_isAvailableButNoBluetoothDevice_notNeedToRegisterCallback() {
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
||||||
.thenReturn("true".getBytes());
|
.thenReturn("true".getBytes());
|
||||||
when(mCachedDevice.getDevice()).thenReturn(null);
|
when(mCachedDevice.getDevice()).thenReturn(null);
|
||||||
@@ -452,8 +420,6 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onStop_noBluetoothDevice_noNeedToUnregisterCallback() {
|
public void onStop_noBluetoothDevice_noNeedToUnregisterCallback() {
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
||||||
.thenReturn("true".getBytes());
|
.thenReturn("true".getBytes());
|
||||||
when(mCachedDevice.getDevice()).thenReturn(null);
|
when(mCachedDevice.getDevice()).thenReturn(null);
|
||||||
@@ -549,8 +515,6 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
|||||||
@Test
|
@Test
|
||||||
@EnableFlags(Flags.FLAG_ENABLE_BLUETOOTH_DEVICE_DETAILS_POLISH)
|
@EnableFlags(Flags.FLAG_ENABLE_BLUETOOTH_DEVICE_DETAILS_POLISH)
|
||||||
public void enablePolishFlag_renameButtonShown() {
|
public void enablePolishFlag_renameButtonShown() {
|
||||||
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
|
||||||
.thenReturn("true".getBytes());
|
.thenReturn("true".getBytes());
|
||||||
Set<CachedBluetoothDevice> cacheBluetoothDevices = new HashSet<>();
|
Set<CachedBluetoothDevice> cacheBluetoothDevices = new HashSet<>();
|
||||||
|
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.when;
|
|||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.testutils.FakeFeatureFactory;
|
import com.android.settings.testutils.FakeFeatureFactory;
|
||||||
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
||||||
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
|
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
|
||||||
@@ -127,24 +126,10 @@ public class BluetoothDetailsHeaderControllerTest extends BluetoothDetailsContro
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isAvailable_untetheredHeadsetWithConfigOn_returnFalse() {
|
public void isAvailable_untetheredHeadset_returnFalse() {
|
||||||
android.provider.DeviceConfig.setProperty(
|
|
||||||
android.provider.DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(
|
when(mBluetoothDevice.getMetadata(
|
||||||
BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET)).thenReturn("true".getBytes());
|
BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET)).thenReturn("true".getBytes());
|
||||||
|
|
||||||
assertThat(mController.isAvailable()).isFalse();
|
assertThat(mController.isAvailable()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void isAvailable_untetheredHeadsetWithConfigOff_returnTrue() {
|
|
||||||
android.provider.DeviceConfig.setProperty(
|
|
||||||
android.provider.DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "false", true);
|
|
||||||
when(mBluetoothDevice.getMetadata(
|
|
||||||
BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET)).thenReturn("true".getBytes());
|
|
||||||
|
|
||||||
assertThat(mController.isAvailable()).isTrue();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -554,7 +554,6 @@ public class BluetoothDetailsProfilesControllerTest extends BluetoothDetailsCont
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void prefKeyInBlockingList_hideToggle() {
|
public void prefKeyInBlockingList_hideToggle() {
|
||||||
mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_BLUETOOTH_PROFILE_TOGGLE_VISIBILITY_CHECKER);
|
|
||||||
setupDevice(makeDefaultDeviceConfig());
|
setupDevice(makeDefaultDeviceConfig());
|
||||||
|
|
||||||
addA2dpProfileToDevice(true, true, true);
|
addA2dpProfileToDevice(true, true, true);
|
||||||
@@ -569,7 +568,6 @@ public class BluetoothDetailsProfilesControllerTest extends BluetoothDetailsCont
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void prefKeyNotInBlockingList_showToggle() {
|
public void prefKeyNotInBlockingList_showToggle() {
|
||||||
mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_BLUETOOTH_PROFILE_TOGGLE_VISIBILITY_CHECKER);
|
|
||||||
setupDevice(makeDefaultDeviceConfig());
|
setupDevice(makeDefaultDeviceConfig());
|
||||||
|
|
||||||
addA2dpProfileToDevice(true, true, true);
|
addA2dpProfileToDevice(true, true, true);
|
||||||
|
@@ -30,7 +30,6 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
|
import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
|
||||||
import com.android.settings.testutils.shadow.ShadowBluetoothUtils;
|
import com.android.settings.testutils.shadow.ShadowBluetoothUtils;
|
||||||
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
||||||
@@ -177,30 +176,11 @@ public class BluetoothPairingControllerTest {
|
|||||||
assertThat(mBluetoothPairingController.isLeAudio()).isTrue();
|
assertThat(mBluetoothPairingController.isLeAudio()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void isLeContactSharingEnabled_configIsFalse_returnsFalse() {
|
|
||||||
mockIsLeContactSharingEnabled(false);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
|
||||||
|
|
||||||
assertThat(mBluetoothPairingController.isLeContactSharingEnabled()).isFalse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void isLeContactSharingEnabled_configIsTrue_returnsTrue() {
|
|
||||||
mockIsLeContactSharingEnabled(true);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
|
||||||
|
|
||||||
assertThat(mBluetoothPairingController.isLeContactSharingEnabled()).isTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isContactSharingVisible_profileIsNotReady_returnsTrue() {
|
public void isContactSharingVisible_profileIsNotReady_returnsTrue() {
|
||||||
// isProfileReady=false, isLeAudio=false, isLeContactSharingEnabled=true
|
// isProfileReady=false, isLeAudio=false
|
||||||
mockIsProfileReady(false);
|
mockIsProfileReady(false);
|
||||||
mockIsLeAudio(false);
|
mockIsLeAudio(false);
|
||||||
mockIsLeContactSharingEnabled(true);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
mBluetoothPairingController = createBluetoothPairingController();
|
||||||
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
||||||
@@ -210,10 +190,9 @@ public class BluetoothPairingControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isContactSharingVisible_profileIsReady_returnsFalse() {
|
public void isContactSharingVisible_profileIsReady_returnsFalse() {
|
||||||
// isProfileReady=true, isLeAudio=false, isLeContactSharingEnabled=true
|
// isProfileReady=true, isLeAudio=false
|
||||||
mockIsProfileReady(true);
|
mockIsProfileReady(true);
|
||||||
mockIsLeAudio(false);
|
mockIsLeAudio(false);
|
||||||
mockIsLeContactSharingEnabled(true);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
mBluetoothPairingController = createBluetoothPairingController();
|
||||||
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
||||||
@@ -223,10 +202,9 @@ public class BluetoothPairingControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isContactSharingVisible_DeviceIsLeAudioAndProfileIsReady_returnsFalse() {
|
public void isContactSharingVisible_DeviceIsLeAudioAndProfileIsReady_returnsFalse() {
|
||||||
// isProfileReady=true, isLeAudio=true, isLeContactSharingEnabled=true
|
// isProfileReady=true, isLeAudio=true
|
||||||
mockIsProfileReady(true);
|
mockIsProfileReady(true);
|
||||||
mockIsLeAudio(true);
|
mockIsLeAudio(true);
|
||||||
mockIsLeContactSharingEnabled(true);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
mBluetoothPairingController = createBluetoothPairingController();
|
||||||
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
||||||
@@ -236,10 +214,9 @@ public class BluetoothPairingControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isContactSharingVisible_DeviceIsLeAudioAndProfileIsNotReady_returnsTrue() {
|
public void isContactSharingVisible_DeviceIsLeAudioAndProfileIsNotReady_returnsTrue() {
|
||||||
// isProfileReady=false, isLeAudio=true, isLeContactSharingEnabled=true
|
// isProfileReady=false, isLeAudio=true
|
||||||
mockIsProfileReady(false);
|
mockIsProfileReady(false);
|
||||||
mockIsLeAudio(true);
|
mockIsLeAudio(true);
|
||||||
mockIsLeContactSharingEnabled(true);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
mBluetoothPairingController = createBluetoothPairingController();
|
||||||
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
||||||
@@ -247,19 +224,6 @@ public class BluetoothPairingControllerTest {
|
|||||||
assertThat(mBluetoothPairingController.isContactSharingVisible()).isTrue();
|
assertThat(mBluetoothPairingController.isContactSharingVisible()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void isContactSharingVisible_DeviceIsLeAndContactSharingIsNotEnabled_returnsFalse() {
|
|
||||||
// isProfileReady=false, isLeAudio=true, isLeContactSharingEnabled=false
|
|
||||||
mockIsProfileReady(false);
|
|
||||||
mockIsLeAudio(true);
|
|
||||||
mockIsLeContactSharingEnabled(false);
|
|
||||||
|
|
||||||
mBluetoothPairingController = createBluetoothPairingController();
|
|
||||||
mBluetoothPairingController.mockPbapClientProfile(mPbapLocalBluetoothProfile);
|
|
||||||
|
|
||||||
assertThat(mBluetoothPairingController.isContactSharingVisible()).isFalse();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void mockIsProfileReady(boolean mockValue) {
|
private void mockIsProfileReady(boolean mockValue) {
|
||||||
when(mPbapLocalBluetoothProfile.isProfileReady()).thenReturn(mockValue);
|
when(mPbapLocalBluetoothProfile.isProfileReady()).thenReturn(mockValue);
|
||||||
}
|
}
|
||||||
@@ -271,11 +235,4 @@ public class BluetoothPairingControllerTest {
|
|||||||
}
|
}
|
||||||
when(mLocalBluetoothProfile.getProfileId()).thenReturn(profileId);
|
when(mLocalBluetoothProfile.getProfileId()).thenReturn(profileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mockIsLeContactSharingEnabled(boolean mockValue) {
|
|
||||||
android.provider.DeviceConfig.setProperty(
|
|
||||||
android.provider.DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_LE_AUDIO_CONTACT_SHARING_ENABLED,
|
|
||||||
/* value= */ mockValue ? "true" : "false", true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,6 @@ import android.platform.test.flag.junit.SetFlagsRule;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.core.SettingsUIDeviceConfig;
|
|
||||||
import com.android.settings.flags.Flags;
|
import com.android.settings.flags.Flags;
|
||||||
import com.android.settings.testutils.FakeFeatureFactory;
|
import com.android.settings.testutils.FakeFeatureFactory;
|
||||||
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
import com.android.settings.testutils.shadow.ShadowDeviceConfig;
|
||||||
@@ -63,11 +62,6 @@ public class GeneralBluetoothDetailsHeaderControllerTest
|
|||||||
public void setUp() {
|
public void setUp() {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
FakeFeatureFactory.setupForTest();
|
FakeFeatureFactory.setupForTest();
|
||||||
android.provider.DeviceConfig.setProperty(
|
|
||||||
android.provider.DeviceConfig.NAMESPACE_SETTINGS_UI,
|
|
||||||
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED,
|
|
||||||
"true",
|
|
||||||
true);
|
|
||||||
mController =
|
mController =
|
||||||
new GeneralBluetoothDetailsHeaderController(
|
new GeneralBluetoothDetailsHeaderController(
|
||||||
mContext, mFragment, mCachedDevice, mLifecycle);
|
mContext, mFragment, mCachedDevice, mLifecycle);
|
||||||
|
Reference in New Issue
Block a user