Commit Graph

104131 Commits

Author SHA1 Message Date
Michael Groover
f1744af7ed Address edge cases for signing certificate lineages in sharedUids
Currently when a package is installed / updated in a sharedUid the
signatures for the sharedUid are not updated unless the new package
adds a new signer to the lineage; in this case the new lineage is
assigned to the sharedUid without consideration for the existing
lineage. This leads to the following problems:

1. If the current sharedUid lineage is A -> B and the new package has
lineage B -> C then this is used for the sharedUid and A is lost from
the lineage.
2. If the new lineage revokes one or more capabilities from a previous
signer in the lineage these updated capabilities are ignored unless the
lineage added a new signer as well.
3. If the new lineage revokes the sharedUid capability from a previous
signing key in the lineage and another app is installed as part of the
sharedUid and signed with that key the new app's installation is allowed
to proceed.
4. If only a single app is installed as part of a sharedUid, and that
app is updated with a rotated key and a lineage that revokes the
previous signing key's sharedUid capability the update is blocked.
5. If an app is installed as part of the sharedUid and has a diverged
signer in the lineage (ie sharedUid lineage is Y -> A -> B and new app
lineage is Z -> A -> B -> C) the installation is allowed and Y is lost
from the lineage.

Problems 1 and 2 are addressed with the new SigningDetails
mergeLineageWith method that merges common signers between two lineages
and also updates their capabilities to the most restrictive between
the two lineages (capabilities are anded together). Problems 3 is
addressed by checking the signatures of each of the packages in the
sharedUid for any signed with an ancestor for which the sharedUid
capability may have been revoked. Problem 4 is addressed by checking
if the package being updated is the only one in the sharedUid; if so
the update to the new lineage is allowed to proceed. Problem 5 is
addressed by verifying the new app's lineage is the same, a subset, or
a superset of the other.

Bug: 152046935
Test: atest PkgInstallSignatureVerificationTest
Test: atest SigningDetailsTest
Test: atest PackageManagerTests
Test: atest PackageManagerTest
Change-Id: I420c309f522bb47b65ca40ee848024c85cd5804d
2020-05-22 23:50:52 +00:00
TreeHugger Robot
7588f0d7a0 Merge "Fix for goat detection code" into rvc-dev 2020-05-16 01:41:30 +00:00
Winson Chiu
605ec6e272 Merge "Remove PlatformCompat dependency from getPackageArchiveInfo" into rvc-dev 2020-05-16 01:12:23 +00:00
TreeHugger Robot
01ae9d5c22 Merge "Handle apps that upgrade to full conversations" into rvc-dev 2020-05-15 23:35:06 +00:00
Winson
7029b75f67 Remove PlatformCompat dependency from getPackageArchiveInfo
It requires a permission which we can't force apps to take to
maintain backwards compatibility. We also arguably cannot because
it leaks visibility, although only for debuggable apps/non-release
builds.

Instead, there's a new static method for getting the raw targetSdk
to gate against and the check is done manually, ignoring
enabled/disabled state. This will cause a mismatch between certain
apps and some system services like AppIntegrityManager, but the
effects should be minimal if we assume that most people ship
valid APKs. At worse the integrity check will pass an APK that
PM will fail, which doesn't break the feature.

Bug: 156356591
Bug: 156778241

Test: manual device boots

Change-Id: I877a5061476b86b9d63c34e75f16b38be8c3e1c2
2020-05-15 15:52:05 -07:00
Amith Yamasani
1f6e0b89b2 Fix for goat detection code
Since as of R, apps can no longer query other apps by default,
deprecate the isUserAGoat API's undocumented behavior and
always return false.

Fixes: 156543788
Test: atest CtsMultiUserTestCases
Change-Id: I9743d87b762aabb01dc010ba6d5a6c01643a1f92
2020-05-15 14:45:01 -07:00
Joshua Duong
8ba3431761 Merge "Don't attach PendingIntent if settings app is hidden." into rvc-dev 2020-05-15 21:14:39 +00:00
TreeHugger Robot
02ed46782e Merge "Some improvements to process state dumpsys output." into rvc-dev 2020-05-15 20:55:13 +00:00
Joshua Duong
b381dfaf18 Don't attach PendingIntent if settings app is hidden.
The settings app may not be available. In that case, just show the adb
notification without a PendingIntent.

Bug: 156453114

Test: atest AdbNotificationsTest
Test: With USB debugging enabled, install TestDPC, and use it to hide settings app.
Unplug and replug USB. USB debugging notification shows up and clicking
it does nothing.
Change-Id: Ie29d2c425c05bce9371600d76e4eb2eaba692fd7

Change-Id: Ie5f746cbc7b8a32fc280177bf281a9e973c8df12
2020-05-15 18:58:33 +00:00
TreeHugger Robot
48105b5c6e Merge "Camera: Docs: Improve info on key removal in CameraCharacteristics" into rvc-dev 2020-05-15 18:17:04 +00:00
Evan Rosky
bddd280556 Merge "Add a window dump for uiautomator" into rvc-dev 2020-05-15 18:15:36 +00:00
TreeHugger Robot
cd1c478655 Merge "Treat mimegroup as wildcard for app enumeration" into rvc-dev 2020-05-15 17:54:23 +00:00
TreeHugger Robot
d1b6afcc19 Merge "Ignore port when matching with wildcards" into rvc-dev 2020-05-15 17:38:40 +00:00
Julia Reynolds
bc23c7e813 Handle apps that upgrade to full conversations
- Apps that have sent incomplete conversations only are allowed
into the conversation section, but not allowed to have full controls.
Users can also demote these apps entirely from the converstion space
- Once an app starts using complete notifications, it can no longer
be fully demoted out of the conversation space, it's only demoted on
a per conversation basis.
- If an app has sent full conversation notifications, and then sends
an incomplete one, the incomplete notification will not be shown in
the conversation space.

Test: atest
Bug: 155276427

Change-Id: Iba9b01c53949632b6db2834511165e3571387ac9
2020-05-15 12:17:13 -04:00
Wenjie Zhou
ad24e49e2f Merge "mCallback defined in BringYourOwnSection should be an object instead of a reference." into rvc-dev 2020-05-15 02:06:30 +00:00
Patrick Baumann
84249ed31e Treat mimegroup as wildcard for app enumeration
This change treats any filter with a mimegroup as if it matches all or
no mime types when matching for the purpose of app enumeration.

Fixes: 155379839
Test: atest IntentFilterTest
Change-Id: I358872082524a4001179bb145053d006622898a7
2020-05-14 16:11:49 -07:00
Patrick Baumann
97980133d5 Ignore port when matching with wildcards
This change ensures that we don't take port into account when matching
queries tags against intent filters as port is not a supported value in
a queries intent tag. Adding support for this in a future release will
just limit the scope of the queries tag on thos releases; it will still
be ignored in this release.

Bug: 151638510
Test: atest IntentFilterTest
Change-Id: I69d77ae6bebf3984bfe8e8a0f6c2e9e91ee69298
2020-05-14 16:03:23 -07:00
Wenjie Zhou
751c7c947a mCallback defined in BringYourOwnSection should be an object instead of a reference.
The referenced object could be destroyed and result in native crash when
mCallback is used.

Bug: 156536687
Test: manual test with registering a section from an app
Change-Id: Ie36c0e6e64be1246539f12999f037c24377686dd
2020-05-14 15:24:39 -07:00
TreeHugger Robot
5bf3f80f20 Merge "Add tracing for Inset animations" into rvc-dev 2020-05-14 22:16:23 +00:00
Cody Kesting
a611e762ad Merge "Create TestApi for simulating a Data Stall on ConnectivityService." into rvc-dev 2020-05-14 18:56:36 +00:00
Cody Kesting
3fdb1831a4 Merge "Set owner and administrator UIDs for test networks." into rvc-dev 2020-05-14 18:56:16 +00:00
Winson Chung
b159f28fce Merge "Skip parceling destroyed buffer" into rvc-dev 2020-05-14 17:32:08 +00:00
Tiger Huang
8fd8a538b8 Merge "Do not dispatch system UI visibility during traversal" into rvc-dev 2020-05-14 17:25:56 +00:00
Eino-Ville Talvala
1a66adcc56 Merge "Camera: Update documentation for rolling shutter skew" into rvc-dev 2020-05-14 16:49:42 +00:00
Matt Casey
d8aa60aa0d Merge "Allow WindowManager.TYPE_SCREENSHOT to be focusable" into rvc-dev 2020-05-14 16:37:58 +00:00
Winson Chung
5bd2a157c6 Skip parceling destroyed buffer
- Haven't been able to repro, but we shouldn't crash system server

Bug: 154382448
Test: Just adding a destroyed check
Change-Id: I412ab1703602723511a6bd3c598d34b6ade68db7
Merged-In: I412ab1703602723511a6bd3c598d34b6ade68db7
2020-05-14 16:05:07 +00:00
Jorim Jaggi
cb28ae6d17 Add tracing for Inset animations
So we can understand better what's going on.

Bug: 156367695
Test: Systrace
Change-Id: Ic9dc2c963f70a3bb787121d33476b84bd3dc5798
2020-05-14 17:46:32 +02:00
TreeHugger Robot
d99569f88a Merge "Revert "Finish input when the screen state is off"" into rvc-dev 2020-05-14 14:21:39 +00:00
TreeHugger Robot
0e58daf022 Merge "Pass window type to the InputWindowHandle of embedded window" into rvc-dev 2020-05-14 08:32:00 +00:00
arthurhung
d3f17d7df7 Pass window type to the InputWindowHandle of embedded window
A windowless SurfaceControl could grant input via
IWindowSession.grantInputChannel, but other window may receive the
obscured events because of the type value of input window is always 0.

The obscured or partially obscured flag indicates that the window
received this motion event is wholly or partially obscured by another
visible window above it.

We have to filter out the trusted overlap so the motion event could
properly dispatch to the view if it is a security sensitive application.

Bug: 156063505
Test: enter split window mode and check the motion event
Change-Id: I10f63ea131a70ee8cc7d5c4b3e5ca4e5f06fdbad
2020-05-14 11:59:23 +08:00
TreeHugger Robot
3a6ec37a71 Merge "Remove divider view when exiting splitscreen" into rvc-dev 2020-05-14 02:25:24 +00:00
Dianne Hackborn
cb6db38143 Some improvements to process state dumpsys output.
The detailed dumpsys output of ProcessRecord had some formatting
issues.  Cleaned this up, also reorganized and improved some of
the other output.

And improved debugging output of capabilities -- have special
formatting to print the flags in a more human-readable way, and
added this to the process list summaries.

Looks like this:

    Proc #28: psvc   F/ /PER  LCM  t: 0 32602:com.google.android.providers.media.module/u0a236 (service)
        com.google.android.providers.media.module/com.android.providers.media.fuse.ExternalStorageServiceImpl<=Proc{31384:system/1000}
    Proc # 4: psvc   F/ /PER  LCM  t: 0 31614:com.android.bluetooth/1002 (service)
        com.android.bluetooth/.gatt.GattService<=Proc{31384:system/1000}
    Proc # 2: fg+50  F/A/TOP  LCM  t: 0 4029:com.google.android.apps.maps/u0a186 (fg-service-act)
    Proc # 0: vis    F/A/TOP  LCM  t: 0 32033:com.google.android.apps.nexuslauncher/u0a155 (service)
        com.google.android.apps.nexuslauncher/com.android.launcher3.notification.NotificationListener<=Proc{31384:system/1000}
    Proc # 8: vis    F/ /BTOP LCM  t: 0 32563:com.google.android.googlequicksearchbox:interactor/u0a151 (service)
        com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService<=Proc{777:com.google.android.googlequicksearchbox:search/u0a151}
    Proc # 7: vis    F/ /BTOP LCM  t: 0 4406:com.google.android.tts/u0a204 (service)
        com.google.android.tts/.service.GoogleTTSService<=Proc{4029:com.google.android.apps.maps/u0a186}
    Proc # 6: vis    F/ /BTOP LCM  t: 0 777:com.google.android.googlequicksearchbox:search/u0a151 (service)
        com.google.android.googlequicksearchbox/com.google.android.apps.gsa.publicsearch.PublicSearchService<=Proc{4029:com.google.android.apps.maps/u0a186}
    Proc # 1: vis    F/ /BTOP LCM  t: 0 32254:com.google.android.gms.persistent/u0a152 (service)
        com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerService<=Proc{4029:com.google.android.apps.maps/u0a186}
    Proc #47: vis    F/ /BFGS ---  t: 0 31954:com.google.android.ext.services/u0a70 (service)
        com.google.android.ext.services/android.ext.services.notification.Assistant<=Proc{31384:system/1000}
    Proc #16: vis    F/ /BFGS LCM  t: 0 32515:com.google.android.as/u0a112 (service)
        com.google.android.as/com.google.android.apps.miphone.aiai.captions.SystemCaptionsManagerService<=Proc{31384:system/1000}
    Proc #51: vis    F/ /IMPF ---  t: 0 2072:com.qualcomm.qcrilmsgtunnel/1001 (service)
        com.qualcomm.qcrilmsgtunnel/.QcrilMsgTunnelService<=Proc{31915:com.android.phone/1001}
    Proc #48: prcp   b/ /IMPB ---  t: 0 3783:com.google.android.inputmethod.latin/u0a182 (service)
        com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME<=Proc{31384:system/1000}

Bug: 156545187
Test: manually checked output
Change-Id: I99d8136b98b39e74d9f316da5954f85aec570c01
2020-05-13 17:34:35 -07:00
Ming-Shin Lu
2c6e80be12 Revert "Finish input when the screen state is off"
This reverts commit 0df8812486.

The original CL is trying to reduce the dependency of PownerManager to
finish input when screen off by using display state.

However, it doesn't fully fix the original Bug 26851566 since we only
finish input connection but didn't callback onFinishInput callback for
IME client.

Also, for some scenarios, the window / view focus may not change
during screen turns off / on:
  - Focusing timing when disable keyguard, then quickly screen off / on.
  - Using P-sensor to turning screen off / on.

When the above scenario happens, makes input connection cannot re-start
and soft-keyboard can't be shown.
(The recovery is manually focus on next window or activity.)

As the above reason, we need to re-consider the lifecycle of
input connection, window / view focus when not only screen state but also
device inactive state when always-on-display.

Fix: 156045961
Fix: 154605805
Bug: 26851566
Bug: 156215187
Test: atest CtsInputMethodTestCases
Change-Id: If06daf71160aa44a4254ac125561974ecbdef4f2
2020-05-14 08:29:18 +08:00
TreeHugger Robot
bc9515e4b9 Merge "Change the timeout for integrity verification from 10 seconds to 30 seconds." into rvc-dev 2020-05-13 22:41:10 +00:00
TreeHugger Robot
4d857ccce5 Merge "Revert tab key behavior on multiline EditTexts." into rvc-dev 2020-05-13 22:30:21 +00:00
TreeHugger Robot
bff3812e82 Merge "SurfaceView: positionLost locking fix" into rvc-dev 2020-05-13 22:04:58 +00:00
TreeHugger Robot
730fb0d97d Merge "Fix inline suggestion ref counting to not over-count" into rvc-dev 2020-05-13 20:58:15 +00:00
TreeHugger Robot
897187dcfa Merge "Controls API - Flag controls support" into rvc-dev 2020-05-13 20:42:42 +00:00
Song Pan
74b5e72f17 Change the timeout for integrity verification from 10 seconds to 30 seconds.
Context: https://buganizer.corp.google.com/issues/154486093#comment24

Bug: 154486093
Test: N/A
Change-Id: I4fae3401ad7323acfa9cc520aac0cbb6bdbf6ada
2020-05-13 20:27:40 +01:00
Feng Cao
723ba2e82b Fix inline suggestion ref counting to not over-count
* Imagine this event sequence:
  1) the IME tries to re-attach an inline suggestion view to the
  window (e.g. because IME layout changes), it calls into the system
  server which causes recreating the backing view because it was
  destroyed earlier due to 0 ref-count (this happens under the hood
  without IME knowing it happens, so the view is still attached to
  the window).
  2) the IME receives a new inline suggestion pointing to the same
  backing view (perhaps due to filtering kicks in).
  3) the recreation from step 1 finishes, but now it will callback
  to the new inline suggestion, therefore the old view doesn't receive
  the new SurfacePackage. See RemoteInlineSuggestionUi for why.
  4) the view in step 1 is detached from window, since it never
  receives a SurfacePackage from the remote view, its detach shouldn't
  cause a reference count down on the remote view.

Test: atest android.autofillservice.cts.inline (sanity test)
Bug: 154683107

Change-Id: I2e6814ef3889de603f6e170efcb795b69ec9febe
2020-05-13 11:55:58 -07:00
Robert Carr
ebaaca1a46 SurfaceView: positionLost locking fix
positionLost can be called from CanvasContext::destroyHardwareResources
which runs asynchronously to the UI thread. This means we could be
simultaneously executing releaseSurfaces on the UI thread. We need
to expand the scope of mSurfaceControl lock in positionLost. While
we are here we add a block comment explaining the previously
undocumented locking strategy.

Bug: 156264048
Test: Existing tests pass
Change-Id: I9cdb6a0f7aeffd878f1755f240e8896f0fb8bf01
2020-05-13 18:29:59 +00:00
TreeHugger Robot
e0a73b1bb6 Merge "webkit: Update documentation for onJsAlert callback method" into rvc-dev 2020-05-13 18:15:31 +00:00
Matt Pietal
9788fd4afd Controls API - Flag controls support
Add a package manager flag so that apps can programmatically query
whether the device have system interface to support the Controls API

Bug: 156096063
Test: manual
Change-Id: I2dab2ecb762b59308c51615137f89733ff42caeb
2020-05-13 14:11:34 -04:00
Matt Casey
834c0f8ea4 Allow WindowManager.TYPE_SCREENSHOT to be focusable
Pre-R, the screenshot window was used just for screenshot animation. In
R, the window is also hosting tappable screenshot actions, which require
focus.

This change modifies TYPE_SCREENSHOT to no longer force it to be
unfocusable.

Test: Verify that screenshot window UI elements can work with talkback
    and accessibility scanner.
Bug: 153517161
Bug: 152583784
Change-Id: If81d9f94dff801c3483a2d834e692b4c77d80d7b
2020-05-13 14:01:41 -04:00
Changwan Ryu
31e2db92ce webkit: Update documentation for onJsAlert callback method
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog.

Also, change some wording to avoid confusion.

Bug: 154014645
Test: m -j offline-sdk-docs seems unbroken
Change-Id: I3f6676094e5472aa99bb014cf2b489f59133d094
2020-05-13 16:52:24 +00:00
TreeHugger Robot
eb191392e6 Merge "Don't try to recreate IncrementalFileStorages on re-commit." into rvc-dev 2020-05-13 16:01:39 +00:00
Yuichiro Hanada
93ec9b85e5 Revert tab key behavior on multiline EditTexts.
This CL reverts ag/10267783 effectively.
ag/10267783 makes tab key insert \t character on multiline text fields,
however, it broke the existing apps which depends on the previous
behavior.

Bug: 154290658
Test: manual - Tab key on multiline text fields advance focus
Test: atest TextViewTest#testKeyNavigation
Change-Id: I9836ce29321ca789bce6636514ce9a8dbf923ada
2020-05-13 21:26:36 +09:00
TreeHugger Robot
8ae0cfe36b Merge "Increase content capture buffer size to 500 Anecdotally this should cover typical messaging first screens whereas 100 events seems to be small." into rvc-dev 2020-05-13 01:57:06 +00:00
TreeHugger Robot
d775b6404f Merge "Allow some OpEntry#* methods for apps targeting R" into rvc-dev 2020-05-12 23:18:52 +00:00
Julian Odell
82c92bcf3c Increase content capture buffer size to 500
Anecdotally this should cover typical messaging first screens
     whereas 100 events seems to be small.

Test: make -j
Test: Manually start WhatsApp - check for lost events
Bug: 154777879
Change-Id: I3090584ec03714656948045189e0e0c068740c82
2020-05-12 23:02:55 +00:00