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

Commit 34eacbbf authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "nfc(api): Pass package name to reader, discovery AIDL calls" into main

parents 14a533a8 498e9ae5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ interface INfcAdapter

    void dispatch(in Tag tag);

    void setReaderMode (IBinder b, IAppCallback callback, int flags, in Bundle extras);
    void setReaderMode (IBinder b, IAppCallback callback, int flags, in Bundle extras, String pkg);

    void addNfcUnlockHandler(INfcUnlockHandler unlockHandler, in int[] techList);
    void removeNfcUnlockHandler(INfcUnlockHandler unlockHandler);
@@ -100,7 +100,7 @@ interface INfcAdapter
    void unregisterWlcStateListener(in INfcWlcStateListener listener);
    WlcListenerDeviceInfo getWlcListenerDeviceInfo();

    void updateDiscoveryTechnology(IBinder b, int pollFlags, int listenFlags);
    void updateDiscoveryTechnology(IBinder b, int pollFlags, int listenFlags, String pkg);

    void notifyPollingLoop(in PollingFrame frame);
    void notifyHceDeactivated();
+4 −2
Original line number Diff line number Diff line
@@ -236,7 +236,8 @@ public final class NfcActivityManager extends IAppCallback.Stub

    public void setReaderMode(Binder token, int flags, Bundle extras) {
        if (DBG) Log.d(TAG, "Setting reader mode");
        NfcAdapter.callService(() -> NfcAdapter.sService.setReaderMode(token, this, flags, extras));
        NfcAdapter.callService(() -> NfcAdapter.sService.setReaderMode(
                token, this, flags, extras, mAdapter.getContext().getPackageName()));
    }

    /**
@@ -395,7 +396,8 @@ public final class NfcActivityManager extends IAppCallback.Stub

    private void changeDiscoveryTech(Binder token, int pollTech, int listenTech) {
        NfcAdapter.callService(
            () -> NfcAdapter.sService.updateDiscoveryTechnology(token, pollTech, listenTech));
                () -> NfcAdapter.sService.updateDiscoveryTechnology(
                        token, pollTech, listenTech, mAdapter.getContext().getPackageName()));
    }

}
+4 −2
Original line number Diff line number Diff line
@@ -1731,7 +1731,8 @@ public final class NfcAdapter {
        }
        Binder token = new Binder();
        int flags = enable ? ENABLE_POLLING_FLAGS : DISABLE_POLLING_FLAGS;
        callService(() -> sService.setReaderMode(token, null, flags, null));
        callService(() -> sService.setReaderMode(
                token, null, flags, null, mContext.getPackageName()));
    }

    /**
@@ -1804,7 +1805,8 @@ public final class NfcAdapter {
                || (listenTechnology & FLAG_SET_DEFAULT_TECH) == FLAG_SET_DEFAULT_TECH)) {
            Binder token = new Binder();
            callService( () ->
                sService.updateDiscoveryTechnology(token, pollTechnology, listenTechnology));
                    sService.updateDiscoveryTechnology(
                            token, pollTechnology, listenTechnology, mContext.getPackageName()));
        } else {
            mNfcActivityManager.setDiscoveryTech(activity, pollTechnology, listenTechnology);
        }