Commit Graph

4564 Commits

Author SHA1 Message Date
Olivier Gaillard
78ecd34d29 Merge changes I02e88c93,Id0a2f52c
* changes:
  Use the BinderProxy#TransactListener to propagate the UID.
  Adds a mechanism to listen to proxy transact method calls.
2018-10-30 10:27:23 +00:00
Tony Zhu
a51294bc9e Merge "[Call Screening]Default call screening app setting storage." am: 371786f6b0 am: 56b75cb498
am: 5b3b0ea44b

Change-Id: I32d514581e8fa9403d8412d2cd23fef41860d075
2018-10-29 20:54:24 -07:00
Tony Zhu
5b3b0ea44b Merge "[Call Screening]Default call screening app setting storage." am: 371786f6b0
am: 56b75cb498

Change-Id: I98ac08b917aef63202b006b7440bee4c75ff665f
2018-10-29 20:45:18 -07:00
Tony Zhu
371786f6b0 Merge "[Call Screening]Default call screening app setting storage." 2018-10-30 02:43:52 +00:00
Olivier Gaillard
510cdfc32c Adds a mechanism to listen to proxy transact method calls.
There are multiple use cases for it:

1) Make it easy for another process to set the worksource. The
worksource can be propagated in a thread local - this is how gmscore and soon
system server works -  the worksource can then be set for all binder
calls using

Object transactStarted() {
    Binder.setWorkSource(ThreadLocalWorkSourceUid.get());
    return null;  // No token needed.
}

void transactEnded() {
    Binder.setWorkSource(null);
}

This will be used by system process and gmscore.

2) SystemUI team was interested in detecting binder calls done from the
main thread in dogfood/tests. This listener will make it easy to figure
out which thread is used.

Performance impact of transact method:
    - With current code: 45ns per call
    - With this code: 57ns per call
This is not significant compared to the total binder call time which is
10-100s of microseconds.

Test: unit test
Change-Id: Id0a2f52cba33b390ff83f703284b79471cc80b1c
2018-10-29 17:19:31 +00:00
Jeff Sharkey
bc2ae00878 Magic to keep "_data" paths working.
As part of the storage changes in Q, we're removing the ability for
apps to directly access storage devices like /sdcard/.  (Instead,
they'll need to go through ContentResolver.openFileDescriptor() to
gain access.)  However, in several places we're returning raw
filesystem paths in the "_data" column.  An initial attempt to simply
redact these with "/dev/null" shows that many popular apps are
depending on these paths, and become non-functional.

So we need to somehow return "_data" paths that apps can manually
open.  We explored tricks like /proc/self/fd/ and FUSE, but neither
of those are feasible.  Instead, we've created a cursor that returns
paths of this form:

/mnt/content/media/audio/12

And we then hook Libcore.os to intercept open() syscalls made by
Java code and redirect these to CR.openFileDescriptor() with Uris
like this:

content://media/audio/12

This appears to be enough to keep most popular apps working!  Note
that it doesn't support apps that try opening the returned paths
from native code, which we'll hopefully be solving via direct
developer outreach.

Since this feature is a bit risky, it's guarded with a feature flag
that's disabled by default; a future CL will actually enable it,
offering a simple CL to revert in the case of trouble.

Bug: 111268862, 111960973
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ied15e62b46852aef73725f63d7648da390c4e03e
2018-10-26 09:32:29 -06:00
tonyzhu
70526c3e95 [Call Screening]Default call screening app setting storage.
Add new string in Settings. To indicate which app is default
call screening, similar to default dialer application setting,
store this in the system settings provider.

Bug: 118416082
Test: atest SettingsBackupTest pass.
Change-Id: I39f81b31a68ee2dbb056ff935f8dea0f51720017
2018-10-26 13:40:45 +00:00
Olivier Gaillard
88de48f78e Update BinderCallsStats to use the worksource.
We update UidEntry to use the worksource when it is set.

Test: unit test
Change-Id: I7ddfcfcd87de21e6e0ded94a943ae71f1980a5ce
2018-10-26 08:08:28 +00:00
Seigo Nonaka
b1e1182809 Merge "Update test cases for HarfBuzz 2.0.2" am: 866a9678d2
am: 2e738cf4ce

Change-Id: I56bc4faa8548f7476309aba13636672124d4cbd1
2018-10-25 22:47:27 -07:00
Steven Moreland
748f697207 Merge "pm: Disallow HIDL libs from boot jars >= Q." am: 06182b0764 am: 7430f3e6fd
am: 71ac2676b6

Change-Id: I4daf19b65d9b3e24c196e6ede697935b5c5460a3
2018-10-25 16:51:48 -07:00
Seigo Nonaka
3e140b2403 Update test cases for HarfBuzz 2.0.2
Now HarfBuzz combines chars with ZWJ into single cluster

This is 2nd attempt of Ic642c469aab90a2ecd3874cf0dec82625ea21c1b

Bug: 117953171
Test: TreeHugger
Change-Id: I7e731500e71c1973c254ede0f316fc36e3c22576
Merged-In: I531b7a5f5727540d6d11db619eeba6eb23fb113d
2018-10-25 22:15:33 +00:00
Seigo Nonaka
52a4c07f7c Revert "Update test cases for HarfBuzz 2.0.2 DO NOT MERGE"
This reverts commit 155951f2f6.

Reason for revert: broke test in pi-dev/stage-aosp-master

Change-Id: I917e170b570b89ba2e8a26cec0bf0a8adf577b80
2018-10-25 18:23:32 +00:00
TreeHugger Robot
bd70ed4cfa Merge "Implement TextClassifierImpl.detectLanguage()" 2018-10-25 13:19:24 +00:00
TreeHugger Robot
0d51e3fcef Merge "Update test case for HarfBuzz 2.0.2" 2018-10-24 23:30:16 +00:00
Steven Moreland
71ac2676b6 Merge "pm: Disallow HIDL libs from boot jars >= Q." am: 06182b0764
am: 7430f3e6fd

Change-Id: I0f2fa1c1571283d247fb6ac344b0dc5b6085d3aa
2018-10-24 14:44:14 -07:00
Seigo Nonaka
dfd38fcbae Update test case for HarfBuzz 2.0.2
Now HarfBuzz combines chars with ZWJ into single cluster

Bug: 117953171
Test: TreeHugger
Change-Id: I531b7a5f5727540d6d11db619eeba6eb23fb113d
2018-10-24 09:42:54 -07:00
Abodunrinwa Toki
ee3a48eec0 Implement TextClassifierImpl.detectLanguage()
- Includes some fixes to handle null ParcelFileDescriptors.
- Closes fds immediately after the model has been loaded.

Bug: 116020587
Test: atest android.view.textclassifier.TextClassificationManagerTest
Change-Id: Ieb05d081847ac218d2a5b46db95cd512838f67ab
2018-10-24 15:55:12 +01:00
Seigo Nonaka
155951f2f6 Update test cases for HarfBuzz 2.0.2 DO NOT MERGE
Now HarfBuzz combines chars with ZWJ into single cluster

Bug: 117953171
Test: TreeHugger
Change-Id: Ic642c469aab90a2ecd3874cf0dec82625ea21c1b
Merged-In: I531b7a5f5727540d6d11db619eeba6eb23fb113d
2018-10-24 05:57:57 +00:00
Olivier Gaillard
e4ff397f08 Add WorkSource support to Binder.java.
Test: unit test
Change-Id: I6f3507b51a89c35943cc34299d7e364aab337e98
2018-10-23 14:27:34 +01:00
Sudheer Shanka
e5ec6b1077 Merge "Push sharedUserIds info to config/sdcardfs." 2018-10-22 21:46:58 +00:00
Treehugger Robot
06182b0764 Merge "pm: Disallow HIDL libs from boot jars >= Q." 2018-10-22 07:08:10 +00:00
Sudheer Shanka
12783cb4e5 Push sharedUserIds info to config/sdcardfs.
Bug: 117573457
Test: manual
Test: atest core/tests/packagemanagertests/src/android/content/pm/KernelPackageMappingTests.java
Change-Id: I652a0e7dab75d68247d2270edbddcc1b7ea18229
2018-10-21 18:43:12 -07:00
qqd
19799c44c4 Disable double cursor for BiDi in Layout.
-- Disabled double cursor for BiDi in Layout.getCursorPath.
-- Add tests in LayoutTest.

Bug: 112875662
Test: Manual (no more double cursors, bidi editing feels OK)
Test: bit FrameworksCoreTests:android.text.LayoutTest
Change-Id: I3d201734d12f59724fa627b06ba9ca8c307c27fb
2018-10-19 19:09:22 -07:00
Jeff Sharkey
047edaeaa3 Merge changes I86f597f1,I5c9c09dd
* changes:
  MediaStore deprecations for Q.
  Convenience method for obtaining thumbnails.
2018-10-19 15:21:54 +00:00
Abodunrinwa Toki
e428c32653 Merge "Introduce TextClassifier.detectLanguage() API." 2018-10-19 14:27:26 +00:00
Jeff Sharkey
4e5efa3186 Convenience method for obtaining thumbnails.
Obtaining a thumbnail for a Uri requires opening it with the slightly
obscure openTypedAssetFileDescriptor(), passing in "image/*" with the
right Bundle of EXTRA_SIZE to hint the target area on screen, and
defensively scaling any returned results.

This is pretty tedious to get right, so offer a convenience method
that does all this for the developer.  Internally uses ImageDecoder
to follow best-practices, and replaces older getDocumentThumbnail()
implementation by delegating to this one.

A future CL will teach ImageDecoder about how to read any embedded
EXIF thumbnails, including any required rotation.

Bug: 111268862
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Change-Id: I5c9c09ddf9b480f3b5c6ade0a078cccb68de2f2b
2018-10-18 14:32:51 -06:00
TreeHugger Robot
69ebcb1b81 Merge "Revive ForwardDeleteTest with updating expectations" 2018-10-18 20:01:34 +00:00
TreeHugger Robot
a02e61107f Merge "Temporarily revert device identifier access check to previous behavior" 2018-10-18 15:59:18 +00:00
Abodunrinwa Toki
7cefd4f20c Introduce TextClassifier.detectLanguage() API.
Implementation will follow in TextClassifierImpl (for AOSP)
and SystemTextClassifier (for OEM version).

Bug: 116020587
Test: atest android.view.textclassifier.TextLanguageTest
Change-Id: Iaf7e8df2a14fe22335805bee41f138468430aea6
2018-10-18 03:04:28 +01:00
Steven Moreland
ae88825916 pm: Disallow HIDL libs from boot jars >= Q.
These two libraries:
android.hidl.base-V1.0-java
android.hidl.manager-V1.0-java

were removed from BOOT_JARS. This change disallows them to be used on
the classpath >= Q. They are still allowed to be used <= P for legacy
reasons.

Test: atest android.content.pm.AndroidHidlUpdaterTest
Test: build & boot Pixel 2
Fixes: 77307025

Change-Id: I7752812318030cbaa15f42301c168371ceade901
2018-10-17 18:17:33 -07:00
Michael Groover
9db22c7a89 Temporarily revert device identifier access check to previous behavior
If a calling package does not meet the new requirements for device identifier
access the calling package and method will be logged and the previous
READ_PHONE_STATE permission check will be performed to grant access to the
requested identifier. This is to prevent additional breakage for apps that
currently require device identifiers but have not yet been granted the
privileged permission or carrier privileges.

Bug: 117585389
Test: cts-tradefed run cts -m CtsPermissionTestCases \
      -t android.permission.cts.TelephonyManagerPermissionTest
Test: Manually invoked an app targeting pre-Q and verified access
      to device identifiers with the READ_PHONE_STATE permission.

Change-Id: I03339486a2d6971b93472479b79959c888beba1e
2018-10-17 18:05:46 -07:00
Jeff Sharkey
0c91451bc8 Catch more invalid file modes.
Bug: 117440225
Test: atest android.os.FileUtilsTest
Change-Id: Id5e8c0869182b6391994dd9266a455dd3152e653
2018-10-17 18:32:27 -06:00
Seigo Nonaka
906a87e2ed Revive ForwardDeleteTest with updating expectations
In Unicode 11, the emoji category is reorganized and some sequences are
now treated as single grapheme clusters.

Bug: 111299224
Test: atest FrameworksCoreTests:ForwardDeleteTest
Change-Id: Id078c9f6dfa79eee76af3ac40f10c8ce53c52278
2018-10-17 15:50:52 -07:00
TreeHugger Robot
a1b9c31cbc Merge "Move displayId into MotionEvent" 2018-10-17 07:34:36 +00:00
Cody Northrop
fba8e6342f Merge "Revert "Revert "Rootless GPU Debug for GLES""" 2018-10-16 18:54:42 +00:00
Cody Northrop
ebe6a56f80 Revert "Revert "Rootless GPU Debug for GLES""
This reverts commit 2653e624dc.

Exempt-From-Owner-Approval: This restores a commit that was already
approved and rolled back for unrelated reasons in frameworks/native.

Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Test: Chromium starts up
Test: CtsDeqpTestCases:include-filter:dEQP-EGL.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES2.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES3.*
Test: CtsDeqpTestCases:include-filter:dEQP-GLES31.*
Bug: 110883880
Bug: 117609555
Change-Id: Iab23a5d598986ba34c0ba62dc78299d022924cd9
2018-10-16 18:51:28 +00:00
TreeHugger Robot
02f2a315d7 Merge "Add Context.getDisplayId() to avoid possible IPC" 2018-10-16 00:20:52 +00:00
Seigo Nonaka
aa35899430 Merge "Make LineBreaker public" 2018-10-15 21:56:12 +00:00
Neil Fuller
f1246180a5 Merge "Remove explicit dependencies on conscrypt" am: ca980ac83c am: 2462e2de0c
am: 03bcf21faf

Change-Id: Ie075359bbb965c524d3d20b31c8efdb38884322a
2018-10-15 13:48:54 -07:00
Neil Fuller
03bcf21faf Merge "Remove explicit dependencies on conscrypt" am: ca980ac83c
am: 2462e2de0c

Change-Id: I1f393d0da1d8ee9f7e0efb708951d7f87813be3c
2018-10-15 13:37:38 -07:00
Neil Fuller
2462e2de0c Merge "Remove explicit dependencies on conscrypt"
am: ca980ac83c

Change-Id: I44d73ff073dcdd566e95dd89a08490f8afdf833f
2018-10-15 13:22:31 -07:00
Neil Fuller
071d5b22d0 Remove explicit dependencies on conscrypt
The dependency is unnecessary since conscrypt is
now included in the "standard libraries".

Test: build
Bug: 113148576
Change-Id: I5d6ae56af35fddb452fdd5b6abbb47178c1bfdc0
2018-10-15 16:25:35 +01:00
Yohei Yukawa
5281b6b4c0 Add Context.getDisplayId() to avoid possible IPC
ContextImpl has an internal rule that when ContextImpl#mDisplay is
null the Context is associated with the default display.  The problem
is that, as discussed in Bug 117709581, when ContextImpl#mDisplay is
null ContextImpl#getDisplay() tries to get some non-null Display
object by making an IPC to the system server, which is redundant when
the display ID is the only thing that the caller wants to know.

By having an @hide method Context.getDisplayId(), we can ensure that
display ID can be obtained without any IPC.  This enables us to
re-submit my CL [1] that aimed to instantiate InputMethodManager (IMM)
for each display but then got reverted due to a performance regression
(Bug 117434607).

There should be no developer-observable behavior change.

 [1]: I7242e765426353672823fcc8277f20ac361930d7
      c53d78e992

Fix: 117712745
Test: atest FrameworksCoreTests:android.content.ContextTest
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/tests/coretests/src/android/content/ContextTest.java
Change-Id: I2534530a5ce90e2620c5039d793a6454a0a1e154
2018-10-15 07:38:25 +08:00
Cody Northrop
2653e624dc Revert "Rootless GPU Debug for GLES"
This reverts commit f41625936f.

Exempt-From-Owner-Approval: Reverting
Bug: 110883880
Test: Chrome no longer crashes
Change-Id: I70c9d4a0376b27059e7759e1b6283903c0cf168b
2018-10-12 21:34:15 +00:00
TreeHugger Robot
22f182d1b5 Merge "LooperStats - track time to message dispatch" 2018-10-12 14:17:24 +00:00
Marcin Oczeretko
4427272533 LooperStats - track time to message dispatch
Test: UT and manual
atest .../LooperStatsTest.java
Verified that adb shell cmd looper_stats dump produces data
with dispatch delay

Bug: 113651685

Change-Id: I44550f8c5d71848932733bd02016aa65ce7b75b3
2018-10-12 13:17:01 +01:00
Adrian Roos
de363d08dd DisplayCutout: Fix NPE in deprecated constructor and add nullability annotations
Change-Id: Ib791a41e399afbd8586f6b471165185e63b93ea4
Fixes: 117590687
Test: atest DisplayCutoutTest
2018-10-12 13:08:17 +02:00
Colin Cross
62df67ddf7 Remove workarounds for b/79755007 am: f5c86dc1c1
am: 9428a92293

Change-Id: I89276e49bf16da997cc4501067caa946054af3b4
2018-10-10 22:54:33 -07:00
Neil Fuller
a88ba587c9 Merge "Avoid hidden DataFormat.is24Hour field access" am: 4d9823f3eb am: 64106e4399
am: bdb8b5ef4d

Change-Id: I26a0dd8a3f7693f008b5fb35d78dc41ceb333031
2018-10-10 22:14:58 -07:00
Rhed Jao
4bc4fe6252 Merge "Accessibility: Improve TouchDelegate Accessibility" 2018-10-11 04:37:56 +00:00