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

@@ -26,6 +26,8 @@ public class FakeToggleController extends TogglePreferenceController {
private String settingKey = "toggle_key";
public static final String AVAILABILITY_KEY = "fake_toggle_availability_key";
private final int ON = 1;
private final int OFF = 0;
@@ -47,6 +49,7 @@ public class FakeToggleController extends TogglePreferenceController {
@Override
public int getAvailabilityStatus() {
return AVAILABLE;
return Settings.Global.getInt(mContext.getContentResolver(),
AVAILABILITY_KEY, AVAILABLE);
}
}