Merge "WiFi: Wifi service get configured networks use ParceledListSlice."
am: 8b549c9539
Change-Id: I9ccfbfcf17590284aedd4449022b107c37e5aef2
This commit is contained in:
@@ -16,7 +16,11 @@
|
|||||||
|
|
||||||
package android.net.wifi;
|
package android.net.wifi;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.pm.ParceledListSlice;
|
||||||
|
|
||||||
import android.net.wifi.hotspot2.PasspointConfiguration;
|
import android.net.wifi.hotspot2.PasspointConfiguration;
|
||||||
|
|
||||||
import android.net.wifi.WifiConfiguration;
|
import android.net.wifi.WifiConfiguration;
|
||||||
import android.net.wifi.WifiInfo;
|
import android.net.wifi.WifiInfo;
|
||||||
import android.net.wifi.ScanSettings;
|
import android.net.wifi.ScanSettings;
|
||||||
@@ -51,9 +55,9 @@ interface IWifiManager
|
|||||||
*/
|
*/
|
||||||
oneway void requestActivityInfo(in ResultReceiver result);
|
oneway void requestActivityInfo(in ResultReceiver result);
|
||||||
|
|
||||||
List<WifiConfiguration> getConfiguredNetworks();
|
ParceledListSlice getConfiguredNetworks();
|
||||||
|
|
||||||
List<WifiConfiguration> getPrivilegedConfiguredNetworks();
|
ParceledListSlice getPrivilegedConfiguredNetworks();
|
||||||
|
|
||||||
WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult);
|
WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult);
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.annotation.SdkConstant.SdkConstantType;
|
|||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.ParceledListSlice;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.DhcpInfo;
|
import android.net.DhcpInfo;
|
||||||
import android.net.Network;
|
import android.net.Network;
|
||||||
@@ -46,6 +47,7 @@ import com.android.server.net.NetworkPinner;
|
|||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides the primary API for managing all aspects of Wi-Fi
|
* This class provides the primary API for managing all aspects of Wi-Fi
|
||||||
@@ -811,7 +813,12 @@ public class WifiManager {
|
|||||||
*/
|
*/
|
||||||
public List<WifiConfiguration> getConfiguredNetworks() {
|
public List<WifiConfiguration> getConfiguredNetworks() {
|
||||||
try {
|
try {
|
||||||
return mService.getConfiguredNetworks();
|
ParceledListSlice<WifiConfiguration> parceledList =
|
||||||
|
mService.getConfiguredNetworks();
|
||||||
|
if (parceledList == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return parceledList.getList();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
@@ -821,7 +828,12 @@ public class WifiManager {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
public List<WifiConfiguration> getPrivilegedConfiguredNetworks() {
|
public List<WifiConfiguration> getPrivilegedConfiguredNetworks() {
|
||||||
try {
|
try {
|
||||||
return mService.getPrivilegedConfiguredNetworks();
|
ParceledListSlice<WifiConfiguration> parceledList =
|
||||||
|
mService.getPrivilegedConfiguredNetworks();
|
||||||
|
if (parceledList == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return parceledList.getList();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user