Merge "Fixed all APIs not meeting API review requirement"

This commit is contained in:
Treehugger Robot
2019-03-03 04:27:32 +00:00
committed by Gerrit Code Review
7 changed files with 43 additions and 28 deletions

View File

@@ -3133,8 +3133,8 @@ package android.net {
public class LinkAddress implements android.os.Parcelable { public class LinkAddress implements android.os.Parcelable {
ctor public LinkAddress(java.net.InetAddress, int, int, int); ctor public LinkAddress(java.net.InetAddress, int, int, int);
ctor public LinkAddress(java.net.InetAddress, int); ctor public LinkAddress(@NonNull java.net.InetAddress, int);
ctor public LinkAddress(String); ctor public LinkAddress(@NonNull String);
ctor public LinkAddress(String, int, int); ctor public LinkAddress(String, int, int);
method public boolean isGlobalPreferred(); method public boolean isGlobalPreferred();
method public boolean isIPv4(); method public boolean isIPv4();
@@ -6070,7 +6070,7 @@ package android.telephony {
public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable { public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable {
ctor public NetworkService.NetworkServiceProvider(int); ctor public NetworkService.NetworkServiceProvider(int);
method public abstract void close(); method public abstract void close();
method public void getNetworkRegistrationState(int, android.telephony.NetworkServiceCallback); method public void getNetworkRegistrationState(int, @NonNull android.telephony.NetworkServiceCallback);
method public final int getSlotId(); method public final int getSlotId();
method public final void notifyNetworkRegistrationStateChanged(); method public final void notifyNetworkRegistrationStateChanged();
} }
@@ -6251,12 +6251,12 @@ package android.telephony {
} }
public class ServiceState implements android.os.Parcelable { public class ServiceState implements android.os.Parcelable {
method public android.telephony.NetworkRegistrationState getNetworkRegistrationState(int, int); method @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationState(int, int);
method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(); method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates();
method @Deprecated public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(int); method @Deprecated @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(int);
method @Deprecated public android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int); method @Deprecated @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int);
method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int); method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int);
method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int); method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int);
field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2 field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3 field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0 field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
@@ -6563,9 +6563,9 @@ package android.telephony.data {
method public void getDataCallList(@NonNull android.telephony.data.DataServiceCallback); method public void getDataCallList(@NonNull android.telephony.data.DataServiceCallback);
method public final int getSlotId(); method public final int getSlotId();
method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>); method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
method public void setDataProfile(java.util.List<android.telephony.data.DataProfile>, boolean, @Nullable android.telephony.data.DataServiceCallback); method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @Nullable android.telephony.data.DataServiceCallback);
method public void setInitialAttachApn(android.telephony.data.DataProfile, boolean, @Nullable android.telephony.data.DataServiceCallback); method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @Nullable android.telephony.data.DataServiceCallback);
method public void setupDataCall(int, android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @Nullable android.telephony.data.DataServiceCallback); method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @Nullable android.telephony.data.DataServiceCallback);
} }
public class DataServiceCallback { public class DataServiceCallback {
@@ -6584,7 +6584,7 @@ package android.telephony.data {
public abstract class QualifiedNetworksService extends android.app.Service { public abstract class QualifiedNetworksService extends android.app.Service {
ctor public QualifiedNetworksService(); ctor public QualifiedNetworksService();
method public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int); method @NonNull public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int);
field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService"; field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService";
} }
@@ -6592,7 +6592,7 @@ package android.telephony.data {
ctor public QualifiedNetworksService.NetworkAvailabilityUpdater(int); ctor public QualifiedNetworksService.NetworkAvailabilityUpdater(int);
method public abstract void close(); method public abstract void close();
method public final int getSlotIndex(); method public final int getSlotIndex();
method public final void updateQualifiedNetworkTypes(int, int[]); method public final void updateQualifiedNetworkTypes(int, @Nullable int[]);
} }
} }

View File

@@ -626,8 +626,8 @@ package android.net {
public class LinkAddress implements android.os.Parcelable { public class LinkAddress implements android.os.Parcelable {
ctor public LinkAddress(java.net.InetAddress, int, int, int); ctor public LinkAddress(java.net.InetAddress, int, int, int);
ctor public LinkAddress(java.net.InetAddress, int); ctor public LinkAddress(@NonNull java.net.InetAddress, int);
ctor public LinkAddress(String); ctor public LinkAddress(@NonNull String);
ctor public LinkAddress(String, int, int); ctor public LinkAddress(String, int, int);
method public boolean isGlobalPreferred(); method public boolean isGlobalPreferred();
method public boolean isIPv4(); method public boolean isIPv4();

View File

@@ -25,6 +25,7 @@ import static android.system.OsConstants.RT_SCOPE_LINK;
import static android.system.OsConstants.RT_SCOPE_SITE; import static android.system.OsConstants.RT_SCOPE_SITE;
import static android.system.OsConstants.RT_SCOPE_UNIVERSE; import static android.system.OsConstants.RT_SCOPE_UNIVERSE;
import android.annotation.NonNull;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.TestApi; import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage; import android.annotation.UnsupportedAppUsage;
@@ -177,7 +178,7 @@ public class LinkAddress implements Parcelable {
*/ */
@SystemApi @SystemApi
@TestApi @TestApi
public LinkAddress(InetAddress address, int prefixLength) { public LinkAddress(@NonNull InetAddress address, int prefixLength) {
this(address, prefixLength, 0, 0); this(address, prefixLength, 0, 0);
this.scope = scopeForUnicastAddress(address); this.scope = scopeForUnicastAddress(address);
} }
@@ -196,12 +197,12 @@ public class LinkAddress implements Parcelable {
/** /**
* Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or * Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or
* "2001:db8::1/64". The flags are set to zero and the scope is determined from the address. * "2001:db8::1/64". The flags are set to zero and the scope is determined from the address.
* @param string The string to parse. * @param address The string to parse.
* @hide * @hide
*/ */
@SystemApi @SystemApi
@TestApi @TestApi
public LinkAddress(String address) { public LinkAddress(@NonNull String address) {
this(address, 0, 0); this(address, 0, 0);
this.scope = scopeForUnicastAddress(this.address); this.scope = scopeForUnicastAddress(this.address);
} }
@@ -209,7 +210,7 @@ public class LinkAddress implements Parcelable {
/** /**
* Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or * Constructs a new {@code LinkAddress} from a string such as "192.0.2.5/24" or
* "2001:db8::1/64", with the specified flags and scope. * "2001:db8::1/64", with the specified flags and scope.
* @param string The string to parse. * @param address The string to parse.
* @param flags The address flags. * @param flags The address flags.
* @param scope The address scope. * @param scope The address scope.
* @hide * @hide

View File

@@ -26,6 +26,7 @@ import android.os.IBinder;
import android.os.Looper; import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.os.RemoteException; import android.os.RemoteException;
import android.telephony.NetworkRegistrationState.Domain;
import android.util.SparseArray; import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
@@ -99,11 +100,12 @@ public abstract class NetworkService extends Service {
/** /**
* API to get network registration state. The result will be passed to the callback. * API to get network registration state. The result will be passed to the callback.
* @param domain * @param domain Network domain
* @param callback * @param callback The callback for reporting network registration state
* @return SIM slot id the network service associated with. * @return SIM slot id the network service associated with.
*/ */
public void getNetworkRegistrationState(int domain, NetworkServiceCallback callback) { public void getNetworkRegistrationState(@Domain int domain,
@NonNull NetworkServiceCallback callback) {
callback.onGetNetworkRegistrationStateComplete( callback.onGetNetworkRegistrationStateComplete(
NetworkServiceCallback.RESULT_ERROR_UNSUPPORTED, null); NetworkServiceCallback.RESULT_ERROR_UNSUPPORTED, null);
} }

View File

@@ -17,6 +17,8 @@
package android.telephony; package android.telephony;
import android.annotation.IntDef; import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.annotation.TestApi; import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage; import android.annotation.UnsupportedAppUsage;
@@ -1760,6 +1762,7 @@ public class ServiceState implements Parcelable {
* @return List of {@link NetworkRegistrationState} * @return List of {@link NetworkRegistrationState}
* @hide * @hide
*/ */
@NonNull
@SystemApi @SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStates() { public List<NetworkRegistrationState> getNetworkRegistrationStates() {
synchronized (mNetworkRegistrationStates) { synchronized (mNetworkRegistrationStates) {
@@ -1776,6 +1779,7 @@ public class ServiceState implements Parcelable {
* *
* @deprecated Use {@link #getNetworkRegistrationStatesFromTransportType(int)} * @deprecated Use {@link #getNetworkRegistrationStatesFromTransportType(int)}
*/ */
@NonNull
@Deprecated @Deprecated
@SystemApi @SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStates(int transportType) { public List<NetworkRegistrationState> getNetworkRegistrationStates(int transportType) {
@@ -1789,6 +1793,7 @@ public class ServiceState implements Parcelable {
* @return List of {@link NetworkRegistrationState} * @return List of {@link NetworkRegistrationState}
* @hide * @hide
*/ */
@NonNull
@SystemApi @SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStatesForTransportType( public List<NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(
int transportType) { int transportType) {
@@ -1812,6 +1817,7 @@ public class ServiceState implements Parcelable {
* @return List of {@link NetworkRegistrationState} * @return List of {@link NetworkRegistrationState}
* @hide * @hide
*/ */
@NonNull
@SystemApi @SystemApi
public List<NetworkRegistrationState> getNetworkRegistrationStatesForDomain( public List<NetworkRegistrationState> getNetworkRegistrationStatesForDomain(
@Domain int domain) { @Domain int domain) {
@@ -1838,6 +1844,7 @@ public class ServiceState implements Parcelable {
* *
* @deprecated Use {@link #getNetworkRegistrationState(int, int)} * @deprecated Use {@link #getNetworkRegistrationState(int, int)}
*/ */
@Nullable
@Deprecated @Deprecated
@SystemApi @SystemApi
public NetworkRegistrationState getNetworkRegistrationStates(@Domain int domain, public NetworkRegistrationState getNetworkRegistrationStates(@Domain int domain,
@@ -1854,6 +1861,7 @@ public class ServiceState implements Parcelable {
* @hide * @hide
* *
*/ */
@Nullable
@SystemApi @SystemApi
public NetworkRegistrationState getNetworkRegistrationState(@Domain int domain, public NetworkRegistrationState getNetworkRegistrationState(@Domain int domain,
int transportType) { int transportType) {

View File

@@ -152,8 +152,9 @@ public abstract class DataService extends Service {
* @param callback The result callback for this request. Null if the client does not care * @param callback The result callback for this request. Null if the client does not care
* about the result. * about the result.
*/ */
public void setupDataCall(int accessNetworkType, DataProfile dataProfile, boolean isRoaming, public void setupDataCall(int accessNetworkType, @NonNull DataProfile dataProfile,
boolean allowRoaming, @SetupDataReason int reason, boolean isRoaming, boolean allowRoaming,
@SetupDataReason int reason,
@Nullable LinkProperties linkProperties, @Nullable LinkProperties linkProperties,
@Nullable DataServiceCallback callback) { @Nullable DataServiceCallback callback) {
// The default implementation is to return unsupported. // The default implementation is to return unsupported.
@@ -192,7 +193,7 @@ public abstract class DataService extends Service {
* @param callback The result callback for this request. Null if the client does not care * @param callback The result callback for this request. Null if the client does not care
* about the result. * about the result.
*/ */
public void setInitialAttachApn(DataProfile dataProfile, boolean isRoaming, public void setInitialAttachApn(@NonNull DataProfile dataProfile, boolean isRoaming,
@Nullable DataServiceCallback callback) { @Nullable DataServiceCallback callback) {
// The default implementation is to return unsupported. // The default implementation is to return unsupported.
if (callback != null) { if (callback != null) {
@@ -211,7 +212,7 @@ public abstract class DataService extends Service {
* @param callback The result callback for this request. Null if the client does not care * @param callback The result callback for this request. Null if the client does not care
* about the result. * about the result.
*/ */
public void setDataProfile(List<DataProfile> dps, boolean isRoaming, public void setDataProfile(@NonNull List<DataProfile> dps, boolean isRoaming,
@Nullable DataServiceCallback callback) { @Nullable DataServiceCallback callback) {
// The default implementation is to return unsupported. // The default implementation is to return unsupported.
if (callback != null) { if (callback != null) {

View File

@@ -16,6 +16,8 @@
package android.telephony.data; package android.telephony.data;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.app.Service; import android.app.Service;
import android.content.Intent; import android.content.Intent;
@@ -132,7 +134,7 @@ public abstract class QualifiedNetworksService extends Service {
* for data setup. * for data setup.
*/ */
public final void updateQualifiedNetworkTypes(@ApnType int apnTypes, public final void updateQualifiedNetworkTypes(@ApnType int apnTypes,
int[] qualifiedNetworkTypes) { @Nullable int[] qualifiedNetworkTypes) {
mHandler.obtainMessage(QNS_UPDATE_QUALIFIED_NETWORKS, mSlotIndex, apnTypes, mHandler.obtainMessage(QNS_UPDATE_QUALIFIED_NETWORKS, mSlotIndex, apnTypes,
qualifiedNetworkTypes).sendToTarget(); qualifiedNetworkTypes).sendToTarget();
} }
@@ -233,6 +235,7 @@ public abstract class QualifiedNetworksService extends Service {
* @param slotIndex SIM slot index the qualified networks service associated with. * @param slotIndex SIM slot index the qualified networks service associated with.
* @return Qualified networks service instance * @return Qualified networks service instance
*/ */
@NonNull
public abstract NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int slotIndex); public abstract NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int slotIndex);
/** @hide */ /** @hide */