Commit Graph

13652 Commits

Author SHA1 Message Date
Adrian Roos
a89cdcefab Merge "Restrict getInputMethodWindowVisibleHeight" into rvc-dev am: 31e8959439
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18492305

Change-Id: I24bd536937c9794cc17ec42eeeb047940adbb884
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 07:39:21 +00:00
Adrian Roos
31e8959439 Merge "Restrict getInputMethodWindowVisibleHeight" into rvc-dev 2022-06-08 07:20:12 +00:00
Raphael Kim
b37d5d47da Remove package title from notification access confirmation intent am: 51d47ec7c8 am: c1b4cacc66 am: 963c9f8bc8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18670434

Change-Id: I7b76141852d2314dd8a37d4a4ceb50f169dd8640
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-05 02:50:26 +00:00
Raphael Kim
963c9f8bc8 Remove package title from notification access confirmation intent am: 51d47ec7c8 am: c1b4cacc66
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18670434

Change-Id: I3af28be0359c45814aacf66a6952292894fac72b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-05 02:32:27 +00:00
Raphael Kim
c1b4cacc66 Remove package title from notification access confirmation intent am: 51d47ec7c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18670434

Change-Id: I4fb8082b1f94c628417c41fd6bd6d1fd4906a12e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-05 02:14:42 +00:00
Raphael Kim
51d47ec7c8 Remove package title from notification access confirmation intent
Bug: 228178437
Test: Manually confirmed on an application
Change-Id: Idad6dc0c71d7b39de0bd9e4ad922b5e6020a6184
Merged-In: Idad6dc0c71d7b39de0bd9e4ad922b5e6020a6184
2022-06-01 22:26:34 +00:00
Adrian Roos
fd7847b533 Restrict getInputMethodWindowVisibleHeight
Make sure only the app currently interacting with the IME can
query this, and restrict the API to apps targeting SDKs before T

Fixes: 204906124
Test: atest 'InputMethodManagerTest#getInputMethodWindowVisibleHeight_returnsZeroIfNotFocused'
Change-Id: If1da19a3dd8c29542afc970b4b201d87547c27a9
Merged-In: If1da19a3dd8c29542afc970b4b201d87547c27a9
2022-05-20 18:11:19 +02:00
TreeHugger Robot
508167f720 Merge "[DO NOT MERGE] Keyguard - Treat messsages to lock with priority" into rvc-dev 2022-03-08 19:20:39 +00:00
Matt Pietal
21e48cf26b [DO NOT MERGE] Keyguard - Treat messsages to lock with priority
When switching users and attempting to lock the device, the sysui main
thread becomes overwhelmed with events, creating a significant lag
between the time a message is posted and processed on the main
thread. This can be dangerous when these events are critical for
security, such as calls coming from PhoneWindowManager#lockNow() that
call KeyguardViewMediator#doKeyguardTimeout(). On older devices with
slower CPUs and less memory, the delay in processing can be
significant (15 - 30s).

The result of not prioritizing these events leads to a window of time
where a guest user can switch back to the owner, and gain access to
the owner's homescreen without needing to unlock the device with the
owner's credentials.

As a mitigation, prioritize two events originating in two specific
methods to make sure the device locks as soon as possible as well as
have the system server preemptively update its local cache.

Bug: 151095871
Test: Very manual race condition - follow steps listed in bug
Change-Id: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
Merged-In: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
(cherry picked from commit 28c53ab8bc)
2022-02-11 20:23:48 +00:00
Jeff Chang
a04ffe4326 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity am: 2c87a8a7ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16743363

Change-Id: Ifdf47e595d507cd8d67bb968b1234a5d11d2b387
2022-02-09 17:51:46 +00:00
Jeff Chang
be7090b09e [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity am: 53ee9c2472
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16743244

Change-Id: I647e79eb6b60514c34fcea06c0a23cc786de639b
2022-02-09 12:46:54 +00:00
Jeff Chang
53ee9c2472 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is
able to be tapped through, which can trick the user into starting a
harmful activity.

The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for
the activity to prevent the tapjacking/overlay attack.

Bug: 205595291
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
(cherry picked from commit a04b3666b8)
2022-01-28 04:33:49 +00:00
Jeff Chang
2c87a8a7ce [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is
able to be tapped through, which can trick the user into starting a
harmful activity.

The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for
the activity to prevent the tapjacking/overlay attack.

Bug: 205595291
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
(cherry picked from commit a04b3666b8)
2022-01-28 03:49:51 +00:00
Hai Zhang
b641a97b4d DO NOT MERGE Re-implement reading/writing Throwables from/to Parcel, without am: 562f1bd91f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16406531

Change-Id: I64c3dd7fc5f7b48b70144b4ff4f9a25aa300efad
2021-12-09 17:26:56 +00:00
Hai Zhang
562f1bd91f DO NOT MERGE Re-implement reading/writing Throwables from/to Parcel, without
Parcel private APIs.

Bug:197228210
Test: atest CtsSecurityTestCases:android.security.cts.AndroidFutureTest
(cherry picked from I577da5a3bc4ed537123b7eceaa5addf8f7bb0d92 and
Icc5ce702f0cd84e9136dee3c65f63619df697358)

Change-Id: I1d488c475f2f7af835a67496535cecdd6987c0cf
2021-12-07 18:14:35 +00:00
Collin Fijalkovich
978809e428 Disallow overlays for ResolverActivity
Prevents non-system apps from placing a window over the app selection
screen.

Bug: 143559931
Test: Installed test app and attempted to overlay
Change-Id: Ied05088a5007e0f10cd3e1abd8d7da8ffeb3b674
Merged-In: Ied05088a5007e0f10cd3e1abd8d7da8ffeb3b674
(cherry picked from commit 34534e1fd2)
2021-10-07 14:24:33 +00:00
Collin Fijalkovich
718c60bea7 Disallow overlays for ResolverActivity
Prevents non-system apps from placing a window over the app selection
screen.

Bug: 143559931
Test: Installed test app and attempted to overlay
Change-Id: Ied05088a5007e0f10cd3e1abd8d7da8ffeb3b674
Merged-In: Ied05088a5007e0f10cd3e1abd8d7da8ffeb3b674
(cherry picked from commit 34534e1fd2)
2021-10-07 14:24:07 +00:00
TreeHugger Robot
d4be365335 Merge "Disallow overlays for ResolverActivity" into qt-dev am: f3661fc780
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15960137

Change-Id: I9b7a79b6d27be475f72549b3716d8036459b3f31
2021-10-06 21:50:19 +00:00
Collin Fijalkovich
9bd0b2f9d0 Disallow overlays for ResolverActivity
Prevents non-system apps from placing a window over the app selection
screen.

Bug: 143559931
Test: Installed test app and attempted to overlay
Change-Id: Ied05088a5007e0f10cd3e1abd8d7da8ffeb3b674
Merged-In: Ied05088a5007e0f10cd3e1abd8d7da8ffeb3b674
(cherry picked from commit 34534e1fd2)
2021-10-01 19:20:03 +00:00
TreeHugger Robot
91568eb50e Merge "Clean up dead code in NetInitiatedActivity" into rvc-qpr-dev 2021-03-05 17:10:19 +00:00
Christopher Tate
8a3e7201b5 Make isAppBad() lock-free
We trade off increased cost of (rare) mutations of the set of "bad" apps
in order to make the core lookup "is this specific app bad?" lock-free.
Locking discipline turned out to be a dominant cost in a very hot code
path within the running system, even uncontended.

Bug: 175339368
Bug: 163297662
Test: atest ActivityManagerServiceTest
Change-Id: I8803a177d46b01b86897f1e8d0966eb2452849fd
Merged-In: I8803a177d46b01b86897f1e8d0966eb2452849fd
2021-02-22 17:47:16 -08:00
Miranda Kephart
a5141a4b96 [DO NOT MERGE] Close screenshot process on user switched
Currently, we keep the process up even if the user switches,
meaning that in some cases (if the user is switched while the
screenshot UI is up) we will save images to the wrong profile.
This change makes ScreenshotHelper listen for user switches and
close the screenshot service, so that a new screenshot is
guaranteed to be constructed with the correct user's context.

Bug: 170474245
Fix: 170474245
Test: manual -- verified bad state occurs if user switches within
the timeout period, ensured that screenshots work immediately
after switching with this change.

Change-Id: I9d32d0928e6c2bda161d04555438d0dd7afef0ba
(cherry picked from commit 7ef1a5dd15)
2021-02-03 14:29:12 +00:00
Miranda Kephart
9908e1a145 [DO NOT MERGE] Close screenshot process on user switched
Currently, we keep the process up even if the user switches,
meaning that in some cases (if the user is switched while the
screenshot UI is up) we will save images to the wrong profile.
This change makes ScreenshotHelper listen for user switches and
close the screenshot service, so that a new screenshot is
guaranteed to be constructed with the correct user's context.

Bug: 170474245
Fix: 170474245
Test: manual -- verified bad state occurs if user switches within
the timeout period, ensured that screenshots work immediately
after switching with this change.

Change-Id: I9d32d0928e6c2bda161d04555438d0dd7afef0ba
(cherry picked from commit 7ef1a5dd15)
2021-01-28 18:49:29 +00:00
Miranda Kephart
41a97a3fd7 [DO NOT MERGE] Close screenshot process on user switched
Currently, we keep the process up even if the user switches,
meaning that in some cases (if the user is switched while the
screenshot UI is up) we will save images to the wrong profile.
This change makes ScreenshotHelper listen for user switches and
close the screenshot service, so that a new screenshot is
guaranteed to be constructed with the correct user's context.

Bug: 170474245
Fix: 170474245
Test: manual -- verified bad state occurs if user switches within
the timeout period, ensured that screenshots work immediately
after switching with this change.

Change-Id: I9d32d0928e6c2bda161d04555438d0dd7afef0ba
(cherry picked from commit 7ef1a5dd15)
2021-01-28 14:36:00 +00:00
Miranda Kephart
05f7aef1b0 [DO NOT MERGE] Close screenshot process on user switched
Currently, we keep the process up even if the user switches,
meaning that in some cases (if the user is switched while the
screenshot UI is up) we will save images to the wrong profile.
This change makes ScreenshotHelper listen for user switches and
close the screenshot service, so that a new screenshot is
guaranteed to be constructed with the correct user's context.

Bug: 170474245
Fix: 170474245
Test: manual -- verified bad state occurs if user switches within
the timeout period, ensured that screenshots work immediately
after switching with this change.

Change-Id: I9d32d0928e6c2bda161d04555438d0dd7afef0ba
(cherry picked from commit 7ef1a5dd15)
2021-01-27 23:16:21 +00:00
Yu-Han Yang
196bafdc64 Clean up dead code in NetInitiatedActivity
Bug: 174151048
Test: on device
Change-Id: I5a3a77557720571b455ffec296cdd4e2e1a02f7b
(cherry picked from commit b5765cc3e7)
2021-01-05 21:54:31 +00:00
Alison Cichowlas
b09236d867 Fix sharing shortcuts not showing for Work Profile.
Bug: 175042485, 175240616
Test: per repro instructions in bug
Change-Id: Iecbc57369f46fcae72d6acdb997ea8daacc77979
(cherry picked from commit 17cb4137ad)
2020-12-15 20:09:33 +00:00
TreeHugger Robot
14692e3d21 Merge "Fix wrong target launches in Chooser." into rvc-qpr-dev 2020-12-10 15:50:08 +00:00
Winson Chiu
643416f8a3 Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into qt-qpr1-dev 2020-12-08 00:26:01 +00:00
Winson Chiu
a2cee8fb7b Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into qt-dev 2020-12-08 00:25:56 +00:00
Winson Chiu
5e971858b8 Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into rvc-qpr-dev 2020-12-08 00:25:50 +00:00
Winson Chiu
ca2d8ec7b9 Merge "Remove updateIntentVerificationStatusAsUser from ResolverActivity" into rvc-dev 2020-12-08 00:25:37 +00:00
TreeHugger Robot
78c8bbdfaf Merge "Revoke the uri permission when the file is deleted" into pi-dev am: 2b52397d56 am: 9095b67c84
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12455472

Change-Id: Ic42474e16756dbd77c3a343ba1f7cbf95b2c10c8
2020-12-03 06:11:17 +00:00
TreeHugger Robot
9095b67c84 Merge "Revoke the uri permission when the file is deleted" into pi-dev am: 2b52397d56
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12455472

Change-Id: I46865cbc3572d68f2ef738c95bcc05de8088f403
2020-12-03 05:48:51 +00:00
Alison Cichowlas
2c12806649 Fix wrong target launches in Chooser.
The service target row was sometimes overfull - with more targets in
the list than were displayed - when we used each row's offset
to calculate which target was selected to launch.
This fix makes sure we are not overfilling.

Test: ChooserActivityTest & manual repro -- use targets from
alphabetical section, make sure you have at least one old-API target
available
Fixes: 170518649, 165944833

Change-Id: I8a554197c01f4eadbeac43742984e4c86ca49601
(cherry picked from commit 6f015708fb)
2020-12-03 00:31:17 +00:00
Maryam Karimzadehgan
0ed68db06c Add flag to get the name of the Model file from the flag in case we want
to try out different models. In addition, we should not log touches in
the middle of the screen for logging so moving the block at the very
beginning.

Test: unittest, manual test
Bug: 150170384
Change-Id: I6ecb556fea01f26323248b999d17c7b1d1b7eeb7
Merged-In: I6ecb556fea01f26323248b999d17c7b1d1b7eeb7
2020-11-16 18:56:28 +00:00
Maryam Karimzadehgan
c7035fe4fe Use ML model for the Back Gesture in EdgeBackGestureHandler.
Change-Id: I2fd5255e903932c03a35ae463b0eff3840dc81bd
Merged-In: I2fd5255e903932c03a35ae463b0eff3840dc81bd
Test: manual model test and getting the results
Bug: 150170384
2020-11-11 20:17:56 +00:00
Winson
3ebeb4c490 Remove updateIntentVerificationStatusAsUser from ResolverActivity
DO NOT CHERRY PICK ANYWHERE: Security issue

This API is meant to grant an app complete verification over the
domains it has declared, meaning it will always resolve the domains it
declares for web links.

This can allow an app to take over links that are unowned. Any time a
user selects "Always" when resolving an Intent in the diambiguation
dialog, this API would be called, and all subsequent resolutions of any
domain declared by the app selected would be automatically directed to
that app, with no prompt to the user.

From a quick search, it's possible that all usages of this API are
actually unintended and should be removed. Should be considered for
deprecation in the future.

Bug: 163358811

Test: none, this is not generally testable, see linked bug for context

Merged-In: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
Change-Id: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
2020-10-28 20:59:38 +00:00
Winson
7dc064e9ed Remove updateIntentVerificationStatusAsUser from ResolverActivity
DO NOT CHERRY PICK ANYWHERE: Security issue

This API is meant to grant an app complete verification over the
domains it has declared, meaning it will always resolve the domains it
declares for web links.

This can allow an app to take over links that are unowned. Any time a
user selects "Always" when resolving an Intent in the diambiguation
dialog, this API would be called, and all subsequent resolutions of any
domain declared by the app selected would be automatically directed to
that app, with no prompt to the user.

From a quick search, it's possible that all usages of this API are
actually unintended and should be removed. Should be considered for
deprecation in the future.

Bug: 163358811

Test: none, this is not generally testable, see linked bug for context

Merged-In: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
Change-Id: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
2020-10-28 20:59:17 +00:00
Winson
ebb4d67258 Remove updateIntentVerificationStatusAsUser from ResolverActivity
DO NOT CHERRY PICK ANYWHERE: Security issue

This API is meant to grant an app complete verification over the
domains it has declared, meaning it will always resolve the domains it
declares for web links.

This can allow an app to take over links that are unowned. Any time a
user selects "Always" when resolving an Intent in the diambiguation
dialog, this API would be called, and all subsequent resolutions of any
domain declared by the app selected would be automatically directed to
that app, with no prompt to the user.

From a quick search, it's possible that all usages of this API are
actually unintended and should be removed. Should be considered for
deprecation in the future.

Bug: 163358811

Test: none, this is not generally testable, see linked bug for context

Merged-In: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
Change-Id: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
2020-10-28 20:58:56 +00:00
Winson
0220a57ec5 Remove updateIntentVerificationStatusAsUser from ResolverActivity
DO NOT CHERRY PICK ANYWHERE: Security issue

This API is meant to grant an app complete verification over the
domains it has declared, meaning it will always resolve the domains it
declares for web links.

This can allow an app to take over links that are unowned. Any time a
user selects "Always" when resolving an Intent in the diambiguation
dialog, this API would be called, and all subsequent resolutions of any
domain declared by the app selected would be automatically directed to
that app, with no prompt to the user.

From a quick search, it's possible that all usages of this API are
actually unintended and should be removed. Should be considered for
deprecation in the future.

Bug: 163358811

Test: none, this is not generally testable, see linked bug for context

Merged-In: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
Change-Id: Iff7f788a83af68c7fbb1c6b9a8be7b47136be2b6
2020-10-28 20:58:32 +00:00
TreeHugger Robot
7ce178e6cb Merge "Call DecorView.drawableChanged() in PhoneWindow.setBackgroungDrawable" into rvc-qpr-dev 2020-10-20 17:24:35 +00:00
Alison Cichowlas
7f03b9f0cf When logging ranking positions, use the number of displayed targets
in calculating offset rather than the total number available.

Test: ChooserActivityTest; log inspection
Bug: 169344682
Change-Id: I40c841bf0f3e1cf90b0e4998bde1c9e8009c09c5
(cherry picked from commit b17dbd20c3)
2020-10-08 19:29:50 +00:00
Ming-Shin Lu
44ecc735ec RESTRICT AUTOMERGE Reland "Fix showing keyboard without editor focused.."
Resolve SearchViewTest and InputMethodServiceTest failure when
landing CL[1] in QPR branch.

Also, CL[1] mentioned window focus behavior changes from R,
ignoring STATE_VISIBLE or STATE_ALWAYS_VISIBLE request doesn't enough
to fix unexpected keyboard visible issue when same window focused with
the above softInput flag without editor focus, since there is no
additional unspecified window focus to hide the current soft-input
as prior to R's behavior.

To fix that, we introduced new SoftInputShowHideReason to hide
soft-input when the same window focused without valid editor focus
after screen unlock, in order to align with the behavior prior to R.

[1]: I37ae6e30d1de581ba15131c2a90396b3a522a4d6

Bug: 161506356
Test: atest CtsInputMethodTestCases
Change-Id: Id51863a5b67d5d79d903adf43f19b52bd139e03f
2020-09-28 05:13:09 +00:00
Alison Cichowlas
a102616d48 Merge "Fix handling of bad image previews." into rvc-qpr-dev 2020-09-25 20:55:20 +00:00
Vadim Caen
870c9f7cae Call DecorView.drawableChanged() in PhoneWindow.setBackgroungDrawable
Not calling it result in empty buffer and stuttering during some
animation.

BUG: 158672949
Test: Manual test with ASOS app (see b/151910308) and Boost app
(b/158672949)

Change-Id: Ic5018829d7c7dde388bc928c1f5b3f773cc2f5e4
2020-09-25 11:26:30 +02:00
Song Hu
eedf47cbf5 DO NOT MERGE Put parameterized weights on top two sharing shortcuts of each app as per shortcuts native ranking in PeopleService Sharesheet model.
By default weights are 0 which ensures ranking same as what it is now.

Bug: 168212835
Test: atest com.android.server.people.prediction.SharesheetModelScorerTest
Change-Id: I02eaa5b6a448c33b51e5f4c6acaba93e7a2bd995
2020-09-24 22:18:49 -07:00
TreeHugger Robot
1c98cc2848 Merge "BatteryStatsImpl: Add mBatteryTimeToFull to parcel" into rvc-qpr-dev 2020-09-24 23:40:57 +00:00
Winson Chung
a03cd95a12 Merge "Account for cutouts in system insets (as done previously)" into rvc-qpr-dev 2020-09-24 16:45:18 +00:00
Alison Cichowlas
208b157b8d Fix handling of bad image previews.
When the image preview fails (eg for permissions or timeout) the entire
system area is removed. This prevents the user from using Nearby.

Instead, when the image preview fails, we should hide only the image
preview and leave the rest of the system area intact.

Bug: 168557188
Test: ChooserActivityTest; manual inspection
Change-Id: I49190c1fbc4e25b3d2e2802a90de355bff297f7e
(cherry picked from commit ba027fad91)
2020-09-24 13:18:25 +00:00