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
Also, delete a bunch of deprecated functions that are package-private,
and not called anywhere in the package.
Test: booted walleye
Change-Id: I728e63e7d6f9e1ba42644f93983cfcd6a2d2634c
* changes:
Add DetectTvSystemAudioModeSupportAction
Add tests for HdmiAudioSystemClient
Fix test failure at HdmiCecLocalDeviceAudioSystemTest.
Fix test failure for SystemAudioInitiationActionFromAvrTest.
Checking SYSTEM_AUDIO_CONTROL_ON_POWER_ON property when power on.
Handle atom power off.
Add SystemAudioInitiationActionFromAvr
Handle atom wake up: bring System Audio Control on.
Send audio status at most once per 500 ms
Send <Report audio status> CEC commands when it's changed
The support library was recently merged in frameworks/support, and exposes
the negative button action through an onError message (instead of an
OnClickListener). These change adds a placeholder in frameworks/base
so that the constants are kept in sync.
Fixes: 77969138
Test: builds
Change-Id: Ic1d142006c09e1d4b9149540554e4f068e666798
According to HDMI CEC specification, an audio system
can report its audio status when System Audio Mode
is on, so that the TV can display the audio status
of external amplifier.
More details can be found in section CEC-13.15 of
HDMI Specification 1.4b
Bug: 80297383
Test: make; flashall; local tests
Change-Id: Id71b709a62add7bf5dccb418489e200350debb8e
The crash was introduced by Ib66ef392c19c937718e7101f6d48fac3abe51ad0
The root cause of the crashing is requesting out-of-line access for the
horizontal width. This invalid access is silently ignored by
TextLine#measure() method but new implementation end up with out of
bounds access.
To makes behavior as old implementation, calling getHorizontal instead
of accessing measured result array.
Bug: 111580019
Test: Manually done
Change-Id: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
Test: none
Circles are historically actually easier to draw than Paths for HW
acceleration, though they're equivalent in Skia.
Change-Id: I1a7e2ca6439b6a09fdac784237065668db8cadc6
We've encountered subtle bugs in how apps are using this public
API, so revert it back to exactly what shipped in the last
release, and move functionality to new SQLiteStatementBuilder
class, since we already have several customers using it.
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111486645
Change-Id: Ief059e987f2421e19f6f57a94320c313946a26d7
Right now this test is focused in the parcelization of a big object, due to an
upcoming refactoring on the Autofill parcelization that does not use
ensureData() to load the structure (which in turn requires calls from
system server to the app).
Bug: 35708678
Test: atest app.assist.AssistStructureTest
Change-Id: I9e1c52b19cd1d82869fa8f48113cc7dd7b00a38c
* changes:
Move queryTvSystemAudioModeSupport to HdmiCecLocalDeviceAudioSystem
Add stub method for detecting System Audio Mode support
Add HdmiAudioSystemClient
In O the settings were in the 'allow' section, not the 'disallow'
section, so the conditional needs to be reversed.
Test: runtest systemui-notification, manual
Change-Id: Icfcb328ac1d44b83b11d185be40c4ec696ebfb25
Fixes: 111313535