diff options
| author | Etan Cohen <etancohen@google.com> | 2017-04-03 17:42:34 -0700 |
|---|---|---|
| committer | Etan Cohen <etancohen@google.com> | 2017-04-21 18:47:35 +0000 |
| commit | 859748f08c42ddff5693c48d17bed633cbfe9cce (patch) | |
| tree | 8a222bf7820976fce23144109781f47b3bba39d7 /core/java | |
| parent | 946410eef568ecb9f3771b9c78b16290e694b10e (diff) | |
[AWARE] Add UID checking to WifiAwareNetworkSpecifier
Wifi Aware networks are per app - i.e. a requestor gets
a dedicated network. Change verifies that the only the
original requestor matches the created network (using UID).
Bug: 36053921
Test: Integration (sl4a) tests
Change-Id: I4ff3994731dd7ccb88e2bea333d1e6905b136f02
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/NetworkSpecifier.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/net/NetworkSpecifier.java b/core/java/android/net/NetworkSpecifier.java index 87a2b05a4430..9ce2a5bd1b54 100644 --- a/core/java/android/net/NetworkSpecifier.java +++ b/core/java/android/net/NetworkSpecifier.java @@ -33,4 +33,20 @@ public abstract class NetworkSpecifier { * @hide */ public abstract boolean satisfiedBy(NetworkSpecifier other); + + /** + * Optional method which can be overriden by concrete implementations of NetworkSpecifier to + * check a self-reported UID. A concrete implementation may contain a UID which would be self- + * reported by the caller (since NetworkSpecifier implementations should be non-mutable). This + * function is called by ConnectivityService and is passed the actual UID of the caller - + * allowing the verification of the self-reported UID. In cases of mismatch the implementation + * should throw a SecurityException. + * + * @param requestorUid The UID of the requestor as obtained from its binder. + * + * @hide + */ + public void assertValidFromUid(int requestorUid) { + // empty + } } |
