Add a little logging to diagnose wifi cycle bug
Hiroshi approved (with serious code review). bug: 2171575
This commit is contained in:
@@ -1702,8 +1702,10 @@ public class WifiService extends IWifiManager.Stub {
|
||||
}
|
||||
|
||||
private boolean acquireWifiLockLocked(WifiLock wifiLock) {
|
||||
Log.d(TAG, "acquireWifiLockLocked: " + wifiLock);
|
||||
|
||||
mLocks.addLock(wifiLock);
|
||||
|
||||
|
||||
int uid = Binder.getCallingUid();
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
@@ -1721,7 +1723,7 @@ public class WifiService extends IWifiManager.Stub {
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
|
||||
|
||||
updateWifiState();
|
||||
return true;
|
||||
}
|
||||
@@ -1735,8 +1737,11 @@ public class WifiService extends IWifiManager.Stub {
|
||||
|
||||
private boolean releaseWifiLockLocked(IBinder lock) {
|
||||
boolean hadLock;
|
||||
|
||||
|
||||
WifiLock wifiLock = mLocks.removeLock(lock);
|
||||
|
||||
Log.d(TAG, "releaseWifiLockLocked: " + wifiLock);
|
||||
|
||||
hadLock = (wifiLock != null);
|
||||
|
||||
if (hadLock) {
|
||||
@@ -1758,7 +1763,7 @@ public class WifiService extends IWifiManager.Stub {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO - should this only happen if you hadLock?
|
||||
updateWifiState();
|
||||
return hadLock;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user