API review: access field by method
- InvalidPacketException, public field should be a method so
add getter to get error code.
- KeepalivePacketData, public fields should be methods so
add getter for fields.
Bug: 151322799
Test: atest FrameworksNetTests
atest FrameworksWifiTests
atest FrameworksTelephonyTests: some failure in CarrierAppUtilsTest
Change-Id: Id01e6135193716cc21bba11da529bf1507a954f7
This commit is contained in:
parent
13097923fa
commit
c3e9562525
1 changed files with 66 additions and 32 deletions
|
|
@ -28,7 +28,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
*/
|
||||
@SystemApi
|
||||
public class InvalidPacketException extends Exception {
|
||||
public final int error;
|
||||
private final int mError;
|
||||
|
||||
// Must match SocketKeepalive#ERROR_INVALID_IP_ADDRESS.
|
||||
/** Invalid IP address. */
|
||||
|
|
@ -56,6 +56,11 @@ public class InvalidPacketException extends Exception {
|
|||
* See the error code for details.
|
||||
*/
|
||||
public InvalidPacketException(@ErrorCode final int error) {
|
||||
this.error = error;
|
||||
this.mError = error;
|
||||
}
|
||||
|
||||
/** Get error code. */
|
||||
public int getError() {
|
||||
return mError;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue