Make summary text update after settings changes

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

Change-Id: I4d04642bc80b97c5191bf0e1e7a5e15a2c58d6c9
Merged-In: I6735c5a60dc7df6894bd17e67d7702a7ec6c07d4
Fixes: 79779837
Test: robotest
This commit is contained in:
Matthew Fritze
2018-05-23 13:03:27 -07:00
parent 666ee4fa14
commit a2ea991101
2 changed files with 41 additions and 6 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;
@@ -151,6 +152,7 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
sliderController.setSliderPosition(newPosition);
logSliceValueChange(context, key, newPosition);
updateUri(context, key, isPlatformSlice);
}
/**
@@ -173,8 +175,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 */);
}
}