OSDN Git Service

android-x86/frameworks-base.git
5 years agoDO NOT MERGE Truncate newline and tab characters in BluetoothDevice name
Hansong Zhang [Thu, 26 Apr 2018 21:22:39 +0000 (14:22 -0700)]
DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name

Test: manual
Bug: 73173182
Change-Id: I7f2201cab36adf7f01d1a794d783cb78a536811f
(cherry picked from commit 24da173b63b17a0bc6c80b2fcfefa7fe4574a15b)

5 years agoFix broken check for TelephonyManager#getForbiddenPlmns
sqian [Sat, 14 Apr 2018 00:10:05 +0000 (17:10 -0700)]
Fix broken check for TelephonyManager#getForbiddenPlmns

(backport from a fix merged in pi-dev)

Bug: 73884967
Test: Treehugger
Change-Id: I9deaae20893184cde36dcd936fe83708fa60b830
Merged-In: I0cf7920e138892fbcab71fae0eed1293f0b2e404
Merged-In: I9e3456e5f1e479b0e2b102f6c90db57cd0e977fe
(cherry picked from commit 7b52a48d6b10e3ed2806b57d39a2d9211dd4b585)

5 years agoDO NOT MERGE (O) Revoke permision when group changed
Philip P. Moltmann [Thu, 12 Apr 2018 21:45:14 +0000 (14:45 -0700)]
DO NOT MERGE (O) Revoke permision when group changed

If a run time permission of a group is already granted we grant the
other permission of the group automatically when requested.

Hence if an already granted permission changed its group during an
update suddenly permission of a potentially not approved group will
get auto-granted.

This is undesirable, hence we revoke the permission during the update
process.

Test: atest android.permission.cts.PermissionGroupChange
Change-Id: Ib2165d1ae53b80455ebe02e07775853e37a2e339
Fixes: 72710897
(cherry picked from commit 0ed1b472af194896fcf421dc862c443343c7c127)

5 years agoResStringPool: Fix security vulnerability
y [Fri, 6 Apr 2018 00:57:27 +0000 (17:57 -0700)]
ResStringPool: Fix security vulnerability

Adds detection of attacker-modified size and data fields passed to
ResStringPool::setTo(). These attacks are modified apks that AAPT would
not normally generate. In the rare case this occurs, the installation
cannot be allowed to continue.

Bug: 71361168
Bug: 71360999
Test: run cts -m CtsAppSecurityHostTestCases \
          -t android.appsecurity.cts.CorruptApkTests

Change-Id: If7eb93a9e723b16c8a0556fc4e20006aa0391d57
Merged-In: If7eb93a9e723b16c8a0556fc4e20006aa0391d57
(cherry picked from commit 7e54c3f261d81316b75cb734075319108d8bc1d1)

5 years agoRESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to...
akirilov [Tue, 27 Mar 2018 20:08:47 +0000 (13:08 -0700)]
RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to oc-mr1-dev)

Test: added AccessibilityEndToEndTest#testPackageNameCannotBeFaked
      cts-tradefed run cts -m CtsAccessibilityServiceTestCases
      cts-tradefed run cts -m CtsAccessibilityTestCases

Bug: 69981755
Change-Id: If3752e106aa7fdee4645dc9852289af471ceff18
Merged-In: I13304efbee10d1affa087e9c8bc4ec237643283e
(cherry picked from commit c36db6d473c9988496cd614924ee113b67f7e333)

5 years agoUse concrete CREATOR instance for parceling lists
Fyodor Kupolov [Fri, 16 Mar 2018 19:20:40 +0000 (12:20 -0700)]
Use concrete CREATOR instance for parceling lists

Replaced readTypedArrayList/writeTypedArrayList with
writeTypedList/createTypedArrayList(CREATOR)

Bug: 71508348
Test: CtsAutoFillServiceTestCases pass
Merged-In: I2a8321023b40cc74b7026eb0fb32a9cc5f5543a9
Change-Id: Id17d02e40a4ae567bf2d74d2ea8ba4d8a943bdb7
(cherry picked from commit 4921986db76b1580bcb6ec8b2fd381d1364a6325)

5 years agoRework thumbnail cleanup
Marco Nelissen [Tue, 7 Nov 2017 21:52:02 +0000 (13:52 -0800)]
Rework thumbnail cleanup

Bug: 63766886
Test: ran CTS tests
Change-Id: I1f92bb014e275eafe3f42aef1f8c817f187c6608
(cherry picked from commit 6d2096f3889d38da60099b1b5678347de4f042bf)

5 years agoProper autofill fix to let phone process autofill Settings activity.
Felipe Leme [Mon, 11 Dec 2017 22:37:35 +0000 (14:37 -0800)]
Proper autofill fix to let phone process autofill Settings activity.

Test: adb shell am start com.android.settings/.RadioInfo
Bug: 69981710
Fixes: 70506888

Change-Id: Id29bad2d20b621f7379eb6144c95dcc819949b3d
Merged-In: Id29bad2d20b621f7379eb6144c95dcc819949b3d
(cherry picked from commit 97f16a76db29269619d9a1b45d4cea49026a5b6a)
(cherry picked from commit 92b5d2783a1b97bee476f04754481403839b4e45)

6 years agoMerge cherrypicks of [3782287, 3782954, 3783025, 3783026, 3783027, 3783028, 3783029...
android-build-team Robot [Thu, 22 Mar 2018 20:42:54 +0000 (20:42 +0000)]
Merge cherrypicks of [3782287378295437830253783026378302737830283783029378303037831643783165378316737831683783170378317137831723782288378303137821963782955] into oc-m4-release

Change-Id: Ie5bb0080290b16322833b5ca450689b3ff66892a

6 years agoFixed Security Vulnerability of DcParamObject
Pengquan Meng [Fri, 9 Mar 2018 04:08:25 +0000 (20:08 -0800)]
Fixed Security Vulnerability of DcParamObject

The writeToParcel and readFromParcel is not symmetry, fixed it.

Test: no test
Bug: 70721937
Change-Id: I01f6f6b2ab778ee8b638d9b69fe0a6b9aa7ee395
(cherry picked from commit 8c55a70728fdb0a7b0585fac08629b0137dca51e)

6 years agoUpdate internal ViewPager's SavedState to match Support Library version
Alan Viverette [Fri, 16 Feb 2018 18:56:02 +0000 (13:56 -0500)]
Update internal ViewPager's SavedState to match Support Library version

Merged-In: Ic4569b21d8a26a62bba91742b442f0c3ea8bcc9e
Change-Id: I17d085be9ce1a139e75264f1e715df7f565cd41b
Fixes: 71992105
Test: manual
(cherry picked from commit 187964aca12115c7ab66f59d1ebb95e4f4130ac6)

6 years ago[DO NOT MERGE] Copy PermissionChecker from support lib and use in RcognitionService
Eugene Susla [Thu, 22 Feb 2018 18:39:34 +0000 (10:39 -0800)]
[DO NOT MERGE] Copy PermissionChecker from support lib and use in RcognitionService

Fixes: 7351107673311729
Test: presubmit
Change-Id: Ie98f67ffee4744050ac85d8b229370a16a76a194
(cherry picked from commit 726b51a26e9a54b7352aad90ed15edccc44dd60d)
(cherry picked from commit 5a28e533fe8865ed371b5c0fd909a4ec89f63633)

6 years ago[DO NOT MERGE] Add permission check to setAllowOnlyVpnForUids
Rubin Xu [Thu, 11 Jan 2018 10:59:19 +0000 (10:59 +0000)]
[DO NOT MERGE] Add permission check to setAllowOnlyVpnForUids

Bug: 63000005
Test: runtest frameworks-net -c com.android.server.connectivity.VpnTest
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAlwaysOnVpnLockDown
Merged-In: Ia1a82ee73d8617f3124032986fe6c09c14bf7752
Change-Id: Ia1a82ee73d8617f3124032986fe6c09c14bf7752
(cherry picked from commit f915e04d5010c4dfffad263fa70c1e412e856314)

6 years agoVerify last array's length in readFromParcel
Fyodor Kupolov [Wed, 21 Feb 2018 01:02:35 +0000 (17:02 -0800)]
Verify last array's length in readFromParcel

Length of the last array in readFromParcel should be the same as
value of mNextIndex.

Test: PoC app in the bug
Bug: 73252178
Change-Id: I69f935949e945c3a036b19b4f88684d906079ea5
(cherry picked from commit 3b8bc2e45048527d7682b24b96957c34433da382)

6 years agoDO NOT MERGE - fix AFM.getComponentNameFromContext()
Felipe Leme [Mon, 22 Jan 2018 23:33:40 +0000 (15:33 -0800)]
DO NOT MERGE - fix AFM.getComponentNameFromContext()

This method broke on O-MR1 when I3abf999eb6056c1df7982780bae43b58337c0668
was chery-picked from master.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases \
      -t android.autofillservice.cts.AttachedContextActivityTest#testAutofill
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Also individually ran tests that failed (due to flakiness) when ran in a suite:

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases \
-t android.autofillservice.cts.OptionalSaveActivityTest#testDontShowSaveUiWhenUserManuallyFilled_oneDatasetAllRequiredFields

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.PreSimpleSaveActivityTest #testTapLink_tapBack_thenStartOverBySayingYesAndManualRequest

Fixes: 71960322

Change-Id: Ia093dcefe6699dc9493c46d671e48c2000214b31
Merged-In: I3abf999eb6056c1df7982780bae43b58337c0668
(cherry picked from commit b25b4736db2ea05dce6b9f03e8a9920ab338dd5a)

6 years agoMake sure apps cannot forge package name on AssistStructure used for Autofill.
Felipe Leme [Fri, 1 Dec 2017 01:41:57 +0000 (17:41 -0800)]
Make sure apps cannot forge package name on AssistStructure used for Autofill.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.VirtualContainerActivityTest#testAppCannotFakePackageName
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 69981710

Change-Id: Id6036cddb51dd8dd0c9128b7212d573f630d693f
Merged-In: Id6036cddb51dd8dd0c9128b7212d573f630d693f
(cherry picked from commit 23e61a9086a34405e277868474e003b37ed1b711)

6 years agoSnap for 4657601 from 65ff5247cb85e2bd1fb7f65228542fe8266f6d9e to oc-m4-release
android-build-team Robot [Wed, 21 Mar 2018 21:27:14 +0000 (21:27 +0000)]
Snap for 4657601 from 65ff5247cb85e2bd1fb7f65228542fe8266f6d9e to oc-m4-release

Change-Id: I549a4ec71b46c202ed9209ddea8b147f91b8f294

6 years agoSnap for 4603989 from 833770d26f7813768e195d22ca9c8e41dc83448a to oc-m2-release
android-build-team Robot [Thu, 15 Mar 2018 17:01:09 +0000 (17:01 +0000)]
Snap for 4603989 from 833770d26f7813768e195d22ca9c8e41dc83448a to oc-m2-release

Change-Id: Id2935bbe1630247131e87ed78cc70a7e3aaa0f5b

6 years agoMerge cherrypicks of [3661626, 3661980, 3662429, 3661545, 3661546, 3661579, 3661580...
android-build-team Robot [Mon, 26 Feb 2018 23:53:20 +0000 (23:53 +0000)]
Merge cherrypicks of [36616263661980366242936615453661546366157936615803662430366154736615483661549366155036625783662579366258036625813662582366258336615973661598366155136615523661553366155436615553662596366259736625983662599366258436625853662586366261636626173662618] into oc-m4-release

Change-Id: I7c9c46ea767f4332fbcb7bca50eabaa446acacdc

6 years ago[RTT] ParcelableRttResults parcel code fix
Etan Cohen [Fri, 2 Feb 2018 16:07:20 +0000 (08:07 -0800)]
[RTT] ParcelableRttResults parcel code fix

ParcelableRttResults was unparceled incorrectly.

Bug: 70398564
Test: exploit provided in bug no longer works
Change-Id: Ifd6de547e9861bbebc399b43d0cc2899a8160813
(cherry picked from commit e1e5a2409c8bef2481e68d9329f87bb8037afa45)

6 years agoFix VerifyCredentialResponse parcelling code
Rubin Xu [Wed, 7 Feb 2018 08:10:08 +0000 (08:10 +0000)]
Fix VerifyCredentialResponse parcelling code

There was an asymmetry between parcelling and unparcelling of
VerifyCredentialResponse that could lead to type confusion if
packed with other objects in a Parcel.

Test: none
Bug: 71714464
Change-Id: Icff68879e249422ccca49f2bb7db85c35b4cb353
(cherry picked from commit 54813e988884f0d604d5358569f10feda8622f46)

6 years agoAdjust URI host parsing to stop on \ character.
Adam Vartanian [Wed, 31 Jan 2018 11:05:10 +0000 (11:05 +0000)]
Adjust URI host parsing to stop on \ character.

The WHATWG URL parsing algorithm [1] used by browsers says that for
"special" URL schemes (which is basically all commonly-used
hierarchical schemes, including http, https, ftp, and file), the host
portion ends if a \ character is seen, whereas this class previously
continued to consider characters part of the hostname.  This meant
that a malicious URL could be seen as having a "safe" host when viewed
by an app but navigate to a different host when passed to a browser.

[1] https://url.spec.whatwg.org/#host-state

Bug: 71360761
Test: vogar frameworks/base/core/tests/coretests/src/android/net/UriTest.java (on NYC branch)
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: Id53f7054d1be8d59bbcc7e219159e59a2425106e
(cherry picked from commit fa3afbd0e7a9a0d8fc8c55ceefdb4ddf9d0115af)

6 years agoCheck for null-terminator in ResStringPool::string8At
Adam Lesinski [Fri, 10 Nov 2017 01:12:17 +0000 (17:12 -0800)]
Check for null-terminator in ResStringPool::string8At

All other stringAt methods check for null termination. Be consistent
so that upper levels don't end up with huge corrupt strings.

Bug: 62537081
Test: none
Change-Id: I17bdfb0c1e34507b66c6cad651bbdb12c5d4c417
(cherry picked from commit 3d35a0ea307693a97583a61973e729a5e7db2687)
(cherry picked from commit 97f8cb01149b35b1832c7f9efe85ff19edf1083e)
(cherry picked from commit 5ec65ae909a85d13d03c030be357c8c14a50d306)

6 years agoOutputConfiguration: Fix missing mIsShared in parcel read
Shuzhen Wang [Fri, 8 Dec 2017 20:16:49 +0000 (12:16 -0800)]
OutputConfiguration: Fix missing mIsShared in parcel read

Test: Camera CTS
Bug: 69683251
Merged-In: I7ea4aa8ed4baa5a5e7d25a0073361d827ba86c13
Change-Id: I7ea4aa8ed4baa5a5e7d25a0073361d827ba86c13
(cherry picked from commit 4304a02ac990c1af5fb8f479bdd2b04c8af4fddb)

6 years agoFix bad type for txPower in PeriodicAdvertisingReport serialization
Jakub Pawlowski [Fri, 8 Dec 2017 06:56:03 +0000 (22:56 -0800)]
Fix bad type for txPower in PeriodicAdvertisingReport serialization

Bug: 69634768
Test: compilation
Change-Id: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
Merged-In: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
(cherry picked from commit 5332988c62e2f2ededb29ac3bfc4774551fe956f)

6 years agoSnap for 4565141 from 68505b3110160bb83b68ef0f61663446593d9c06 to oc-m4-release
android-build-team Robot [Mon, 26 Feb 2018 18:09:31 +0000 (18:09 +0000)]
Snap for 4565141 from 68505b3110160bb83b68ef0f61663446593d9c06 to oc-m4-release

Change-Id: Ibf135d197dba570c2fd622f5942d05e5b1ec0da7

6 years agoMerge cherrypicks of [3594034, 3594272, 3594273, 3594274, 3594275, 3594347, 3594035...
android-build-team Robot [Fri, 9 Feb 2018 21:28:44 +0000 (21:28 +0000)]
Merge cherrypicks of [35940343594272359427335942743594275359434735940353592471] into oc-mr1-release

Change-Id: Id0214b5206fd01da1829b1475cef34ecac46f4e2

6 years agofix isActiveNetworkMetered with VPNs
Eric Enslen [Thu, 8 Feb 2018 02:03:53 +0000 (18:03 -0800)]
fix isActiveNetworkMetered with VPNs

Bug: 72871435
Test: flashed and verified, also ran runtest framework-net

Change-Id: I69319a7db269489053426bb2d41574180be2d43d
(cherry picked from commit c81ef199549c552003e78a2b9383d5d38aaed8d0)

6 years agoHandle onBindingDied in notification manager
Ryan Lothian [Mon, 4 Dec 2017 16:56:58 +0000 (11:56 -0500)]
Handle onBindingDied in notification manager

On Android, if the process containing the service being bound to
crashes before the bind succeeds, the app doing the binding won't
get a success or failure callback.

When that happens in this code, this leaves notif. manager thinking
that a binding is in progress, so it never attempts to rebind until
the device is rebooted.

Bug: 69064494
Test: manual, crashed listener on proc start, verified not unbound forever
Change-Id: Id2082744208e21a709d9453365f282449a2e9407
(cherry picked from commit 4a86a51b672617b02994fc812e4f96342daf424e)
(cherry picked from commit 1936097afc3188ed5f2bb4e7211bb404364eeb38)

6 years agoRelax Instant Apps Settings whitelist enforcement
Chad Brubaker [Sun, 24 Dec 2017 04:06:44 +0000 (20:06 -0800)]
Relax Instant Apps Settings whitelist enforcement

The strict whitelist of settings for Instant Apps is leading to too much
unintended breakage, remove the enforcement until better infrastructure
can be added to make sure settings that should be whitelisted are.

Bug: 71009655
Test: Coming in a follow up

(cherry picked from commit b6108d621002d4de708ae526e7c2bc95dabef080)

Change-Id: Iaa1d71331407cee86c10105c1e5668ffd0c925a1
(cherry picked from commit 26ae1d359e02fe5871177c9adfc90ca571fd0f86)

6 years agoMerge cherrypicks of [3581037, 3581038, 3580473, 3580624, 3580656, 3580657, 3580658...
android-build-team Robot [Thu, 8 Feb 2018 04:15:45 +0000 (04:15 +0000)]
Merge cherrypicks of [358103735810383580473358062435806563580657358065835803823580474358047535810393581040358047635802063581527358095535809563580957358095835809593580960358096135809623580963358096435809653580966358156735815683581569358157035815713580625358062635815873581513358151435815153580477358158835806593580660358038335803843580478358071935804793580480358138535815283581041358104235810433581044358104535810463581607358038535804813580482358048335806613580662358066335806643580665358048435804853581608358160935816103581611358161235815893581613358048635815193581627358162835815293581530358153135816293581630] into oc-mr1-release

Change-Id: I107552246742f7f284efd431d810a44d97a223b1

6 years ago[RTT] ParcelableRttResults parcel code fix
Etan Cohen [Fri, 2 Feb 2018 16:07:20 +0000 (08:07 -0800)]
[RTT] ParcelableRttResults parcel code fix

ParcelableRttResults was unparceled incorrectly.

Bug: 70398564
Test: exploit provided in bug no longer works
Change-Id: Ifd6de547e9861bbebc399b43d0cc2899a8160813
(cherry picked from commit e1e5a2409c8bef2481e68d9329f87bb8037afa45)

6 years agoFix VerifyCredentialResponse parcelling code
Rubin Xu [Wed, 7 Feb 2018 08:10:08 +0000 (08:10 +0000)]
Fix VerifyCredentialResponse parcelling code

There was an asymmetry between parcelling and unparcelling of
VerifyCredentialResponse that could lead to type confusion if
packed with other objects in a Parcel.

Test: none
Bug: 71714464
Change-Id: Icff68879e249422ccca49f2bb7db85c35b4cb353
(cherry picked from commit 54813e988884f0d604d5358569f10feda8622f46)

6 years agoUpdate diskstats to break out code & data.
Daniel Nishi [Fri, 15 Sep 2017 00:10:00 +0000 (17:10 -0700)]
Update diskstats to break out code & data.

This updates both the text-based diskstats and the proto-based diskstats
to both have both an aggregated and line-itemed view of app sizes.
Formerly, the code and data sizes were rolled up into the same category
and now they are separated.

Bug: 63908720
Test: FrameworksServicesTest passes
Merged-In: I1434327ffde6ad1f31243218c5201a80f9725a63
(cherry picked from commit b6cc838142d2390eaec99670bb6caf6bee0ec96f)
(cherry picked from commit 41a5ae86f1d51204995af617ef3d1f31b178a618)

Change-Id: I0d21ecc0ded5d715e3b5a478e78de2ba1f7e9ec2

6 years agoAdjust URI host parsing to stop on \ character.
Adam Vartanian [Wed, 31 Jan 2018 11:05:10 +0000 (11:05 +0000)]
Adjust URI host parsing to stop on \ character.

The WHATWG URL parsing algorithm [1] used by browsers says that for
"special" URL schemes (which is basically all commonly-used
hierarchical schemes, including http, https, ftp, and file), the host
portion ends if a \ character is seen, whereas this class previously
continued to consider characters part of the hostname.  This meant
that a malicious URL could be seen as having a "safe" host when viewed
by an app but navigate to a different host when passed to a browser.

[1] https://url.spec.whatwg.org/#host-state

Bug: 71360761
Test: vogar frameworks/base/core/tests/coretests/src/android/net/UriTest.java (on NYC branch)
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: Id53f7054d1be8d59bbcc7e219159e59a2425106e
(cherry picked from commit fa3afbd0e7a9a0d8fc8c55ceefdb4ddf9d0115af)

6 years agoCheck for null-terminator in ResStringPool::string8At
Adam Lesinski [Fri, 10 Nov 2017 01:12:17 +0000 (17:12 -0800)]
Check for null-terminator in ResStringPool::string8At

All other stringAt methods check for null termination. Be consistent
so that upper levels don't end up with huge corrupt strings.

Bug: 62537081
Test: none
Change-Id: I17bdfb0c1e34507b66c6cad651bbdb12c5d4c417
(cherry picked from commit 3d35a0ea307693a97583a61973e729a5e7db2687)
(cherry picked from commit 97f8cb01149b35b1832c7f9efe85ff19edf1083e)
(cherry picked from commit 5ec65ae909a85d13d03c030be357c8c14a50d306)

6 years agoOutputConfiguration: Fix missing mIsShared in parcel read
Shuzhen Wang [Fri, 8 Dec 2017 20:16:49 +0000 (12:16 -0800)]
OutputConfiguration: Fix missing mIsShared in parcel read

Test: Camera CTS
Bug: 69683251
Merged-In: I7ea4aa8ed4baa5a5e7d25a0073361d827ba86c13
Change-Id: I7ea4aa8ed4baa5a5e7d25a0073361d827ba86c13
(cherry picked from commit 4304a02ac990c1af5fb8f479bdd2b04c8af4fddb)

6 years agoFix bad type for txPower in PeriodicAdvertisingReport serialization
Jakub Pawlowski [Fri, 8 Dec 2017 06:56:03 +0000 (22:56 -0800)]
Fix bad type for txPower in PeriodicAdvertisingReport serialization

Bug: 69634768
Test: compilation
Change-Id: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
Merged-In: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
(cherry picked from commit 5332988c62e2f2ededb29ac3bfc4774551fe956f)

6 years agoUse correct user id for permission check for instant foreground service
Svet Ganov [Thu, 7 Dec 2017 07:45:38 +0000 (23:45 -0800)]
Use correct user id for permission check for instant foreground service

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
          -t android.appsecurity.cts.EphemeralTest#testStartForegrondService

bug: 68275646
Bug: 71366502

Change-Id: I196522c49ae8a7e0ec07bf631f04bae51e96db5b

cherry pick from: https://android-review.googlesource.com/c/platform/frameworks/base/+/559340
(cherry picked from commit e32c238ce76151dd6221e6762f841c8f721c45f7)

Change-Id: Idfeae038d42b9dee9f6f57203f2bdb0764f51877
(cherry picked from commit d967610fb865ce2ac5f8c379a13e21feee98fbe0)

6 years agoMetrics wifi.proto for connected wifi score
Michael Plass [Fri, 6 Oct 2017 17:29:51 +0000 (10:29 -0700)]
Metrics wifi.proto for connected wifi score

(cherry picked from commit bb367b689605d0ca3641984b4d59bbe13e6861df)

Bug: 67429363
Bug: 71708302
Test: Wifi unit tests

Change-Id: I2993a02e7b3199c2b50dc2ddb7704fc5b6364025
Merged-In: I315613b8ea3aa1d02810ae376c76083d80865d31
(cherry picked from commit 1b8fe6ef73cdeff9ad7faf6bf695657c9b8df7ff)

6 years agoFixed AUTOFILL_UI_LATENCY metric.
Felipe Leme [Thu, 18 Jan 2018 23:21:36 +0000 (15:21 -0800)]
Fixed AUTOFILL_UI_LATENCY metric.

This metric was using the RESERVED_FOR_LOGBUILDER_COUNTER and hence was not
being picked up.

Bug: 71863561
Fixes: 72175011

Test: adb shell logcat -b events | grep sysui | grep 1136
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Change-Id: I34f701ff5336a413477fd14172d16d8d1e5403ad
(cherry picked from commit b659adb3f3d13049ca1c08fcec2d419ffd7a386b)

6 years agoAdd metric for anomaly detection
jackqdyulei [Tue, 24 Oct 2017 23:32:58 +0000 (16:32 -0700)]
Add metric for anomaly detection

ACTION_APP_STOP_AND_BACKGROUND_CHECK
FIELD_ANOMALY_ACTION_TYPE
ANOMALY_TYPE_WAKELOCK
ANOMALY_TYPE_WAKEUP_ALARM
ANOMALY_TYPE_UNOPTIMIZED_BT

Bug: 68215016
Test: Build
Merged-In: I66f0465a3b89713060948af31c370e9ac894e0ff
Change-Id: I66f0465a3b89713060948af31c370e9ac894e0ff
(cherry picked from commit 7d36b386902117eaec68679499342e35fa7743e9)

6 years agoAdd support for notification of LTE to WIFI handover for video calls.
Tyler Gunn [Thu, 14 Dec 2017 22:06:15 +0000 (14:06 -0800)]
Add support for notification of LTE to WIFI handover for video calls.

Test: Manual, added new unit tests.
Bug: 65490850
Change-Id: I7afbd2d1e783aae425ac3fe640a6e92d1600b9a5
(cherry picked from commit 5ce0d3a6b590c59855f9a8091e62d7e8361d0dd8)

6 years agoTurn default gradient into solid black
Lucas Dupin [Mon, 30 Oct 2017 18:09:25 +0000 (11:09 -0700)]
Turn default gradient into solid black

Test: visual
Bug: 66957450
Change-Id: I6a34a35912e4dd4594565f88636ce89689d26f2f
(cherry picked from commit e7476addecb4fec6abd08cfb7aa27c473ce5c1f0)
(cherry picked from commit 12dad0c4fc5fc8f0988dca0fffd2d26f2cb04195)

6 years ago[PASSPOINT] Add metrics to determine deployment/avail of Passpoint
Etan Cohen [Mon, 9 Oct 2017 17:27:44 +0000 (10:27 -0700)]
[PASSPOINT] Add metrics to determine deployment/avail of Passpoint

Add metrics which will help determine Passpoint availability in the
wild. The metrics measure the percentage of time a Passpoint network
is visible to user - by collecting historgrams of observations per
scan result.

(cherry-pick of commit c462a7a4c15ca7c35002c84de4ff115be12b28a1)

Bug: 66951771
Test: unit test
Merged-In: I8c91f490a533f90a4f0630e1cb461e1d2643358b
Change-Id: I08367ab2c45900c76b65cea980a9b4a335b3dcdb
(cherry picked from commit 8c88b5e2e17fdee5eb192c4bb388472878b79811)

6 years agoAdd assisted dialing properties to the framework.
Eric Erfanian [Thu, 7 Dec 2017 00:27:53 +0000 (16:27 -0800)]
Add assisted dialing properties to the framework.

These properties allow the feature to be propogated from
the outgoing call broadcast, to the connection, to the call,
and finally to the call log as a feature.

Test: no existing unit tests found. could use some pointers
Bug: 35963245
Merged-In: I84343fb0cda16514c01997fd71d1e819b5b7eebb
Change-Id: I086e761ada9a57dca61c3a412561ee54255d6260
(cherry picked from commit 9765e89e1ed533d844583bae5de0026452bf9e70)

6 years ago[AWARE] Make PeerHandle comparable/hashable
Etan Cohen [Mon, 4 Dec 2017 15:53:31 +0000 (07:53 -0800)]
[AWARE] Make PeerHandle comparable/hashable

Add public equals()/hash() methods to PeerHandle. Allows the handle to
be used across multiple calls/sessions.

(partial cherry-pick of commit 3d33d7495ffbf12966299df8359d71a6f0926e7a)
(cherry-pick of commit 0d49c0dda8bfef0267d81e8490e4882e51a15af4)

Bug: 68931709
Test: builds, unit test, integration test
Change-Id: I87df50edb948a7afc90e496165013235ddca1e48
Merged-In: Idc59269d4275181ed6d9a793213c681dc4e98134
Merged-In: I6848acda9bfef306b8feaae6987ff18f7bc2e6ec
(cherry picked from commit 4454bda052aea4087880674bb0e0f81ce2647009)

6 years agoFix issues with TRON app transition logging
Jorim Jaggi [Fri, 20 Oct 2017 12:33:18 +0000 (14:33 +0200)]
Fix issues with TRON app transition logging

There was a case where a app launch started activity A. A step in
the UI finished A and started B in the same task. Next time A was
started it immediately finished itself, putting B at the top of
the task. Now, this launch was considered aborted because A was
finished during launching, making it invisible.

We fix this by modifying the logic to only abort the launch if the
full task is not visible anymore after an activity has been set to
invisible.

There is another case where an app launches A, finishes A, and then
launches B. In this case the home gets visible in between so we
don't consider this an app launch anymore, and correctly cancel
the logging. However it's still useful to know that this is
happening to expose it to the developer, so we log any cancel
events, no matter where they are coming from.

Test: Launch Snapchat, click Sign Up, click home, relaunch
Snapchat from home
Test: Open slow app and press home quickly to test cancel.

Change-Id: I211636c97fd6785adb3fe443a8ffa1ae766946a4
Merged-In: I211636c97fd6785adb3fe443a8ffa1ae766946a4
Fixes: 67094673
(cherry picked from commit a9d408214cd73709ff25f235cf6817eaaf7a23d6)

6 years agoMerge cherrypicks of [3551537, 3552808, 3552809, 3551513, 3551514, 3554326, 3555207...
android-build-team Robot [Sat, 3 Feb 2018 00:11:30 +0000 (00:11 +0000)]
Merge cherrypicks of [3551537355280835528093551513355151435543263555207355520835552093555210355211035551543555155] into oc-m2-release

Change-Id: I70e258cf97c5073fad0c58c4d801ff2ec8076728

6 years agoAdjust URI host parsing to stop on \ character.
Adam Vartanian [Wed, 31 Jan 2018 11:05:10 +0000 (11:05 +0000)]
Adjust URI host parsing to stop on \ character.

The WHATWG URL parsing algorithm [1] used by browsers says that for
"special" URL schemes (which is basically all commonly-used
hierarchical schemes, including http, https, ftp, and file), the host
portion ends if a \ character is seen, whereas this class previously
continued to consider characters part of the hostname.  This meant
that a malicious URL could be seen as having a "safe" host when viewed
by an app but navigate to a different host when passed to a browser.

[1] https://url.spec.whatwg.org/#host-state

Bug: 71360761
Test: vogar frameworks/base/core/tests/coretests/src/android/net/UriTest.java (on NYC branch)
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: Id53f7054d1be8d59bbcc7e219159e59a2425106e
(cherry picked from commit fa3afbd0e7a9a0d8fc8c55ceefdb4ddf9d0115af)

6 years agoCheck for null-terminator in ResStringPool::string8At
Adam Lesinski [Fri, 10 Nov 2017 01:12:17 +0000 (17:12 -0800)]
Check for null-terminator in ResStringPool::string8At

All other stringAt methods check for null termination. Be consistent
so that upper levels don't end up with huge corrupt strings.

Bug: 62537081
Test: none
Change-Id: I17bdfb0c1e34507b66c6cad651bbdb12c5d4c417
(cherry picked from commit 3d35a0ea307693a97583a61973e729a5e7db2687)
(cherry picked from commit 97f8cb01149b35b1832c7f9efe85ff19edf1083e)
(cherry picked from commit 5ec65ae909a85d13d03c030be357c8c14a50d306)

6 years agoOutputConfiguration: Fix missing mIsShared in parcel read
Shuzhen Wang [Fri, 8 Dec 2017 20:16:49 +0000 (12:16 -0800)]
OutputConfiguration: Fix missing mIsShared in parcel read

Test: Camera CTS
Bug: 69683251
Merged-In: I7ea4aa8ed4baa5a5e7d25a0073361d827ba86c13
Change-Id: I7ea4aa8ed4baa5a5e7d25a0073361d827ba86c13
(cherry picked from commit 4304a02ac990c1af5fb8f479bdd2b04c8af4fddb)

6 years agoFix bad type for txPower in PeriodicAdvertisingReport serialization
Jakub Pawlowski [Fri, 8 Dec 2017 06:56:03 +0000 (22:56 -0800)]
Fix bad type for txPower in PeriodicAdvertisingReport serialization

Bug: 69634768
Test: compilation
Change-Id: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
Merged-In: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
(cherry picked from commit 5332988c62e2f2ededb29ac3bfc4774551fe956f)

6 years agoUse correct user id for permission check for instant foreground service
Svet Ganov [Thu, 7 Dec 2017 07:45:38 +0000 (23:45 -0800)]
Use correct user id for permission check for instant foreground service

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
          -t android.appsecurity.cts.EphemeralTest#testStartForegrondService

bug: 68275646
Bug: 71366502

Change-Id: I196522c49ae8a7e0ec07bf631f04bae51e96db5b

cherry pick from: https://android-review.googlesource.com/c/platform/frameworks/base/+/559340
(cherry picked from commit e32c238ce76151dd6221e6762f841c8f721c45f7)

Change-Id: Idfeae038d42b9dee9f6f57203f2bdb0764f51877
(cherry picked from commit d967610fb865ce2ac5f8c379a13e21feee98fbe0)

6 years agoMerge cherrypicks of [3536650, 3536562, 3536563, 3536481, 3535874, 3536495, 3536496...
android-build-team Robot [Tue, 30 Jan 2018 21:05:08 +0000 (21:05 +0000)]
Merge cherrypicks of [35366503536562353656335364813535874353649535364963536632353663335364343535900] into oc-m2-release

Change-Id: I5665b657607cd31a5ca9ce74371037726ba43145

6 years agoMetrics wifi.proto for connected wifi score
Michael Plass [Fri, 6 Oct 2017 17:29:51 +0000 (10:29 -0700)]
Metrics wifi.proto for connected wifi score

(cherry picked from commit bb367b689605d0ca3641984b4d59bbe13e6861df)

Bug: 67429363
Bug: 71708302
Test: Wifi unit tests

Change-Id: I2993a02e7b3199c2b50dc2ddb7704fc5b6364025
Merged-In: I315613b8ea3aa1d02810ae376c76083d80865d31
(cherry picked from commit 1b8fe6ef73cdeff9ad7faf6bf695657c9b8df7ff)

6 years agoMerge cherrypicks of [3519487, 3519488, 3520743, 3521264, 3521265] into oc-m2-release
android-build-team Robot [Fri, 26 Jan 2018 19:14:28 +0000 (19:14 +0000)]
Merge cherrypicks of [35194873519488352074335212643521265] into oc-m2-release

Change-Id: I890e0abea705523c9dc9c38818a74b6d0a939a61

6 years agoRelax Instant Apps Settings whitelist enforcement
Chad Brubaker [Sun, 24 Dec 2017 04:06:44 +0000 (20:06 -0800)]
Relax Instant Apps Settings whitelist enforcement

The strict whitelist of settings for Instant Apps is leading to too much
unintended breakage, remove the enforcement until better infrastructure
can be added to make sure settings that should be whitelisted are.

Bug: 71009655
Test: Coming in a follow up

(cherry picked from commit b6108d621002d4de708ae526e7c2bc95dabef080)

Change-Id: Iaa1d71331407cee86c10105c1e5668ffd0c925a1
(cherry picked from commit 26ae1d359e02fe5871177c9adfc90ca571fd0f86)

6 years agoFixed AUTOFILL_UI_LATENCY metric.
Felipe Leme [Thu, 18 Jan 2018 23:21:36 +0000 (15:21 -0800)]
Fixed AUTOFILL_UI_LATENCY metric.

This metric was using the RESERVED_FOR_LOGBUILDER_COUNTER and hence was not
being picked up.

Bug: 71863561
Fixes: 72175011

Test: adb shell logcat -b events | grep sysui | grep 1136
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Change-Id: I34f701ff5336a413477fd14172d16d8d1e5403ad
(cherry picked from commit b659adb3f3d13049ca1c08fcec2d419ffd7a386b)

6 years agoDO NOT MERGE - fix AFM.getComponentNameFromContext()
Felipe Leme [Mon, 22 Jan 2018 23:33:40 +0000 (15:33 -0800)]
DO NOT MERGE - fix AFM.getComponentNameFromContext()

This method broke on O-MR1 when I3abf999eb6056c1df7982780bae43b58337c0668
was chery-picked from master.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases \
      -t android.autofillservice.cts.AttachedContextActivityTest#testAutofill
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Also individually ran tests that failed (due to flakiness) when ran in a suite:

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases \
-t android.autofillservice.cts.OptionalSaveActivityTest#testDontShowSaveUiWhenUserManuallyFilled_oneDatasetAllRequiredFields

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.PreSimpleSaveActivityTest #testTapLink_tapBack_thenStartOverBySayingYesAndManualRequest

Fixes: 71960322

Change-Id: Ia093dcefe6699dc9493c46d671e48c2000214b31
Merged-In: I3abf999eb6056c1df7982780bae43b58337c0668
(cherry picked from commit b25b4736db2ea05dce6b9f03e8a9920ab338dd5a)

6 years agoMerge cherrypicks of [3509910] into oc-mr1-release
android-build-team Robot [Thu, 25 Jan 2018 02:26:12 +0000 (02:26 +0000)]
Merge cherrypicks of [3509910] into oc-mr1-release

Change-Id: Id1d5683a00a88832ec7bf746fa7bb918a8d7579c

6 years agoOMS: Only allow trusted overlays to be registered.
Adam Lesinski [Tue, 14 Nov 2017 08:50:18 +0000 (00:50 -0800)]
OMS: Only allow trusted overlays to be registered.

Bug: 69383160
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.OverlayHostTest
Change-Id: I930c11716317cff1ec485a3943d1f22f07a423df
Merged-In: I930c11716317cff1ec485a3943d1f22f07a423df
(cherry picked from commit 80609e584c9c6155ed3199109735ec8d16f6115c)

6 years agoMerge cherrypicks of [3484108, 3483651] into oc-m2-release
android-build-team Robot [Fri, 19 Jan 2018 18:51:21 +0000 (18:51 +0000)]
Merge cherrypicks of [34841083483651] into oc-m2-release

Change-Id: Ibeefb03c27e7f04dddd770533c2c8fd4ac52df0b

6 years agoAdd metric for anomaly detection
jackqdyulei [Tue, 24 Oct 2017 23:32:58 +0000 (16:32 -0700)]
Add metric for anomaly detection

ACTION_APP_STOP_AND_BACKGROUND_CHECK
FIELD_ANOMALY_ACTION_TYPE
ANOMALY_TYPE_WAKELOCK
ANOMALY_TYPE_WAKEUP_ALARM
ANOMALY_TYPE_UNOPTIMIZED_BT

Bug: 68215016
Test: Build
Merged-In: I66f0465a3b89713060948af31c370e9ac894e0ff
Change-Id: I66f0465a3b89713060948af31c370e9ac894e0ff
(cherry picked from commit 7d36b386902117eaec68679499342e35fa7743e9)

6 years agoMerge cherrypicks of [3478238, 3478653, 3478239, 3478580, 3478612, 3478240, 3478654...
android-build-team Robot [Thu, 18 Jan 2018 22:44:19 +0000 (22:44 +0000)]
Merge cherrypicks of [347823834786533478239347858034786123478240347865434786553478656347949434794953478933347893434794963479497347949834781603478161347816234788763478877347887834782413478163347816434781653478166347816734781683478169347999034799913479992348001034800113480012] into oc-m2-release

Change-Id: Ia25b4308ed0e59b88d02d2b7388addb421cb99c2

6 years agoProper autofill fix to let phone process autofill Settings activity.
Felipe Leme [Mon, 11 Dec 2017 22:37:35 +0000 (14:37 -0800)]
Proper autofill fix to let phone process autofill Settings activity.

Test: adb shell am start com.android.settings/.RadioInfo
Bug: 69981710
Fixes: 70506888

Change-Id: Id29bad2d20b621f7379eb6144c95dcc819949b3d
Merged-In: Id29bad2d20b621f7379eb6144c95dcc819949b3d
(cherry picked from commit 97f16a76db29269619d9a1b45d4cea49026a5b6a)
(cherry picked from commit 92b5d2783a1b97bee476f04754481403839b4e45)

6 years agoOMS: Only allow trusted overlays to be registered.
Adam Lesinski [Tue, 14 Nov 2017 08:50:18 +0000 (00:50 -0800)]
OMS: Only allow trusted overlays to be registered.

Bug: 69383160
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.OverlayHostTest
Change-Id: I930c11716317cff1ec485a3943d1f22f07a423df
Merged-In: I930c11716317cff1ec485a3943d1f22f07a423df
(cherry picked from commit 80609e584c9c6155ed3199109735ec8d16f6115c)

6 years agoMake sure apps cannot forge package name on AssistStructure used for Autofill.
Felipe Leme [Fri, 1 Dec 2017 01:41:57 +0000 (17:41 -0800)]
Make sure apps cannot forge package name on AssistStructure used for Autofill.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.VirtualContainerActivityTest#testAppCannotFakePackageName
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 69981710

Change-Id: Id6036cddb51dd8dd0c9128b7212d573f630d693f
Merged-In: Id6036cddb51dd8dd0c9128b7212d573f630d693f
(cherry picked from commit 23e61a9086a34405e277868474e003b37ed1b711)

6 years agoMerge cherrypicks of [3463668, 3464926, 3464927, 3464663, 3464895, 3464928, 3464896...
android-build-team Robot [Tue, 16 Jan 2018 21:39:21 +0000 (21:39 +0000)]
Merge cherrypicks of [346366834649263464927346466334648953464928346489634646643464665346466634644923464456346492934654923465473] into oc-m2-release

Change-Id: Id509cbd1072540b4d396afaafb3e9d3fb0248970

6 years agoAdd support for notification of LTE to WIFI handover for video calls.
Tyler Gunn [Thu, 14 Dec 2017 22:06:15 +0000 (14:06 -0800)]
Add support for notification of LTE to WIFI handover for video calls.

Test: Manual, added new unit tests.
Bug: 65490850
Change-Id: I7afbd2d1e783aae425ac3fe640a6e92d1600b9a5
(cherry picked from commit 5ce0d3a6b590c59855f9a8091e62d7e8361d0dd8)

6 years agoMerge cherrypicks of [3436310, 3434392, 3435998, 3435077, 3435273, 3436350, 3434393...
android-build-team Robot [Tue, 9 Jan 2018 22:04:25 +0000 (22:04 +0000)]
Merge cherrypicks of [343631034343923435998343507734352733436350343439334343943434395343469634359993434352343435334343543435080343604134343553435813343508234350843434396343439734360613436000] into oc-m2-release

Change-Id: I0e2fceb57ae7623495c27bcb0071276669b6bb23

6 years agoTurn default gradient into solid black
Lucas Dupin [Mon, 30 Oct 2017 18:09:25 +0000 (11:09 -0700)]
Turn default gradient into solid black

Test: visual
Bug: 66957450
Change-Id: I6a34a35912e4dd4594565f88636ce89689d26f2f
(cherry picked from commit e7476addecb4fec6abd08cfb7aa27c473ce5c1f0)
(cherry picked from commit 12dad0c4fc5fc8f0988dca0fffd2d26f2cb04195)

6 years ago[PASSPOINT] Add metrics to determine deployment/avail of Passpoint
Etan Cohen [Mon, 9 Oct 2017 17:27:44 +0000 (10:27 -0700)]
[PASSPOINT] Add metrics to determine deployment/avail of Passpoint

Add metrics which will help determine Passpoint availability in the
wild. The metrics measure the percentage of time a Passpoint network
is visible to user - by collecting historgrams of observations per
scan result.

(cherry-pick of commit c462a7a4c15ca7c35002c84de4ff115be12b28a1)

Bug: 66951771
Test: unit test
Merged-In: I8c91f490a533f90a4f0630e1cb461e1d2643358b
Change-Id: I08367ab2c45900c76b65cea980a9b4a335b3dcdb
(cherry picked from commit 8c88b5e2e17fdee5eb192c4bb388472878b79811)

6 years agoAdd assisted dialing properties to the framework.
Eric Erfanian [Thu, 7 Dec 2017 00:27:53 +0000 (16:27 -0800)]
Add assisted dialing properties to the framework.

These properties allow the feature to be propogated from
the outgoing call broadcast, to the connection, to the call,
and finally to the call log as a feature.

Test: no existing unit tests found. could use some pointers
Bug: 35963245
Merged-In: I84343fb0cda16514c01997fd71d1e819b5b7eebb
Change-Id: I086e761ada9a57dca61c3a412561ee54255d6260
(cherry picked from commit 9765e89e1ed533d844583bae5de0026452bf9e70)

6 years ago[AWARE] Make PeerHandle comparable/hashable
Etan Cohen [Mon, 4 Dec 2017 15:53:31 +0000 (07:53 -0800)]
[AWARE] Make PeerHandle comparable/hashable

Add public equals()/hash() methods to PeerHandle. Allows the handle to
be used across multiple calls/sessions.

(partial cherry-pick of commit 3d33d7495ffbf12966299df8359d71a6f0926e7a)
(cherry-pick of commit 0d49c0dda8bfef0267d81e8490e4882e51a15af4)

Bug: 68931709
Test: builds, unit test, integration test
Change-Id: I87df50edb948a7afc90e496165013235ddca1e48
Merged-In: Idc59269d4275181ed6d9a793213c681dc4e98134
Merged-In: I6848acda9bfef306b8feaae6987ff18f7bc2e6ec
(cherry picked from commit 4454bda052aea4087880674bb0e0f81ce2647009)

6 years agoFix issues with TRON app transition logging
Jorim Jaggi [Fri, 20 Oct 2017 12:33:18 +0000 (14:33 +0200)]
Fix issues with TRON app transition logging

There was a case where a app launch started activity A. A step in
the UI finished A and started B in the same task. Next time A was
started it immediately finished itself, putting B at the top of
the task. Now, this launch was considered aborted because A was
finished during launching, making it invisible.

We fix this by modifying the logic to only abort the launch if the
full task is not visible anymore after an activity has been set to
invisible.

There is another case where an app launches A, finishes A, and then
launches B. In this case the home gets visible in between so we
don't consider this an app launch anymore, and correctly cancel
the logging. However it's still useful to know that this is
happening to expose it to the developer, so we log any cancel
events, no matter where they are coming from.

Test: Launch Snapchat, click Sign Up, click home, relaunch
Snapchat from home
Test: Open slow app and press home quickly to test cancel.

Change-Id: I211636c97fd6785adb3fe443a8ffa1ae766946a4
Merged-In: I211636c97fd6785adb3fe443a8ffa1ae766946a4
Fixes: 67094673
(cherry picked from commit a9d408214cd73709ff25f235cf6817eaaf7a23d6)

6 years agoSnap for 4527419 from 23fbf77b8d604a062abbfc53841935e3437876b7 to oc-m2-release
android-build-team Robot [Fri, 5 Jan 2018 18:58:04 +0000 (18:58 +0000)]
Snap for 4527419 from 23fbf77b8d604a062abbfc53841935e3437876b7 to oc-m2-release

Change-Id: Id9802da6080eb008b7262ee6cb69d383817b8826

6 years agoSnap for 4485699 from df0b5eed48a59c6f4f86b082352a957e0e6610ba to oc-m2-release
android-build-team Robot [Wed, 3 Jan 2018 22:37:53 +0000 (22:37 +0000)]
Snap for 4485699 from df0b5eed48a59c6f4f86b082352a957e0e6610ba to oc-m2-release

Change-Id: I2b47c51e179b5a92ecf972f4b25d20fe2f1b05e7

6 years agoMerge cherrypicks of [3365569, 3365570, 3366860, 3366878, 3365571, 3365572, 3366918...
android-build-team Robot [Thu, 14 Dec 2017 21:22:17 +0000 (21:22 +0000)]
Merge cherrypicks of [336556933655703366860336687833655713365572336691833655733365589336559033669383366902336557433655753365576336557733669583365824336559133669593366960336696133669623366963336696433669653366919336696633669673366968336696933669703367018336701933655923365593336698533658253366988336698933669903366991336699233669933366994336700433670053367006336700733670083367009336701033670113367012336701333670143367015336701633670173367038336703933670403367041336704233670443367045336704633670493367050336705233670533367054336705533670563366920336692133669223367079] into oc-mr1-release

Change-Id: Iae843903b50e7df11a333cabfff45861e4a17355

6 years agoSwap the order of synthetic password wrapping
Rubin Xu [Tue, 31 Oct 2017 15:40:32 +0000 (15:40 +0000)]
Swap the order of synthetic password wrapping

Synthetic password is double encrypted by both a random auth-bound keymaster
key and a secret derived from user password. In order to avoid a password
verification oracle without rate limiting, synthetic password needs to be
encrypted by the derived secret first, and then the auth-bound key. This
change corrects the order of encryptions, as well as adds an upgrade path to
refresh existing credentials.

Test: Running an old build with existing password, flash to new build,
      verify the device unlocks successfully.
Bug: 68694819

Change-Id: Ifdaa01f3f4ddd5bb3f3d808d38f440ced729034f
Merged-In: Ifdaa01f3f4ddd5bb3f3d808d38f440ced729034f
(cherry picked from commit 78acfe71d5d527ec727ffa3ad33f0de6255d60d7)

6 years agoMerge cherrypicks of [3276508, 3277765, 3277766, 3277904, 3276473, 3278009, 3278010...
android-build-team Robot [Tue, 28 Nov 2017 03:35:27 +0000 (03:35 +0000)]
Merge cherrypicks of [327650832777653277766327790432764733278009327801032777673277768327776932777703276509327651032780113278012327801332780143278099327810032781013278102327810332781043278105327810632778003276474327801532780163278017327811832781193278120327812132781223277946327790532779473277906327775132781233277752327811032777713277907327809532779083278111327777232764753276476] into oc-mr1-release

Change-Id: I2f4ccf6bf2dd0827493d7cc3429d9535da532ca5

6 years agoMore dimming tweaks (for accessibility)
Jason Monk [Wed, 8 Nov 2017 20:51:59 +0000 (15:51 -0500)]
More dimming tweaks (for accessibility)

 - Don't dim when battery saver bar is showing.
 - Bump alpha by 10% for light nav bar

Test: manual
Change-Id: I296aa68c0904f7972dd941eb1aac3b4c71114eee
Fixes: 63630024
(cherry picked from commit cdec5ff9f496e345d1e2e40f3d36d66938ace5f6)

6 years agoAdjust Uri host parsing to use last instead of first @.
Adam Vartanian [Tue, 7 Nov 2017 12:22:23 +0000 (12:22 +0000)]
Adjust Uri host parsing to use last instead of first @.

Malformed authority segments can currently cause the parser to produce
a hostname that doesn't match the hostname produced by the WHATWG URL
parsing algorithm* used by browsers, which means that a URL could be seen
as having a "safe" host when checked by an Android app but actually visit
a different host when passed to a browser.  The WHATWG URL parsing
algorithm always produces a hostname based on the last @ in the authority
segment, so we do the same.

* https://url.spec.whatwg.org/#authority-state resets the "buffer", which
  is being used to build up the host name, each time an @ is found, so it
  has the effect of using the content between the final @ and the end
  of the authority section as the hostname.

Bug: 68341964
Test: vogar android.net.UriTest (on NYC branch)
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: Idca79f35a886de042c94d6ab66787c2e98ac8376
(cherry picked from commit cd6228dd377b2a0caa02a1e6df92f3d9ae702a95)

6 years agoThrow OOME if Bitmap.nativeCreate fails
Leon Scroggins III [Tue, 3 Oct 2017 18:00:20 +0000 (14:00 -0400)]
Throw OOME if Bitmap.nativeCreate fails

Bug:33846679
Test: I6ab6cb7a3b3151641a9f9b02b0bfc484e0a4524b

This matches the old behavior, prior to switching from Java allocated
pixel memory to native allocations (b/27762775). It also better matches
what has happened - we ran out of memory. (Better than the current
behavior - NullPointerException in the Java code, or an alternative
solution of returning null, which would likely result in NPEs in the
calling code.)

Merged-In: I3958ed1106ac94fb1d3f30e044b620d984875211
Change-Id: I3958ed1106ac94fb1d3f30e044b620d984875211
(cherry picked from commit 5906a4869cdf5c39eba1d9a3125aff894c5e804d)

6 years agomtp: fix double free of thumbnail data
Chong Zhang [Tue, 24 Oct 2017 23:07:18 +0000 (16:07 -0700)]
mtp: fix double free of thumbnail data

bug: 67864232
Change-Id: I6eb51be839df12317273830521c70a4ed80f9496
(cherry picked from commit e6b98532ee03d0ac1ca93382699893172454a946)

6 years agoSnap for 4431872 from 250714c67ba9d2029bc88284672949a87b243b9a to oc-m2-release
android-build-team Robot [Fri, 3 Nov 2017 22:41:10 +0000 (22:41 +0000)]
Snap for 4431872 from 250714c67ba9d2029bc88284672949a87b243b9a to oc-m2-release

Change-Id: I959e83ca9924df486c7e27876a5a354a8d46df9e

6 years agoMerge cherrypicks of [3156476, 3155698, 3156194, 3156639, 3156018, 3156477, 3156098...
android-build-team Robot [Thu, 2 Nov 2017 04:50:11 +0000 (04:50 +0000)]
Merge cherrypicks of [3156476315569831561943156639315601831564773156098315609931561003156101315610231583933155699315570031561953156196315601931560203158394] into oc-mr1-release

Change-Id: I5b1e8ce0b0d4c129cf502ab21733dd7bc65aed67

6 years agoPreventing recursive referrence in drawables
Sunny Goyal [Wed, 1 Nov 2017 18:58:13 +0000 (11:58 -0700)]
Preventing recursive referrence in drawables

Bug: 68706673
Bug: 66498711
Test: Added CTS tests
Change-Id: I8034f49d16f9a7bc1749714fd6d6231bba5088d0
(cherry picked from commit 99b25d2817a1058e56c5384a43040e0f3f291ce1)

6 years agoRespect legacy color mode settings
Christine Franks [Mon, 30 Oct 2017 23:22:37 +0000 (16:22 -0700)]
Respect legacy color mode settings

Bug: 68411440
Test: make -j100, verified starting with each of the three options.
Change-Id: I73e701a86733e0f8a5d017949052b16cdf58f398
(cherry picked from commit 17947177b38c0b583ce263b1f66454b84cb5959e)
(cherry picked from commit 8ab97c1e417620b99a2057b7dd6ad59ecc419853)

6 years agoAllow dnd access for secondary users
Julia Reynolds [Thu, 26 Oct 2017 15:30:31 +0000 (11:30 -0400)]
Allow dnd access for secondary users

Test: runtest systemui-notification
Change-Id: Ie63b767bcd25b7b3e7cac08afcf3351adc97263f
Merged-In: Ie63b767bcd25b7b3e7cac08afcf3351adc97263f
Fixes: 68060759
(cherry picked from commit ee611537e935ca419b4333cc82c9dee5d2e7a92d)

6 years agoDO NOT MERGE Remove orientation restriction to only fullscreen activities.
Bryce Lee [Tue, 31 Oct 2017 18:35:55 +0000 (11:35 -0700)]
DO NOT MERGE Remove orientation restriction to only fullscreen activities.

This changelist removes checks that enforce that only fullscreen,
opaque activities may request orientation changes. An application
may itself be compatible with the change and update their SDK level.
However, it is possible they use a library that has not itself been
updated and still leverages this feature for non-fullscreen
activities.

Fixes: 68684796
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests

Change-Id: Ib5a60f0b660ad145d07e953e541a0a1b801aeef2
(cherry picked from commit a89b183ef9323f4426941b207e2378064b5c7de3)

6 years agoAAPT2: Allow for nested inline xmls
Michael Wachenschwanz [Tue, 31 Oct 2017 02:06:23 +0000 (19:06 -0700)]
AAPT2: Allow for nested inline xmls

Add recursion to InlineXmlFormatParser::Consume for handling nested
aapt:attr

Change-Id: Iabf98945b4f5ef22a3b8fdc4ca2bac092a377629
Fixes: 64385167
Test: make aapt2_tests
(cherry picked from commit 7b6b02bd13aea90b938c3ab3b1eaa3fb5043f931)
(cherry picked from commit c8f5fc284cc635f7056307e55121e439b21ac83a)

6 years agoSnap for 4420879 from 37e2e248430976004df02588e9ff489bb2cd5ae8 to oc-m2-release
android-build-team Robot [Tue, 31 Oct 2017 22:27:21 +0000 (22:27 +0000)]
Snap for 4420879 from 37e2e248430976004df02588e9ff489bb2cd5ae8 to oc-m2-release

Change-Id: I5f749352e90ff6505678c6e7c3cf83ed6227e977

6 years agoMerge cherrypicks of [3134552, 3130583, 3131953, 3131954, 3131955, 3131956, 3131957...
android-build-team Robot [Fri, 27 Oct 2017 14:49:38 +0000 (14:49 +0000)]
Merge cherrypicks of [3134552313058331319533131954313195531319563131957313195831319593132062313233631310743133939313102431310253131026313058431308793130880] into oc-mr1-release

Change-Id: I345643be0750801a95bd6a61a235f1576501807f

6 years agoGive fg services a shelf life before they go bad.
Dan Sandler [Fri, 27 Oct 2017 03:27:57 +0000 (23:27 -0400)]
Give fg services a shelf life before they go bad.

When a fg service starts (as indicated by its presence in a
NOTE_FOREGROUND_SERVICES notification), we note the service
start time (as encoded in Notification.when in ActivityMgr).

SysUI will suppress the dungeon (foreground service
disclosure) notification until 5 seconds have elapsed since
the earliest service start time. After that, if the service
is still running, the disclosure will be shown.

Bug: 67819284
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java
Change-Id: I5b6df95eb673e2f551aaa3ecc5a7df617f815a90
(cherry picked from commit 9830b5a8e41c3b477064e3b378734fc129e8342f)

6 years agoAllow internal services access to instant apps
Todd Kennedy [Wed, 25 Oct 2017 17:11:09 +0000 (10:11 -0700)]
Allow internal services access to instant apps

Any system UID [those with a UID < Process.FIRST_APPLICATION_UID] should be
able to see instant applications. These are trusted processes and will often
need to verify permissions of the calling instant app.

Change-Id: I4ec899ffd45d931a17d4ea0bfacf3004d3e074ef
Fixes: 67849834
Test: Manual.
Test: Install hellozip_base.apk from bug:
Test:  $ adb install --instantapp -i com.android.vending hellozip_base.apk
Test: Run hellozip
Test:  $ adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d https://hello.samples.androidinstantapps.com/hello
Test: Try to capture a photo and see that the app crashes with a SecurityException before the patch and that a photo is taken after the patch
Test: Try to record audio and see that the app crashes with an IllegalStateException before the patch and that the app doesn't crash after the patch
(cherry picked from commit 17e40d2fb6d5ad2be3b71d3bc1232ea84f6596b6)

6 years agoAAPT: treat "-I" with lower precedence than main APK for dumping.
Donald Chai [Fri, 13 Oct 2017 04:00:45 +0000 (21:00 -0700)]
AAPT: treat "-I" with lower precedence than main APK for dumping.

This is the desired behavior if resource IDs may overlap, and also happens to
improve the behavior of:

  aapt dump -I base.apk badging feature.apk

when both APKs use the same package name with different package IDs
(base=0x7F, feature=0x80).  Previously, the final call to
DynamicRefTable::addMapping was for base.apk, and all references to 0x80 were
rewritten in DynamicRefTable::lookupResourceId to 0x7F.  After this
change resources defined in both APKs are resolved correctly.

Note that this is a bit of kludge, and APKs should use different names
to avoid conflating the package IDs.

Fixes: 67070085
Bug: 64058531
Test: manual with sample in b/67070085#comment2
Change-Id: I285adb6f44a297440b08fc7a1f9ad73c700eb9bc
(cherry picked from commit d1ac6e1f9ea3a4d6c0d6d4a118c61526b8234a5f)
(cherry picked from commit 94251fac62b12f030c404132a395fdef73e7ab29)

6 years agoAAPT leave <gradient> alone for VDC
ztenghui [Fri, 13 Oct 2017 22:56:08 +0000 (15:56 -0700)]
AAPT leave <gradient> alone for VDC

bug: 62421666
Test: Tested with changes for Gradient of VDC.

Change-Id: I07b39721aeaaafd888416a0f71f6cbd5fce97732
(cherry picked from commit ab2a38c03d54fad1ed0873ac091959ee38823cd6)
(cherry picked from commit f49cce3aa6f625cfc7288886c044992e1580dbbc)

6 years agoAAPT2: Sanitize resource qualifiers before using in split names.
Donald Chai [Thu, 19 Oct 2017 06:51:18 +0000 (23:51 -0700)]
AAPT2: Sanitize resource qualifiers before using in split names.

Fixes: 67960909
Test: UtilTest.SplitNamesAreSanitized
Change-Id: I9ba1b8430a00cc7ce981075a60388f275c41dbea
(cherry picked from commit b8f078c9a0c9f32ad84c475c26299ecb00962ffa)
(cherry picked from commit 50bae79111afcdb8d36d73cac15155cb61df2dc0)

6 years agoSnap for 4417144 from 4745025d36ce428dce07ef13ee6039f7234ea087 to oc-m2-release
android-build-team Robot [Thu, 26 Oct 2017 20:02:18 +0000 (20:02 +0000)]
Snap for 4417144 from 4745025d36ce428dce07ef13ee6039f7234ea087 to oc-m2-release

Change-Id: I3e3c4343b9aae5ddbc205a1f28470a5fe9e1247c