Revert "Add Credential Manager settings"

This reverts commit 8c6f627a93.

Reason for revert: possible cause of b/263060941

Change-Id: I8ce36da052ceb1f29372c307ae1c7a85cc932fe4
This commit is contained in:
Dan Shi
2022-12-19 06:48:52 +00:00
committed by Android (Google) Code Review
parent 8c6f627a93
commit 7a231eaba0
10 changed files with 44 additions and 1011 deletions

View File

@@ -22,13 +22,11 @@ import android.accounts.AccountManager;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.UserInfo;
import android.credentials.CredentialManager;
import android.os.UserHandle;
import android.os.UserManager;
import com.android.settings.R;
import com.android.settings.applications.autofill.PasswordsPreferenceController;
import com.android.settings.applications.credentials.CredentialManagerPreferenceController;
import com.android.settings.applications.defaultapps.DefaultAutofillPreferenceController;
import com.android.settings.applications.defaultapps.DefaultWorkAutofillPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
@@ -49,6 +47,7 @@ public class AccountDashboardFragment extends DashboardFragment {
private static final String TAG = "AccountDashboardFrag";
@Override
public int getMetricsCategory() {
return SettingsEnums.ACCOUNT;
@@ -61,7 +60,7 @@ public class AccountDashboardFragment extends DashboardFragment {
@Override
protected int getPreferenceScreenResId() {
return getPreferenceLayoutResId();
return R.xml.accounts_dashboard_settings;
}
@Override
@@ -72,12 +71,6 @@ public class AccountDashboardFragment extends DashboardFragment {
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (CredentialManager.isServiceEnabled()) {
CredentialManagerPreferenceController cmpp =
use(CredentialManagerPreferenceController.class);
cmpp.setParentFragment(this);
}
getSettingsLifecycle().addObserver(use(PasswordsPreferenceController.class));
}
@@ -102,13 +95,11 @@ public class AccountDashboardFragment extends DashboardFragment {
}
private static void buildAccountPreferenceControllers(
Context context,
DashboardFragment parent,
String[] authorities,
Context context, DashboardFragment parent, String[] authorities,
List<AbstractPreferenceController> controllers) {
final AccountPreferenceController accountPrefController =
new AccountPreferenceController(
context, parent, authorities, ProfileSelectFragment.ProfileType.ALL);
new AccountPreferenceController(context, parent, authorities,
ProfileSelectFragment.ProfileType.ALL);
if (parent != null) {
parent.getSettingsLifecycle().addObserver(accountPrefController);
}
@@ -118,14 +109,8 @@ public class AccountDashboardFragment extends DashboardFragment {
controllers.add(new AutoSyncWorkDataPreferenceController(context, parent));
}
public static int getPreferenceLayoutResId() {
return CredentialManager.isServiceEnabled()
? R.xml.accounts_dashboard_settings_credman
: R.xml.accounts_dashboard_settings;
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(getPreferenceLayoutResId()) {
new BaseSearchIndexProvider(R.xml.accounts_dashboard_settings) {
@Override
public List<AbstractPreferenceController> createPreferenceControllers(
@@ -139,11 +124,11 @@ public class AccountDashboardFragment extends DashboardFragment {
@SuppressWarnings("MissingSuperCall") // TODO: Fix me
@Override
public List<SearchIndexableRaw> getDynamicRawDataToIndex(
Context context, boolean enabled) {
public List<SearchIndexableRaw> getDynamicRawDataToIndex(Context context,
boolean enabled) {
final List<SearchIndexableRaw> indexRaws = new ArrayList<>();
final UserManager userManager =
(UserManager) context.getSystemService(Context.USER_SERVICE);
final UserManager userManager = (UserManager) context.getSystemService(
Context.USER_SERVICE);
final List<UserInfo> profiles = userManager.getProfiles(UserHandle.myUserId());
for (final UserInfo userInfo : profiles) {
if (userInfo.isManagedProfile()) {

View File

@@ -22,11 +22,9 @@ import static com.android.settings.accounts.AccountDashboardFragment.buildAutofi
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.credentials.CredentialManager;
import com.android.settings.R;
import com.android.settings.applications.autofill.PasswordsPreferenceController;
import com.android.settings.applications.credentials.CredentialManagerPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
import com.android.settings.users.AutoSyncDataPreferenceController;
@@ -36,7 +34,9 @@ import com.android.settingslib.core.AbstractPreferenceController;
import java.util.ArrayList;
import java.util.List;
/** Account Setting page for personal profile. */
/**
* Account Setting page for personal profile.
*/
public class AccountPersonalDashboardFragment extends DashboardFragment {
private static final String TAG = "AccountPersonalFrag";
@@ -53,9 +53,6 @@ public class AccountPersonalDashboardFragment extends DashboardFragment {
@Override
protected int getPreferenceScreenResId() {
if (CredentialManager.isServiceEnabled()) {
return R.xml.accounts_personal_dashboard_settings_credman;
}
return R.xml.accounts_personal_dashboard_settings;
}
@@ -67,13 +64,6 @@ public class AccountPersonalDashboardFragment extends DashboardFragment {
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (CredentialManager.isServiceEnabled()) {
CredentialManagerPreferenceController cmpp =
use(CredentialManagerPreferenceController.class);
cmpp.setParentFragment(this);
}
getSettingsLifecycle().addObserver(use(PasswordsPreferenceController.class));
}
@@ -87,13 +77,11 @@ public class AccountPersonalDashboardFragment extends DashboardFragment {
}
private static void buildAccountPreferenceControllers(
Context context,
DashboardFragment parent,
String[] authorities,
Context context, DashboardFragment parent, String[] authorities,
List<AbstractPreferenceController> controllers) {
final AccountPreferenceController accountPrefController =
new AccountPreferenceController(
context, parent, authorities, ProfileSelectFragment.ProfileType.PERSONAL);
new AccountPreferenceController(context, parent, authorities,
ProfileSelectFragment.ProfileType.PERSONAL);
if (parent != null) {
parent.getSettingsLifecycle().addObserver(accountPrefController);
}
@@ -103,15 +91,15 @@ public class AccountPersonalDashboardFragment extends DashboardFragment {
}
// TODO: b/141601408. After featureFlag settings_work_profile is launched, unmark this
// public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
// new BaseSearchIndexProvider(R.xml.accounts_personal_dashboard_settings) {
//
// @Override
// public List<AbstractPreferenceController> createPreferenceControllers(
// Context context) {
// ..Add autofill here too..
// return buildPreferenceControllers(
// context, null /* parent */, null /* authorities*/);
// }
// };
// public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
// new BaseSearchIndexProvider(R.xml.accounts_personal_dashboard_settings) {
//
// @Override
// public List<AbstractPreferenceController> createPreferenceControllers(
// Context context) {
// ..Add autofill here too..
// return buildPreferenceControllers(
// context, null /* parent */, null /* authorities*/);
// }
// };
}

View File

@@ -22,11 +22,9 @@ import static com.android.settings.accounts.AccountDashboardFragment.buildAutofi
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.credentials.CredentialManager;
import com.android.settings.R;
import com.android.settings.applications.autofill.PasswordsPreferenceController;
import com.android.settings.applications.credentials.CredentialManagerPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
import com.android.settings.users.AutoSyncDataPreferenceController;
@@ -36,7 +34,9 @@ import com.android.settingslib.core.AbstractPreferenceController;
import java.util.ArrayList;
import java.util.List;
/** Account Setting page for work profile. */
/**
* Account Setting page for work profile.
*/
public class AccountWorkProfileDashboardFragment extends DashboardFragment {
private static final String TAG = "AccountWorkProfileFrag";
@@ -53,9 +53,6 @@ public class AccountWorkProfileDashboardFragment extends DashboardFragment {
@Override
protected int getPreferenceScreenResId() {
if (CredentialManager.isServiceEnabled()) {
return R.xml.accounts_work_dashboard_settings_credman;
}
return R.xml.accounts_work_dashboard_settings;
}
@@ -67,13 +64,6 @@ public class AccountWorkProfileDashboardFragment extends DashboardFragment {
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (CredentialManager.isServiceEnabled()) {
CredentialManagerPreferenceController cmpp =
use(CredentialManagerPreferenceController.class);
cmpp.setParentFragment(this);
}
getSettingsLifecycle().addObserver(use(PasswordsPreferenceController.class));
}
@@ -87,13 +77,11 @@ public class AccountWorkProfileDashboardFragment extends DashboardFragment {
}
private static void buildAccountPreferenceControllers(
Context context,
DashboardFragment parent,
String[] authorities,
Context context, DashboardFragment parent, String[] authorities,
List<AbstractPreferenceController> controllers) {
final AccountPreferenceController accountPrefController =
new AccountPreferenceController(
context, parent, authorities, ProfileSelectFragment.ProfileType.WORK);
new AccountPreferenceController(context, parent, authorities,
ProfileSelectFragment.ProfileType.WORK);
if (parent != null) {
parent.getSettingsLifecycle().addObserver(accountPrefController);
}
@@ -103,15 +91,15 @@ public class AccountWorkProfileDashboardFragment extends DashboardFragment {
}
// TODO: b/141601408. After featureFlag settings_work_profile is launched, unmark this
// public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
// new BaseSearchIndexProvider(R.xml.accounts_work_dashboard_settings) {
//
// @Override
// public List<AbstractPreferenceController> createPreferenceControllers(
// Context context) {
// ..Add autofill here too..
// return buildPreferenceControllers(
// context, null /* parent */, null /* authorities*/);
// }
// };
// public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
// new BaseSearchIndexProvider(R.xml.accounts_work_dashboard_settings) {
//
// @Override
// public List<AbstractPreferenceController> createPreferenceControllers(
// Context context) {
// ..Add autofill here too..
// return buildPreferenceControllers(
// context, null /* parent */, null /* authorities*/);
// }
// };
}