Update a Slice Uri when unavailable

When a slice becomes unavailable, it should not update the
underlying data even if the view has not changed.

When we receive a change from an unavailable slice, notifychange
on the Uri and do not change the underlying data.

Change-Id: I91851ab668e4aece669fd65c14e0dc4ec2edefdf
Fixes: 77980406
Test: robotests
This commit is contained in:
Matthew Fritze
2018-04-12 16:40:07 -07:00
parent d743f20618
commit 7acd13f3e4
6 changed files with 111 additions and 15 deletions

View File

@@ -19,13 +19,14 @@ package com.android.settings.testutils;
import android.content.Context;
import android.provider.Settings;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.SliderPreferenceController;
public class FakeSliderController extends SliderPreferenceController {
private final String settingKey = "fake_slider_key";
public static final String AVAILABILITY_KEY = "fake_slider_availability_key";
public static final int MAX_STEPS = 9;
public FakeSliderController(Context context, String key) {
@@ -49,6 +50,7 @@ public class FakeSliderController extends SliderPreferenceController {
@Override
public int getAvailabilityStatus() {
return BasePreferenceController.AVAILABLE;
return Settings.Global.getInt(mContext.getContentResolver(),
AVAILABILITY_KEY, AVAILABLE);
}
}