Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors. Test: We can't test it now. But we will have an integration test later. Bug: 110259478 Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
This commit is contained in:
@@ -80,7 +80,7 @@ public class AccountDashboardFragment extends DashboardFragment {
|
||||
final AccountPreferenceController accountPrefController =
|
||||
new AccountPreferenceController(context, parent, authorities);
|
||||
if (parent != null) {
|
||||
parent.getLifecycle().addObserver(accountPrefController);
|
||||
parent.getSettingsLifecycle().addObserver(accountPrefController);
|
||||
}
|
||||
controllers.add(accountPrefController);
|
||||
controllers.add(new AutoSyncDataPreferenceController(context, parent));
|
||||
|
@@ -117,7 +117,7 @@ public class AccountDetailDashboardFragment extends DashboardFragment {
|
||||
mRemoveAccountController = new RemoveAccountPreferenceController(context, this);
|
||||
controllers.add(mRemoveAccountController);
|
||||
controllers.add(new AccountHeaderPreferenceController(
|
||||
context, getLifecycle(), getActivity(), this /* host */, getArguments()));
|
||||
context, getSettingsLifecycle(), getActivity(), this /* host */, getArguments()));
|
||||
return controllers;
|
||||
}
|
||||
|
||||
|
@@ -35,6 +35,7 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnResume;
|
||||
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
public class AccountHeaderPreferenceController extends AbstractPreferenceController
|
||||
@@ -43,14 +44,14 @@ public class AccountHeaderPreferenceController extends AbstractPreferenceControl
|
||||
private static final String KEY_ACCOUNT_HEADER = "account_header";
|
||||
|
||||
private final Activity mActivity;
|
||||
private final PreferenceFragment mHost;
|
||||
private final PreferenceFragmentCompat mHost;
|
||||
private final Account mAccount;
|
||||
private final UserHandle mUserHandle;
|
||||
|
||||
private LayoutPreference mHeaderPreference;
|
||||
|
||||
public AccountHeaderPreferenceController(Context context, Lifecycle lifecycle,
|
||||
Activity activity, PreferenceFragment host, Bundle args) {
|
||||
Activity activity, PreferenceFragmentCompat host, Bundle args) {
|
||||
super(context);
|
||||
mActivity = activity;
|
||||
mHost = host;
|
||||
|
@@ -122,7 +122,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
|
||||
final Activity activity = getActivity();
|
||||
final Preference pref = EntityHeaderController
|
||||
.newInstance(activity, this, null /* header */)
|
||||
.setRecyclerView(getListView(), getLifecycle())
|
||||
.setRecyclerView(getListView(), getSettingsLifecycle())
|
||||
.setIcon(getDrawableForType(mAccount.type))
|
||||
.setLabel(mAccount.name)
|
||||
.setSummary(getLabelForType(mAccount.type))
|
||||
|
@@ -41,6 +41,7 @@ import com.android.settingslib.core.instrumentation.Instrumentable;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.Preference.OnPreferenceClickListener;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.preference.PreferenceGroup;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
@@ -60,9 +61,9 @@ public class AccountTypePreferenceLoader {
|
||||
|
||||
private AuthenticatorHelper mAuthenticatorHelper;
|
||||
private UserHandle mUserHandle;
|
||||
private PreferenceFragment mFragment;
|
||||
private PreferenceFragmentCompat mFragment;
|
||||
|
||||
public AccountTypePreferenceLoader(PreferenceFragment fragment,
|
||||
public AccountTypePreferenceLoader(PreferenceFragmentCompat fragment,
|
||||
AuthenticatorHelper authenticatorHelper, UserHandle userHandle) {
|
||||
mFragment = fragment;
|
||||
mAuthenticatorHelper = authenticatorHelper;
|
||||
|
@@ -22,7 +22,7 @@ import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.widget.FooterPreference;
|
||||
import com.android.settingslib.widget.FooterPreferenceMixin;
|
||||
import com.android.settingslib.widget.FooterPreferenceMixinCompat;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
@@ -30,7 +30,7 @@ import androidx.preference.PreferenceScreen;
|
||||
public class EnterpriseDisclosurePreferenceController extends BasePreferenceController {
|
||||
|
||||
private final EnterprisePrivacyFeatureProvider mFeatureProvider;
|
||||
private FooterPreferenceMixin mFooterPreferenceMixin;
|
||||
private FooterPreferenceMixinCompat mFooterPreferenceMixin;
|
||||
private PreferenceScreen mScreen;
|
||||
|
||||
public EnterpriseDisclosurePreferenceController(Context context) {
|
||||
@@ -41,7 +41,7 @@ public class EnterpriseDisclosurePreferenceController extends BasePreferenceCont
|
||||
.getEnterprisePrivacyFeatureProvider(mContext);
|
||||
}
|
||||
|
||||
public void setFooterPreferenceMixin(FooterPreferenceMixin footerPreferenceMixin) {
|
||||
public void setFooterPreferenceMixin(FooterPreferenceMixinCompat footerPreferenceMixin) {
|
||||
mFooterPreferenceMixin = footerPreferenceMixin;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user