Merge "Fix ANR in SliceRelayReceiver"

This commit is contained in:
TreeHugger Robot
2018-12-13 06:20:19 +00:00
committed by Android (Google) Code Review
3 changed files with 27 additions and 12 deletions

View File

@@ -25,7 +25,6 @@ import android.annotation.ColorInt;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
@@ -75,14 +74,6 @@ public class WifiSlice implements CustomSliceable {
return WIFI_SLICE_URI;
}
@Override
public IntentFilter getIntentFilter() {
final IntentFilter filter = new IntentFilter();
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
return filter;
}
@Override
public Slice getSlice() {
final boolean isWifiEnabled = isWifiEnabled();
@@ -200,7 +191,7 @@ public class WifiSlice implements CustomSliceable {
mWifiManager.isWifiEnabled());
mWifiManager.setWifiEnabled(newState);
// Do not notifyChange on Uri. The service takes longer to update the current value than it
// does for the Slice to check the current value again. Let {@link SliceBroadcastRelay}
// does for the Slice to check the current value again. Let {@link WifiScanWorker}
// handle it.
}
@@ -292,6 +283,7 @@ public class WifiSlice implements CustomSliceable {
@Override
public void onWifiStateChanged(int state) {
mContext.getContentResolver().notifyChange(getUri(), null);
}
@Override