Add DnD as a special case Slice
Add DND Slice as a special case, since there is an existing inheritance structures in the zen mode preference controllers which would be too risky to change at this point in the release. Change-Id: If4b7013be35c89695786af2dbbea2edcf7a189f3 Merged-In: Ice608b9a7bd6f38b73e581eb3723f0a2fae96f2b Test: make RunSettingsRoboTests Fixes: 67997377
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.wifi;
|
||||
|
||||
import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
|
||||
import static android.provider.SettingsSlicesContract.KEY_WIFI;
|
||||
|
||||
import android.annotation.ColorInt;
|
||||
@@ -79,8 +80,7 @@ public class WifiSliceBuilder {
|
||||
/**
|
||||
* Return a Wifi Slice bound to {@link #WIFI_URI}.
|
||||
* <p>
|
||||
* Note that you should register a listener with {@link #registerIntentFilter(Context, Uri)}
|
||||
* to get changes from Wifi.
|
||||
* Note that you should register a listener for {@link #INTENT_FILTER} to get changes for Wifi.
|
||||
*/
|
||||
public static Slice getSlice(Context context) {
|
||||
final boolean isWifiEnabled = isWifiEnabled(context);
|
||||
@@ -111,7 +111,7 @@ public class WifiSliceBuilder {
|
||||
*/
|
||||
public static void handleUriChange(Context context, Intent intent) {
|
||||
final WifiManager wifiManager = context.getSystemService(WifiManager.class);
|
||||
final boolean newState = intent.getBooleanExtra(android.app.slice.Slice.EXTRA_TOGGLE_STATE,
|
||||
final boolean newState = intent.getBooleanExtra(EXTRA_TOGGLE_STATE,
|
||||
wifiManager.isWifiEnabled());
|
||||
wifiManager.setWifiEnabled(newState);
|
||||
// Do not notifyChange on Uri. The service takes longer to update the current value than it
|
||||
|
Reference in New Issue
Block a user