Remove Slice getter from BasePreferenceController
After working through a prototype here: (ag/3324435) it is clear that we don't need the controller to provider the slice. We will build an index that will contain sufficent UI information, and a reference to the controller. At Slice Bind time, we can get the curret value from the controller, and the UI information from the Index. Bug: 67996923 Test: robotests Change-Id: Id43a51bcd73051bc719cd5829907583e0edf23b2
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
package com.android.settings.applications.appinfo;
|
package com.android.settings.applications.appinfo;
|
||||||
|
|
||||||
import android.app.LoaderManager;
|
import android.app.LoaderManager;
|
||||||
import android.app.slice.Slice;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Loader;
|
import android.content.Loader;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
@@ -81,11 +80,6 @@ public class AppBatteryPreferenceController extends BasePreferenceController
|
|||||||
return AVAILABLE;
|
return AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Slice getSettingSlice() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void displayPreference(PreferenceScreen screen) {
|
public void displayPreference(PreferenceScreen screen) {
|
||||||
super.displayPreference(screen);
|
super.displayPreference(screen);
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.settings.applications.appinfo;
|
package com.android.settings.applications.appinfo;
|
||||||
|
|
||||||
import android.app.slice.Slice;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceScreen;
|
import android.support.v7.preference.PreferenceScreen;
|
||||||
@@ -50,11 +49,6 @@ public abstract class AppInfoPreferenceControllerBase extends BasePreferenceCont
|
|||||||
return AVAILABLE;
|
return AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Slice getSettingSlice() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void displayPreference(PreferenceScreen screen) {
|
public void displayPreference(PreferenceScreen screen) {
|
||||||
super.displayPreference(screen);
|
super.displayPreference(screen);
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
package com.android.settings.applications.appinfo;
|
package com.android.settings.applications.appinfo;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.slice.Slice;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
@@ -110,11 +109,6 @@ public class AppMemoryPreferenceController extends BasePreferenceController
|
|||||||
? AVAILABLE : DISABLED_DEPENDENT_SETTING;
|
? AVAILABLE : DISABLED_DEPENDENT_SETTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Slice getSettingSlice() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void displayPreference(PreferenceScreen screen) {
|
public void displayPreference(PreferenceScreen screen) {
|
||||||
super.displayPreference(screen);
|
super.displayPreference(screen);
|
||||||
|
@@ -23,13 +23,11 @@ import android.content.res.Resources;
|
|||||||
import android.icu.text.ListFormatter;
|
import android.icu.text.ListFormatter;
|
||||||
import android.support.annotation.VisibleForTesting;
|
import android.support.annotation.VisibleForTesting;
|
||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceScreen;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.applications.AppInfoDashboardFragment;
|
import com.android.settings.applications.AppInfoDashboardFragment;
|
||||||
import com.android.settingslib.applications.PermissionsSummaryHelper;
|
import com.android.settingslib.applications.PermissionsSummaryHelper;
|
||||||
import com.android.settingslib.core.AbstractPreferenceController;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@@ -50,11 +50,6 @@ public abstract class DefaultAppShortcutPreferenceControllerBase extends BasePre
|
|||||||
return hasAppCapability() ? AVAILABLE : DISABLED_UNSUPPORTED;
|
return hasAppCapability() ? AVAILABLE : DISABLED_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Slice getSettingSlice() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateState(Preference preference) {
|
public void updateState(Preference preference) {
|
||||||
preference.setSummary(isDefaultApp() ? R.string.yes : R.string.no);
|
preference.setSummary(isDefaultApp() ? R.string.yes : R.string.no);
|
||||||
|
@@ -14,14 +14,10 @@
|
|||||||
package com.android.settings.core;
|
package com.android.settings.core;
|
||||||
|
|
||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.app.slice.Slice;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.v7.preference.Preference;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
|
||||||
import com.android.settings.core.PreferenceControllerMixin;
|
|
||||||
import com.android.settings.search.ResultPayload;
|
import com.android.settings.search.ResultPayload;
|
||||||
import com.android.settings.search.SearchIndexableRaw;
|
import com.android.settings.search.SearchIndexableRaw;
|
||||||
import com.android.settingslib.core.AbstractPreferenceController;
|
import com.android.settingslib.core.AbstractPreferenceController;
|
||||||
@@ -88,11 +84,6 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl
|
|||||||
@AvailabilityStatus
|
@AvailabilityStatus
|
||||||
public abstract int getAvailabilityStatus();
|
public abstract int getAvailabilityStatus();
|
||||||
|
|
||||||
/**
|
|
||||||
* @return A slice for the corresponding setting.
|
|
||||||
*/
|
|
||||||
public abstract Slice getSettingSlice();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPreferenceKey() {
|
public String getPreferenceKey() {
|
||||||
return mPreferenceKey;
|
return mPreferenceKey;
|
||||||
@@ -150,10 +141,4 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl
|
|||||||
public ResultPayload getResultPayload() {
|
public ResultPayload getResultPayload() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO (b/69380366) Add Method to get preference UI
|
|
||||||
|
|
||||||
// TODO (b/69380464) Add method to get intent
|
|
||||||
|
|
||||||
// TODO (b/69380560) Add method to get broadcast intent
|
|
||||||
}
|
}
|
@@ -13,7 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.settings.core;
|
package com.android.settings.core;
|
||||||
|
|
||||||
import android.app.slice.Slice;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.v14.preference.SwitchPreference;
|
import android.support.v14.preference.SwitchPreference;
|
||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
@@ -55,10 +54,4 @@ public abstract class TogglePreferenceController extends BasePreferenceControlle
|
|||||||
setChecked(auto);
|
setChecked(auto);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Slice getSettingSlice() {
|
|
||||||
// TODO
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user