diff options
author | Hugo Benichi <hugobenichi@google.com> | 2018-08-08 13:43:03 +0900 |
---|---|---|
committer | Hugo Benichi <hugobenichi@google.com> | 2018-11-07 22:38:17 +0900 |
commit | 185481355ca669cd3c8a9e7bab5ca78a13f1551f (patch) | |
tree | 8642c421381b936abded3582702177d84c31cfa8 /service | |
parent | 60f3e78cefae1f0d59de16e2744840571598350b (diff) |
WiFi: Migrate WifiServiceImpl to use AbstractWifiService
Bug: 112338174
Test: Compiled, flashed marlin, booted. WiFi works.
Change-Id: I832bddb738155ab7aa6e57ea87016329723effb4
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 4b1766d79..c32ab65ea 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -61,7 +61,6 @@ import android.net.ip.IpClient; import android.net.wifi.INetworkRequestMatchCallback; import android.net.wifi.ISoftApCallback; import android.net.wifi.ITrafficStateCallback; -import android.net.wifi.IWifiManager; import android.net.wifi.ScanResult; import android.net.wifi.WifiActivityEnergyInfo; import android.net.wifi.WifiConfiguration; @@ -136,7 +135,7 @@ import java.util.concurrent.ConcurrentHashMap; * * @hide */ -public class WifiServiceImpl extends IWifiManager.Stub { +public class WifiServiceImpl extends AbstractWifiService { private static final String TAG = "WifiService"; private static final boolean VDBG = false; @@ -559,11 +558,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { // If we are already disabled (could be due to airplane mode), avoid changing persist // state here if (wifiEnabled) { - try { - setWifiEnabled(mContext.getPackageName(), wifiEnabled); - } catch (RemoteException e) { - /* ignore - local call */ - } + setWifiEnabled(mContext.getPackageName(), wifiEnabled); } } @@ -784,8 +779,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { * started or is already in the queue. */ @Override - public synchronized boolean setWifiEnabled(String packageName, boolean enable) - throws RemoteException { + public synchronized boolean setWifiEnabled(String packageName, boolean enable) { if (enforceChangePermission(packageName) != MODE_ALLOWED) { return false; } @@ -2338,7 +2332,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { * an AsyncChannel communication with WifiService */ @Override - public Messenger getWifiServiceMessenger(String packageName) throws RemoteException { + public Messenger getWifiServiceMessenger(String packageName) { enforceAccessPermission(); if (enforceChangePermission(packageName) != MODE_ALLOWED) { // We don't have a good way of creating a fake Messenger, and returning null would @@ -2385,8 +2379,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { } }; - private boolean startConsentUi(String packageName, - int callingUid, String intentAction) throws RemoteException { + private boolean startConsentUi(String packageName, int callingUid, String intentAction) { if (UserHandle.getAppId(callingUid) == Process.SYSTEM_UID || checkWifiPermissionWhenWirelessConsentRequired()) { return false; @@ -2410,7 +2403,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { mContext.startActivity(intent); return true; } catch (PackageManager.NameNotFoundException e) { - throw new RemoteException(e.getMessage()); + throw new RemoteException(e.getMessage()).rethrowFromSystemServer(); } } |