Rename logIfEthernetNotStarted to throwIfEthernetNotStarted am: 038c80551e am: 6a90204a43
Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/net/ethernet/+/2018415
Change-Id: I07c6e66ccb8f294f87d3b008a707fe5c9191f9cf
diff --git a/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java b/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java
index 782ee0f..89ac6e4 100644
--- a/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java
+++ b/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java
@@ -80,7 +80,7 @@
mStarted.set(true);
}
- private void logIfEthernetNotStarted() {
+ private void throwIfEthernetNotStarted() {
if (!mStarted.get()) {
throw new IllegalStateException("System isn't ready to change ethernet configurations");
}
@@ -111,7 +111,7 @@
*/
@Override
public void setConfiguration(String iface, IpConfiguration config) {
- logIfEthernetNotStarted();
+ throwIfEthernetNotStarted();
PermissionUtils.enforceNetworkStackPermission(mContext);
if (mTracker.isRestrictedInterface(iface)) {
@@ -229,8 +229,7 @@
@Nullable final IEthernetNetworkManagementListener listener) {
Objects.requireNonNull(iface);
Objects.requireNonNull(request);
- // TODO: rename to throwIfEthernetNotStarted.
- logIfEthernetNotStarted();
+ throwIfEthernetNotStarted();
if (mTracker.isValidTestInterface(iface)) {
enforceManageTestNetworksPermission();
@@ -255,7 +254,7 @@
@Nullable final IEthernetNetworkManagementListener listener) {
Log.i(TAG, "connectNetwork called with: iface=" + iface + ", listener=" + listener);
Objects.requireNonNull(iface);
- logIfEthernetNotStarted();
+ throwIfEthernetNotStarted();
if (mTracker.isValidTestInterface(iface)) {
enforceManageTestNetworksPermission();
@@ -273,7 +272,7 @@
@Nullable final IEthernetNetworkManagementListener listener) {
Log.i(TAG, "disconnectNetwork called with: iface=" + iface + ", listener=" + listener);
Objects.requireNonNull(iface);
- logIfEthernetNotStarted();
+ throwIfEthernetNotStarted();
if (mTracker.isValidTestInterface(iface)) {
enforceManageTestNetworksPermission();