Search in sources :

Example 6 with IPhoneSubInfo

use of com.android.internal.telephony.IPhoneSubInfo in project android_frameworks_base by crdroidandroid.

the class TelephonyManager method getNai.

/**
     * Returns the NAI. Return null if NAI is not available.
     *
     *  @param slotId of which Nai is returned
     */
/** {@hide}*/
public String getNai(int slotId) {
    int[] subId = SubscriptionManager.getSubId(slotId);
    try {
        IPhoneSubInfo info = getSubscriberInfo();
        if (info == null)
            return null;
        String nai = info.getNaiForSubscriber(subId[0], mContext.getOpPackageName());
        if (Log.isLoggable(TAG, Log.VERBOSE)) {
            Rlog.v(TAG, "Nai = " + nai);
        }
        return nai;
    } catch (RemoteException ex) {
        return null;
    } catch (NullPointerException ex) {
        return null;
    }
}
Also used : IPhoneSubInfo(com.android.internal.telephony.IPhoneSubInfo) RemoteException(android.os.RemoteException)

Aggregations

RemoteException (android.os.RemoteException)6 IPhoneSubInfo (com.android.internal.telephony.IPhoneSubInfo)6 ITelephony (com.android.internal.telephony.ITelephony)2