Snap for 4937020 from fa44a94aa9 to qt-release
Change-Id: I8e6e5543bce76557ad7ef8e7d86042e90dde235c
This commit is contained in:
@@ -2452,7 +2452,6 @@
|
||||
<activity
|
||||
android:name="Settings$ZenAccessSettingsActivity"
|
||||
android:label="@string/manage_zen_access_title"
|
||||
android:taskAffinity="com.android.settings"
|
||||
android:parentActivityName="Settings">
|
||||
<intent-filter android:priority="1">
|
||||
<action android:name="android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS" />
|
||||
|
||||
@@ -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">
|
||||
|
||||
<Spinner
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
<!-- Whether toggle_airplane is available or not. -->
|
||||
<bool name="config_show_toggle_airplane">true</bool>
|
||||
|
||||
<!-- Whether private_dns_settings is available or not. -->
|
||||
<bool name="config_show_private_dns_settings">true</bool>
|
||||
|
||||
<!-- Whether memory from app_info_settings is available or not. -->
|
||||
<bool name="config_show_app_info_settings_memory">false</bool>
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<bool name="config_additional_system_update_setting_enable">true</bool>
|
||||
<bool name="config_show_wifi_settings">false</bool>
|
||||
<bool name="config_show_toggle_airplane">false</bool>
|
||||
<bool name="config_show_private_dns_settings">false</bool>
|
||||
<bool name="config_show_app_info_settings_memory">true</bool>
|
||||
<bool name="config_show_app_info_settings_battery">false</bool>
|
||||
<bool name="config_show_high_power_apps">false</bool>
|
||||
|
||||
@@ -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<CachedBluetoothDevice> cachedDevices;
|
||||
private ShadowAudioManager mShadowAudioManager;
|
||||
|
||||
@@ -87,8 +79,6 @@ public class ConnectedBluetoothDeviceUpdaterTest {
|
||||
new ArrayList<CachedBluetoothDevice>(new ArrayList<CachedBluetoothDevice>());
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user