Skip to content
Commit 1b85ccef authored by jwwang's avatar jwwang
Browse files

Fix PackageWatchdog::syncRequestsAsync and related code.

A. mSomeHandler.post(this::doSomething);
B. mSomeHandler.removeCallbacks(this::doSomething);

B will not remove the pending runnable posted in A since each method reference will create a new Runnable instance.

Instead, we should do:
mDoSomething = this::doSomething;
mSomeHandler.post(mDoSomething);
mSomeHandler.removeCallbacks(mDoSomething);

Bug: 140085748
Test: Manual testing && atest PackageWatchdogTest
Change-Id: I15752e49741f4e3c3b894d925e2a58beab31209d
parent 007620d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment