OSDN Git Service

android-x86/frameworks-base.git
6 years agoMerge "ResStringPool: Prevenet boot loop from se fix" into mnc-dev
TreeHugger Robot [Wed, 6 Jun 2018 22:09:54 +0000 (22:09 +0000)]
Merge "ResStringPool: Prevenet boot loop from se fix" into mnc-dev

6 years agoResStringPool: Prevenet boot loop from se fix
Ryan Mitchell [Mon, 21 May 2018 20:59:23 +0000 (13:59 -0700)]
ResStringPool: Prevenet boot loop from se fix

Changes the logs adding in a previous security fix to warnings so
devices with malformed APKs currently on them will not undergo DOS when
they are upgraded to P.

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

Change-Id: Ied54e4bb14abdaf79da562022c7ea6075187c1f8
(cherry picked from commit f05f47b2c1838529e682ad8f931d3da72244b1a1)

6 years agoOptimise the hit test algorithm
Mihai Popa [Wed, 9 May 2018 16:31:48 +0000 (17:31 +0100)]
Optimise the hit test algorithm

Layout#getOffsetForHorizontal was running in O(n^2) time, where n is the
length of the current line. The method is used when a touch event
happens on a text line, to compute the cursor offset (and the character)
where it happened. Although this is not an issue in common usecases,
where the number of characters on a line is relatively small, this can
be very inefficient as a consequence of Unicode containing 0-width
(invisible) characters. Specifically, there are characters defining the
text direction (LTR or RTL), which cause our algorithm to touch the
worst case quadratic runtime. For example, a person is able to send a
message containing a few visible characters, and also a lot of these
direction changing invisible ones. When the receiver touches the message
(causing the Layout#getOffsetForHorizontal method to be called), the
receiver's application would become not responsive.

This CL optimizes the method to run in O(n) worst case. This is achieved
by computing the measurements of all line prefixes at first, which can
be done in a single pass. Then, all the prefix measurement queries will
be answered in O(1), rather than O(n) as it was happening before.

Bug: 79215201
Test: manual testing
Change-Id: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
Merged-In: Ib66ef392c19c937718e7101f6d48fac3abe51ad0

6 years agoclearCallingIdentity before calling into getPackageUidAsUser
Tony Mak [Thu, 14 Dec 2017 12:40:07 +0000 (12:40 +0000)]
clearCallingIdentity before calling into getPackageUidAsUser

Fix: 70585244
Bug: 69981755

Test: Enable any accessibility service -> inflate work profile
      -> Tap on any work app -> no longer crash

Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.CrossProfileAppsHostSideTest.testPrimaryUserToManagedProfile
Change-Id: I80d18f4e2ab76a228cb0aa2c8312c323a9b5c84d

6 years agoNullcheck to fix Autofill CTS
Eugene Susla [Mon, 11 Dec 2017 18:07:03 +0000 (10:07 -0800)]
Nullcheck to fix Autofill CTS

Test: presubmit
Fixes: 70506475
Bug: 69981755
Change-Id: I187bed4889a4901a7137a2995178ea651ed09186

6 years agoDO NOT MERGE Truncate newline and tab characters in BluetoothDevice name
Hansong Zhang [Thu, 26 Apr 2018 21:13:45 +0000 (14:13 -0700)]
DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name

Test: manual
Bug: 73173182
Change-Id: I3c25af233742e63351a68e8c5a279b51a94e49e2

6 years agoMerge "DO NOT MERGE (M) Revoke permision when group changed" into mnc-dev
TreeHugger Robot [Sat, 14 Apr 2018 01:56:10 +0000 (01:56 +0000)]
Merge "DO NOT MERGE (M) Revoke permision when group changed" into mnc-dev

6 years agoDO NOT MERGE (M) Revoke permision when group changed
Philip P. Moltmann [Thu, 12 Apr 2018 23:44:43 +0000 (16:44 -0700)]
DO NOT MERGE (M) 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
Bug: 72710897
Change-Id: Ib2165d1ae53b80455ebe02e07775853e37a2e339

6 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

6 years agoRESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to...
akirilov [Thu, 22 Mar 2018 21:01:44 +0000 (14:01 -0700)]
RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to mnc-dev)

Test: added AccessibilityEndToEndTest#testPackageNameCannotBeFaked
      cts-tradefed run cts --package android.accessibilityservice
      cts-tradefed run cts --package android.accessibility

BUG:69981755

Change-Id: Id9990ccf1e88cea441f9b8927e849e67a059cfe4

6 years agoFix issue #27317952: PendingIntent.getIntent() should be protected
Dianne Hackborn [Tue, 1 Mar 2016 02:02:43 +0000 (18:02 -0800)]
Fix issue #27317952: PendingIntent.getIntent() should be protected

Bug: 64752751
Change-Id: Ib05135cd94f5251942a6fc6df542ed39083f7827
(cherry picked from commit e5ad41bc022db99c4f6663da0a9e49356c006741)

6 years agoDO NOT MERGE Rework thumbnail cleanup
Marco Nelissen [Tue, 7 Nov 2017 21:52:02 +0000 (13:52 -0800)]
DO NOT MERGE Rework thumbnail cleanup

Bug: 63766886
Test: ran CTS tests
Change-Id: I1f92bb014e275eafe3f42aef1f8c817f187c6608
Merged-In: I1f92bb014e275eafe3f42aef1f8c817f187c6608

6 years agoDO NOT MERGE Fix build with SDK 24-like implementation of constructor
Alan Viverette [Tue, 13 Mar 2018 17:56:24 +0000 (13:56 -0400)]
DO NOT MERGE Fix build with SDK 24-like implementation of constructor

Bug: 71992105
Test: manual
Change-Id: I106760ada9c85adde29fd143e5dfcd924fd95f54

6 years agoMerge "Fixed Security Vulnerability of DcParamObject" into mnc-dev
Pengquan Meng [Fri, 9 Mar 2018 23:37:01 +0000 (23:37 +0000)]
Merge "Fixed Security Vulnerability of DcParamObject" into mnc-dev

6 years agoMerge "Update internal ViewPager's SavedState to match Support Library version" into...
Alan Viverette [Fri, 9 Mar 2018 18:43:02 +0000 (18:43 +0000)]
Merge "Update internal ViewPager's SavedState to match Support Library version" into mnc-dev

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

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)

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

6 years agoMerge "DO NOT MERGE Fix mTrustManager NPE" into mnc-dev
Siyamed Sinir [Thu, 15 Feb 2018 00:14:36 +0000 (00:14 +0000)]
Merge "DO NOT MERGE Fix mTrustManager NPE" into mnc-dev

6 years agoMerge "[RTT] ParcelableRttResults parcel code fix" into mnc-dev
Etan Cohen [Wed, 7 Feb 2018 22:41:26 +0000 (22:41 +0000)]
Merge "[RTT] ParcelableRttResults parcel code fix" into mnc-dev

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

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

6 years agoMerge "Adjust URI host parsing to stop on \ character." into lmp-mr1-dev
Adam Vartanian [Thu, 1 Feb 2018 14:13:34 +0000 (14:13 +0000)]
Merge "Adjust URI host parsing to stop on \ character." into lmp-mr1-dev
am: 5ed5d15e66

Change-Id: I7eb106b0db3ab568a7d8845ddd2025d80eeced3c

6 years agoMerge changes from topic "am-f1eb5cc5-7ac1-4540-b9cf-e0577f9334e7" into mnc-dev
Adam Vartanian [Thu, 1 Feb 2018 10:02:43 +0000 (10:02 +0000)]
Merge changes from topic "am-f1eb5cc5-7ac1-4540-b9cf-e0577f9334e7" into mnc-dev

* changes:
  [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7
  Adjust URI host parsing to stop on \ character.

6 years agoMerge "Adjust URI host parsing to stop on \ character." into lmp-mr1-dev
Adam Vartanian [Thu, 1 Feb 2018 10:02:42 +0000 (10:02 +0000)]
Merge "Adjust URI host parsing to stop on \ character." into lmp-mr1-dev

6 years ago[automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7
Android Build Merger (Role) [Wed, 31 Jan 2018 11:19:56 +0000 (11:19 +0000)]
[automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7

Change-Id: I20336a5786e753e6941b9a784068480475415110

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

6 years ago[automerger] Check for null-terminator in ResStringPool::string8At am: 5ec65ae909
Android Build Merger (Role) [Wed, 17 Jan 2018 22:20:03 +0000 (22:20 +0000)]
[automerger] Check for null-terminator in ResStringPool::string8At am: 5ec65ae909

Change-Id: I1ea52e1ccd7bf5467438e3dc2e670cf8f325c629

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)

6 years agoDO NOT MERGE Fix mTrustManager NPE
Siyamed Sinir [Tue, 28 Nov 2017 21:29:18 +0000 (13:29 -0800)]
DO NOT MERGE Fix mTrustManager NPE

When isDeviceLocked function is called in KeyguardManager, mTrustManager
can be null. To prevent NPE during this call, moved the mTrustManager
access to a synchronized getter.

Test: run cts -c android.print.cts.PageRangeAdjustmentTest -m testWantedPagesAlreadyWrittenForPreview
Test: run cts -c android.accessibilityservice.cts.AccessibilityEndToEndTest -m testTypeViewTextChangedAccessibilityEvent
Test: run cts -c com.android.cts.appsecurity.DocumentsTest -m testCreateExisting
Test: run cts -c com.android.cts.devicepolicy.ManagedProfileTest -m testCrossProfileCopyPaste
Test: run cts -c android.text.method.cts.PasswordTransformationMethodTest

Bug: 69471788
Change-Id: I4b4a0bb3b127424fecdad85ba559ce861af165e4

6 years agoAdjust Uri host parsing to use last instead of first @. am: cd6228dd37
Adam Vartanian [Tue, 7 Nov 2017 20:51:02 +0000 (20:51 +0000)]
Adjust Uri host parsing to use last instead of first @. am: cd6228dd37
am: 6a9c7c4814

Change-Id: I80bedf58833511d336839df9f17daf65cfebfacf

6 years agoAdjust Uri host parsing to use last instead of first @.
Adam Vartanian [Tue, 7 Nov 2017 20:41:28 +0000 (20:41 +0000)]
Adjust Uri host parsing to use last instead of first @.
am: cd6228dd37

Change-Id: I5db66a5a2073acaffe0560999c914a78df362c51

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

6 years agoMerge "Use calling user ID when calling isDeviceLocked" into mnc-dev
Siyamed Sinir [Tue, 31 Oct 2017 16:17:06 +0000 (16:17 +0000)]
Merge "Use calling user ID when calling isDeviceLocked" into mnc-dev

6 years agoDO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: ca7ffa06bc -s ours
Jeff Sharkey [Thu, 19 Oct 2017 22:14:01 +0000 (22:14 +0000)]
DO NOT MERGE. KEY_INTENT shouldn't grant permissions. am: ca7ffa06bc  -s ours
am: edb6b17ebc  -s ours

Change-Id: Ie31aff669dfbabd860c123d4448362af4903973d

6 years agoDO NOT MERGE. KEY_INTENT shouldn't grant permissions.
Jeff Sharkey [Thu, 19 Oct 2017 22:10:20 +0000 (22:10 +0000)]
DO NOT MERGE. KEY_INTENT shouldn't grant permissions.
am: 1f2a5d3622  -s ours

Change-Id: I2bf88a0e4808e7d3db67e7944696121c284ed7ae

6 years agoFix ClipboardService device lock check for cross profile am: 0595b5a94b
Siyamed Sinir [Thu, 19 Oct 2017 22:04:10 +0000 (22:04 +0000)]
Fix ClipboardService device lock check for cross profile am: 0595b5a94b
am: 9e5a4ed6c3  -s ours

Change-Id: Ie6822b787e5777688faadcf125637b9c66c202de

6 years agoMerge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-mr1-dev
Beverly Tai [Thu, 19 Oct 2017 21:18:55 +0000 (21:18 +0000)]
Merge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-mr1-dev
am: f2b592726d  -s ours

Change-Id: Idd1243bb1cddc91f34f6e47e9cea88b72cff29d0

6 years agoClearing up invalid entries when SyncStorageEngine starts am: 271702fc28
Suprabh Shukla [Thu, 19 Oct 2017 20:57:26 +0000 (20:57 +0000)]
Clearing up invalid entries when SyncStorageEngine starts am: 271702fc28
am: 8b438236ce  -s ours

Change-Id: Ib8c3a4e6e8e39e42aa640c9988d0dd2022f486ec

6 years agoMerge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-dev...
Beverly Tai [Thu, 19 Oct 2017 01:23:57 +0000 (01:23 +0000)]
Merge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-dev am: e1adf2240f  -s ours
am: 3ca0cc0ae6  -s ours

Change-Id: Id5662a7d789e3e17e365d99b439cc8e8ab5d1c37

6 years agoMerge "Prevent getting data from Clipboard if device is locked" into lmp-dev am:...
Siyamed Sinir [Thu, 19 Oct 2017 01:20:25 +0000 (01:20 +0000)]
Merge "Prevent getting data from Clipboard if device is locked" into lmp-dev am: 9f496fbbe0
am: 4973227cbf  -s ours

Change-Id: I9f53bf5a896885860e204764a8a282f77eff50cd

6 years agoRevert "Clearing up invalid entries when SyncStorageEngine starts" am: 4a9d358448
Suprabh Shukla [Thu, 19 Oct 2017 00:07:54 +0000 (00:07 +0000)]
Revert "Clearing up invalid entries when SyncStorageEngine starts" am: 4a9d358448
am: 0597a93629  -s ours

Change-Id: I08d261935eb00ae8e8a929ff9ab54f6ec48fac88

6 years agoClearing up invalid entries when SyncStorageEngine starts am: 89c0dbca0f
Suprabh Shukla [Wed, 18 Oct 2017 18:04:15 +0000 (18:04 +0000)]
Clearing up invalid entries when SyncStorageEngine starts am: 89c0dbca0f
am: 53a2e46036  -s ours

Change-Id: Ic0fa17750a252a75912c4a2da73d45ff9a9fea1d

6 years agoUse calling user ID when calling isDeviceLocked
Fyodor Kupolov [Thu, 12 Oct 2017 18:22:57 +0000 (11:22 -0700)]
Use calling user ID when calling isDeviceLocked

If isDeviceLocked is called with clearCallingIdentity,
original userId should be explicitly passed

Bug: 67621847
Test: Manual
Change-Id: I2bcb92572898811cc96bda1149ef806e6239e929

6 years agoDO NOT MERGE. KEY_INTENT shouldn't grant permissions.
Jeff Sharkey [Wed, 11 Oct 2017 22:55:00 +0000 (22:55 +0000)]
DO NOT MERGE. KEY_INTENT shouldn't grant permissions.
am: ca7ffa06bc  -s ours

Change-Id: I306c63c1922f29f1df3cb225bd2d3153cadecaa3

6 years agoDO NOT MERGE. KEY_INTENT shouldn't grant permissions.
Jeff Sharkey [Mon, 12 Jun 2017 23:33:07 +0000 (17:33 -0600)]
DO NOT MERGE. KEY_INTENT shouldn't grant permissions.

KEY_INTENT has no business granting any Uri permissions, so remove
any grant flags that malicious apps may have tried sneaking in.

Test: builds, boots
Bug: 3299034132879915
Change-Id: I657455a770c81f045ccce6abbd2291407a1cfb42

6 years agoDO NOT MERGE. KEY_INTENT shouldn't grant permissions.
Jeff Sharkey [Mon, 12 Jun 2017 23:33:07 +0000 (17:33 -0600)]
DO NOT MERGE. KEY_INTENT shouldn't grant permissions.

KEY_INTENT has no business granting any Uri permissions, so remove
any grant flags that malicious apps may have tried sneaking in.

Test: builds, boots
Bug: 3299034132879915
Change-Id: I657455a770c81f045ccce6abbd2291407a1cfb42

6 years agoDO NOT MERGE. KEY_INTENT shouldn't grant permissions.
Jeff Sharkey [Mon, 12 Jun 2017 23:33:07 +0000 (17:33 -0600)]
DO NOT MERGE. KEY_INTENT shouldn't grant permissions.

KEY_INTENT has no business granting any Uri permissions, so remove
any grant flags that malicious apps may have tried sneaking in.

Test: builds, boots
Bug: 3299034132879915
Change-Id: I657455a770c81f045ccce6abbd2291407a1cfb42

6 years agoFix ClipboardService device lock check for cross profile
Siyamed Sinir [Sat, 30 Sep 2017 00:03:48 +0000 (00:03 +0000)]
Fix ClipboardService device lock check for cross profile
am: 0595b5a94b

Change-Id: I6aeaaef43a8e8c5ede049ae9e97fbf6d0129bac4

6 years agoMerge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-mr1-dev
Beverly Tai [Thu, 14 Sep 2017 13:11:10 +0000 (13:11 +0000)]
Merge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-mr1-dev

6 years agoFix ClipboardService device lock check for cross profile
Siyamed Sinir [Wed, 13 Sep 2017 23:32:21 +0000 (16:32 -0700)]
Fix ClipboardService device lock check for cross profile

ClipboardService.isDeviceLocked should clear callingIdentity before
accessing KeyguardManager.

Test: bit CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileTest

Bug: 64934810
Change-Id: I81a7adac8c9d56ed801ffc1380fcbc987d5df3e6
Merged-In: I712abfe8d542cd1be9c1816f407c8912321ac480

6 years agoFix ClipboardService device lock check for cross profile
Siyamed Sinir [Wed, 13 Sep 2017 22:09:24 +0000 (15:09 -0700)]
Fix ClipboardService device lock check for cross profile

ClipboardService.isDeviceLocked should clear callingIdentity before
accessing KeyguardManager.

Test: bit CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileTest

Bug: 64934810
Change-Id: Iffc8e73dd3ee14a94958bb50dd11a696eab7f052

6 years agoClearing up invalid entries when SyncStorageEngine starts
Suprabh Shukla [Wed, 13 Sep 2017 20:21:09 +0000 (20:21 +0000)]
Clearing up invalid entries when SyncStorageEngine starts
am: 271702fc28

Change-Id: I4943cf417be41679c2fa332223825dd01a477814

6 years agoClearing up invalid entries when SyncStorageEngine starts
Suprabh Shukla [Mon, 11 Sep 2017 22:20:35 +0000 (22:20 +0000)]
Clearing up invalid entries when SyncStorageEngine starts

Fixing the original change which was reverted. Using the
available api Context.getSystemService(String) instead of
the unavailable Context.getSystemService(Class)

Test: cts-tradefed run cts -p android.content.syncmanager

Bug: 35028827

This reverts commit 4a9d358448ef150cae259e9c5b5ed1227a1d6d9c.

Change-Id: I725430401eaec861f45bb91ee1352bb1307a6915

6 years agoMerge "DO NOT MERGE Backporting potential usb tapjacking precaution." into mnc-dev
Beverly Tai [Tue, 12 Sep 2017 15:29:21 +0000 (15:29 +0000)]
Merge "DO NOT MERGE Backporting potential usb tapjacking precaution." into mnc-dev

6 years agoDO NOT MERGE Backporting potential usb tapjacking precaution.
Beverly [Wed, 6 Sep 2017 17:24:46 +0000 (13:24 -0400)]
DO NOT MERGE Backporting potential usb tapjacking precaution.

Bug: 62187985
Test: manual, backport
Change-Id: I1a2150b795425a68ad45ee0134e31a317076d806

6 years agoDO NOT MERGE Backporting potential usb tapjacking precaution.
Beverly [Fri, 1 Sep 2017 15:14:03 +0000 (11:14 -0400)]
DO NOT MERGE Backporting potential usb tapjacking precaution.

Bug: 62187985
Test: manual, backport
Change-Id: Id9fff28cf54969cbcbdc8a3bfaeadc02ff597c89

6 years agoMerge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-dev
Beverly Tai [Tue, 12 Sep 2017 14:11:10 +0000 (14:11 +0000)]
Merge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-dev
am: e1adf2240f  -s ours

Change-Id: I02b0df60257429b5f2ed4ce2f0f4ee817abf585c

6 years agoMerge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-dev
Beverly Tai [Tue, 12 Sep 2017 14:03:19 +0000 (14:03 +0000)]
Merge "DO NOT MERGE Backporting potential usb tapjacking precaution." into lmp-dev

6 years agoDO NOT MERGE Backporting potential usb tapjacking precaution.
Beverly [Thu, 31 Aug 2017 19:32:36 +0000 (15:32 -0400)]
DO NOT MERGE Backporting potential usb tapjacking precaution.

Bug: 62187985
Test: manual, backport
Change-Id: I52e27f84338fdcf63cad0ee7436233736499d87b

6 years agoMerge "Prevent getting data from Clipboard if device is locked" into lmp-dev
Siyamed Sinir [Mon, 11 Sep 2017 23:42:10 +0000 (23:42 +0000)]
Merge "Prevent getting data from Clipboard if device is locked" into lmp-dev
am: 9f496fbbe0

Change-Id: Ibc57c285fec0bf1fcf560854971770e1353a88ac

6 years agoMerge "Prevent getting data from Clipboard if device is locked" into mnc-dev
Siyamed Sinir [Mon, 11 Sep 2017 23:31:44 +0000 (23:31 +0000)]
Merge "Prevent getting data from Clipboard if device is locked" into mnc-dev

6 years agoMerge "Prevent getting data from Clipboard if device is locked" into lmp-dev
Siyamed Sinir [Mon, 11 Sep 2017 23:30:34 +0000 (23:30 +0000)]
Merge "Prevent getting data from Clipboard if device is locked" into lmp-dev

6 years agoRevert "Clearing up invalid entries when SyncStorageEngine starts"
Suprabh Shukla [Mon, 11 Sep 2017 22:25:29 +0000 (22:25 +0000)]
Revert "Clearing up invalid entries when SyncStorageEngine starts"
am: 4a9d358448

Change-Id: I3844594302279f859f7834a6bb29093162914ae6

6 years agoRevert "Clearing up invalid entries when SyncStorageEngine starts"
Suprabh Shukla [Mon, 11 Sep 2017 19:50:51 +0000 (19:50 +0000)]
Revert "Clearing up invalid entries when SyncStorageEngine starts"

API getSystemService(Class) was not present in lmp-dev.

This reverts commit 89c0dbca0f52987571b62e929f114f3126c29455.

Bug: 35028827
Change-Id: I19846d2a3ee27aecbae2367a74ee49082eea154d

6 years agoMerge "DPC should not be allowed to grant development permission" into mnc-dev
TreeHugger Robot [Mon, 11 Sep 2017 08:14:19 +0000 (08:14 +0000)]
Merge "DPC should not be allowed to grant development permission" into mnc-dev

6 years agoClearing up invalid entries when SyncStorageEngine starts
Suprabh Shukla [Mon, 11 Sep 2017 04:13:16 +0000 (04:13 +0000)]
Clearing up invalid entries when SyncStorageEngine starts
am: 89c0dbca0f

Change-Id: Ib6a256a22d703feae8067366d8dc2622593c1142

6 years agoPrevent getting data from Clipboard if device is locked
Siyamed Sinir [Thu, 7 Sep 2017 01:02:23 +0000 (18:02 -0700)]
Prevent getting data from Clipboard if device is locked

Clipboard should not return data if the device is locked. This CL checks
for device locked state before returning values from get/has functions.

Bug: 64934810
Change-Id: I856a9079fe64db0af44383fae1a9a418de959420
Merged-In: Icefac226615fe22a7735dff4ba4c3b528fb2ac12

6 years agoPrevent getting data from Clipboard if device is locked
Siyamed Sinir [Thu, 7 Sep 2017 01:02:23 +0000 (18:02 -0700)]
Prevent getting data from Clipboard if device is locked

Clipboard should not return data if the device is locked. This CL checks
for device locked state before returning values from get/has functions.

Bug: 64934810
Change-Id: I856a9079fe64db0af44383fae1a9a418de959420

6 years agoClearing up invalid entries when SyncStorageEngine starts
Suprabh Shukla [Fri, 12 May 2017 22:26:54 +0000 (15:26 -0700)]
Clearing up invalid entries when SyncStorageEngine starts

Any app with permission WRITE_SYNC_SETTINGS could write sync settings
for authorities or accounts that are not valid. This results in invalid
data being persisted to disk which can effectively lead to a DOS style
attack. Clearing such entries on boot will make sure that a reboot fixes
any such issues.

Test: cts-tradefed run cts-dev -m CtsSyncContentHostTestCases

Bug: 35028827
Change-Id: I9e206a42508e3cba65d7523bf47fff743f47dcb2
Merged-In: I9e206a42508e3cba65d7523bf47fff743f47dcb2
(cherry picked from commit 042a478b73c3b7f7cd73f5bb1af657cfe07d0571)

6 years agoClearing up invalid entries when SyncStorageEngine starts
Suprabh Shukla [Fri, 12 May 2017 22:26:54 +0000 (15:26 -0700)]
Clearing up invalid entries when SyncStorageEngine starts

Any app with permission WRITE_SYNC_SETTINGS could write sync settings
for authorities or accounts that are not valid. This results in invalid
data being persisted to disk which can effectively lead to a DOS style
attack. Clearing such entries on boot will make sure that a reboot fixes
any such issues.

Test: cts-tradefed run cts-dev -m CtsSyncContentHostTestCases

Bug: 35028827
Change-Id: I9e206a42508e3cba65d7523bf47fff743f47dcb2
Merged-In: I9e206a42508e3cba65d7523bf47fff743f47dcb2
(cherry picked from commit 042a478b73c3b7f7cd73f5bb1af657cfe07d0571)

6 years agoDPC should not be allowed to grant development permission
Tony Mak [Tue, 15 Aug 2017 18:56:39 +0000 (19:56 +0100)]
DPC should not be allowed to grant development permission

Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPermissionGrant_developmentPermission
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedProfileOwnerTest#testPermissionGrant_developmentPermission
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPermissionGrant
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedProfileOwnerTest#testPermissionGrant
Test: Run "Permissions lockdown" test in CtsVerifier

Merged-In: If83d8edd0eea99145421e967ae47fdc264a5cf7c
Merged-In: I129bfe850981cf0b3646b7c1cf19c8a3ec69f512

Bug: 62623498
Change-Id: Ief96a23fa49f1ea923574840f8ff590a5ea2456e

6 years agoDO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6...
Siarhei Vishniakou [Wed, 16 Aug 2017 21:15:05 +0000 (21:15 +0000)]
DO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6 am: 9d99b0001e  -s ours am: 3280efe50e  -s ours am: b737365553
am: 3d1931d4e3  -s ours

Change-Id: Ieb19904cf060072d2525836ebba9f310da515b4b

6 years agoDO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6...
Siarhei Vishniakou [Wed, 16 Aug 2017 20:50:20 +0000 (20:50 +0000)]
DO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6 am: 9d99b0001e  -s ours am: 3280efe50e  -s ours
am: b737365553

Change-Id: I375324a937478c584e95cb6550d98293162656fc

6 years agoDO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6...
Siarhei Vishniakou [Wed, 16 Aug 2017 20:35:40 +0000 (20:35 +0000)]
DO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6 am: 9d99b0001e  -s ours
am: 3280efe50e  -s ours

Change-Id: Ia7bf4d6991be15c732ba8b55c37f2c9e447b1dbd

6 years agoDO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6
Siarhei Vishniakou [Wed, 16 Aug 2017 20:19:29 +0000 (20:19 +0000)]
DO NOT MERGE Remove window obscurement information. am: c3c2ed94ff am: 96fe6421f6
am: 9d99b0001e  -s ours

Change-Id: Ib0fb40f990138b3729b66bdb6d6a095bd3ad231d

6 years agoDO NOT MERGE Remove window obscurement information. am: c3c2ed94ff
Siarhei Vishniakou [Wed, 16 Aug 2017 20:03:29 +0000 (20:03 +0000)]
DO NOT MERGE Remove window obscurement information. am: c3c2ed94ff
am: 96fe6421f6

Change-Id: Ia2ce3f8b95b578253c5336407ae85880d3d317f4

6 years agoDO NOT MERGE Remove window obscurement information.
Siarhei Vishniakou [Wed, 16 Aug 2017 19:48:22 +0000 (19:48 +0000)]
DO NOT MERGE Remove window obscurement information.
am: c3c2ed94ff

Change-Id: Ib9552165e9b1c2dfcd235d1f7930d85c258b2ece

6 years agoMerge "Fix security hole in GateKeeperResponse." into mnc-dev
TreeHugger Robot [Tue, 15 Aug 2017 19:30:53 +0000 (19:30 +0000)]
Merge "Fix security hole in GateKeeperResponse." into mnc-dev

6 years agoDO NOT MERGE Remove window obscurement information.
Siarhei Vishniakou [Fri, 28 Jul 2017 01:24:01 +0000 (18:24 -0700)]
DO NOT MERGE Remove window obscurement information.

If ACTION_OUTSIDE_EVENTS contain information about whether the touch is
obscured, then a pattern of invisible, untouchable, unfocusable
SYSTEM_ALERT_WINDOWS can be placed across the screen to determine
approximate locations of touch events without the user knowing.

Bug: 31097064
Test: cts-tradefed run cts --class android.security.cts.MotionEventTest
Change-Id: I081a483c491dd384e252f0b615affee96038fdda

7 years agoMerge "Back-port fixes for b/62196835" into mnc-dev
Phil Weaver [Tue, 18 Jul 2017 23:21:16 +0000 (23:21 +0000)]
Merge "Back-port fixes for b/62196835" into mnc-dev

7 years agoMerge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev am: a620b21828 ...
Phil Weaver [Tue, 18 Jul 2017 20:30:39 +0000 (20:30 +0000)]
Merge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev am: a620b21828  -s ours am: 954deb1c6e
am: 37cf6265db  -s ours

Change-Id: I28f848331e5379736dd777995fe844aa5c5df689

7 years agoDO NOT MERGE Back-port fixes for b/62196835 am: 24fdc53cfe -s ours am: ff115bffb1
Phil Weaver [Tue, 18 Jul 2017 20:28:22 +0000 (20:28 +0000)]
DO NOT MERGE Back-port fixes for b/62196835 am: 24fdc53cfe  -s ours am: ff115bffb1
am: ccbac7e9e0  -s ours

Change-Id: I28a499e21a6a6d6a4df26317712c09f658383d37

7 years agoBack-port fixes for b/62196835 am: fd0ca151a6
Phil Weaver [Tue, 18 Jul 2017 20:25:44 +0000 (20:25 +0000)]
Back-port fixes for b/62196835 am: fd0ca151a6
am: 3c4d24923c  -s ours

Change-Id: Ie8d7f1d4840bcea7538f99b2eb1bfb2bc472549f

7 years agoMerge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev am: a620b21828 ...
Phil Weaver [Tue, 18 Jul 2017 18:41:22 +0000 (18:41 +0000)]
Merge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev am: a620b21828  -s ours
am: 954deb1c6e

Change-Id: I929c9dfa84b25fdbeadfedf0e0e9ecd914a74483

7 years agoMerge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev
Phil Weaver [Tue, 18 Jul 2017 18:36:23 +0000 (18:36 +0000)]
Merge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev
am: a620b21828  -s ours

Change-Id: Iaa4e8eb83ebf2036999a31e3487c6157bcefecbf

7 years agoDO NOT MERGE Back-port fixes for b/62196835 am: 24fdc53cfe -s ours
Phil Weaver [Tue, 18 Jul 2017 18:36:21 +0000 (18:36 +0000)]
DO NOT MERGE Back-port fixes for b/62196835 am: 24fdc53cfe  -s ours
am: ff115bffb1

Change-Id: Ieca157f60b7c57f60900b55b10fcf8e585852e70

7 years agoBack-port fixes for b/62196835
Phil Weaver [Tue, 18 Jul 2017 18:26:58 +0000 (18:26 +0000)]
Back-port fixes for b/62196835
am: fd0ca151a6

Change-Id: I442d26b476e3e83602b5f2eb61a01386e4d6d247

7 years agoDO NOT MERGE Back-port fixes for b/62196835
Phil Weaver [Tue, 18 Jul 2017 18:26:57 +0000 (18:26 +0000)]
DO NOT MERGE Back-port fixes for b/62196835
am: 24fdc53cfe  -s ours

Change-Id: I01a6f574df5cc1b133b7f761062a6259aac07476

7 years agoMerge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev
Phil Weaver [Tue, 18 Jul 2017 18:19:45 +0000 (18:19 +0000)]
Merge "DO NOT MERGE Back-port fixes for b/62196835" into lmp-dev

7 years agoBack-port fixes for b/62196835
Phil Weaver [Wed, 12 Jul 2017 21:04:16 +0000 (14:04 -0700)]
Back-port fixes for b/62196835

Bug: 62196835
Test: Created an accessibility service that displays a system
and a toast overlay, confirmed that it disappeared when we
reached the accessibility permission screen that uses this
flag.

Change-Id: Ic51ead670fc480e549512ba1d02f49d9c13bc3f0

7 years agoFix security hole in GateKeeperResponse.
Charles He [Fri, 14 Jul 2017 13:41:06 +0000 (14:41 +0100)]
Fix security hole in GateKeeperResponse.

GateKeeperResponse has inconsistent writeToParcel() and
createFromParcel() methods, making it possible for a malicious app to
create a Bundle that changes contents after reserialization. Such
Bundles can be used to execute Intents with system privileges.

This CL changes writeToParcel() to make serialization and
deserialization consistent, thus fixing the issue.

Bug: 62998805
Test: use the debug app (see bug)
Change-Id: Ie1c64172c454c3a4b7a0919eb3454f0e38efcd09

7 years agoBack-port fixes for b/62196835
Phil Weaver [Wed, 12 Jul 2017 21:04:16 +0000 (14:04 -0700)]
Back-port fixes for b/62196835

Bug: 62196835
Test: Created an accessibility service that displays a system
and a toast overlay, confirmed that it disappeared when we
reached the accessibility permission screen that uses this
flag.

Change-Id: Ic51ead670fc480e549512ba1d02f49d9c13bc3f0

7 years agoDO NOT MERGE Back-port fixes for b/62196835
Phil Weaver [Wed, 12 Jul 2017 21:04:16 +0000 (14:04 -0700)]
DO NOT MERGE Back-port fixes for b/62196835

Bug: 62196835
Test: Created an accessibility service that displays a system
and a toast overlay, confirmed that it disappeared when we
reached the accessibility permission screen that uses this
flag.

Change-Id: Ic51ead670fc480e549512ba1d02f49d9c13bc3f0

7 years agoBack-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2 -s ours am: f433884a84...
Phil Weaver [Wed, 12 Jul 2017 22:18:59 +0000 (22:18 +0000)]
Back-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2  -s ours am: f433884a84 am: ba928bd522 am: 1add6be25e
am: ba46064323

Change-Id: I7119e3f003562f6d826d40ad3577b9db0e44c2c6

7 years agoBack-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2 -s ours am: f433884a84...
Phil Weaver [Wed, 12 Jul 2017 22:14:01 +0000 (22:14 +0000)]
Back-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2  -s ours am: f433884a84 am: ba928bd522
am: 1add6be25e

Change-Id: I83a6c654862443a69bfeeaf675a8c038b3f7fb53

7 years agoBack-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2 -s ours am: f433884a84
Phil Weaver [Wed, 12 Jul 2017 22:06:27 +0000 (22:06 +0000)]
Back-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2  -s ours am: f433884a84
am: ba928bd522

Change-Id: I74a7b0488371606dd9bdccab854d23c0e09b1ac9

7 years agoBack-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2 -s ours
Phil Weaver [Wed, 12 Jul 2017 22:00:31 +0000 (22:00 +0000)]
Back-port fixes for b/62196835 am: 5bdffc5d57 am: 5a7eb970e2  -s ours
am: f433884a84

Change-Id: I737838098a36efafe1509c4814ac1120a3bb8297

7 years agoBack-port fixes for b/62196835 am: 5bdffc5d57
Phil Weaver [Wed, 12 Jul 2017 21:55:31 +0000 (21:55 +0000)]
Back-port fixes for b/62196835 am: 5bdffc5d57
am: 5a7eb970e2  -s ours

Change-Id: Ifd4b5ff2487c8b8035ffaf6ed7e55539f26a463e

7 years agoBack-port fixes for b/62196835
Phil Weaver [Wed, 12 Jul 2017 21:43:46 +0000 (21:43 +0000)]
Back-port fixes for b/62196835
am: 5bdffc5d57

Change-Id: Ia5dafc7a8724d296e710f32d936bb493b51951de