Loading AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1609,9 +1609,14 @@ android:excludeFromRecents="true" android:theme="@*android:style/Theme.Holo.Light.Dialog.Alert"> <intent-filter> <!-- TODO this filter can be removed --> <action android:name="android.nfc.cardemulation.ACTION_CHANGE_DEFAULT" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="Settings$NotificationAccessSettingsActivity" Loading src/com/android/settings/nfc/PaymentBackend.java +4 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.nfc.NfcAdapter; import android.nfc.cardemulation.ApduServiceInfo; import android.nfc.cardemulation.CardEmulationManager; import android.nfc.cardemulation.CardEmulation; import android.provider.Settings; import java.util.ArrayList; Loading @@ -40,19 +40,19 @@ public class PaymentBackend { private final Context mContext; private final NfcAdapter mAdapter; private final CardEmulationManager mCardEmuManager; private final CardEmulation mCardEmuManager; public PaymentBackend(Context context) { mContext = context; mAdapter = NfcAdapter.getDefaultAdapter(context); mCardEmuManager = CardEmulationManager.getInstance(mAdapter); mCardEmuManager = CardEmulation.getInstance(mAdapter); } public List<PaymentAppInfo> getPaymentAppInfos() { PackageManager pm = mContext.getPackageManager(); List<ApduServiceInfo> serviceInfos = mCardEmuManager.getServices(CardEmulationManager.CATEGORY_PAYMENT); mCardEmuManager.getServices(CardEmulation.CATEGORY_PAYMENT); List<PaymentAppInfo> appInfos = new ArrayList<PaymentAppInfo>(); if (serviceInfos == null) return appInfos; Loading src/com/android/settings/nfc/PaymentDefaultDialog.java +4 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.nfc.cardemulation.CardEmulationManager; import android.nfc.cardemulation.CardEmulation; import android.os.Bundle; import android.util.Log; Loading @@ -47,8 +47,8 @@ public final class PaymentDefaultDialog extends AlertActivity implements mBackend = new PaymentBackend(this); Intent intent = getIntent(); ComponentName component = intent.getParcelableExtra( CardEmulationManager.EXTRA_SERVICE_COMPONENT); String category = intent.getStringExtra(CardEmulationManager.EXTRA_CATEGORY); CardEmulation.EXTRA_SERVICE_COMPONENT); String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY); setResult(RESULT_CANCELED); if (!buildDialog(component, category)) { Loading @@ -75,7 +75,7 @@ public final class PaymentDefaultDialog extends AlertActivity implements return false; } if (!CardEmulationManager.CATEGORY_PAYMENT.equals(category)) { if (!CardEmulation.CATEGORY_PAYMENT.equals(category)) { Log.e(TAG, "Don't support defaults for category " + category); return false; } Loading src/com/android/settings/nfc/PaymentSettings.java +0 −15 Original line number Diff line number Diff line Loading @@ -55,23 +55,10 @@ public class PaymentSettings extends SettingsPreferenceFragment implements for (PaymentAppInfo appInfo : appInfos) { PaymentAppPreference preference = new PaymentAppPreference(getActivity(), appInfo, this); // If for some reason isAuto gets out of sync, clear out app default preference.setIcon(appInfo.icon); preference.setTitle(appInfo.caption); screen.addPreference(preference); } if (appInfos.size() > 1) { PaymentAppInfo appInfo = new PaymentAppInfo(); appInfo.icon = null; appInfo.componentName = null; appInfo.isDefault = !(mPaymentBackend.getDefaultPaymentApp() != null); // Add "Ask every time" option PaymentAppPreference preference = new PaymentAppPreference(getActivity(), appInfo, this); preference.setIcon(null); preference.setTitle(R.string.nfc_payment_ask); screen.addPreference(preference); } } setPreferenceScreen(screen); } Loading @@ -82,8 +69,6 @@ public class PaymentSettings extends SettingsPreferenceFragment implements PaymentAppInfo appInfo = (PaymentAppInfo) v.getTag(); if (appInfo.componentName != null) { mPaymentBackend.setDefaultPaymentApp(appInfo.componentName); } else { mPaymentBackend.setDefaultPaymentApp(null); } refresh(); } Loading Loading
AndroidManifest.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1609,9 +1609,14 @@ android:excludeFromRecents="true" android:theme="@*android:style/Theme.Holo.Light.Dialog.Alert"> <intent-filter> <!-- TODO this filter can be removed --> <action android:name="android.nfc.cardemulation.ACTION_CHANGE_DEFAULT" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="Settings$NotificationAccessSettingsActivity" Loading
src/com/android/settings/nfc/PaymentBackend.java +4 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.nfc.NfcAdapter; import android.nfc.cardemulation.ApduServiceInfo; import android.nfc.cardemulation.CardEmulationManager; import android.nfc.cardemulation.CardEmulation; import android.provider.Settings; import java.util.ArrayList; Loading @@ -40,19 +40,19 @@ public class PaymentBackend { private final Context mContext; private final NfcAdapter mAdapter; private final CardEmulationManager mCardEmuManager; private final CardEmulation mCardEmuManager; public PaymentBackend(Context context) { mContext = context; mAdapter = NfcAdapter.getDefaultAdapter(context); mCardEmuManager = CardEmulationManager.getInstance(mAdapter); mCardEmuManager = CardEmulation.getInstance(mAdapter); } public List<PaymentAppInfo> getPaymentAppInfos() { PackageManager pm = mContext.getPackageManager(); List<ApduServiceInfo> serviceInfos = mCardEmuManager.getServices(CardEmulationManager.CATEGORY_PAYMENT); mCardEmuManager.getServices(CardEmulation.CATEGORY_PAYMENT); List<PaymentAppInfo> appInfos = new ArrayList<PaymentAppInfo>(); if (serviceInfos == null) return appInfos; Loading
src/com/android/settings/nfc/PaymentDefaultDialog.java +4 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.nfc.cardemulation.CardEmulationManager; import android.nfc.cardemulation.CardEmulation; import android.os.Bundle; import android.util.Log; Loading @@ -47,8 +47,8 @@ public final class PaymentDefaultDialog extends AlertActivity implements mBackend = new PaymentBackend(this); Intent intent = getIntent(); ComponentName component = intent.getParcelableExtra( CardEmulationManager.EXTRA_SERVICE_COMPONENT); String category = intent.getStringExtra(CardEmulationManager.EXTRA_CATEGORY); CardEmulation.EXTRA_SERVICE_COMPONENT); String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY); setResult(RESULT_CANCELED); if (!buildDialog(component, category)) { Loading @@ -75,7 +75,7 @@ public final class PaymentDefaultDialog extends AlertActivity implements return false; } if (!CardEmulationManager.CATEGORY_PAYMENT.equals(category)) { if (!CardEmulation.CATEGORY_PAYMENT.equals(category)) { Log.e(TAG, "Don't support defaults for category " + category); return false; } Loading
src/com/android/settings/nfc/PaymentSettings.java +0 −15 Original line number Diff line number Diff line Loading @@ -55,23 +55,10 @@ public class PaymentSettings extends SettingsPreferenceFragment implements for (PaymentAppInfo appInfo : appInfos) { PaymentAppPreference preference = new PaymentAppPreference(getActivity(), appInfo, this); // If for some reason isAuto gets out of sync, clear out app default preference.setIcon(appInfo.icon); preference.setTitle(appInfo.caption); screen.addPreference(preference); } if (appInfos.size() > 1) { PaymentAppInfo appInfo = new PaymentAppInfo(); appInfo.icon = null; appInfo.componentName = null; appInfo.isDefault = !(mPaymentBackend.getDefaultPaymentApp() != null); // Add "Ask every time" option PaymentAppPreference preference = new PaymentAppPreference(getActivity(), appInfo, this); preference.setIcon(null); preference.setTitle(R.string.nfc_payment_ask); screen.addPreference(preference); } } setPreferenceScreen(screen); } Loading @@ -82,8 +69,6 @@ public class PaymentSettings extends SettingsPreferenceFragment implements PaymentAppInfo appInfo = (PaymentAppInfo) v.getTag(); if (appInfo.componentName != null) { mPaymentBackend.setDefaultPaymentApp(appInfo.componentName); } else { mPaymentBackend.setDefaultPaymentApp(null); } refresh(); } Loading