Intitialize AcceptableLeftDistance with NUM_OP-1.
Originally, on receiving any report from app AcceptableLeftDistance was decreasing below NUM_OP. After changes introduced in ag/12060128, AcceptableLeftDistance doesn't always change on report receipt. Fix: 161451424 Test: atest RuntimeMessageCollectionTest Change-Id: Id9a066d9efb16a60b2d68c78fb06bbd549c83e40
This commit is contained in:
@@ -6020,7 +6020,7 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
private void resampleAppOpForPackageLocked(@NonNull String packageName, boolean pickOp) {
|
||||
mMessagesCollectedCount = 0.0f;
|
||||
mSampledAppOpCode = pickOp ? ThreadLocalRandom.current().nextInt(_NUM_OP) : OP_NONE;
|
||||
mAcceptableLeftDistance = _NUM_OP;
|
||||
mAcceptableLeftDistance = _NUM_OP - 1;
|
||||
mSampledPackage = packageName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user