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

Commit 6023a99a authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Added getServiceState API to TelephonyManager."

parents 118af28d 39daf8d6
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -4848,4 +4848,21 @@ public class TelephonyManager {
        }
        return null;
    }

    /**
     * Returns the service state information on specified subscription. Callers require
     * either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE to retrieve the information.
     * @hide
     */
    public ServiceState getServiceStateForSubscriber(int subId) {
        try {
            ITelephony service = getITelephony();
            if (service != null) {
                return service.getServiceStateForSubscriber(subId, getOpPackageName());
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#getServiceStateForSubscriber", e);
        }
        return null;
    }
}
 No newline at end of file
+10 −1
Original line number Diff line number Diff line
@@ -21,9 +21,10 @@ import android.os.Bundle;
import android.telecom.PhoneAccount;
import android.telephony.CellInfo;
import android.telephony.IccOpenLogicalChannelResponse;
import android.telephony.ModemActivityInfo;
import android.telephony.NeighboringCellInfo;
import android.telephony.RadioAccessFamily;
import android.telephony.ModemActivityInfo;
import android.telephony.ServiceState;
import com.android.internal.telephony.CellNetworkScanResult;
import com.android.internal.telephony.OperatorInfo;
import java.util.List;
@@ -1005,4 +1006,12 @@ interface ITelephony {
     * Return the modem activity info.
     */
    ModemActivityInfo getModemActivityInfo();

    /**
     * Get the service state on specified subscription
     * @param subId Subscription id
     * @param callingPackage The package making the call
     * @return Service state on specified subscription.
     */
    ServiceState getServiceStateForSubscriber(int subId, String callingPackage);
}