When an inline slice is requested, and the setting is unavailable, we should present more useful information to the user. This CL handles: - Unsupported: return intent slice to Settings home page - Disabled for user: intent to the setting page - Unknown reason: intent to setting page - Disabled dependency: Create intent-based Slice rather than the requested inline slice. Bug: 71640747 Test: robotests Change-Id: I9c1a0ee36119d4f9f3b205e0824c251f4356db55
22 lines
600 B
Java
22 lines
600 B
Java
package com.android.settings.slices;
|
|
|
|
import android.content.Context;
|
|
import android.provider.Settings;
|
|
|
|
import com.android.settings.core.BasePreferenceController;
|
|
|
|
public class FakeUnavailablePreferenceController extends BasePreferenceController {
|
|
|
|
public static final String AVAILABILITY_KEY = "fake_availability_key";
|
|
|
|
public FakeUnavailablePreferenceController(Context context) {
|
|
super(context, "key");
|
|
}
|
|
|
|
@Override
|
|
public int getAvailabilityStatus() {
|
|
return Settings.System.getInt(mContext.getContentResolver(),
|
|
AVAILABILITY_KEY, 0);
|
|
}
|
|
}
|