summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorDavid Su <dysu@google.com>2020-07-08 12:57:54 -0700
committerDavid Su <dysu@google.com>2020-08-07 00:13:37 +0000
commitc4713c9006b236bf1c7d0bf82b50bfb6b1eb53b6 (patch)
tree73a56e03a9c4d555e24e72359396e6561078491e /service
parentcc45059e81a75488313073896dd9de0e25379a5f (diff)
ScanRequestProxy: Return copy of list in getScanResults
Return a copy of internal list to prevent external modification. Bug: 160751554 Test: atest FrameworksWifiTests Change-Id: Id7f8c05160d0d480077327d56dec03080708b375 Merged-In: Id7f8c05160d0d480077327d56dec03080708b375 (cherry picked from commit 48e1bcfb68371999d968c4527791d302be3140b4)
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/ScanRequestProxy.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/ScanRequestProxy.java b/service/java/com/android/server/wifi/ScanRequestProxy.java
index c054b90a4..622fcdab9 100644
--- a/service/java/com/android/server/wifi/ScanRequestProxy.java
+++ b/service/java/com/android/server/wifi/ScanRequestProxy.java
@@ -464,7 +464,8 @@ public class ScanRequestProxy {
* @return the list of results
*/
public List<ScanResult> getScanResults() {
- return mLastScanResults;
+ // return a copy to prevent external modification
+ return new ArrayList<>(mLastScanResults);
}
/**