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

Commit c9d4ee11 authored by Chen Xu's avatar Chen Xu
Browse files

new telephony annotation class

This is a preparatory work for mainline. since Intdef is hidden, so we
have to move some annotations (applied in SDK/system API) to a separate
annotation class and having other module statically link to it.

TODO: include telephony annotation in framework-non-updatable-sources

Bug: 140908357
Test: Build
Change-Id: I37f8a0624bbf27f264870ee9dbf03d3aaa5cadc1
parent 0234e05c
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -21,23 +21,25 @@ import android.net.NetworkCapabilities;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.telephony.Annotation;
import android.telephony.Annotation.ApnType;
import android.telephony.Annotation.CallState;
import android.telephony.Annotation.DataActivityType;
import android.telephony.Annotation.DataFailureCause;
import android.telephony.Annotation.DataState;
import android.telephony.Annotation.NetworkType;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SimActivationState;
import android.telephony.Annotation.SrvccState;
import android.telephony.CallQuality;
import android.telephony.CellInfo;
import android.telephony.DataFailCause;
import android.telephony.DisconnectCause;
import android.telephony.PhoneCapability;
import android.telephony.PreciseCallState.State;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager.CallState;
import android.telephony.TelephonyManager.DataActivityType;
import android.telephony.TelephonyManager.DataState;
import android.telephony.TelephonyManager.NetworkType;
import android.telephony.TelephonyManager.RadioPowerState;
import android.telephony.TelephonyManager.SimActivationState;
import android.telephony.data.ApnSetting;
import android.telephony.data.ApnSetting.ApnType;
import android.telephony.ims.ImsReasonInfo;
import com.android.internal.telephony.ITelephonyRegistry;
import java.util.List;
@@ -410,7 +412,7 @@ public class TelephonyRegistryManager {
     * @hide
     */
    public void notifyPreciseDataConnectionFailed(int subId, int slotIndex, String apnType,
        String apn, @DataFailCause.FailCause int failCause) {
        String apn, @DataFailureCause int failCause) {
        try {
            sRegistry.notifyPreciseDataConnectionFailed(slotIndex, subId, apnType, apn, failCause);
        } catch (RemoteException ex) {
@@ -427,7 +429,7 @@ public class TelephonyRegistryManager {
     *
     * @hide
     */
    public void notifySrvccStateChanged(int subId, @TelephonyManager.SrvccState int state) {
    public void notifySrvccStateChanged(int subId, @SrvccState int state) {
        try {
            sRegistry.notifySrvccStateChanged(subId, state);
        } catch (RemoteException ex) {
+8 −6
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.os.UserHandle;
import android.telephony.Annotation.DataFailureCause;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SrvccState;
import android.telephony.CallAttributes;
import android.telephony.CallQuality;
import android.telephony.CellInfo;
@@ -245,7 +248,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {

    private int mActiveDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;

    @TelephonyManager.RadioPowerState
    @RadioPowerState
    private int mRadioPowerState = TelephonyManager.RADIO_POWER_UNAVAILABLE;

    private final LocalLog mLocalLog = new LocalLog(100);
@@ -1718,7 +1721,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }

    public void notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType,
            String apn, @DataFailCause.FailCause int failCause) {
            String apn, @DataFailureCause int failCause) {
        if (!checkNotifyPermission("notifyPreciseDataConnectionFailed()")) {
            return;
        }
@@ -1748,7 +1751,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }

    @Override
    public void notifySrvccStateChanged(int subId, @TelephonyManager.SrvccState int state) {
    public void notifySrvccStateChanged(int subId, @SrvccState int state) {
        if (!checkNotifyPermission("notifySrvccStateChanged()")) {
            return;
        }
@@ -1855,8 +1858,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
    }

    public void notifyRadioPowerStateChanged(int phoneId, int subId,
                                             @TelephonyManager.RadioPowerState int state) {
    public void notifyRadioPowerStateChanged(int phoneId, int subId, @RadioPowerState int state) {
        if (!checkNotifyPermission("notifyRadioPowerStateChanged()")) {
            return;
        }
@@ -2227,7 +2229,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {

    private void broadcastPreciseDataConnectionStateChanged(int state, int networkType,
            String apnType, String apn, LinkProperties linkProperties,
            @DataFailCause.FailCause int failCause) {
            @DataFailureCause int failCause) {
        Intent intent = new Intent(TelephonyManager.ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED);
        intent.putExtra(PhoneConstants.STATE_KEY, state);
        intent.putExtra(PhoneConstants.DATA_NETWORK_TYPE_KEY, networkType);
+2 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.telephony.Annotation.CallState;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@@ -1412,7 +1413,7 @@ public class TelecomManager {
     * @hide
     */
    @SystemApi
    public @TelephonyManager.CallState int getCallState() {
    public @CallState int getCallState() {
        try {
            if (isServiceConnected()) {
                return getTelecomService().getCallState();
+472 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.TelephonyManager.NetworkType;

import android.telephony.Annotation.NetworkType;
import java.util.Objects;

/**
Loading