diff options
author | Patrick Rohr <prohr@google.com> | 2022-03-09 13:58:28 +0100 |
---|---|---|
committer | Patrick Rohr <prohr@google.com> | 2022-03-09 14:05:48 +0100 |
commit | efe300c812ac3cd6cae8c6be0a8ca1d877cd640b (patch) | |
tree | c455ead9bc4cb42f0c22558d524b9c75ae703925 | |
parent | f95a2982864df88692d1fa99220ac8774f3b3199 (diff) | |
download | ethernet-efe300c812ac3cd6cae8c6be0a8ca1d877cd640b.tar.gz |
Rename logIfEthernetNotStarted to throwIfEthernetNotStarted
The functions does not log but throws an exception instead. Changing the
name to reflect that.
Test: TH
Change-Id: I6207aababaccc9bc553f7f731e3b8a1d26eb16a1
-rw-r--r-- | java/com/android/server/ethernet/EthernetServiceImpl.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/java/com/android/server/ethernet/EthernetServiceImpl.java b/java/com/android/server/ethernet/EthernetServiceImpl.java index 782ee0f..89ac6e4 100644 --- a/java/com/android/server/ethernet/EthernetServiceImpl.java +++ b/java/com/android/server/ethernet/EthernetServiceImpl.java @@ -80,7 +80,7 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { 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 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { */ @Override public void setConfiguration(String iface, IpConfiguration config) { - logIfEthernetNotStarted(); + throwIfEthernetNotStarted(); PermissionUtils.enforceNetworkStackPermission(mContext); if (mTracker.isRestrictedInterface(iface)) { @@ -229,8 +229,7 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { @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 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { @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 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { @Nullable final IEthernetNetworkManagementListener listener) { Log.i(TAG, "disconnectNetwork called with: iface=" + iface + ", listener=" + listener); Objects.requireNonNull(iface); - logIfEthernetNotStarted(); + throwIfEthernetNotStarted(); if (mTracker.isValidTestInterface(iface)) { enforceManageTestNetworksPermission(); |