Fix Settings search result 'add an account' does nothing.
Tap 'add an account' from search results will launch ChooseAccountFragment, this way doesn't invoke AddAccountSettings and the add account service of gms won't be triggered, so the items on the fragment will do nothing. Move the key word to the search synonym of AccountDashboardFragment and remove it from ChooseAccountFragment, the search result will invoke AccountDashboardFragment. Fixes: 133511289 Test: maunal Change-Id: I67fa004c4965da37c59cada6ca27752e9fe7202b
This commit is contained in:
@@ -20,15 +20,11 @@ import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.search.Indexable;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -36,7 +32,6 @@ import java.util.List;
|
||||
/**
|
||||
* Activity asking a user to select an account to be set up.
|
||||
*/
|
||||
@SearchIndexable
|
||||
public class ChooseAccountFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "ChooseAccountFragment";
|
||||
@@ -84,24 +79,4 @@ public class ChooseAccountFragment extends DashboardFragment {
|
||||
controllers.add(new EnterpriseDisclosurePreferenceController(context));
|
||||
return controllers;
|
||||
}
|
||||
|
||||
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
|
||||
boolean enabled) {
|
||||
final ArrayList<SearchIndexableResource> result = new ArrayList<>();
|
||||
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.add_account_settings;
|
||||
result.add(sir);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AbstractPreferenceController> createPreferenceControllers(
|
||||
Context context) {
|
||||
return buildControllers(context);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user