3241 Commits

Author SHA1 Message Date
Andreas Gampe
8272fe83e0 BitmapDrawable: Suppress errorprone warning
Suppress a warning for constructor-chaining not using all parameters.

Bug: 72451126
Test: m javac-check RUN_ERROR_PRONE=true
Change-Id: Ie47dec119ec578b79d866d9c5041bb7b68eac146
2018-01-24 13:25:22 -08:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Tobias Thierer
07efe116b1 Merge "Framework: Prefer android.system.Os over libcore.io.Libcore.os"
am: 5f04db96b3

Change-Id: If85216d03022708787a7218e494434453d5548e3
2017-10-19 14:25:12 +00:00
Tobias Thierer
6217e37d30 Framework: Prefer android.system.Os over libcore.io.Libcore.os
This is a pure refactoring with no a behavior change other than
that these calls now go through android.system.Os, which immediately
delegates to Libcore.os.

This is a first step towards separating framework (via
android.system.Os) vs. libcore (via Libcore.os) clients of these
low level APIs. Separating these is a prerequisite towards moving
the API parts of android.system into framework, and moving the
rest into a different package in libcore.

Test: Treehugger
Bug: 67901714

Change-Id: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
Merged-In: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
2017-10-18 14:53:57 +01:00
Eino-Ville Talvala
3e99a5fcb9 ImageFormat: Document units/coordinate system for DEPTH_POINT_CLOUD
For camera devices, DEPTH_POINT_CLOUD coordinates are in meters and
are in the camera's local coordinate system.

Test: Built docs, manually verified output.
Bug: 67308479
Change-Id: I028e13a2fb79688a7ce440f905fa82826fc38a03
2017-10-02 11:39:41 -07:00
John Reck
3885bf6f04 Add nullptr check
Bug: 65717856
Test: builds
Change-Id: I188d3366e956f087c6317ae0b56d5fb19a20708d
2017-09-27 09:30:30 -07:00
ztenghui
3d30ca1d3c Add systrace for VectorDrawable inflation and draw
We didn't trace the draw from cache.
Here we add trace for draw into bitmap, which is normally heavy.

fix: 65060698
Bug: 65060698
Test: run test app and get systrace and check

Change-Id: Ia81127c4aa285b3277e9c9edbdf356d85cb28b5e
(cherry picked from commit cf0c41dbc221c2619212c7e25e6d90a9c4d05b05)
2017-09-22 19:44:24 +00:00
sergeyv
08beea71c9 Throw if BitmapFactory.Options.inBitmap is HARDWARE
Test: BitmapRegionDecoderTest#testHardwareBitmapIn
bug:34415265
Change-Id: I58061504dd42ba918f89e1e5daf668f7601ca8d3
2017-09-14 21:13:58 +00:00
Seigo Nonaka
065c59beaf Revert "Implement family fallback." DO NOT MERGE
This reverts commit 0d253e46aa0b4cb2ea56e220812aeab92de64ae1.

The original CL changed Typeface internal methods and broke
TypefaceCompatApi26Impl in support library which uses reflections.
Ideally, TypefaceCompatApi26Impl must fall back to public API
implementation but due to lack of method availability check, it ended up
crashing the application.

The original patch didn't change any behaviors in MR1, so reverting
that change is the best solution for MR1.

Bug: 64033594
Change-Id: Ie86afeb1b809e57915d62c1db5a70c8d210d2354
Test: N/A
2017-07-26 22:21:14 +00:00
Seigo Nonaka
298bb2995b Support font resource in TextAppearanceSpan
To be able to parcel/unparcel Typeface, keep it in static context.

Bug: 62850669
Test: Manually done
Test: bit CtsTextTestCases:android.text.style.cts.TextAppearanceSpanTest
Change-Id: I408cd33b98d8bb13776560231d1eeaac0a7c6bf8
(cherry picked from commit c49ee3bde904b1dcce2d605477ed07278be22561)
2017-07-20 23:40:44 +00:00
Selim Cinek
15733d1f85 Reducing bitmap sizes in notifications
Bitmap sizes could be arbitrary large when they were sent
over to the system. We're now reducing them to reasonable
sizes.s

Also fixed that notification bitmaps were not put into
ashmem anymore since it got lost in a refactor.

Test: code inspection
Bug: 62319200
Merged-In: I87db7656e749666b9eab1f67fd497f155c407e18
Change-Id: I87db7656e749666b9eab1f67fd497f155c407e18
2017-07-19 18:06:09 +00:00
Selim Cinek
d0426628f6 Reducing bitmap sizes in notifications
Bitmap sizes could be arbitrary large when they were sent
over to the system. We're now reducing them to reasonable
sizes.s

Also fixed that notification bitmaps were not put into
ashmem anymore since it got lost in a refactor.

Test: code inspection
Bug: 62319200
Change-Id: I87db7656e749666b9eab1f67fd497f155c407e18
2017-07-19 11:05:26 -07:00
Makoto Onuki
1480b67635 Better preload drawable logging
Bug 63136392
Test: Manual test

Change-Id: I8753b36f632cf2ff57a5ef28df29f3fc5657f607
2017-07-14 11:40:29 -07:00
Roozbeh Pournader
e2393ae726 Merge "Make strike-through respect kerning at boundaries" 2017-07-14 02:17:43 +00:00
Roozbeh Pournader
1378a9d72c Make strike-through respect kerning at boundaries
Also clean up lower-level drawing of strike-through in Cavas.cpp.

We still cannot use the strike-through information from the font
since Skia doesn't provide it, so we are going with the default
values.

Test: Manual
Test: bit CtsTextTestCases:*
Test: adb shell am instrument -w -e package android.text com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 32907446
Change-Id: Iee6f8102a35eba0ff4127dbbef189529ab573e6d
2017-07-13 13:21:00 -07:00
Seigo Nonaka
0d253e46aa Implement family fallback.
Introduce new attribute "fallbackFor" to font element.
By specifying name of the family to this attribute, that font is used
when the developer specifies the font family.
For example, if fonts.xml has the following family entry,
  <family lang="ja">
    <font fallbackFor="serif">NotoSerifJP-Regular.ttf</font>
    <font>NotoSansJP-Regular.ttf</font>
  </family>
the Japanese text is rendered by NotoSansJP-Regular.ttf by default.
Then, if developer specifies fontFamily="serif" in TextView, the Japanese
text is rendered by NotoSerifJP-Regular.ttf.

Bug: 37328609
Bug: 31491668
Test: bit FrameworksCoreTests:android.graphics.TypefaceSystemFallbackTest

Change-Id: I2744db7384c8056795e841c88b387545434131f4
2017-07-13 10:47:48 -07:00
Selim Cinek
3594b9f4fd Merge "Fixed an issue where the shelf could be hidden" into oc-dr1-dev am: fdc84a13a2
am: 3ec9d993ce

Change-Id: I307a3d65603f5ede0e283f36715271bc68b8eabd
2017-07-03 10:59:17 +00:00
Selim Cinek
fdc84a13a2 Merge "Fixed an issue where the shelf could be hidden" into oc-dr1-dev 2017-07-03 10:46:35 +00:00
Selim Cinek
707e2072c8 Fixed an issue where the shelf could be hidden
During reinflation, the panel could be stuck in
a bad state where qs edit mode was on but not
visible. QS edit now persists through reinflations.

Test: manual
Change-Id: I6e7a20fda2db2184a26a11093064a1367469ab45
Fixes: 62807612
2017-06-30 18:40:53 +02:00
Hyunyoung Song
0e00add46a Merge "AdaptiveIconDrawable should not update layer bounds when bound is empty" into oc-dr1-dev am: e54ad58aea
am: 73035910fc

Change-Id: I43e867115e6242ef5a19795c8e53cccb5097d633
2017-06-29 19:33:54 +00:00
Hyunyoung Song
dba9934fb7 AdaptiveIconDrawable should not update layer bounds when bound is empty
Test: build succeeds. Also, setting tint mode does not result in error.

Bug: 37682281
Change-Id: I5991b8e58514a2130a793a5edb90baeafae9b148
2017-06-28 00:13:15 +00:00
Chris Craik
fc651ecf81 Merge "Use NativeAllocationRegistry for ColorFilter" into oc-dr1-dev am: 049543b771
am: bc1db397eb

Change-Id: I76e107bbbb89e32f535324f393c8f4ad3341bed3
2017-06-27 02:08:00 +00:00
Chris Craik
f65e92d9f9 Use NativeAllocationRegistry for ColorFilter
Bug: 62994689
Test: bit CtsGraphicsTestCases:*

Change-Id: Icea01fa7d4c6e78f3a93434de64bc8ddfe0c7a0e
2017-06-26 21:33:47 +00:00
Roozbeh Pournader
554585e08d Merge "Get underline position and thickness from the font" 2017-06-09 21:44:59 +00:00
Roozbeh Pournader
ca8a04a366 Get underline position and thickness from the font
Previously, font underline position and thickness were fixed in Android.
Although a custom font may have specified a different value, such a value
would never be used. Now we use the values from the font if they are
provided and fall back to the old default values only if needed.

Bug: 62353930

Test: adb shell am instrument -w -e package android.graphics com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w -e package android.text com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: cts-tradefed run cts-dev --module CtsTextTestCases
Test: Manual
Change-Id: I6bf21000dd69a2780c894b231638bc0c122e41f4
2017-06-08 14:13:57 -07:00
Doris Liu
21d562c122 Merge "Better error message for AVD" into oc-dev am: cabf9cdc2e
am: cab35e9b0e

Change-Id: I48726108f88abbe3d08973259e1be1a1683df797
2017-06-07 19:45:52 +00:00
Doris Liu
7bbb50e21d Merge "Better error message for AVD" into oc-dev
am: cabf9cdc2e

Change-Id: I6e63b81fd2168780d23a88d7340812b55db98497
2017-06-07 19:40:53 +00:00
Doris Liu
cabf9cdc2e Merge "Better error message for AVD" into oc-dev 2017-06-07 19:31:14 +00:00
John Reck
4ee3fb4c54 Merge "Clear native shader when Paint shader changes" into oc-dev
am: d3e78478aa

Change-Id: I7d96db34b1894e1064116b830a8fb159ad4c57b0
2017-06-07 16:49:12 +00:00
John Reck
fbff7117ab Clear native shader when Paint shader changes
Since Recents never goes away that means TaskViewThumbnail
never goes away which in turn means mDrawPaint never goes away.

mDrawPaint has a setShader(null) called on it to release
the BitmapShader it was previously drawn with, but that
change didn't push down to native until the next time the
paint was used. As a result, the Paint held on to a
reference to the bitmap.

The fix is simple, when the shader is changed simply
push down an immediate clear of the native shader. Since
the bitmap of a BitmapShader isn't changeable we don't
need to worry about clearing references for shader mutation,
merely when Paint#setShader() happens.

Bug: 38258699
Test: Open & close recents, observe EGL memory immediately returns
to sub-5MB.

Change-Id: I6742efa8ae8dfca76b62a06bc1a1a00646feba64
2017-06-06 12:14:04 -07:00
Roozbeh Pournader
fd8c22d513 Move underline thickness and position computation to Paint
Also, in TextLine, fix underline color and thickness to come from the
underline info rather than the TextPaint object.

Bug: 32907446
Bug: 62353930
Test: Manual
Test: cts-tradefed run cts-dev --module CtsTextTestCases
Test: cts-tradefed run cts-dev --module CtsWidgetTestCases
Change-Id: I259e9cf635a7056ccd367baa77c03100c69e3b98
2017-06-05 15:57:14 -07:00
Doris Liu
03f2fcbd88 Better error message for AVD
Moved the error checking to an earlier stage of the AVD, so that
the error message can contain more information.

BUG: 36571432
Test: Follow the repro step in b/36244835, the error message
      is much clear now.

Change-Id: Ibc6a0e666cc4c23c3dfa589755a77a015da2db1c
2017-06-05 15:51:18 -07:00
Roozbeh Pournader
cc4f086c94 Merge "Make underlining spans independent of actual class" 2017-06-05 17:30:27 +00:00
Roozbeh Pournader
538de5bb3b Make underlining spans independent of actual class
Previously, we had singled out UnderlineSpan for special treatment
for proper kerning at span boundaries. That had the limitation that
any other span that used underlining, or even subclasses of
UnderlineSpan were not getting the fix.

With this CL, we actually look at all the effects of applying a
span's updateDrawState() and if the changes were only in underlining,
we merge the pieces and call handleText() on the merged chunk of
text.

Change-Id: I829162c758192b80594f164d1105699224b627ba
Bug: 32907446
Test: cts-tradefed run cts-dev --module CtsTextTestCases
Test: cts-tradefed run cts-dev --module CtsWidgetTestCases
Test: manual
2017-06-01 16:45:33 -07:00
TreeHugger Robot
2a3220b247 Merge "graphics: Icon: use Arrays#equals for byte array comparison" 2017-06-01 20:31:50 +00:00
Peter Qiu
335a6e0f74 graphics: Icon: use Arrays#equals for byte array comparison
Bug: 62258815
Test: build

Change-Id: I95b7b7b663a8067aea40f36944003901afd8988c
2017-06-01 10:45:56 -07:00
Seigo Nonaka
0ee11e3f7e Merge "Fix NPE and wrong behavior of Typeface.isSupportedAxes" into oc-dev am: 633b32be55
am: bc790383d2

Change-Id: Ie308baed43bf39394949e2fa9fc1ebab1dc98e65
2017-05-31 00:27:12 +00:00
TreeHugger Robot
633b32be55 Merge "Fix NPE and wrong behavior of Typeface.isSupportedAxes" into oc-dev 2017-05-30 23:58:11 +00:00
Roozbeh Pournader
a63794c9cc Merge "Update Paint#mFontVariationSettings in set() and reset()" into oc-dev am: d865c624bd
am: 1ee4894e6c

Change-Id: I6c9bff56660ec6b6bddc48da9f629a571c7fe2d6
2017-05-30 21:35:50 +00:00
TreeHugger Robot
d865c624bd Merge "Update Paint#mFontVariationSettings in set() and reset()" into oc-dev 2017-05-30 21:15:20 +00:00
Seigo Nonaka
ffae6c7f71 Fix NPE and wrong behavior of Typeface.isSupportedAxes
The Typeface kept by Paint object can be null if nobody calls
setTypeface. The null typeface is equivalent to the Typeface.DEFAULT.
To check whether the passed axis is usable for Typeface.DEFAULT, we
need to pass Typeface.DEFAULT to isSupportedAxes if no typeface was set
on the Paint.

At the same time this CL fixes an issue in isSupportedAxes.
If the requested axis is listed in the first element of axes list,
isSupportedAxes returned false due to wrong handling of binarySearch
result.

Bug: 62146672
Bug: 62147012
Test: am instrument -w -e class android.graphics.cts.PaintTest
android.graphics.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I7c154adfe8a19d6ed24ad645df7c10cee7880461
2017-05-30 13:40:49 -07:00
Hyunyoung Song
d04970da5d Merge "Merge "Fix safezone and getAlpha b/38361276 Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java" into oc-dev am: cca181bfbb" into oc-dev-plus-aosp
am: fa5f8fa8a8

Change-Id: I11d97f6c553882c0fb2423c1a62ee540378fcd25
2017-05-25 23:52:25 +00:00
TreeHugger Robot
cca181bfbb Merge "Fix safezone and getAlpha b/38361276 Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java" into oc-dev 2017-05-25 22:55:56 +00:00
Hyunyoung Song
ac2f74e80e Fix safezone and getAlpha
b/38361276
Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java

Change-Id: I3e1c73276968747249b053fd581f289c340d98af
2017-05-24 17:29:34 -07:00
Roozbeh Pournader
425e719c46 Update Paint#mFontVariationSettings in set() and reset()
Change-Id: I2dc41a998c940c4a4a98a06aaa6038cbca457186
Fixes: 62066408
Test: none
2017-05-24 15:16:55 -07:00
Tenghui Zhu
c495d8f1b5 Merge "Add documentation about 0 scale matrix to Shader" into oc-dev am: 52ca75011b
am: e7bc3d70b5

Change-Id: I1f659529a22072d329af949bedb3636400f0fde3
2017-05-24 21:36:45 +00:00
Tenghui Zhu
52ca75011b Merge "Add documentation about 0 scale matrix to Shader" into oc-dev 2017-05-24 21:06:56 +00:00
Andrew Solovay
591cccd2e7 Merge "docs: Fixing malformatted HTML escape" into oc-dev am: 1272847f1d
am: 670286ea89

Change-Id: I8f9acee143abd62b2d0599ad7ee866235916084d
2017-05-24 18:21:17 +00:00
Andrew Solovay
22ebb54e17 docs: Fixing malformatted HTML escape
Through the file's javadoc comments, the less-than character is
improperly coded as "&lt" instead of "&lt;" (it's missing the
terminating semicolon). Chrome is clever enough to render that as <
, but I don't know if other browsers do, and in any event we
shouldn't count on that behavior.

Doc is staged to:

http://go/dac-stage/reference/android/graphics/drawable/RippleDrawable.html

Test: make ds-docs
Bug: 62028102
Change-Id: I81813fcb758349300f56ce10ccb0d03046ab4736
2017-05-23 12:24:12 -07:00
ztenghui
6f085f60e9 Add documentation about 0 scale matrix to Shader
fix:36989035

Test: build
Change-Id: Id1134d5d31ea6a17dc56f24d26eb5da9a78a2c2d
2017-05-22 14:56:50 -07:00