Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4302dfa8 authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by Andre Eisenbach
Browse files

nfc: Make tap & pay searchable



Bug: 26818511
Test: make RunSettingsRoboTests -j40; no regression
Change-Id: I2e79fcac984510cb444fcaf0cca8f64f9822c047
Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
parent c4a4c944
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5998,6 +5998,7 @@
    <string name="keywords_profile_challenge">work challenge, work, profile</string>
    <string name="keywords_unification">work profile, managed profile, unify, unification, work, profile</string>
    <string name="keywords_gesture">gesture</string>
    <string name="keywords_payment_settings">pay, tap, payments</string>
    <!-- NFC Wi-Fi pairing/setup strings-->
+24 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.nfc;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.support.v7.preference.PreferenceManager;
@@ -31,13 +32,18 @@ import android.view.ViewGroup;

import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settings.search.SearchIndexableRaw;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.nfc.PaymentBackend.PaymentAppInfo;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;

public class PaymentSettings extends SettingsPreferenceFragment {
public class PaymentSettings extends SettingsPreferenceFragment implements Indexable {
    public static final String TAG = "PaymentSettings";
    private PaymentBackend mPaymentBackend;

@@ -132,4 +138,21 @@ public class PaymentSettings extends SettingsPreferenceFragment {
            return new SummaryProvider(activity, summaryLoader);
        }
    };

    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
        new BaseSearchIndexProvider() {
            @Override
            public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
                final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>();
                final Resources res = context.getResources();

                // Add fragment title
                SearchIndexableRaw data = new SearchIndexableRaw(context);
                data.title = res.getString(R.string.nfc_payment_settings_title);
                data.screenTitle = res.getString(R.string.nfc_payment_settings_title);
                data.keywords = res.getString(R.string.keywords_payment_settings);
                result.add(data);
                return result;
            }
    };
}
+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import com.android.settings.inputmethod.InputMethodAndLanguageSettings;
import com.android.settings.location.LocationSettings;
import com.android.settings.location.ScanningSettings;
import com.android.settings.network.NetworkDashboardFragment;
import com.android.settings.nfc.PaymentSettings;
import com.android.settings.notification.ConfigureNotificationSettings;
import com.android.settings.notification.OtherSoundSettings;
import com.android.settings.notification.SoundSettings;
@@ -154,6 +155,7 @@ public final class SearchIndexableResources {
        addIndex(StorageDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_storage);
        addIndex(ConnectedDeviceDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_bt_laptop);
        addIndex(EnterprisePrivacySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_about);
        addIndex(PaymentSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_nfc_payment);
    }

    private SearchIndexableResources() {