Merge "Fix a memory leak in ConnectivityManager." into nyc-dev

This commit is contained in:
Pierre Imai 2016-04-13 06:37:31 +00:00 • committed by Android (Google) Code Review
commit a5ccd54500

View file

@ -2734,7 +2734,7 @@ public class ConnectivityManager {
private void incCallbackHandlerRefCount() {
synchronized(sCallbackRefCount) {
if (sCallbackRefCount.incrementAndGet() == 1) {
// TODO - switch this over to a ManagerThread or expire it when done
// TODO: switch this to ConnectivityThread
HandlerThread callbackThread = new HandlerThread("ConnectivityManager");
callbackThread.start();
sCallbackHandler = new CallbackHandler(callbackThread.getLooper(),
@ -3093,6 +3093,10 @@ public class ConnectivityManager {
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
synchronized (sNetworkCallback) {
sNetworkCallback.remove(networkCallback.networkRequest);
}
}
/**