Commit Graph

90545 Commits

Author SHA1 Message Date
Pinyao Ting
46368e4f5c fixes a security vulnerability in slice provider
Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
Merged-In: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
(cherry picked from commit 2b415a4c44)
2019-08-17 00:49:29 +00:00
Bryan Ferris
a94d8aed24 Merge "Fix Layout.primaryIsTrailingPreviousAllLineOffsets" into pi-dev 2019-07-10 21:10:18 +00:00
Mihai Popa
9109ce6b0a Fix Layout.primaryIsTrailingPreviousAllLineOffsets
The CL fixes a crash in Layout.primaryIsTrailingPreviousAllLineOffsets.
The crash was happening when the method was called for a line beginning
with an empty bidi run. This could happen, for example, for empty text -
I was unable to find any other case. The CL improves the existing test
for the method with this case, which was previously crashing.

The CL also fixes a potential crash in getLineHorizontals. However, this
bug could never happen as in the current code path clamped is always
false (and kept as parameter for parity with getHorizontal).

Bug: 135444178
Bug: 78464361
Test: atest FrameworksCoreTests:android.text.LayoutTest\#testPrimaryIsTrailingPrevious
Change-Id: I47157abe1d74675884734e3810628a566e40c1b4
(cherry picked from commit 7ad499d007)
2019-07-10 18:02:01 +00:00
Dmitry Dementyev
c0e4ee7332 Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"
This reverts commit 8094880025.

Reason for revert: changed services order
Test: manual
Bug: 136261465

Change-Id: I2f78f0dbbace212309b87f779efad020cf255196
Merged-In: I2f78f0dbbace212309b87f779efad020cf255196
2019-07-01 20:11:36 +00:00
Michael Wachenschwanz
57f6c0deb2 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618 am: 2ca66d4d10 am: 1c8a632ad2
am: 7eec0a8448

Change-Id: Ic2cc203ee994927ec0b7f355917a15010f6e2a7c
2019-06-05 20:05:28 -07:00
Michael Wachenschwanz
7eec0a8448 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618 am: 2ca66d4d10
am: 1c8a632ad2

Change-Id: I6cc244c8e40d66d639faef43ec8d3a23bfc11df7
2019-06-05 17:38:43 -07:00
Michael Wachenschwanz
1c8a632ad2 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618
am: 2ca66d4d10

Change-Id: I452bc18a9cebc417e7c4499c2bebf8fd3cc0f1ce
2019-06-05 17:07:58 -07:00
Android Build Merger (Role)
2ca66d4d10 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618
Change-Id: I780fc62bcad56b4f1518a9a84ff7a77914f5c722
2019-06-05 17:32:04 +00:00
Android Build Merger (Role)
31737b4618 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df
Change-Id: Ia92e1831963623df7931de17b029a92bab7f9374
2019-06-05 17:32:01 +00:00
Android Build Merger (Role)
d944d907df [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f
Change-Id: I38fbeaf20d21dd174e2b022196446631c20b2367
2019-06-05 17:31:57 +00:00
Android Build Merger (Role)
6d72c0681f [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251
Change-Id: I16e96c2b33f18459189bfff359ae85483667a202
2019-06-05 17:31:54 +00:00
Android Build Merger (Role)
86c9bdd251 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21
Change-Id: I416ed302e6c680fd006bd9b38565ebfc8b132084
2019-06-05 17:31:48 +00:00
Michael Wachenschwanz
f8ef5bcf21 Clear the Parcel before writing an exception during a transaction
This prevents any object data from being accidentally overwritten by the
exception, which could cause unexpected malformed objects to be sent
across the transaction.

Test: atest CtsOsTestCases:ParcelTest#testExceptionOverwritesObject
Bug: 34175893
Change-Id: Iaf80a0ad711762992b8ae60f76d861c97a403013
Merged-In: Iaf80a0ad711762992b8ae60f76d861c97a403013
2019-06-05 17:31:43 +00:00
Daichi Hirono
9799956531 Stop invoke initAppOps in Camera default constructor.
Camera default constructor does not create the underlying native camera
object. Thus calling _enableShutterSound after the default constuctor
causes application crash.

Bug: 132362603
Bug: 80498247
Test: ARC++ Eve/Kevin:
        Manually modify the code to return MODE_IGNORED for
        AppOpsService#checkAudioOperation() and to return false for
        CameraManager#supportsCamera2ApiLocked. Then start voice call in
        Hangouts.
      cf_x86_phone with camera HALv1 enabled:
        New CTS test
Change-Id: Ia232dd71da15fda31c4dbe5568ba5083cbfaed9b
Merged-In: Id738c4d46a8e3625bc3b1142b11acac9cfb0b603
2019-05-09 13:39:25 -07:00
Robert Carr
dc49e0088a [RESTRICT AUTOMERGE]: Exclude secure layers from most screenshots taken by the system server.
In pre-P versions of Android, it was allowed to screenshot secure layers if the
buffer queue producer which was the target of the screenshot was owned by
the system (in this case SurfaceFlinger). This really was a synonym for:
The screen rotation animation was allowed to capture secure layers, but the other
code paths weren't. In O we mistakenly changed this check to always allow the system server
to capture secure layers via the captureScreen path (the captureLayers path used for
TaskSnapshots was unaffected). This can result in data leakage in cases where the
system server takes screenshots on behalf of other parts of the system (e.g. for
the assistant). To mitigate this we provide an explicit switch for the system server
to specify whether it wishes to capture Secure layers. While this is dangerous, I think
it is less dangerous than the previous implicit switch of capturing secure layers based on which
type of BufferQueue was passed in. The flag defaults to not capturing secure layers
and we set it to true in the one place we need it (for the screen rotation animation).
Non privileged clients can still not capture secure layers at all directly.

Test: TransactionTest.cpp#SetFlagsSecureEUidSystem
Bug: 120610669
Change-Id: I9d32c5ac2b005059be9f464859a415167d9ddbd4
2019-05-02 18:50:09 -07:00
Yin-Chia Yeh
5b09928b22 Merge "Camera: add QCIF resolution exception" into pi-dev 2019-04-02 19:07:19 +00:00
Yin-Chia Yeh
428256d258 Camera: add QCIF resolution exception
Also fix a typo.

Test: checkbuild
Bug: 120158047
Bug: 122461651
Change-Id: I61eab3f526e307b04a71c8382e9fa76aee7871e1
2019-04-01 12:40:51 -07:00
Rich Cannings
820b2504f3 DO NOT MERGE Refactor passwords/pins/patterns to byte[]
Relating to frameworks/base

Bug: 120484642
Test: manual - test setting and unlocking passwords/pins/patterns.
      automated - atest services/tests/servicestests/src/com/android/server/locksettings/

Change-Id: I57aa530ca2db1a026c56b66f5b4c91172f2667f6
(cherry picked from commit f64ec63a02)
2019-03-19 11:13:18 -07:00
TreeHugger Robot
a24113f030 Merge "Remove ConnectivityManager and its usages from NetworkStatsService." into pi-dev 2019-03-19 02:00:38 +00:00
Shimi Zhang
ce222afda7 onPageFinished javadoc cleanup
PictureListener was deprecated, we need to replace its mentioning in
onPageFinished() javadoc with postVisualStateCallback().

Bug: 125939241
Test: make ds-docs
Change-Id: I7c1641c86632bb6c8214fd701e052096952deeec
2019-03-11 19:30:58 +00:00
Varun Anand
47a6760c76 Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

This change also is cherry-picking cleanup made to NSS in
http://aosp/628368.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Ia687845888434c8ddd24bdf44b4c70dfe80e03f5
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
2019-03-01 03:32:23 +00:00
Qasid Ahmad Sadiq
4d70022b88 Revert "Fix a11y cache correctness bug"
This fix introduced a painful crash that ends up disabling accessibility
services for certain users.
This happens when a client of AccessibilityCache tries to add a node, with the same id as a node previously in the cache, but fewer children, where the removed child is not in the cache.
This is because, when children are removed, and a the node is updated, the cache tries to clear the child trees. But if the child is not in the cache, the cache clears the whole tree. Every node is recycled.
Then the original node being replaced is attempted to be recycled again, and voila crash.

The fix also didn't fix the original issue based on the discussion in
b/114133438.

The risk for this is pretty low, since nothing was built on top of this.

This reverts commit 2f69c16c3d.
Bug: 124676705
Test: Tested to see if above usecase still happens.

Change-Id: I8a39698c4532a1613ba47e1c6ca70201cd496212
2019-02-21 21:07:12 -08:00
TreeHugger Robot
bec9d394d3 Merge "Clarify WebResourceResponse's stream handling." into pi-dev 2019-02-21 04:32:58 +00:00
Lucas Dupin
98684aa82a Merge "Improve the performance when loading image wallpaper colors" into pi-dev 2019-02-20 20:26:25 +00:00
Beverly
7ee646771b Override old alarms in zen schedule
Change-Id: I371a586d470e3e341a42fb5ae3b8f32929214c18
Merged-in: I371a586d470e3e341a42fb5ae3b8f32929214c18
Fixes: 112493468
Test: ScheduleCalendarTest
(cherry picked from commit 4e76191a9f)
2019-02-19 20:18:01 +00:00
wilsonshih
5abc71b27b Improve the performance when loading image wallpaper colors
When SystemUI start up, ColorExtractor will get wallpaper colors so
status bar can use it to update theme, however, this will also block
SystemUI start up process if the wallpaper is image wallpaper.
In order to break the latency, we can extract getWallpaperColors
method from ColorExtractor's contructor, and do it at another thread,
so it won't block SystemUI start up.

Bug: 124279857
Test: atest ColorExtractorTest
Test: Manual test change theme feature can work normally.
Merged-In: I8589b28a17b0a2b33b4bbbda2265080af983f26a
Change-Id: I8589b28a17b0a2b33b4bbbda2265080af983f26a
2019-02-19 16:57:59 +00:00
TreeHugger Robot
d14c8a2a72 Merge "RESTRICT AUTOMERGE Close TextClassifier native resources." into pi-dev 2019-02-14 16:22:18 +00:00
Ng Zhi An
8094880025 Do not load xml metadata for unchanged packages in RegisteredServicesCache
RegisteredServicesCache caches services in an xml, so the system doesn't
have to scan all the apks. Whenever a package is changed
(add/remove/replaced), the broadcast receiver in RegisteredServicesCache
will refresh this cache by quering all matching services and reading
their
xml metadata. There is extra work done here, because only the changed
package
will have services added/removed.

The edge case is after a cache is invalidated, we want to query package
manager for everything, regardless of what changedUids is (we could
have arrived here if invalidateCache is called, and then a package
change event fires, before a getAllServices is called to rescan
everything).

Add a new test to verify that the optimization takes care of the case
when the cache is invalidated.

Bug: 117755076
Bug: 122912184
Test: atest RegisteredServicesCache
Test: dumpsys content # check sync adapters
Merged-In: I5c1f57108c4b67d24b198000d57216c63d35290a
Change-Id: I5c1f57108c4b67d24b198000d57216c63d35290a
2019-02-11 17:03:02 +00:00
Abodunrinwa Toki
ec1b164923 RESTRICT AUTOMERGE Close TextClassifier native resources.
Bug: 122904322
Test: atest android.view.textclassifier.TextClassificationManagerTest
Test: (MANUAL)
      1. Start an app with a TextView
      2. Select the text to trigger the text selection toolbar and TextClassifier
      3. Close the app's activity by repeatedly clicking back on the nav bar
      4. Start a Profiler for the app and observe for memory growth
      5. Repeat 1 - 3 several times and observe.
         If the bug still exists, memory should grow at about 4 - 5MB.
	 If the bug is fixed, Memory should remain about the same across activity restarts.

Change-Id: Id9a60dea85cf3949de030042537287ddb29842a2
2019-02-08 13:05:38 +00:00
Abodunrinwa Toki
7c8a46e0dd DO NOT MERGE No smart text assist for unprovisioned device.
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
bit FrameworksCoreTests:android.widget.TextViewActivityTest
bit FrameworksCoreTests:android.widget.TextViewActivityMoutseTest
Bug: 120866126
Bug: 62745625
Merged-In: I360250a5c2a92d09c8d8f559b51c74f490f70c2c
Change-Id: I360250a5c2a92d09c8d8f559b51c74f490f70c2c
2019-02-04 21:26:48 +00:00
TreeHugger Robot
a3a280e4d8 Merge "Add closing div tag for ContentResolver javadoc" into pi-dev 2019-02-04 19:38:42 +00:00
Ng Zhi An
3ca513070b Add closing div tag for ContentResolver javadoc
Bug: 123290414
Test: m docs and manually verify
Change-Id: Ibb159678c9e3538b186fe936ab2369b6fe6fb51d
2019-01-24 21:39:24 -08:00
Vishnu Nair
47d2d1e46a [DO NOT MERGE] ViewRoot: Notify app when surface is released from setWindowStopped
NativeActivities do not receive onNativeWindowDestroyed callback when the activity is stopped. If
the app still uses the window object after the window is destroyed, the app can crash.

Test: run native-plasma from Android NDK. Launch activity & press home. Verify from the logs app
receives onNativeWindowDestroyed callback when its stopped.
Test: go/wm-smoke

Bug: b/111948775, b/120100553
Change-Id: I1de76feb7f4974b77b42b56e592ff6444713c699
(cherry picked from commit e626d58c1b)
2019-01-24 15:55:18 -08:00
Nate Fischer
9f726cd280 WebView: clean up onReceivedSslError docs
No change to logic, only docs.

This adds {@link}'s for references to SslErrorHandler methods, improving
readability. This also clarifies this API is only called for recoverable
errors.

Fixes: 123042566
Test: m offline-sdk-docs
Change-Id: I0e94c9903e638e2fce59f35ec76eb5566e7ad875
2019-01-18 13:00:33 -08:00
Torne (Richard Coles)
5b0a3215eb Clarify WebResourceResponse's stream handling.
Explicitly state in the documentation that the WebView will call
InputStream.close() after it's finished reading the response from a
WebResourceResponse.

Fixes: 122665050
Test: m offline-sdk-docs
Change-Id: I933c58e335ff1af31db6b4f959316ee389359e01
2019-01-11 11:56:52 -05:00
TreeHugger Robot
3f3c8f812e Merge "Nullify the default wallpaper component if it does not exist" into pi-dev 2019-01-11 03:36:19 +00:00
Tony Mak
3f552669e3 RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
am: d9e75a497e

Change-Id: Id1b62f552f29ef9a20d78bb7487201452dfda601
2019-01-08 02:50:57 -08:00
Abodunrinwa Toki
4e3507d544 RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: runtest -x cts/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
Change-Id: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
2019-01-04 17:30:28 +00:00
Tony Mak
d9e75a497e RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: runtest -x cts/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
Change-Id: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
Merged-In: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
2019-01-03 17:10:46 +00:00
Abodunrinwa Toki
a69950ce18 RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: atest android.view.textclassifier.TextClassificationManagerTest \
            android.text.util.cts.LinkifyTest \
	    android.text.util.LinkifyTest \
	    android.widget.TextViewActivityTest

Change-Id: I01b5e936aa4dfc937a98f50e9fc8171666861a61
2019-01-03 14:20:30 +00:00
Android Build Merger (Role)
3823545fee [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306 am: 363e47e676 am: efb165f557 am: b2b98a008b
Change-Id: I29c3f97af12987c8a1dd8a69529641d32d2dd172
2019-01-03 14:07:59 +00:00
Android Build Merger (Role)
b2b98a008b [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306 am: 363e47e676 am: efb165f557
Change-Id: Ibc588da08fbb6069989c7c97110e4cecea0b0ce5
2019-01-03 14:07:52 +00:00
Android Build Merger (Role)
efb165f557 [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306 am: 363e47e676
Change-Id: I828e0c99ab41935d20033c970b5131f2fcbf9085
2019-01-03 14:07:43 +00:00
Android Build Merger (Role)
363e47e676 [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306
Change-Id: I423ddd8df74bee8dbf7cd96009bbdffebf81b93a
2019-01-03 14:07:33 +00:00
Tony Mak
73f398d306 RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: runtest -x cts/tests/tests/text/src/android/text/util/cts/LinkifyTest.java

Change-Id: Id271cab8aef6b9b13ef17f1a8654c7616f75cf13
2019-01-03 14:07:30 +00:00
Nate Fischer
e0938b86ae WebView: no bars in javadoc
No change to logic, only docs change.

The bar/pipe symbols have no meaning in javadoc. We should mark this
with {@code} instead.

Bug: 122046530
Test: None
Change-Id: I594480ea3bf4fec9c87a48275364c7c616a0e3ea
2018-12-26 15:36:35 -08:00
SzuWei Lin
32a7e2f357 Nullify the default wallpaper component if it does not exist
The default wallpaper component cannot be found after GSI is flashed.
The home screen background will have no wallpaper and be black.
It will also cause the following CTS tests to fail:

- KeyguardTests#testDialogShowWhenLockedActivity
- KeyguardTests#testTranslucentShowWhenLockedActivity

The patch will check if the package of the default component exists.
If not, it will fall back to null, which is the AOSP default value, and
display the wallpaper in framework resource.

Bug: 119895131
Bug: 111909699
Test: flash GSI aosp_arm64-userdebug on a crosshatch, got AOSP wallpaper
Test: flash full crosshatch-userdebug on a crosshatch, got crosshatch wallpaper
Change-Id: I9d618d05458a03a675324cb2f861decf31c5bf18
Merged-In: I9d618d05458a03a675324cb2f861decf31c5bf18
(cherry picked from commit 1c7ae31e97)
2018-12-21 07:59:57 +00:00
TreeHugger Robot
dfcbdef8ab Merge "Clarify WebResourceResponse parameter documentation." into pi-dev 2018-12-17 17:21:38 +00:00
Torne (Richard Coles)
c848639f08 Clarify WebResourceResponse parameter documentation.
Developers commonly misuse the mimeType and encoding parameters in the
WebResourceResponse constructor as the meaning is different to the
similarly named HTTP headers. Explain more carefully what valid/invalid
inputs look like and mention that this is different to HTTP.

Change-Id: I14d159bc50c89c2215f7de5f4732569e5e246930
Fixes: 64765685
Test: m offline-sdk-docs
2018-12-14 13:00:54 -05:00
Andrew Solovay
6eaf48ea57 docs: Fixing malformed javadoc
Several @link & @see javadoc directives were malformed, resulting in the
Javadoc code being output to the HTML.

Staged to:

http://go/dac-stage/reference/android/app/slice/Slice.Builder
http://go/dac-stage/reference/android/app/slice/SliceProvider
http://go/dac-stage/reference/android/text/style/ImageSpan
http://go/dac-stage/reference/android/content/ContentProvider

Bug: 120743732
Test: make ds-docs
Change-Id: I589644f8d266a116441409fbdaf7a0c533e0e356
Merged-In: I589644f8d266a116441409fbdaf7a0c533e0e356
Exempt-From-Owner-Approval: Doc-only change
2018-12-14 00:11:19 +00:00