Loading core/java/android/se/omapi/Channel.java +7 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ package android.se.omapi; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.util.Log; import java.io.IOException; Loading Loading @@ -168,8 +169,10 @@ public class Channel { throw new IOException("Error in communicating with Secure Element"); } return response; } catch (RemoteException e) { } catch (ServiceSpecificException e) { throw new IOException(e.getMessage()); } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } Loading Loading @@ -244,8 +247,10 @@ public class Channel { synchronized (mLock) { return mChannel.selectNext(); } } catch (RemoteException e) { } catch (ServiceSpecificException e) { throw new IOException(e.getMessage()); } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } core/java/android/se/omapi/Reader.java +5 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ package android.se.omapi; import android.annotation.NonNull; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.util.Log; import java.io.IOException; Loading @@ -45,8 +46,7 @@ public class Reader { private final Object mLock = new Object(); Reader(SEService service, String name, ISecureElementReader reader) throws IOException { Reader(SEService service, String name, ISecureElementReader reader) { if (reader == null || service == null || name == null) { throw new IllegalArgumentException("Parameters cannot be null"); } Loading Loading @@ -96,8 +96,10 @@ public class Reader { ISecureElementSession session; try { session = mReader.openSession(); } catch (RemoteException e) { } catch (ServiceSpecificException e) { throw new IOException(e.getMessage()); } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } if (session == null) { throw new IOException("service session is null."); Loading core/java/android/se/omapi/SEService.java +17 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,23 @@ import java.util.HashMap; */ public class SEService { /** * Error code used with ServiceSpecificException. * Thrown if there was an error communicating with the Secure Element. * * @hide */ public static final int IO_ERROR = 1; /** * Error code used with ServiceSpecificException. * Thrown if AID cannot be selected or is not available when opening * a logical channel. * * @hide */ public static final int NO_SUCH_ELEMENT_ERROR = 2; private static final String TAG = "OMAPI.SEService"; private final Object mLock = new Object(); Loading core/java/android/se/omapi/Session.java +19 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ package android.se.omapi; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.util.Log; import java.io.IOException; Loading Loading @@ -207,8 +208,16 @@ public class Session { return null; } return new Channel(mService, this, channel); } catch (RemoteException e) { } catch (ServiceSpecificException e) { if (e.errorCode == SEService.IO_ERROR) { throw new IOException(e.getMessage()); } else if (e.errorCode == SEService.NO_SUCH_ELEMENT_ERROR) { throw new NoSuchElementException(e.getMessage()); } else { throw new IllegalStateException(e.getMessage()); } } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } Loading Loading @@ -311,8 +320,16 @@ public class Session { return null; } return new Channel(mService, this, channel); } catch (RemoteException e) { } catch (ServiceSpecificException e) { if (e.errorCode == SEService.IO_ERROR) { throw new IOException(e.getMessage()); } else if (e.errorCode == SEService.NO_SUCH_ELEMENT_ERROR) { throw new NoSuchElementException(e.getMessage()); } else { throw new IllegalStateException(e.getMessage()); } } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } Loading Loading
core/java/android/se/omapi/Channel.java +7 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ package android.se.omapi; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.util.Log; import java.io.IOException; Loading Loading @@ -168,8 +169,10 @@ public class Channel { throw new IOException("Error in communicating with Secure Element"); } return response; } catch (RemoteException e) { } catch (ServiceSpecificException e) { throw new IOException(e.getMessage()); } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } Loading Loading @@ -244,8 +247,10 @@ public class Channel { synchronized (mLock) { return mChannel.selectNext(); } } catch (RemoteException e) { } catch (ServiceSpecificException e) { throw new IOException(e.getMessage()); } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } }
core/java/android/se/omapi/Reader.java +5 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ package android.se.omapi; import android.annotation.NonNull; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.util.Log; import java.io.IOException; Loading @@ -45,8 +46,7 @@ public class Reader { private final Object mLock = new Object(); Reader(SEService service, String name, ISecureElementReader reader) throws IOException { Reader(SEService service, String name, ISecureElementReader reader) { if (reader == null || service == null || name == null) { throw new IllegalArgumentException("Parameters cannot be null"); } Loading Loading @@ -96,8 +96,10 @@ public class Reader { ISecureElementSession session; try { session = mReader.openSession(); } catch (RemoteException e) { } catch (ServiceSpecificException e) { throw new IOException(e.getMessage()); } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } if (session == null) { throw new IOException("service session is null."); Loading
core/java/android/se/omapi/SEService.java +17 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,23 @@ import java.util.HashMap; */ public class SEService { /** * Error code used with ServiceSpecificException. * Thrown if there was an error communicating with the Secure Element. * * @hide */ public static final int IO_ERROR = 1; /** * Error code used with ServiceSpecificException. * Thrown if AID cannot be selected or is not available when opening * a logical channel. * * @hide */ public static final int NO_SUCH_ELEMENT_ERROR = 2; private static final String TAG = "OMAPI.SEService"; private final Object mLock = new Object(); Loading
core/java/android/se/omapi/Session.java +19 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ package android.se.omapi; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceSpecificException; import android.util.Log; import java.io.IOException; Loading Loading @@ -207,8 +208,16 @@ public class Session { return null; } return new Channel(mService, this, channel); } catch (RemoteException e) { } catch (ServiceSpecificException e) { if (e.errorCode == SEService.IO_ERROR) { throw new IOException(e.getMessage()); } else if (e.errorCode == SEService.NO_SUCH_ELEMENT_ERROR) { throw new NoSuchElementException(e.getMessage()); } else { throw new IllegalStateException(e.getMessage()); } } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } Loading Loading @@ -311,8 +320,16 @@ public class Session { return null; } return new Channel(mService, this, channel); } catch (RemoteException e) { } catch (ServiceSpecificException e) { if (e.errorCode == SEService.IO_ERROR) { throw new IOException(e.getMessage()); } else if (e.errorCode == SEService.NO_SUCH_ELEMENT_ERROR) { throw new NoSuchElementException(e.getMessage()); } else { throw new IllegalStateException(e.getMessage()); } } catch (RemoteException e) { throw new IllegalStateException(e.getMessage()); } } } Loading