[Settings] Support search of each Sim slot status within about phone
Support searching of each SIM slot status within about phone page. Bug: 260540995 Test: auto and local Change-Id: If905fc595af566665fb1077a5ce11a967f7487aa
This commit is contained in:
@@ -31,6 +31,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.network.SubscriptionUtil;
|
||||
import com.android.settingslib.Utils;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -159,4 +160,28 @@ public class SimStatusPreferenceController extends BasePreferenceController {
|
||||
Preference createNewPreference(Context context) {
|
||||
return new Preference(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDynamicRawDataToIndex(List<SearchIndexableRaw> rawData) {
|
||||
int simSlot = getSimSlotIndex();
|
||||
SubscriptionInfo subInfo = getSubscriptionInfo(simSlot);
|
||||
if (subInfo == null) {
|
||||
/**
|
||||
* Only add to search when SIM is active
|
||||
* (presented in SIM Slot Status as availavle.)
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
/* Have different search keywork when comes to eSIM */
|
||||
int keywordId = subInfo.isEmbedded() ?
|
||||
R.string.keywords_sim_status_esim : R.string.keywords_sim_status;
|
||||
|
||||
SearchIndexableRaw data = new SearchIndexableRaw(mContext);
|
||||
data.key = getPreferenceKey();
|
||||
data.title = getPreferenceTitle(simSlot);
|
||||
data.screenTitle = mContext.getString(R.string.about_settings);
|
||||
data.keywords = mContext.getString(keywordId).toString();
|
||||
rawData.add(data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user