Strip names out of externally supplied WorkSources to WifiManager (b/10710007).

Change-Id: I69bd7ce9e942c2f9327415b2821d805e1b50a1a4
This commit is contained in:
David Christie
2013-09-13 17:11:53 -07:00
parent 3157e73fb0
commit 6ab2284c98
2 changed files with 13 additions and 0 deletions

View File

@@ -96,6 +96,16 @@ public class WorkSource implements Parcelable {
return mNames != null ? mNames[index] : null;
}
/**
* Clear names from this WorkSource. Uids are left intact.
*
* <p>Useful when combining with another WorkSource that doesn't have names.
* @hide
*/
public void clearNames() {
mNames = null;
}
/**
* Clear this WorkSource to be empty.
*/

View File

@@ -342,6 +342,9 @@ public final class WifiService extends IWifiManager.Stub {
enforceChangePermission();
if (workSource != null) {
enforceWorkSourcePermission();
// WifiManager currently doesn't use names, so need to clear names out of the
// supplied WorkSource to allow future WorkSource combining.
workSource.clearNames();
}
mWifiStateMachine.startScan(Binder.getCallingUid(), workSource);
}