Merge "Introduce mutable parcelable request to open/close logical channel" am: 3059d36148
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2037108 Change-Id: I80a0a926e396650fce2113f50e1e2031c81c3e9f
This commit is contained in:
@@ -118,6 +118,7 @@ import com.android.internal.telephony.ISms;
|
|||||||
import com.android.internal.telephony.ISub;
|
import com.android.internal.telephony.ISub;
|
||||||
import com.android.internal.telephony.ITelephony;
|
import com.android.internal.telephony.ITelephony;
|
||||||
import com.android.internal.telephony.IUpdateAvailableNetworksCallback;
|
import com.android.internal.telephony.IUpdateAvailableNetworksCallback;
|
||||||
|
import com.android.internal.telephony.IccLogicalChannelRequest;
|
||||||
import com.android.internal.telephony.OperatorInfo;
|
import com.android.internal.telephony.OperatorInfo;
|
||||||
import com.android.internal.telephony.PhoneConstants;
|
import com.android.internal.telephony.PhoneConstants;
|
||||||
import com.android.internal.telephony.RILConstants;
|
import com.android.internal.telephony.RILConstants;
|
||||||
@@ -6784,8 +6785,13 @@ public class TelephonyManager {
|
|||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null) {
|
if (telephony != null) {
|
||||||
return telephony.iccOpenLogicalChannelByPort(slotIndex, DEFAULT_PORT_INDEX,
|
IccLogicalChannelRequest request = new IccLogicalChannelRequest();
|
||||||
getOpPackageName(), aid, p2);
|
request.slotIndex = slotIndex;
|
||||||
|
request.aid = aid;
|
||||||
|
request.p2 = p2;
|
||||||
|
request.callingPackage = getOpPackageName();
|
||||||
|
request.binder = new Binder();
|
||||||
|
return telephony.iccOpenLogicalChannel(request);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
@@ -6852,8 +6858,15 @@ public class TelephonyManager {
|
|||||||
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID, int p2) {
|
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID, int p2) {
|
||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null)
|
if (telephony != null) {
|
||||||
return telephony.iccOpenLogicalChannel(subId, getOpPackageName(), AID, p2);
|
IccLogicalChannelRequest request = new IccLogicalChannelRequest();
|
||||||
|
request.subId = subId;
|
||||||
|
request.callingPackage = getOpPackageName();
|
||||||
|
request.aid = AID;
|
||||||
|
request.p2 = p2;
|
||||||
|
request.binder = new Binder();
|
||||||
|
return telephony.iccOpenLogicalChannel(request);
|
||||||
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
}
|
}
|
||||||
@@ -6883,8 +6896,10 @@ public class TelephonyManager {
|
|||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null) {
|
if (telephony != null) {
|
||||||
return telephony.iccCloseLogicalChannelByPort(slotIndex, DEFAULT_PORT_INDEX,
|
IccLogicalChannelRequest request = new IccLogicalChannelRequest();
|
||||||
channel);
|
request.slotIndex = slotIndex;
|
||||||
|
request.channel = channel;
|
||||||
|
return telephony.iccCloseLogicalChannel(request);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
@@ -6927,8 +6942,12 @@ public class TelephonyManager {
|
|||||||
public boolean iccCloseLogicalChannel(int subId, int channel) {
|
public boolean iccCloseLogicalChannel(int subId, int channel) {
|
||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null)
|
if (telephony != null) {
|
||||||
return telephony.iccCloseLogicalChannel(subId, channel);
|
IccLogicalChannelRequest request = new IccLogicalChannelRequest();
|
||||||
|
request.subId = subId;
|
||||||
|
request.channel = channel;
|
||||||
|
return telephony.iccCloseLogicalChannel(request);
|
||||||
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ import com.android.ims.internal.IImsServiceFeatureCallback;
|
|||||||
import com.android.internal.telephony.CellNetworkScanResult;
|
import com.android.internal.telephony.CellNetworkScanResult;
|
||||||
import com.android.internal.telephony.IBooleanConsumer;
|
import com.android.internal.telephony.IBooleanConsumer;
|
||||||
import com.android.internal.telephony.ICallForwardingInfoCallback;
|
import com.android.internal.telephony.ICallForwardingInfoCallback;
|
||||||
|
import com.android.internal.telephony.IccLogicalChannelRequest;
|
||||||
import com.android.internal.telephony.IImsStateCallback;
|
import com.android.internal.telephony.IImsStateCallback;
|
||||||
import com.android.internal.telephony.IIntegerConsumer;
|
import com.android.internal.telephony.IIntegerConsumer;
|
||||||
import com.android.internal.telephony.INumberVerificationCallback;
|
import com.android.internal.telephony.INumberVerificationCallback;
|
||||||
@@ -584,60 +585,25 @@ interface ITelephony {
|
|||||||
*/
|
*/
|
||||||
void setCellInfoListRate(int rateInMillis);
|
void setCellInfoListRate(int rateInMillis);
|
||||||
|
|
||||||
/**
|
|
||||||
* Opens a logical channel to the ICC card using the physical slot index and port index.
|
|
||||||
*
|
|
||||||
* Input parameters equivalent to TS 27.007 AT+CCHO command.
|
|
||||||
*
|
|
||||||
* @param slotIndex The physical slot index of the target ICC card
|
|
||||||
* @param portIndex The unique index referring to a port belonging to the SIM slot
|
|
||||||
* @param callingPackage the name of the package making the call.
|
|
||||||
* @param AID Application id. See ETSI 102.221 and 101.220.
|
|
||||||
* @param p2 P2 parameter (described in ISO 7816-4).
|
|
||||||
* @return an IccOpenLogicalChannelResponse object.
|
|
||||||
*/
|
|
||||||
IccOpenLogicalChannelResponse iccOpenLogicalChannelByPort(
|
|
||||||
int slotIndex, int portIndex, String callingPackage, String AID, int p2);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens a logical channel to the ICC card.
|
* Opens a logical channel to the ICC card.
|
||||||
*
|
*
|
||||||
* Input parameters equivalent to TS 27.007 AT+CCHO command.
|
* Input parameters equivalent to TS 27.007 AT+CCHO command.
|
||||||
*
|
*
|
||||||
* @param subId The subscription to use.
|
* @param request the parcelable used to indicate how to open the logical channel.
|
||||||
* @param callingPackage the name of the package making the call.
|
|
||||||
* @param AID Application id. See ETSI 102.221 and 101.220.
|
|
||||||
* @param p2 P2 parameter (described in ISO 7816-4).
|
|
||||||
* @return an IccOpenLogicalChannelResponse object.
|
* @return an IccOpenLogicalChannelResponse object.
|
||||||
*/
|
*/
|
||||||
IccOpenLogicalChannelResponse iccOpenLogicalChannel(
|
IccOpenLogicalChannelResponse iccOpenLogicalChannel(in IccLogicalChannelRequest request);
|
||||||
int subId, String callingPackage, String AID, int p2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Closes a previously opened logical channel to the ICC card using the physical slot index and port index.
|
|
||||||
*
|
|
||||||
* Input parameters equivalent to TS 27.007 AT+CCHC command.
|
|
||||||
*
|
|
||||||
* @param slotIndex The physical slot index of the target ICC card
|
|
||||||
* @param portIndex The unique index referring to a port belonging to the SIM slot
|
|
||||||
* @param channel is the channel id to be closed as returned by a
|
|
||||||
* successful iccOpenLogicalChannel.
|
|
||||||
* @return true if the channel was closed successfully.
|
|
||||||
*/
|
|
||||||
boolean iccCloseLogicalChannelByPort(int slotIndex, int portIndex, int channel);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes a previously opened logical channel to the ICC card.
|
* Closes a previously opened logical channel to the ICC card.
|
||||||
*
|
*
|
||||||
* Input parameters equivalent to TS 27.007 AT+CCHC command.
|
* Input parameters equivalent to TS 27.007 AT+CCHC command.
|
||||||
*
|
*
|
||||||
* @param subId The subscription to use.
|
* @param request the parcelable used to indicate how to close the logical channel.
|
||||||
* @param channel is the channel id to be closed as returned by a
|
|
||||||
* successful iccOpenLogicalChannel.
|
|
||||||
* @return true if the channel was closed successfully.
|
* @return true if the channel was closed successfully.
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage(trackingBug = 171933273)
|
boolean iccCloseLogicalChannel(in IccLogicalChannelRequest request);
|
||||||
boolean iccCloseLogicalChannel(int subId, int channel);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transmit an APDU to the ICC card over a logical channel using the physical slot index and port index.
|
* Transmit an APDU to the ICC card over a logical channel using the physical slot index and port index.
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
** Copyright 2007, 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.
|
||||||
|
** You may obtain a copy of the License at
|
||||||
|
**
|
||||||
|
** http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
**
|
||||||
|
** Unless required by applicable law or agreed to in writing, software
|
||||||
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
** See the License for the specific language governing permissions and
|
||||||
|
** limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.internal.telephony;
|
||||||
|
|
||||||
|
import android.os.IBinder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A request to open or close a logical channel to the ICC card.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@JavaDerive(toString=true, equals=true)
|
||||||
|
parcelable IccLogicalChannelRequest {
|
||||||
|
|
||||||
|
/** Subscription id. */
|
||||||
|
int subId = -1;
|
||||||
|
|
||||||
|
/** Physical slot index of the ICC card. */
|
||||||
|
int slotIndex = -1;
|
||||||
|
|
||||||
|
/** The unique index referring to a port belonging to the ICC card slot. */
|
||||||
|
int portIndex = 0;
|
||||||
|
|
||||||
|
/** Package name for the calling app, used only when open channel. */
|
||||||
|
@nullable String callingPackage;
|
||||||
|
|
||||||
|
/** Application id, used only when open channel. */
|
||||||
|
@nullable String aid;
|
||||||
|
|
||||||
|
/** The P2 parameter described in ISO 7816-4, used only when open channel. */
|
||||||
|
int p2 = 0;
|
||||||
|
|
||||||
|
/** Channel number */
|
||||||
|
int channel = -1;
|
||||||
|
|
||||||
|
/** A IBinder object for server side to check if the request client is still living. */
|
||||||
|
@nullable IBinder binder;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user