Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c5674aa authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Avoid NDC deadlock when re-arming network alert."

parents 8ca8a69d 25ce9ed5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {

    private static final int MSG_PERFORM_POLL = 1;
    private static final int MSG_UPDATE_IFACES = 2;
    private static final int MSG_REGISTER_GLOBAL_ALERT = 3;

    /** Flags to control detail level of poll event. */
    private static final int FLAG_PERSIST_NETWORK = 0x1;
@@ -600,7 +601,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
                mHandler.obtainMessage(MSG_PERFORM_POLL, flags, 0).sendToTarget();

                // re-arm global alert for next update
                registerGlobalAlert();
                mHandler.obtainMessage(MSG_REGISTER_GLOBAL_ALERT).sendToTarget();
            }
        }
    };
@@ -951,6 +952,10 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
                    updateIfaces();
                    return true;
                }
                case MSG_REGISTER_GLOBAL_ALERT: {
                    registerGlobalAlert();
                    return true;
                }
                default: {
                    return false;
                }