diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bb43bbf51c6..e2e89bd0915 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2452,7 +2452,6 @@ diff --git a/res/layout/apps_filter_spinner.xml b/res/layout/apps_filter_spinner.xml index 3faff507a2b..e468a4bb8d0 100644 --- a/res/layout/apps_filter_spinner.xml +++ b/res/layout/apps_filter_spinner.xml @@ -21,7 +21,6 @@ android:layout_height="?android:attr/actionBarSize" android:background="?android:attr/colorAccent" android:gravity="center_vertical" - android:paddingEnd="@dimen/switchbar_subsettings_margin_end" android:orientation="horizontal"> true + + true + false diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 4467362e35f..74a5f246fce 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -208,7 +208,6 @@ public class BluetoothPermissionActivity extends AlertActivity implements CachedBluetoothDevice cachedDevice = cachedDeviceManager.findDevice(mDevice); if (cachedDevice == null) { cachedDevice = cachedDeviceManager.addDevice(bluetoothManager.getBluetoothAdapter(), - bluetoothManager.getProfileManager(), mDevice); } always = cachedDevice.checkAndIncreaseMessageRejectionCount(); diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index 85c5e45ec00..bbf3fffc6c7 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java @@ -232,7 +232,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { CachedBluetoothDevice cachedDevice = cachedDeviceManager.findDevice(mDevice); if (cachedDevice == null) { cachedDevice = cachedDeviceManager.addDevice(bluetoothManager.getBluetoothAdapter(), - bluetoothManager.getProfileManager(), mDevice); + mDevice); } String intentName = BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY; diff --git a/src/com/android/settings/datausage/DataUsageList.java b/src/com/android/settings/datausage/DataUsageList.java index d9124628657..0c9c7f99330 100644 --- a/src/com/android/settings/datausage/DataUsageList.java +++ b/src/com/android/settings/datausage/DataUsageList.java @@ -48,6 +48,7 @@ import android.util.SparseArray; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; +import android.widget.ImageView; import android.widget.Spinner; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; @@ -293,6 +294,7 @@ public class DataUsageList extends DataUsageBase { if (isNetworkPolicyModifiable(policy, mSubId) && isMobileDataAvailable(mSubId)) { mChart.setNetworkPolicy(policy); configureButton.setVisibility(View.VISIBLE); + ((ImageView) configureButton).setColorFilter(android.R.color.white); } else { // controls are disabled; don't bind warning/limit sweeps mChart.setNetworkPolicy(null); diff --git a/src/com/android/settings/network/PrivateDnsPreferenceController.java b/src/com/android/settings/network/PrivateDnsPreferenceController.java index ce3a9c0b963..1c62f811072 100644 --- a/src/com/android/settings/network/PrivateDnsPreferenceController.java +++ b/src/com/android/settings/network/PrivateDnsPreferenceController.java @@ -80,7 +80,9 @@ public class PrivateDnsPreferenceController extends BasePreferenceController @Override public int getAvailabilityStatus() { - return AVAILABLE; + return mContext.getResources().getBoolean(R.bool.config_show_private_dns_settings) + ? AVAILABLE + : UNSUPPORTED_ON_DEVICE; } @Override diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml index 6d82451bad9..676a8dd0c71 100644 --- a/tests/robotests/res/values-mcc999/config.xml +++ b/tests/robotests/res/values-mcc999/config.xml @@ -23,6 +23,7 @@ true false false + false true false false diff --git a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java index bf882456af9..d94a8a7cf0a 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java @@ -34,9 +34,7 @@ import com.android.settings.testutils.SettingsRobolectricTestRunner; import com.android.settings.testutils.shadow.ShadowAudioManager; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager; -import com.android.settingslib.bluetooth.HeadsetProfile; import com.android.settingslib.bluetooth.LocalBluetoothManager; -import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import org.junit.Before; import org.junit.Test; @@ -63,16 +61,10 @@ public class ConnectedBluetoothDeviceUpdaterTest { @Mock private LocalBluetoothManager mLocalManager; @Mock - private LocalBluetoothProfileManager mLocalBluetoothProfileManager; - @Mock - private HeadsetProfile mHeadsetProfile; + private CachedBluetoothDeviceManager mCachedDeviceManager; private Context mContext; private ConnectedBluetoothDeviceUpdater mBluetoothDeviceUpdater; - - @Mock - private CachedBluetoothDeviceManager mCachedDeviceManager; - private Collection cachedDevices; private ShadowAudioManager mShadowAudioManager; @@ -87,8 +79,6 @@ public class ConnectedBluetoothDeviceUpdaterTest { new ArrayList(new ArrayList()); when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); - when(mLocalManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager); - when(mLocalBluetoothProfileManager.getHeadsetProfile()).thenReturn(mHeadsetProfile); when(mLocalManager.getCachedDeviceManager()).thenReturn(mCachedDeviceManager); when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(cachedDevices); diff --git a/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java index 47354c747ea..eb17bcbbee2 100644 --- a/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/network/PrivateDnsPreferenceControllerTest.java @@ -24,6 +24,8 @@ import static android.provider.Settings.Global.PRIVATE_DNS_MODE; import static android.provider.Settings.Global.PRIVATE_DNS_SPECIFIER; import static androidx.lifecycle.Lifecycle.Event.ON_START; import static androidx.lifecycle.Lifecycle.Event.ON_STOP; +import static com.android.settings.core.BasePreferenceController.AVAILABLE; +import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Matchers.anyString; @@ -57,6 +59,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; import org.robolectric.RuntimeEnvironment; import org.robolectric.shadow.api.Shadow; import org.robolectric.shadows.ShadowContentResolver; @@ -143,6 +146,17 @@ public class PrivateDnsPreferenceControllerTest { nc.onLinkPropertiesChanged(mNetwork, lp); } + @Test + public void getAvailibilityStatus_availableByDefault() { + assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); + } + + @Test + @Config(qualifiers = "mcc999") + public void getAvailabilityStatus_unsupportedWhenSet() { + assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); + } + @Test public void goThroughLifecycle_shouldRegisterUnregisterSettingsObserver() { mLifecycle.handleLifecycleEvent(ON_START);