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

Commit b1a00f59 authored by Shawn Willden's avatar Shawn Willden
Browse files

Add nullability annotations to ISecureElementService et al

The Java OMAPI implementation passes and expects null pointers for
many arguments/return values, which means the Rust native
implementation must as well to be compatible.  But the Rust AIDL
backend does not allow arguments/returns to be nullable without the
appropriate annotation.  This CL provides the required annotations.

Note that the build flag is not actually used because AIDL doesn't
support flagging.

Bug: 380331467
Test: atest CtsOmapiTestCases
Flag: build.RELEASE_NATIVE_OMAPI
Change-Id: Ia8aedeb2d1cbf6f450ae9879771a304c5be5705a
parent 4063c9d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,5 +41,5 @@ aidl_interface {
            imports: [],
        },
    ],

    frozen: false,
}
+2 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021, The Android Open Source Project
 * Copyright (C) 2017, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ interface ISecureElementChannel {
  void close();
  boolean isClosed();
  boolean isBasicChannel();
  byte[] getSelectResponse();
  @nullable byte[] getSelectResponse();
  byte[] transmit(in byte[] command);
  boolean selectNext();
}
+1 −1
Original line number Diff line number Diff line
@@ -41,5 +41,5 @@ package android.se.omapi;
interface ISecureElementService {
  String[] getReaders();
  android.se.omapi.ISecureElementReader getReader(in String reader);
  boolean[] isNfcEventAllowed(in String reader, in byte[] aid, in String[] packageNames, in int userId);
  @nullable boolean[] isNfcEventAllowed(in String reader, in @nullable byte[] aid, in @nullable String[] packageNames, in int userId);
}
+3 −3
Original line number Diff line number Diff line
@@ -39,10 +39,10 @@ package android.se.omapi;
/* @hide */
@VintfStability
interface ISecureElementSession {
  byte[] getAtr();
  @nullable byte[] getAtr();
  void close();
  void closeChannels();
  boolean isClosed();
  android.se.omapi.ISecureElementChannel openBasicChannel(in byte[] aid, in byte p2, in android.se.omapi.ISecureElementListener listener);
  android.se.omapi.ISecureElementChannel openLogicalChannel(in byte[] aid, in byte p2, in android.se.omapi.ISecureElementListener listener);
  @nullable android.se.omapi.ISecureElementChannel openBasicChannel(in @nullable byte[] aid, in byte p2, in android.se.omapi.ISecureElementListener listener);
  @nullable android.se.omapi.ISecureElementChannel openLogicalChannel(in @nullable byte[] aid, in byte p2, in android.se.omapi.ISecureElementListener listener);
}
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ interface ISecureElementChannel {
     * bytes in the following order:
     * [<first data byte>, ..., <last data byte>, <sw1>, <sw2>]
     */
    byte[] getSelectResponse();
    @nullable byte[] getSelectResponse();

    /**
     * Transmits the specified command APDU and returns the response APDU.
Loading