summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-09-27 01:43:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-09-27 01:43:36 +0000
commit87caa81508c8d21a9cba9d0237a1376eb7873af9 (patch)
tree8c7a9e05a237168c4bdea77e8bbd55ad7917e341 /service
parent827b4f26f625ba20483e9e30f4dc5b5b95b1fcc9 (diff)
parentd0925f6d6adb94d11bb1348a388a7069b67ce206 (diff)
Merge "WifiServiceImpl: Ignore null binder objects"
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java14
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java12
2 files changed, 7 insertions, 19 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 535d2f4b2..488f8feeb 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -6180,9 +6180,9 @@ public class ClientModeImpl extends StateMachine {
/**
* Trigger network connection and provide status via the provided callback.
*/
- public void connect(WifiConfiguration config, int netId, IBinder binder,
+ public void connect(WifiConfiguration config, int netId, @Nullable IBinder binder,
@Nullable IActionListener callback, int callbackIdentifier, int callingUid) {
- if (callback != null) {
+ if (callback != null && binder != null) {
synchronized (mProcessingActionListeners) {
mProcessingActionListeners.add(binder, callback, callbackIdentifier);
}
@@ -6195,9 +6195,9 @@ public class ClientModeImpl extends StateMachine {
/**
* Trigger network save and provide status via the provided callback.
*/
- public void save(WifiConfiguration config, IBinder binder, @Nullable IActionListener callback,
- int callbackIdentifier, int callingUid) {
- if (callback != null) {
+ public void save(WifiConfiguration config, @Nullable IBinder binder,
+ @Nullable IActionListener callback, int callbackIdentifier, int callingUid) {
+ if (callback != null && binder != null) {
synchronized (mProcessingActionListeners) {
mProcessingActionListeners.add(binder, callback, callbackIdentifier);
}
@@ -6210,9 +6210,9 @@ public class ClientModeImpl extends StateMachine {
/**
* Trigger network forget and provide status via the provided callback.
*/
- public void forget(int netId, IBinder binder, @Nullable IActionListener callback,
+ public void forget(int netId, @Nullable IBinder binder, @Nullable IActionListener callback,
int callbackIdentifier, int callingUid) {
- if (callback != null) {
+ if (callback != null && binder != null) {
synchronized (mProcessingActionListeners) {
mProcessingActionListeners.add(binder, callback, callbackIdentifier);
}
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 6bab1eafe..7f16bb34f 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -3252,10 +3252,6 @@ public class WifiServiceImpl extends BaseWifiService {
@Override
public void connect(WifiConfiguration config, int netId, IBinder binder,
@Nullable IActionListener callback, int callbackIdentifier) {
- // verify arguments
- if (binder == null) {
- throw new IllegalArgumentException("Binder must not be null");
- }
if (!isPrivileged(Binder.getCallingPid(), Binder.getCallingUid())) {
throw new SecurityException(TAG + ": Permission denied");
}
@@ -3273,10 +3269,6 @@ public class WifiServiceImpl extends BaseWifiService {
@Override
public void save(WifiConfiguration config, IBinder binder, @Nullable IActionListener callback,
int callbackIdentifier) {
- // verify arguments
- if (binder == null) {
- throw new IllegalArgumentException("Binder must not be null");
- }
if (!isPrivileged(Binder.getCallingPid(), Binder.getCallingUid())) {
throw new SecurityException(TAG + ": Permission denied");
}
@@ -3293,10 +3285,6 @@ public class WifiServiceImpl extends BaseWifiService {
@Override
public void forget(int netId, IBinder binder, @Nullable IActionListener callback,
int callbackIdentifier) {
- // verify arguments
- if (binder == null) {
- throw new IllegalArgumentException("Binder must not be null");
- }
if (!isPrivileged(Binder.getCallingPid(), Binder.getCallingUid())) {
throw new SecurityException(TAG + ": Permission denied");
}