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;
sliderController.setSliderPosition(newPosition);
logSliceValueChange(context, key, newPosition);
+ updateUri(context, key, isPlatformSlice);
}
/**
}
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 */);
}
}