Add @GuardedBy for simple functions that require locks and have a name in
one of the frameworks naming styles for locks ("^.*(Locked|LPw|LPr|L[a-zA-Z]|UL|AL|NL)$").
Changelist for statsd.
Derived by errorprone.
Bug: 73000847
Test: m
Change-Id: I02981b3f65102640609c8ca85c765250b0e2e3ad
The root cause is issue 79432238
Before this is fixed, put the field on the light greylist to unblock CTS tests.
Change-Id: I084da8c70534f12e9badfd50a285836219046aa0
Fix: 110798342
Test: cts-tradefed run cts -m CtsCurrentApiSignatureTestCases
atom and logging for statsd to mimic procstats process duration metrics.
ActivityManagerSleepStateChanged
MemoryFactorStateChanged
ExcessiveCpuUsageReported
CachedKillReported
ProcessStateChanged
ProcessMemoryStatReported
Some of the enums will need to use frameworks proto. It is blocked by
other cls that are cleaning namespace, etc.
Bug: 110784286
Bug: 110538804
Bug: 110539297
Bug: 111561536
Bug: 111685402
Bug: 111128767
Test: cts test
Change-Id: I7502eb0bb36b90f43493b147a35bee48bad1b000
In preparation to have atomic install scan and commit results as
separate steps, we're modifying all scanPackage* and usages of them to
deal directly with a scan result and check for success before committing
the result(s).
Bug: 109941548
Change-Id: Ic155dfa0b0e3f84f77387378d60847a617b562af
Fixes: 37565347
Test: manual verification (cannot use CTS because test and service runs in the
same process)
Change-Id: I04e2d4a3587b9b9cf72a06c46291fb3ba6bbc91e
Add @GuardedBy for simple functions that require locks and have a name in
one of the frameworks naming styles for locks ("^.*(Locked|LPw|LPr|L[a-zA-Z]|UL|AL|NL)$").
Changelist for permission manager.
Derived by errorprone.
Bug: 73000847
Test: m
Change-Id: I54bb3a18cbe88d24028d9a90600cd6102598b358
Change the sampling method to be random. The previous mechanism recorded
one call for each key (uid/API name) and every X calls for each key:
- This is biased and will make it to interpret the data from
westworld. It was especially unfair for apps using many different APIs
since the first call to each API was always recorded.
- It uses more memory since we will keep track of all the long tail
Simplify/unify the way we keep track of sampled calls.
Do not estimate the CPU usage of non-recorded calls
long samplesCount = cs.callCount / mPeriodicSamplingInterval + 1;
duration = cs.cpuTimeMicros / samplesCount;
It biases the results, let's use an example with 3 calls: 1ms, 3ms, 5ms
with an sampling interval of 2. With the previous algorithm we would get an
average per call of (1+1+3+2+5)/5=2.4ms. With the new one (1+3+5)/3=3ms.
Test: unit tests
Change-Id: I1dd7eb3c6c631b86a53485bccbfa397882cccc92
Base64OutputStream.close() first write()s (possibly empty) data
and then close()s the underlying stream. Because of an inverted
condition, exceptions thrown by the underlying stream were handled
incorrectly:
- if both the underlying write() and close()/flush() throw
then it would throw the latter exception when it should
have thrown the former, suppressing the latter.
- if only the underlying close() throws then that exception
was swallowed when it should have been closed.
This bug existed ever since this file was first added to
Android in commit 9df2ffd420
in Feb 2010 (before the concept of suppressed exceptions
existed/was supported). The buggy code was proposed in a
review comment on that CL, which was then accepted/integrated
into the CL.
This CL fixes the inverted condition and adds test coverage.
It also adds code to add the suppressed exception (if any).
Bug: 111697617
Test: Confirmed that Base64Test fails (as described above) before
this CL but passes after this CL, when running these commands:
make FrameworksCoreTests && \
adb install -r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk && \
adb shell am instrument -w -e class android.util.Base64Test \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Specifically, before this CL, the following test failures occur:
1.) junit.framework.AssertionFailedError
at junit.framework.Assert.fail(Assert.java:48)
at junit.framework.Assert.fail(Assert.java:56)
at android.util.Base64Test.testOutputStream_ioExceptionDuringClose(Base64Test.java:546)
2.) junit.framework.ComparisonFailure: expected:<[writ]e()> but was:<[clos]e()>
at junit.framework.Assert.assertEquals(Assert.java:85)
at junit.framework.Assert.assertEquals(Assert.java:91)
at android.util.Base64Test.testOutputStream_ioExceptionDuringCloseAndWrite(Base64Test.java:574)
Change-Id: If7fd7c4615ca004638d7c5d8f1869e7eddb16f33