diff options
author | Ganesh Deva <ganesh.deva_1@nxp.com> | 2020-07-22 19:31:58 +0530 |
---|---|---|
committer | nxf24591 <nanjesh.s_1@nxp.com> | 2020-09-08 17:44:08 +0530 |
commit | 92ebc087ebaf6e52446b6c26cd9d41451d14e5b3 (patch) | |
tree | 95dad30641170cc06e282bc66917ea597eebbaf9 | |
parent | bacbd07ba01ccf1e4d88345b274fabc71fdc2c00 (diff) |
Code sync to aosp branch
Sync internal branch code refactor to aosp.
-rwxr-xr-x | src/com/android/se/SecureElementService.java | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/com/android/se/SecureElementService.java b/src/com/android/se/SecureElementService.java index 7f544e3..2451c4e 100755 --- a/src/com/android/se/SecureElementService.java +++ b/src/com/android/se/SecureElementService.java @@ -194,11 +194,15 @@ public final class SecureElementService extends Service { private void addTerminals(String terminalName) { int index = 1; String name = null; + if (terminalName.startsWith(SecureElementService.UICC_TERMINAL)) { + index = mActiveSimCount + 1; + } try { do { name = terminalName + Integer.toString(index); Terminal terminal = new Terminal(name, this); + Log.i(mTag, "Check if terminal " + name + " is available."); // Only retry on fail for the first terminal of each type. terminal.initialize(index == 1); mTerminals.put(name, terminal); @@ -220,7 +224,6 @@ public final class SecureElementService extends Service { } private void refreshUiccTerminals(int activeSimCount) { - int index = 1; String name = null; synchronized (this) { if (activeSimCount < mActiveSimCount) { @@ -238,21 +241,7 @@ public final class SecureElementService extends Service { mActiveSimCount = activeSimCount; } else if (activeSimCount > mActiveSimCount) { // Try to initialize new UICC terminals - try { - index = mActiveSimCount + 1; - do { - name = UICC_TERMINAL + Integer.toString(index); - Log.i(mTag, "Check if terminal " + name + " is available."); - Terminal terminal = new Terminal(name, this); - terminal.initialize(true); - mTerminals.put(name, terminal); - mActiveSimCount = index; - } while (++index <= activeSimCount); - } catch (NoSuchElementException e) { - Log.i(mTag, "No HAL implementation for " + name); - } catch (RemoteException | RuntimeException e) { - Log.e(mTag, "Error in getService() for " + name); - } + addTerminals(UICC_TERMINAL); } } } |