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

Commit 20e7bcc0 authored by Puneet Mishra's avatar Puneet Mishra Committed by Gerrit Code Review
Browse files

frameworks/base: Support for third party NFC features

Integration of below modifications are necessary to support
third party NFC software:

* a new interface in INfcAdapter.aidl allowing vendor specific
  extensions and features
* a new size for MIFARE Classic tags
* a modified constructor to distinguish MIFARE Classic tags
  from NfcA tags
* allowing extensions to AidGroup and changing the protection
  of the instance variables to package protected

Change-Id: Ic11dc68c4ea83262c705ec50b75b5808aa064f82
(integrated from commit 57a001b7851c97d41f042dda643f9a87aa6306e5)
parent cb48836d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,6 +31,7 @@ import android.nfc.INfcTag;
import android.nfc.INfcCardEmulation;
import android.nfc.INfcUnlockHandler;
import android.os.Bundle;
import android.os.IBinder;

/**
 * @hide
@@ -37,6 +41,7 @@ interface INfcAdapter
    INfcTag getNfcTagInterface();
    INfcCardEmulation getNfcCardEmulationInterface();
    INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg);
    IBinder getNfcAdapterVendorInterface(in String vendor);

    int getState();
    boolean disable(boolean saveState);
+7 −4
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
@@ -37,7 +40,7 @@ import android.util.Log;
 *
 * @hide
 */
public final class AidGroup implements Parcelable {
public class AidGroup implements Parcelable {
    /**
     * The maximum number of AIDs that can be present in any one group.
     */
@@ -45,9 +48,9 @@ public final class AidGroup implements Parcelable {

    static final String TAG = "AidGroup";

    final List<String> aids;
    final String category;
    final String description;
    protected List<String> aids;
    protected String category;
    protected String description;

    /**
     * Creates a new AidGroup object.
+6 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 NXP Semiconductors
 * The original Work has been changed by NXP Semiconductors.
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -173,6 +175,10 @@ public final class MifareClassic extends BasicTagTechnology {
            mType = TYPE_CLASSIC;
            mSize = SIZE_4K;
            break;
        case 0x19:
            mType = TYPE_CLASSIC;
            mSize = SIZE_2K;
            break;
        case 0x28:
            mType = TYPE_CLASSIC;
            mSize = SIZE_1K;
+11 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 NXP Semiconductors
 * The original Work has been changed by NXP Semiconductors.
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,8 +68,15 @@ public final class NfcA extends BasicTagTechnology {
    /** @hide */
    public NfcA(Tag tag) throws RemoteException {
        super(tag, TagTechnology.NFC_A);
        Bundle extras = tag.getTechExtras(TagTechnology.NFC_A);
        Bundle extras;
        mSak = 0;
        if(tag.hasTech(TagTechnology.MIFARE_CLASSIC))
        {
            extras = tag.getTechExtras(TagTechnology.MIFARE_CLASSIC);
            mSak = extras.getShort(EXTRA_SAK);
        }
        extras = tag.getTechExtras(TagTechnology.NFC_A);
        mSak |= extras.getShort(EXTRA_SAK);
        mAtqa = extras.getByteArray(EXTRA_ATQA);
    }