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
package com.android.settings.applications.appinfo;
import android.app.LoaderManager;
-import android.app.slice.Slice;
import android.content.Context;
import android.content.Loader;
import android.content.pm.PackageInfo;
}
@Override
- public Slice getSettingSlice() {
- return null;
- }
-
- @Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey());
package com.android.settings.applications.appinfo;
-import android.app.slice.Slice;
import android.content.Context;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
}
@Override
- public Slice getSettingSlice() {
- return null;
- }
-
- @Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey());
package com.android.settings.applications.appinfo;
import android.app.Activity;
-import android.app.slice.Slice;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.AsyncTask;
}
@Override
- public Slice getSettingSlice() {
- return null;
- }
-
- @Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey());
import android.icu.text.ListFormatter;
import android.support.annotation.VisibleForTesting;
import android.support.v7.preference.Preference;
-import android.support.v7.preference.PreferenceScreen;
import android.util.Log;
import com.android.settings.R;
import com.android.settings.applications.AppInfoDashboardFragment;
import com.android.settingslib.applications.PermissionsSummaryHelper;
-import com.android.settingslib.core.AbstractPreferenceController;
import java.util.ArrayList;
import java.util.List;
}
@Override
- public Slice getSettingSlice() {
- return null;
- }
-
- @Override
public void updateState(Preference preference) {
preference.setSummary(isDefaultApp() ? R.string.yes : R.string.no);
}
package com.android.settings.core;
import android.annotation.IntDef;
-import android.app.slice.Slice;
import android.content.Context;
-import android.support.v7.preference.Preference;
import android.text.TextUtils;
import android.util.Log;
-
-import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.search.ResultPayload;
import com.android.settings.search.SearchIndexableRaw;
import com.android.settingslib.core.AbstractPreferenceController;
@AvailabilityStatus
public abstract int getAvailabilityStatus();
- /**
- * @return A slice for the corresponding setting.
- */
- public abstract Slice getSettingSlice();
-
@Override
public String getPreferenceKey() {
return mPreferenceKey;
public ResultPayload getResultPayload() {
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
}
\ No newline at end of file
*/
package com.android.settings.core;
-import android.app.slice.Slice;
import android.content.Context;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
setChecked(auto);
return true;
}
-
- @Override
- public Slice getSettingSlice() {
- // TODO
- return null;
- }
}
\ No newline at end of file
assertThat(mPreferenceController.isSupported()).isTrue();
}
-}
+}
\ No newline at end of file