Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9945067 authored by Oscar Shu's avatar Oscar Shu Committed by Android (Google) Code Review
Browse files

Merge "Catch NullPointer caused by race of setting mWifiCond" into main

parents 19181a03 a1168029
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -718,6 +718,9 @@ public class WifiNl80211Manager {
        } catch (RemoteException e1) {
            Log.e(TAG, "Failed to get IClientInterface due to remote exception");
            return false;
        } catch (NullPointerException e2) {
            Log.e(TAG, "setupInterfaceForClientMode NullPointerException");
            return false;
        }

        if (clientInterface == null) {
@@ -785,6 +788,9 @@ public class WifiNl80211Manager {
        } catch (RemoteException e1) {
            Log.e(TAG, "Failed to teardown client interface due to remote exception");
            return false;
        } catch (NullPointerException e2) {
            Log.e(TAG, "tearDownClientInterface NullPointerException");
            return false;
        }
        if (!success) {
            Log.e(TAG, "Failed to teardown client interface");
@@ -816,6 +822,9 @@ public class WifiNl80211Manager {
        } catch (RemoteException e1) {
            Log.e(TAG, "Failed to get IApInterface due to remote exception");
            return false;
        } catch (NullPointerException e2) {
            Log.e(TAG, "setupInterfaceForSoftApMode NullPointerException");
            return false;
        }

        if (apInterface == null) {
@@ -854,6 +863,9 @@ public class WifiNl80211Manager {
        } catch (RemoteException e1) {
            Log.e(TAG, "Failed to teardown AP interface due to remote exception");
            return false;
        } catch (NullPointerException e2) {
            Log.e(TAG, "tearDownSoftApInterface NullPointerException");
            return false;
        }
        if (!success) {
            Log.e(TAG, "Failed to teardown AP interface");
@@ -1328,6 +1340,8 @@ public class WifiNl80211Manager {
            }
        } catch (RemoteException e1) {
            Log.e(TAG, "Failed to request getChannelsForBand due to remote exception");
        } catch (NullPointerException e2) {
            Log.e(TAG, "getChannelsMhzForBand NullPointerException");
        }
        if (result == null) {
            result = new int[0];
@@ -1352,7 +1366,8 @@ public class WifiNl80211Manager {
     */
    @Nullable public DeviceWiphyCapabilities getDeviceWiphyCapabilities(@NonNull String ifaceName) {
        if (mWificond == null) {
            Log.e(TAG, "getDeviceWiphyCapabilities: mWificond binder is null! Did wificond die?");
            Log.e(TAG, "getDeviceWiphyCapabilities: mWificond binder is null! "
                    + "Did wificond die?");
            return null;
        }

@@ -1360,6 +1375,9 @@ public class WifiNl80211Manager {
            return mWificond.getDeviceWiphyCapabilities(ifaceName);
        } catch (RemoteException e) {
            return null;
        } catch (NullPointerException e2) {
            Log.e(TAG, "getDeviceWiphyCapabilities NullPointerException");
            return null;
        }
    }

@@ -1409,6 +1427,8 @@ public class WifiNl80211Manager {
            Log.i(TAG, "Receive country code change to " + newCountryCode);
        } catch (RemoteException re) {
            re.rethrowFromSystemServer();
        } catch (NullPointerException e) {
            new RemoteException("Wificond service doesn't exist!").rethrowFromSystemServer();
        }
    }