Make summary text update after settings changes

The uri's being pinged when changes happened were incorrect, because
of a hard coded '/'.

Bug: 79779837
Test: robotest
Change-Id: I6735c5a60dc7df6894bd17e67d7702a7ec6c07d4
This commit is contained in:
Matthew Fritze
2018-05-23 13:03:27 -07:00
parent 429c787168
commit 06600041bc
2 changed files with 48 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ import static com.android.settings.wifi.WifiSliceBuilder.ACTION_WIFI_SLICE_CHANG
import android.app.slice.Slice;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -155,6 +156,7 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
sliderController.setSliderPosition(newPosition);
logSliceValueChange(context, key, newPosition);
updateUri(context, key, isPlatformSlice);
}
/**
@@ -177,8 +179,15 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
}
private void updateUri(Context context, String key, boolean isPlatformDefined) {
final String path = SettingsSlicesContract.PATH_SETTING_ACTION + "/" + key;
final Uri uri = SliceBuilderUtils.getUri(path, isPlatformDefined);
final String authority = isPlatformDefined
? SettingsSlicesContract.AUTHORITY
: SettingsSliceProvider.SLICE_AUTHORITY;
final Uri uri = new Uri.Builder()
.scheme(ContentResolver.SCHEME_CONTENT)
.authority(authority)
.appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
.appendPath(key)
.build();
context.getContentResolver().notifyChange(uri, null /* observer */);
}
}