diff options
author | Roshan Pius <rpius@google.com> | 2016-02-12 14:09:02 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2016-02-17 09:11:15 -0800 |
commit | 1fb0a78b06041b918fdf55173d026efc315ee574 (patch) | |
tree | a309722288c2362d734ad304f735153106a69f8b /service | |
parent | a2a3c5080bb6ccf6afbb8599d00b948963bfb23a (diff) |
WifiService: Store UIDs for WifiLock/Multicaster
Store the UID of the calling user in the WifiLock/Multicaster object and
print it in the toString method of both.
Restructure the DeathRecipient class to only hold the information that
is common to WifiLock/Multicaster.
BUG: 27149817
Change-Id: I14031f9badaffc7ba9d952719f61ff0a7d80c5a1
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 0bc8bb38a..aec904484 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -1477,8 +1477,13 @@ public class WifiServiceImpl extends IWifiManager.Stub { } private class WifiLock extends DeathRecipient { + int mMode; + WorkSource mWorkSource; + WifiLock(int lockMode, String tag, IBinder binder, WorkSource ws) { - super(lockMode, tag, binder, ws); + super(tag, binder); + mMode = lockMode; + mWorkSource = ws; } public void binderDied() { @@ -1488,7 +1493,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { } public String toString() { - return "WifiLock{" + mTag + " type=" + mMode + " binder=" + mBinder + "}"; + return "WifiLock{" + mTag + " type=" + mMode + " uid=" + mUid + "}"; } } @@ -1711,16 +1716,14 @@ public class WifiServiceImpl extends IWifiManager.Stub { private abstract class DeathRecipient implements IBinder.DeathRecipient { String mTag; - int mMode; + int mUid; IBinder mBinder; - WorkSource mWorkSource; - DeathRecipient(int mode, String tag, IBinder binder, WorkSource ws) { + DeathRecipient(String tag, IBinder binder) { super(); mTag = tag; - mMode = mode; + mUid = Binder.getCallingUid(); mBinder = binder; - mWorkSource = ws; try { mBinder.linkToDeath(this, 0); } catch (RemoteException e) { @@ -1731,11 +1734,15 @@ public class WifiServiceImpl extends IWifiManager.Stub { void unlinkDeathRecipient() { mBinder.unlinkToDeath(this, 0); } + + public int getUid() { + return mUid; + } } private class Multicaster extends DeathRecipient { Multicaster(String tag, IBinder binder) { - super(Binder.getCallingUid(), tag, binder, null); + super(tag, binder); } public void binderDied() { @@ -1743,17 +1750,13 @@ public class WifiServiceImpl extends IWifiManager.Stub { synchronized (mMulticasters) { int i = mMulticasters.indexOf(this); if (i != -1) { - removeMulticasterLocked(i, mMode); + removeMulticasterLocked(i, mUid); } } } public String toString() { - return "Multicaster{" + mTag + " binder=" + mBinder + "}"; - } - - public int getUid() { - return mMode; + return "Multicaster{" + mTag + " uid=" + mUid + "}"; } } |