OSDN Git Service

android-x86/frameworks-base.git
2 years agoMerge tag 'android-9.0.0_r61' into pie-x86 pie-x86
Chih-Wei Huang [Tue, 6 Jul 2021 08:26:55 +0000 (16:26 +0800)]
Merge tag 'android-9.0.0_r61' into pie-x86

Android 9.0.0 Release 61 (6780336)

3 years agoAdd missing isShellUser check
John Reck [Mon, 6 Jul 2020 23:10:49 +0000 (16:10 -0700)]
Add missing isShellUser check

Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 03542611973e4ce3ddca522ee12bcc85e59ce901)
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 5e2931c6569aa8084be9d0690a1ca30534f49c46)
(cherry picked from commit 4a31000e6072c14608ec1c59321481c8aa330313)

3 years agoMark implicit PendingIntents as immutable
Steve Elliott [Mon, 3 Aug 2020 17:45:44 +0000 (13:45 -0400)]
Mark implicit PendingIntents as immutable

Bug: 156020795
Test: manual, atest
Change-Id: I72206c7a52b067b77d6542d170a6483713dfeee7
(cherry picked from commit 84e08280d3882cfe4bad12ab426016c6d0efc7fb)
(cherry picked from commit db245b0310220ad329c55289ba299f0a1bf8a30b)

3 years agoRequire a more specific intent
Lucas Dupin [Wed, 25 Mar 2020 17:46:44 +0000 (10:46 -0700)]
Require a more specific intent

Bug: 147606347
Fixes: 161150380
Test: run poc, device didn't reboot
Change-Id: I8f721ca659d58271880a7adbf386b270b331e55b
Merged-In: I8f721ca659d58271880a7adbf386b270b331e55b
(cherry picked from commit a9afc32ddc013424e2d17a091ef3fdfbe18c0d76)
(cherry picked from commit d16e86f466c2fc18448b654cbe71089c7fede991)
(cherry picked from commit 6dbda27f98ccfdc97b41e8f3990b3a316bb928dd)

3 years agoRESTRICT AUTOMERGE
Patrick Baumann [Fri, 6 Mar 2020 18:34:17 +0000 (10:34 -0800)]
RESTRICT AUTOMERGE
Do not set referrerUri on SessionInfo for non-owners

This change leaves the referrerUri field null when the caller leading to
its production is not the owner of the session.

Bug: 142125338
Test: atest SessionReferrerUriTest
Change-Id: I84679ea0636aa2097e25e23813c48134c9cc1d75
(cherry picked from commit 681b2364225aca50e7770d82be83f3e129a8cb11)

3 years agoRemove unused intent in NiNotification
Yu-Han Yang [Mon, 8 Jun 2020 21:59:23 +0000 (14:59 -0700)]
Remove unused intent in NiNotification

Bug: 154319182
Test: manual
Change-Id: I5958a8fb442cf4506e1824243493f91aea34a7cc
Merged-In: I5958a8fb442cf4506e1824243493f91aea34a7cc
(cherry picked from commit d541f6d85e9030c5e0e7372332854684d8a32916)

3 years agoImpl basic window round corner with Outline
utzcoz [Wed, 22 Jul 2020 00:13:42 +0000 (08:13 +0800)]
Impl basic window round corner with Outline

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoKeep stack order when starting activity from recents
utzcoz [Mon, 25 May 2020 10:16:31 +0000 (18:16 +0800)]
Keep stack order when starting activity from recents

When starting activity from recents, the AMS will move home stack to
front and then move selected activity stack to front. So when we start
many freeform windows, the operation will move unselected freeform
windows to back. It's not good for usage. So this patch will remove the
logic to move home stack to front when starting activity from recents,
and move recents stack to background to dismiss the recents page.

For split screen secondary windowing, we keep the origin logic to move
home stack to front. If we find rigid problems when starting split
screen window or pip window, we should review this patch again to check
whether this patch causes the problem.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoUse systemui recents as default pc recents
utzcoz [Wed, 1 Apr 2020 02:37:31 +0000 (10:37 +0800)]
Use systemui recents as default pc recents

1. Enable grid layout of systemui recents.
2. Disable OverviewProxyService to use systemui recents, instead of
   recents that implements OverviewProxyService such as Launcher3.
3. Show freeform task in systemui recents.
4. Fix IndexOutArrayException of systemui recents grid layout when
   starting many freeform tasks.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoMerge branch 'pie-x86' of https://pf.osdn.net/gitroot/e/el/electrikjesus/frameworks...
Chih-Wei Huang [Wed, 8 Jul 2020 16:13:46 +0000 (00:13 +0800)]
Merge branch 'pie-x86' of https://pf.osdn.net/gitroot/e/el/electrikjesus/frameworks-base into pie-x86

3 years agoUpdate back button graphics
Jon West [Wed, 24 Jun 2020 16:16:23 +0000 (12:16 -0400)]
Update back button graphics

Thanks again @rogerdott for the artwork

3 years agoMerge branch 'boringdroid-x86-9.0.0' of https://github.com/boringdroid/platform_frame...
Chih-Wei Huang [Tue, 7 Jul 2020 15:40:06 +0000 (23:40 +0800)]
Merge branch 'boringdroid-x86-9.0.0' of https://github.com/boringdroid/platform_frameworks_base into pie-x86

3 years agoRevert "Ignores protected broadcasts if not priv-app"
Winson Chiu [Tue, 16 Jun 2020 21:41:22 +0000 (21:41 +0000)]
Revert "Ignores protected broadcasts if not priv-app"

Revert of I5bd2bf3bd7c38fd9cc563a02b24bc569495d79ed

For now, allow all system apps to declare protected
broadcasts. This will be cleaned up in a future change.

Bug: 158570769

Merged-In: I54d236c0a6daaa934bd64a3bd05e2654e0e868fe
Change-Id: I54d236c0a6daaa934bd64a3bd05e2654e0e868fe
(cherry picked from commit b5e3addc5f27149d1b0bbc213ced47b2ade732bf)

3 years agoOnly autoVerify at install for new hosts
Christopher Tate [Fri, 29 May 2020 00:49:53 +0000 (17:49 -0700)]
Only autoVerify at install for new hosts

Re-run app link verification at update time only when the set of hosts
has expanded.  Intentionally revoke verify history when an app stops
using autoVerify, as a one-time measure to place it back into the
non-autoverify model for tracking the user's launch preferences.  If the
app starts using autoVerify again later, it behaves identically to an
app that has never done so before.

Bug: 151475497
Bug: 146204120
Test: described on master CL

Merged-In: I200d85085ce79842a3ed39377d1f75ec381c8991
Change-Id: Ibaf087946966ad82d60c7b255e3ee75990716b63
(cherry picked from commit 3e76c30b7db2cb431e84a3e933c839fefe283c6d)

3 years agoDO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package
Winson [Thu, 23 Apr 2020 17:45:55 +0000 (10:45 -0700)]
DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package

Without this check, any package can set the installer package of
another package whose installer has been removed or was never set.
This provides access to other privileged actions and is undesired.

Bug: 150857253

Test: manual verify with proof of concept in linked bug
Test: atest android.appsecurity.cts.PackageSetInstallerTest

Merged-In: I2159c357911ff39ffd819054b42f96ae86bc98bc
Change-Id: I2159c357911ff39ffd819054b42f96ae86bc98bc
(cherry picked from commit 8220483a2ed83dbaf838803d45bc58cadede4208)

3 years agoRevert "Revoke 'always' web handler status when not autoverifying"
Chris Tate [Fri, 20 Mar 2020 18:30:24 +0000 (18:30 +0000)]
Revert "Revoke 'always' web handler status when not autoverifying"

This reverts commit ce22265eeda3a96613b9a7bb7dd898c69d295964.

Reason for revert: Inadvertently broke link handling stickiness even for well behaved apps

Bug: 146204120
Test: install app that handles web urls; set to 'always' in Settings;
install same apk again.  Verify that app is still in 'always' state via
'adb shell dumpsys package d'

Merged-In: Ifac4f0c044c2c575a29bdd5ce5d14d12373fbe70
Merged-In: If9046cb420961b8ef0333e9f1115eb69fb92242e
Change-Id: Ife6cd66e0bae5738c08962a8fa9397973e33f28e
(cherry picked from commit 63b6cfd96485c11b906ca4ecc83245335d531364)

3 years agoIgnore system ui visibility for decor caption view visibility
utzcoz [Fri, 12 Jun 2020 12:55:58 +0000 (20:55 +0800)]
Ignore system ui visibility for decor caption view visibility

The decor caption will show only for freeform window, and we don't need
to care system ui visibility for freeform window.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoReset pointer icon type after leaving resizing region
utzcoz [Fri, 12 Jun 2020 07:50:10 +0000 (15:50 +0800)]
Reset pointer icon type after leaving resizing region

We should reset pointer icon type when hover exit task. If we start freeform
window from Taskbar, and move pointer to resize region, the pointer type will
change to TYPE_*_DOUBLE_ARROW, but when we move pointer outer freeform window
resize region, the pointer type will keep to TYPE_*_DOUBLE_ARROW. The reset
operation will help to fix this problem.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoSupport persist window bounds
utzcoz [Thu, 11 Jun 2020 15:24:15 +0000 (23:24 +0800)]
Support persist window bounds

1. Add methods in WMS to store/restore window bounds in
   SharedPreferences.
2. When resizing/moving window, save its value.
3. When launching window, use saved value as launch bounds.

This patch also disable the launch bounds in ActivityOptions, because
the starter doesn't know the new window bounds after resizing. The
Taskbar sets the launch bounds to the center position of screen
forcibly, and it will cause saved bounds can't work. Before finding a
solution to let Taskbar to manage freeform window bounds, we will
disable launch bounds of ActivityOptions.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoAdd back button for freeform window
utzcoz [Thu, 11 Jun 2020 12:16:55 +0000 (20:16 +0800)]
Add back button for freeform window

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoTrigger resize when window from freeform to fullscreen
utzcoz [Thu, 11 Jun 2020 09:56:23 +0000 (17:56 +0800)]
Trigger resize when window from freeform to fullscreen

It will fix blankscreen when changing freeform window to fullscreen.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoFix drag-resizing jump of freeform
utzcoz [Wed, 10 Jun 2020 16:54:31 +0000 (00:54 +0800)]
Fix drag-resizing jump of freeform

When starting to drag freeform window, the DecorView will create
BackdropFrameRenderer to drop back drop frame for freeform window.
The BackdropFrameRenderer will create a render node called back drop
render node, and set its bounds to window frame bounds. But in the
FrameBuilder.cpp in hwui will calculate the distance between back drop
render node bounds with frame contents drawing bounds, and translate
window content with this distance to adapt back drop position. But there
exists a problem, the back drop bounds is set with window frame bounds
what are relative to display, but the content drawing bounds are
relative to window left/top point. So it will cause the problem freeform
window will jump when drag-resizing, and come back to the correct size
after drag-resizing. So we change the back drop bounds to be relative
to window left/top point too to fix this problem.

Test: start settings from Taskbar, and drag shadow of window to resize
      window, and the window's left and top position keep the origin
      location and doesn't jump when resizing.

Signed-off-by: utzcoz <utzcoz@outlook.com>
3 years agoDO NOT MERGE Make intents immutable
Julia Reynolds [Thu, 28 May 2020 14:45:19 +0000 (10:45 -0400)]
DO NOT MERGE Make intents immutable

Test: make
Fixes: 154719656
Change-Id: I212ca5f1a48174ed85311b551259da314718f082
Merged-In: I212ca5f1a48174ed85311b551259da314718f082
(cherry picked from commit 36b3352784ae90326a2b308542b1d2cfe18661a0)
(cherry picked from commit f596432fde8008f3571fa7157e7eb8a85ece5d7b)

3 years agoMore fixes towards the race conditions in AMS
Jing Ji [Fri, 25 Oct 2019 19:03:30 +0000 (12:03 -0700)]
More fixes towards the race conditions in AMS

Bug: 142986887
Bug: 140108616
Test: Manual
Change-Id: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
Merged-In: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
(cherry picked from commit b2e84f0406139156442984943d8de7dd37d51368)
(cherry picked from commit 9f8923d54a2d3740d1a293728b1d5b5b2451627b)

3 years agoAdd back enforceReadPermission for getmetadata
Diksha Gohlyan [Thu, 7 May 2020 00:46:46 +0000 (00:46 +0000)]
Add back enforceReadPermission for getmetadata

Test: manually tested
Bug: 151095863

Change-Id: I29ef120c10c488550b85269e598aeb6ff9505038
Merged-In: I4f04f08f76d039196c2c67bac80d4a46ebec87f2
(cherry picked from commit 71ec29b05022b06ffd4596dc8b339d2067cf58c0)

3 years agoRESTRICT AUTOMERGE
Linus Tufvesson [Tue, 5 May 2020 10:13:51 +0000 (11:13 +0100)]
RESTRICT AUTOMERGE

This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: atest CtsWindowManagerDeviceTestCases:android.server.wm.PresentationTest CtsDisplayTestCases:android.display.cts.VirtualDisplayTest

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
(cherry picked from commit d663d274ea8cdb7169d08bc3a4efa81517a8724a)

3 years agoDO NOT MERGE - Kill apps outright for API contract violations
Christopher Tate [Mon, 19 Aug 2019 23:16:20 +0000 (16:16 -0700)]
DO NOT MERGE - Kill apps outright for API contract violations

...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
(cherry picked from commit a79b6ba5c59dc6aaa8adbe1ffa3ee4b761f45e7f)

3 years agoResolverActivity: use hardware rendering for Intent Resolver dialog
Mauro Rossi [Sun, 31 May 2020 19:53:49 +0000 (21:53 +0200)]
ResolverActivity: use hardware rendering for Intent Resolver dialog

Workaround to avoid graphic glitches with gbm_gralloc happening
when launcher needs to be selected at first boot

Suggested by Franco Catrin for issues affecting software rendering path:
https://github.com/android-rpi/device_brcm_rpi3/issues/49

3 years agoFix ime_switcher icon misplaced
Chih-Wei Huang [Thu, 21 May 2020 01:52:43 +0000 (09:52 +0800)]
Fix ime_switcher icon misplaced

Copy code from Android 10.

3 years agoRESTRICT AUTOMERGE
Eugene Susla [Thu, 28 Mar 2019 20:50:17 +0000 (13:50 -0700)]
RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids

Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
(cherry picked from commit 84cccfe6cdbc57ee372ee1a0fea64c7a11c53766)

3 years agoMerge tag 'android-9.0.0_r56' into pie-x86
Chih-Wei Huang [Wed, 6 May 2020 02:35:57 +0000 (10:35 +0800)]
Merge tag 'android-9.0.0_r56' into pie-x86

Android 9.0.0 release 56

3 years agoVerify all possible hosts that match web nav
Christopher Tate [Wed, 26 Feb 2020 01:48:49 +0000 (17:48 -0800)]
Verify all possible hosts that match web nav

Even if an <intent-filter> matches non-web schemes in addition to http
or https, make sure to include its cited hosts in the autoVerify
evaluation.

Bug: 150038428
Test: atest OsHostTests#testIntentFilterHostValidation
Change-Id: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
Merged-In: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
(cherry picked from commit 1fba0f897f276d5d47962534867e764da8061105)
(cherry picked from commit bfa779601082d9021ea4e7d4cca571575bd0b13b)

3 years agoVerify all possible hosts that match web nav
Christopher Tate [Wed, 26 Feb 2020 01:48:49 +0000 (17:48 -0800)]
Verify all possible hosts that match web nav

Even if an <intent-filter> matches non-web schemes in addition to http
or https, make sure to include its cited hosts in the autoVerify
evaluation.

Bug: 150038428
Test: atest OsHostTests#testIntentFilterHostValidation
Change-Id: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
Merged-In: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
(cherry picked from commit 1fba0f897f276d5d47962534867e764da8061105)
(cherry picked from commit bfa779601082d9021ea4e7d4cca571575bd0b13b)

3 years agoRESTRICT AUTOMERGE
Eugene Susla [Thu, 28 Mar 2019 20:50:17 +0000 (13:50 -0700)]
RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids

Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
(cherry picked from commit 84cccfe6cdbc57ee372ee1a0fea64c7a11c53766)

3 years agoRevert "DO NOT MERGE - Kill apps outright for API contract violations"
Anis Assi [Tue, 28 Apr 2020 19:41:11 +0000 (12:41 -0700)]
Revert "DO NOT MERGE - Kill apps outright for API contract violations"

This reverts commit ca006a7de870f58587dbd9054aa98b3ea21157f6.

4 years ago[Pie port] Add minimize & pip buttons to freeform windows android-x86-9.0-r2
Jon West [Sat, 14 Mar 2020 19:34:41 +0000 (15:34 -0400)]
[Pie port] Add minimize & pip buttons to freeform windows

Thanks to @farmerbb for assistance and @rogerdott for the graphics

Change-Id: I8ddad6eab27f52574ee1c10e8006612fb46a83c5

4 years agoMerge tag 'android-9.0.0_r54' into pie-x86
Chih-Wei Huang [Fri, 13 Mar 2020 04:59:51 +0000 (12:59 +0800)]
Merge tag 'android-9.0.0_r54' into pie-x86

Android 9.0.0 release 54

4 years agoRESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Riddle Hsu [Tue, 3 Mar 2020 08:29:31 +0000 (16:29 +0800)]
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo

Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.

Also forbid attaching null application thread to avoid unexpected state
in process record.

Bug: 144285917
Test: atest ActivityStackTests#testNavigateUpTo
Test: atest CtsSecurityTestCases:ActivityManagerTest# \
      testActivityManager_attachNullApplication
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
(cherry picked from commit da78af4d6696dda77c692a7c6f2f49d4277cf341)

4 years agoRESTRICT AUTOMERGE Create separated tasks for different apps from startActivities
Riddle Hsu [Wed, 19 Feb 2020 07:13:56 +0000 (15:13 +0800)]
RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities

Assume there are 2 applications A, B with different uids.
There are 4 activities A1, A2, B1, B2 with default task
affinity and launch mode.

After A1 called startActivities(B1, A2, B2):
 Original   : Task(A1, B1, A2, B2)
 This Change: Task(A1, B1), Task(A2, B2)
In other words, the source caller cannot launch its activity
above the activity of other application in the same task, and
it can still launch activity of other application in its task.

Bug: 145669109
Test: atest StartActivityTests# \
      testStartActivitiesWithDiffUidNotInSameTask
Change-Id: I97bd875146a52f62b8fe82235487ccefb2955e8e
(cherry picked from commit 48d8d370f3d1dac06719ca6a52bda5f45a1a533a)

4 years agoDO NOT MERGE - Kill apps outright for API contract violations
Christopher Tate [Mon, 19 Aug 2019 23:16:20 +0000 (16:16 -0700)]
DO NOT MERGE - Kill apps outright for API contract violations

...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
(cherry picked from commit a79b6ba5c59dc6aaa8adbe1ffa3ee4b761f45e7f)

4 years agoDO NOT MERGE Ensure package names read from config are system packages.
Hai Zhang [Wed, 11 Dec 2019 01:34:18 +0000 (17:34 -0800)]
DO NOT MERGE Ensure package names read from config are system packages.

Bug: 145981139
Test: manually tested ensureSystemPackageName() returns null for non-system app
Change-Id: I1d23910cbd282f6702785c9dfb059d7be6b0e895
(cherry picked from commit 6a56247200e1a8afc4dacc2497ec384efa200b92)
(cherry picked from commit 584d73a0b066e01b0877b475c8e2b1a85fcf5328)

4 years agoRESTRICT AUTOMERGE
Rubin Xu [Tue, 5 Nov 2019 10:15:36 +0000 (10:15 +0000)]
RESTRICT AUTOMERGE
Update keyguard locked state from TrustManagerService

TrustManagerService holds the ground truth about whether a user is
locked or not, so update keystore using the information there,
instead of doing it from KeyguardStateMonitor. This fixes the issue
of work profile locked state not being correctly pushed to keystore.

Note: since this change is likely to be backported as a security
patch, I'm refraining from doing major refactoring right now.

Bug: 141329041
Bug: 144430870
Test: manually with KeyPairSampleApp
Change-Id: I3472ece73d573a775345ebcceeeb2cc460374c9b
(cherry picked from commit 0860a5c5c303426073c36763bef28644673ff441)

4 years agoOnly suspend package from system or shell
Julia Reynolds [Thu, 7 Nov 2019 16:37:18 +0000 (11:37 -0500)]
Only suspend package from system or shell

Test: manual
Bug: 148059175
Change-Id: I50ee768e792266ad2091f1913168e89d5d1463ed
Merged-In: I50ee768e792266ad2091f1913168e89d5d1463ed
(cherry picked from commit 1c943a2670c1ff499669b42ef72dcd9f07db08c3)
(cherry picked from commit adc39de3a148a2058d63bd7a1b8b71ee0a3524ac)
(cherry picked from commit eb4f716bf3a0ee3ac8015cde48305aeb82724039)

4 years agoWork around foreground app not updating issue
Michael Goffioul [Fri, 30 Aug 2019 00:19:00 +0000 (08:19 +0800)]
Work around foreground app not updating issue

The foreground app not updating anymore after the second sleep/wake
sequence. I managed to work around it using this patch.

4 years agoMerge tag 'android-9.0.0_r53' into pie-x86 android-x86-9.0-r1
Chih-Wei Huang [Tue, 11 Feb 2020 02:50:54 +0000 (10:50 +0800)]
Merge tag 'android-9.0.0_r53' into pie-x86

Android 9.0.0 Release 53 (6107734)

4 years agoFix potential double destroy of AssetManager
Riddle Hsu [Thu, 4 Jul 2019 08:10:08 +0000 (16:10 +0800)]
Fix potential double destroy of AssetManager

Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.

By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.

Bug: 136721562
Bug: 144028297
Test: atest AssetManagerTest
Test: Build and install CorePerfTests
      adb shell am instrument -w -r --no-hidden-api-checks -e class \
      android.app.ResourcesPerfTest#getLayoutAndTravese,android.graphics.perftests.RenderNodePerfTest \
      com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Merged-In: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
(cherry picked from commit 0a8a1e9d40a3cdff06150c43c623fa4c415226b6)

4 years agoRevoke 'always' web handler status when not autoverifying
Christopher Tate [Tue, 17 Dec 2019 19:21:02 +0000 (11:21 -0800)]
Revoke 'always' web handler status when not autoverifying

If an app has previously used autoVerify to make claims about its status
re handling web navigation intents, but is updated such that it no
longer makes those claims, step down its "official handler" status as
though it had never invoked autoVerify in the first place.

Bug: 146204120
Test: manual: as described in bug; observe policy before/after via
      'adb shell dumpsys package d'
Test: atest CtsOsHostTestCases
Change-Id: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
Merged-In: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
(cherry picked from commit ce22265eeda3a96613b9a7bb7dd898c69d295964)

4 years agoMerge tag 'android-9.0.0_r52' into pie-x86
Chih-Wei Huang [Mon, 20 Jan 2020 10:57:14 +0000 (18:57 +0800)]
Merge tag 'android-9.0.0_r52' into pie-x86

Android 9.0.0 release 52

4 years agoFixes NPE when preparing app data during init
Patrick Baumann [Wed, 6 Nov 2019 18:36:39 +0000 (10:36 -0800)]
Fixes NPE when preparing app data during init

When deleting an unused static shared library on Q, the user manager was
fetched via mContext.getSystemService. At this time during boot, the
service wasn't registered and so null was returned. This has already
been addressed in R with a move to injecting dependencies in the
PackageManagerService constructor.

Bug: 142083996
Bug: 141413692
Test: manual; remove static dependency on eng Q build and reboot
Change-Id: I8ae4e331d09b4734c54cdc6887b273705dce88b1
Merged-In: I8ae4e331d09b4734c54cdc6887b273705dce88b1
(cherry picked from commit 5d3fc339b57950fd8621cb410865e8800ccb6873)

4 years agoUse KNOWN_PACKAGES when shared lib consumers
Patrick Baumann [Thu, 10 Oct 2019 22:50:28 +0000 (15:50 -0700)]
Use KNOWN_PACKAGES when shared lib consumers

This change ensures we find ALL known packages that could be consuming a
shared library, not only currently installed ones. Without this check,
the system may get into a state in which we have currently uninstalled
but on-device apps that depend on a shared library that does not exist
on device.

This change also leaves static shared library packages on device even if
it's not installed for any of the remaining users as it could still be
used, but marked uninstalled for users in which it is consumed.

Bug: 141413692
Bug: 142083996
Test: Manual; attempt to remove shared lib after marking its consumer uninstalled.
Test: atest StaticSharedLibsHostTests
Change-Id: Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea
Merged-In: Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea
(cherry picked from commit 08315953bc42fb392c32293418dfb2a3e4ffbe53)

4 years agoHandles null outInfo in deleteSystemPackageLI
Patrick Baumann [Fri, 23 Aug 2019 20:50:23 +0000 (13:50 -0700)]
Handles null outInfo in deleteSystemPackageLI

This change adds null checks before accessing outInfo in
deleteSystemPackageLI.

Bug: 142083996
Bug: 141413692
Test: manual; remove static dependency on eng build and reboot
Change-Id: If0fd48343e89cbb77ccd25826656194195d5b0cd
(cherry picked from commit 17471016508bb9c9ffb8c3946dda0b4897d722f1)
Merged-In: If0fd48343e89cbb77ccd25826656194195d5b0cd
(cherry picked from commit 6afabce549f5725988b9c03de932c34e9d22f10e)

4 years agoFix security problem on PermissionMonitor#hasPermission
paulhu [Mon, 16 Dec 2019 10:24:05 +0000 (18:24 +0800)]
Fix security problem on PermissionMonitor#hasPermission

PermissionMonitor#hasPermission only checks permssions that app
requested but it doesn't check whether the permission can be
granted to this app. If requested permission doens't be granted
to app, this method still returns that app has this permission.
Then PermissionMonitor will pass this info to netd that means
this app still can use network even restricted network without
granted privileged permission like CONNECTIVITY_INTERNAL or
CONNECTIVITY_USE_RESTRICTED_NETWORKS.

Bug: 144679405
Test: Build, flash, manual test
Change-Id: Iae9c273af822b18c2e6fce04848a86f8dea6410a
Merged-In: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
Merged-In: I2da730feda4d7ebed1f158b073167bb3964b3e7d
(cherry picked from commit d0205a3469dc8d8122e89072c19d0e9f18e7452f)

4 years agoSupport strict mode private DNS on VPNs that provide Internet.
Lorenzo Colitti [Fri, 10 May 2019 11:33:43 +0000 (04:33 -0700)]
Support strict mode private DNS on VPNs that provide Internet.

Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Backport of 414b8c8b1ce8ae2ad6ef95c1ffba19062077d3e6.

Bug: 122652057
Test: atest FrameworksNetTests
Test: manually ran a VPN with private DNS in strict mode
Test: atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
(cherry picked from commit 029d9ea11921b7ca5652d24a9563b66c2b70fafc)

4 years agoAdd test coverage for strict mode private DNS.
Lorenzo Colitti [Fri, 25 Oct 2019 16:20:57 +0000 (01:20 +0900)]
Add test coverage for strict mode private DNS.

Support faking out the DNS lookups used by NetworkMonitor to
resolve strict mode DNS, and add more test coverage.

These tests were partly adapted from tests we have in Q but
also contain new coverage. This is because in Q the interface
between ConnectivityService and NetworkMonitor changed
substantially, and it is impractical to backport
NetworkMonitorTest.

Bug: 122652057
Test: atest FrameworksNetTests
Change-Id: I6497b7efa539267576d38d3036eef0af0df4e9cb
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
(cherry picked from commit 60cd85533d3a9ad4e3758de4804d1716e7fe0371)

4 years agoRESTRICT AUTOMERGE
Sterling Huber [Thu, 7 Nov 2019 19:04:03 +0000 (11:04 -0800)]
RESTRICT AUTOMERGE
Make toasts non-clickable

Since enforcement was only on client-side, in Toast class, an app could
use reflection (or other means) to make the Toast clickable. This is a
security vulnerability since it allows tapjacking, that is, intercept touch
events and do stuff like steal PINs and passwords.

This CL brings the enforcement to the system by applying flag
FLAG_NOT_TOUCHABLE.

Test: atest CtsWindowManagetDeviceTestCases:ToastTest
Test: Construct app that uses reflection to remove flag FLAG_NOT_TOUCHABLE and
      log click events. Then:
      1) Observe click events are logged without this CL.
      2) Observer click events are not logged with this CL.
Bug: 128674520

Change-Id: Ica346c853dcb9a1e494f7143ba1c38d22c0003d0
(cherry picked from commit 6bf18c39d9fc727523fa3201567b836032bb2114)

4 years agoDO NOT MERGE back porting for fixing sysui direct reply
Yohei Yukawa [Sat, 19 Jan 2019 19:49:37 +0000 (11:49 -0800)]
DO NOT MERGE back porting for fixing sysui direct reply

Root cause: systemui run as user 0 service to handle all of users'
notifications. And, the users can user the copy/cut/paste
functionality.

Solution: To crate @hide API in TextView let SystemUI to mark the
TextView instance should check if the power of
INTERACT_ACROSS_USER_FULL is needed to be restricted.
e.x. Keyguard password textview/Notificaiton entries

Bug: 123232892
Test: manual test
Reference: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Reference: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
Reference: I975baa748c821538e5a733bb98a33ac609bf40a7

Change-Id: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Merged-In: Ie3daecd1e8fc2f7fdf37baeb5979da9f2e0b3937
(cherry picked from commit 08391b3da7e2da3b0220eb5766e0a1774d28e9a5)

4 years agoRESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView.
Abodunrinwa Toki [Fri, 2 Aug 2019 17:35:50 +0000 (18:35 +0100)]
RESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView.

Sys UI runs in the primary user. This means that TextView components
such as RemoteInputView and KeyguardPasswordView running in it could
leak data across users.

This CL disables the TextClassifier for RemoteInputView.
It also logs when fixed issue is "potentially" exercised.
There is no need to explicitly disable the TextClassifier for
KeyguardPasswordView. It is a password field
(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD) and the
TextClassifier does not run for such fields.

Test: manually attempt to excercise the bug.
      See the bug in 123232892 for more information.

Bug: 136483597
Bug: 123232892
Change-Id: Ia1e4843d1505e204f2e78d2459da198c9988f7f2
(cherry picked from commit 579abbd2d8ad37c4e07e1396002ad5be5bd41365)

4 years agoDO NOT MERGE: Disable SpellChecker in secondary user's direct reply
Tarandeep Singh [Mon, 1 Jul 2019 21:27:25 +0000 (14:27 -0700)]
DO NOT MERGE: Disable SpellChecker in secondary user's direct reply

For secondary users, when AOSP keyboard is used to type in
direct-reply, unknown words can be added to dictionary.
It's *not* OK for SpellCheckerService of primary user to
check unknown words typed by a secondary user.
The dialog to add these words shows up in primary user instead.

TextView uses TextView#isSuggestionsEnabled() to determine if
SpellChecker is enabled. This can be disabled by setting the flag
TYPE_TEXT_FLAG_NO_SUGGESTIONS in inputType.

Note: This doesn't affect workprofile users on P or older versions since
they use same SpellCheckerService for all workprofiles.

Bug: 123232892
Test: Manually tested using the steps mentioned in the bug.
 1. Flash latest P build.
 2. Install AOSP keyboard (LatinIME) and set it as default.
 3. Install and open EditTextVariations
 4. Initiate direct reply in primary user and type non-english
    words like "ggggg hhhhh".
 5. Observe that they get red underline and tapping it brings "add
    to dictionary" popup.
 6. Create a new secondary user and switch to it.
 7. Once the setup completes, initiate a direct reply and type words
    similar to step 4.
 8. Verify that red underlines dont appear.
 9. switch back to primary user and verify direct reply still has red
    underlines.

Change-Id: I93918eb2c12e37908e03a7951a9e2c5375bc0ecc
(cherry picked from commit b5c0e01aca6f19ae3e305ce6d1c1ecec6aba0532)

4 years agoFix QuickSetting panel width
Chih-Wei Huang [Wed, 13 Nov 2019 08:19:28 +0000 (16:19 +0800)]
Fix QuickSetting panel width

Suggested-by: fguy <fguy2102@gmail.com>
4 years agoAlign the pageBlockOrder to the kerne 4.19 kernel
he, bo [Fri, 26 Oct 2018 01:23:58 +0000 (09:23 +0800)]
Align the pageBlockOrder to the kerne 4.19 kernel

Change-Id: Ieb76e3d78856c80c0450e239b5ba026219920c2e
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-70044
Signed-off-by: he, bo <bo.he@intel.com>
4 years agoCheck if mClingWindow is already added before adding.
Yan, WalterX [Mon, 3 Dec 2018 07:22:32 +0000 (15:22 +0800)]
Check if mClingWindow is already added before adding.

If not to check if it's added, the previous one will leak
and cannot be removed any more.

Change-Id: Ifd50b57badd8c630aaa1e202695c7c4525b3a30e
Tracked-On: OAM-72403
Signed-off-by: Yan, WalterX <walterx.yan@intel.com>
4 years agoEnabling suspend on IVI after clicking sleep from the power button menu.
Madhusudhan S [Mon, 12 Nov 2018 07:48:34 +0000 (13:18 +0530)]
Enabling suspend on IVI after clicking sleep from the power button menu.

Tracked-on: OAM-56502

Change-Id: Ib8e5f351815474d8e99739938ac5845227f711ff
Signed-off-by: Madhusudhan S <madhusudhan.s@intel.com>
4 years agoGlobalActions: Handle 'sleep' action
saranya [Tue, 17 Apr 2018 10:22:08 +0000 (15:52 +0530)]
GlobalActions: Handle 'sleep' action

Some Intel platforms do not provide separate
events for power key press and release. This
makes it impossible to detect long press of
power button. So, the solution is to handle
only short press and add 'sleep' also as an
option in GlobalActions menu. This patch
handles 'sleep' option.

Change-Id: Iaae59b324e5ba6eaed9e507fdaa8e5006535716c
Tracked-On: OAM-56502
Signed-off-by: saranya <saranya.gopal@intel.com>
Signed-off-by: Madhusudhan S <madhusudhan.s@intel.com>
4 years agoFix forceDefaultOrientation
Chih-Wei Huang [Thu, 18 Jul 2019 07:32:13 +0000 (15:32 +0800)]
Fix forceDefaultOrientation

Ignore screen size when determines mForceDefaultOrientation.

Fix the bug in the calculation of left and top of DisplayContent
when default orientation is forced. (by Ladehunter)

4 years agoandroid_view_ThreadedRenderer: prevent Null Pointer Exception in createBitmap
Mauro Rossi [Sun, 3 Mar 2019 15:28:41 +0000 (16:28 +0100)]
android_view_ThreadedRenderer: prevent Null Pointer Exception in createBitmap

To avoid Playstore crashes with nouveau and Hardware Bitmap,
a check is added to bitmap returned by Bitmap::createFrom(buffer)
inspired by similar behavior in Bitmap.cpp Bitmap_createHardwareBitmap()

Fixes the following crash:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Android-x86/android_x86/x86:8.1.0/OPM8.181005.003/uten01131829:userdebug/test-keys'
Revision: '0'
ABI: 'x86'
pid: 4644, tid: 4644, name: android.vending  >>> com.android.vending <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc
Cause: null pointer dereference
    eax 89195380  ebx b1d36290  ecx 00000000  edx ae783074
    esi 00000000  edi ae7a9380
    xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
    eip b1c4f7c8  ebp bff902c8  esp bff9028c  flags 00010246

backtrace:
    #00 pc 000fd7c8  /system/lib/libandroid_runtime.so (android::bitmap::createBitmap(_JNIEnv*, android::Bitmap*, int, _jbyteArray*, _jobject*, int)+104)
    #01 pc 000d08ca  /system/lib/libandroid_runtime.so (android::android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode(_JNIEnv*, _jobject*, long long, int, int)+1002)

4 years agopm: ignore restorecon failure
Chih-Wei Huang [Thu, 18 Oct 2018 07:47:19 +0000 (15:47 +0800)]
pm: ignore restorecon failure

On the 9p filesystem, restorecon won't work. It causes apk can't be
installed. Just ignore the errors to workaround it.

4 years agoModify color inversion matrix to swap Red and Blue colors
Mauro Rossi [Thu, 9 Aug 2018 23:12:22 +0000 (01:12 +0200)]
Modify color inversion matrix to swap Red and Blue colors

Instead of color inversion it will produce Red and Blue colors swap,
in order to correct displayed colors for R4xx and other old drivers
still based on KMS API

4 years agoABIPicker: match package name by patterns
Chih-Wei Huang [Mon, 18 Jul 2016 14:32:13 +0000 (22:32 +0800)]
ABIPicker: match package name by patterns

PRC apps from different markets usually have different package names.
This change tries to match them by patterns.

To test it, install the Implosion apps from Wandoujia and CoolMarket
and run them OK.

4 years agoFix the memory leak bug introduced by PRC compatibility feature
jgu21 [Fri, 1 Apr 2016 04:40:31 +0000 (00:40 -0400)]
Fix the memory leak bug introduced by PRC compatibility feature

Fix the memory leak bug introduced by PRC compatibility feature,
introduced by https://android.intel.com/#/c/471490/

Change-Id: Iaf9bd21afa17f3a81ab700c63ae7c0bb0851a594
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-27449
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/489353

4 years agoFix KW issues on PRC compatibility
jgu21 [Wed, 30 Mar 2016 06:57:38 +0000 (02:57 -0400)]
Fix KW issues on PRC compatibility

Fix KW issues on PRC compatibility,introduced by below commit.
https://android.intel.com/#/c/484542/

Change-Id: Ib10899655dd2a18569387dbafbe33856acf5df59
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-26904
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/487804

4 years agoReduce the overhead of the PRC compatibility package feature during system bootup
xiajiang [Mon, 21 Mar 2016 16:26:06 +0000 (12:26 -0400)]
Reduce the overhead of the PRC compatibility package feature during system bootup

The PRC compatibility package introduced too heavy overhead
in system bootup. This commit aims to reduce the overhead
in system bootup and improve the performance of PRC
compatibility package.

NOTE: The format of ThirdPartySO has been changed to improve
the performance. From now on, the lib name should be trimmed
as below if want to add into the list. For "libabc_v1_2_3.so",
add "abc_v" into the list, that is, the version information
at the tail of lib name should be removed.

Change-Id: Ic374e363d3d31f9bd69be839b33b1bd65950ef61
Tracked-On:https://jira01.devtools.intel.com/browse/OAM-25819
Signed-off-by: xiajiang <xia1.jiang@intel.com>
Reviewed-on: https://android.intel.com:443/484542

4 years agoEnable the PRC compatibility package feature for PRC market
xiajiang [Wed, 17 Feb 2016 18:59:14 +0000 (13:59 -0500)]
Enable the PRC compatibility package feature for PRC market

In PRC market, some APKs are packed in non-standard way, that is,
the x86(_64) libraries aren't workable although they're found in the APK.
This patch intends to relieve the impact from below 2 defects,
which is based-on the heuristic algorithm.

NOTE: To enable this feature, set "PRC_COMPATIBILITY_PACKAGE := true"
in device BoardConfig.mk before enabling houdini.

1. Missing x86(_64) libraries: The x86(_64) libraries are ported and
   existing in the APK. But it's incomplete, and not workable.
2. Mixed arm(64) libraries: Several libraries are existing in lib/x86(_64)/
   directory in the APK. But some of them are arm(64) libraries,
   instead of x86(_64) ones.

All of above always cause APP crash if installed x86(_64) libraries
by PackageManager.

This patch aims to improve PackageManager to figure out these defects
and install arm(64) libraries to run the APP with houdini support.
The basic idea is to compare x86(_64) libraries with arm(64) alternatives
to determine which one should be workable.

To customize it for specific APPs, 3 lists are provided under
/system/vendor/etc/misc/ on the device.

1. /system/vendor/etc/misc/.OEMWhiteList:
   This patch will be disabled for the APPs containing in the OEMWhiteList
2. /system/vendor/etc/misc/.OEMBlackList:
   The APP is enforced to install the arm(64) libraries if existed.
3. /system/vendor/etc/misc/.ThirdPartySO:
   This is another list which contains the names of all 3rd-party libraries,
   which will impact on the final decision of APP installation.

Change-Id: I2613d9ebc8fe012c801f4a38fc5dede413f15a91
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-20470
Signed-off-by: xiajiang <xia1.jiang@intel.com>
Reviewed-on: https://android.intel.com:443/471490

4 years agofd_utils: fix DEBUG mode booting issue (pie-x86)
Mauro Rossi [Fri, 8 Mar 2019 16:28:25 +0000 (17:28 +0100)]
fd_utils: fix DEBUG mode booting issue (pie-x86)

Porting to pie-x86 codebase of oreo-86 commit
c283ba107a ("fd_utils: fix DEBUG mode booting issue")

Original commit message:

Remove the "/android/" prefix before the white list checking.

Suggested by Chris Vandomelen <chris@sightworks.com>.

4 years agoCamera: ignore exceptions from getSupportedPreviewFpsRange
Chih-Wei Huang [Fri, 16 Mar 2018 06:50:39 +0000 (14:50 +0800)]
Camera: ignore exceptions from getSupportedPreviewFpsRange

4 years agoinput: simulate long press properly
Chih-Wei Huang [Tue, 21 Nov 2017 08:36:30 +0000 (16:36 +0800)]
input: simulate long press properly

The original implementation of long press sends two ACTION_DOWN events
which would be interpreted as a double tap. For example, sending
a long press POWER key will launch the camera:

11-21 16:27:37.320  2223  2223 I Input   : injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_POWER, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=39641, downTime=39641, deviceId=-1, source=0x101 }
11-21 16:27:37.321  2223  2223 I Input   : injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_POWER, scanCode=0, metaState=0, flags=0x80, repeatCount=1, eventTime=39641, downTime=39641, deviceId=-1, source=0x101 }
11-21 16:27:37.322  1411  1565 I GestureLauncherService: Power button double tap gesture detected, launching camera. Interval=0ms
11-21 16:27:37.322  2223  2223 I Input   : injectKeyEvent: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_POWER, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=39641, downTime=39641, deviceId=-1, source=0x101 }

This is unexpected and incorrect.

Just simulate the long press by delaying ACTION_UP one second.

4 years agoDiskInfo: support CD/DVD type
Chih-Wei Huang [Fri, 24 Mar 2017 19:13:40 +0000 (03:13 +0800)]
DiskInfo: support CD/DVD type

4 years agoDetect HDMI audio by switch events
Chih-Wei Huang [Tue, 13 Sep 2016 09:43:11 +0000 (17:43 +0800)]
Detect HDMI audio by switch events

If detect SW_VIDEOOUT_INSERT, assume HDMI is plugged.

4 years agoanalytics: send anonymous usage information
Hugo [Wed, 6 Jul 2016 03:28:38 +0000 (11:28 +0800)]
analytics: send anonymous usage information

Send usage information to google analytics when applications are started
or throws exceptions.

4 years agoSupport save local time to RTC
Ma Jian [Sun, 12 Jun 2016 07:13:55 +0000 (15:13 +0800)]
Support save local time to RTC

Make it work for dual boot with Windows, we could set property
persist.rtc_local_time to 1, so that RemixOS and Windows both
use local time in rtc.

NO_REF_TASK
Tested:
1) set time in android, reboot to bios, make sure the time in bois is
   local time
2) reboot back to android, the current time should be correct local time
   (this need another change)

Change-Id: Id2c0ce150fb9320b132ad8bdd83b38dcae1070db

4 years agoMap keycode 120 to APP_SWITCH
Chih-Wei Huang [Mon, 22 Dec 2014 04:08:17 +0000 (12:08 +0800)]
Map keycode 120 to APP_SWITCH

Define the unused keycode 120 to be APP_SWITCH.

4 years agoInputReader: read the pointercal from TSCalibration2
Chih-Wei Huang [Sat, 17 May 2014 18:20:32 +0000 (02:20 +0800)]
InputReader: read the pointercal from TSCalibration2

Watch the pointercal and reload it on changed.

4 years agoSystemUI: Recycle the old wallpaper background bitmap after we choose a new wallpaper.
jshe32X [Thu, 24 Oct 2013 04:57:09 +0000 (12:57 +0800)]
SystemUI: Recycle the old wallpaper background bitmap after we choose a new wallpaper.

BZ: 101064

RootCause: ImageWallpaper didn't call old background bitmap's recycle before
           set it to null.

Category: aosp improvement
Domain: AOSP-Framework-Media
Origin: internal
Upstream-Candidate: yes

Orig-Change-Id: I27f6971a3edd26472b69e59b542b27fd7c8e7b90
Change-Id: Ice59aea79f8137d5995d7a5ce9a6ed7903750d30
Signed-off-by: jshe32X<jianchunx.shen@intel.com>
4 years agoMediaFile: support more media types
Chih-Wei Huang [Fri, 13 Sep 2013 08:15:12 +0000 (16:15 +0800)]
MediaFile: support more media types

4 years agoMake "windows" key to act as "home" key
juntingwang [Wed, 24 Apr 2013 06:06:08 +0000 (14:06 +0800)]
Make "windows" key to act as "home" key

Issue: AXIA-1893
Change-Id: I7b2b19f7e34ec8a1867e8e6ce522e65133e5267f
Signed-off-by: juntingwang <Junting.Wang@windriver.com>
4 years agocamera: fix NullPointerException
Chih-Wei Huang [Wed, 20 Feb 2013 17:46:17 +0000 (01:46 +0800)]
camera: fix NullPointerException

4 years agoGLSurfaceView: Be less picky about EGLConfig alpha sizes
Andy Ross [Tue, 15 Jan 2013 23:05:38 +0000 (15:05 -0800)]
GLSurfaceView: Be less picky about EGLConfig alpha sizes

EGLChooseConfig returns a "best match" set of visuals meeting or
exceeding the required r/g/b/a component depths.  But GLSurfaceView
oddly requires that the returned visual be an exact match.  Add to
that that the (rarely used outside of CTS) default request specifies
zero alpha bits and that not all drivers expose a zero-alpha
EGLConfig, and the default configuration will fail needlessly.

It's not incorrect to have alpha bits you didn't request: the only way
to produce divergent behavior is for a fragment shader to write out
explicit alpha values (into the channel it didn't want to begin with!)
with values other than 1.0 and then rely on them being ignored and
treated as 1.0.

For: AXIA-1448
Change-Id: I2f64995d7b9de1ae082aa47822af525390102083
Signed-off-by: Andy Ross <andy.ross@windriver.com>
4 years agoimport YuvToEncoder R3 patches, BZ 18528, 19092, 19696
Zhao Liang [Fri, 20 Jul 2012 03:56:51 +0000 (11:56 +0800)]
import YuvToEncoder R3 patches, BZ 18528, 19092, 19696

BZ: 47824

Please refer http://umgbugzilla.sh.intel.com:41006/show_bug.cgi?id=19092 and
external/jpeg/libjpeg.doc

The MCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16
scanlines on each call to jpeg_write_raw_data(), which is to say 16 actual
sample rows of Y and 8 each of Cb and Cr.

The original implement of Yuv420SpToJpegEncoder::compress didn't add padding to the frame buffer
when height and width aren't aligned with 16 pixel. It will cause illegal memory violation and core dump.

Category: aosp improvement
Domain: Video.Media-jpeg
Origin: Internal
Upstream: Yes

Change-Id: Ibcf14230d616e2d440ace244bb420723b5c01dc2
Orig-Change-Id: Ic1b7494b98ee9c1997b226d58abd034b1dcb18f6
Signed-off-by: Tong, Bo <box.tong@intel.com>
Signed-off-by: Zhao Liang <leo.zhao@intel.com>
4 years agoPrevent system uid component from running in an isolated app process
Jing Ji [Mon, 4 Nov 2019 22:22:27 +0000 (14:22 -0800)]
Prevent system uid component from running in an isolated app process

Bug: 140055304
Test: Manua
Change-Id: Ie7f6ed23f0c6009aad0f67a00af119b02cdceac3
Merged-In: I5a1618fab529cb0300d4a8e9c7762ee218ca09eb
(cherry picked from commit 0bfebadf304bdd5f921e80f93de3e0d13b88b79c)

4 years agoOnly allow INSTALL_ALLOW_TEST from shell or root
Todd Kennedy [Fri, 20 Sep 2019 20:45:15 +0000 (13:45 -0700)]
Only allow INSTALL_ALLOW_TEST from shell or root

Bug: 141169173
Test: Manual. App can't be installed as test-only
Change-Id: Ib6dcca7901aa549d620448c0165c22270a3042be
Merged-In: Ib6dcca7901aa549d620448c0165c22270a3042be
(cherry picked from commit 702d394762a9b162cb2a2b04bb726fd8053f24d3)

4 years agoDO NOT MERGE Validate wallpaper dimension while generating crop
Ahan Wu [Thu, 26 Sep 2019 10:29:59 +0000 (18:29 +0800)]
DO NOT MERGE Validate wallpaper dimension while generating crop

If dimensions of cropped wallpaper image exceed max texture size that
GPU can support, it will cause ImageWallpaper keep crashing
because hwui crashes by invalid operation (0x502).

Bug: 120847476.
Test: Write a custom app to set a 8000x800 bitmap as wallpaper.
Test: The cropped file will be 29600x2960 and make sysui keep crashing.
Test: After applyed this cl, wallpaper will use fallback.
Test: Sysui will not keep crashing any more.
Change-Id: I8ed5931298c652a2230858cf62df3f6fcd345c5a
(cherry picked from commit f1e1f4f04d0165ed065637a4ba556583a7c79ef0)

4 years agoRESTRICT AUTOMERGE
Seigo Nonaka [Wed, 16 Oct 2019 21:48:30 +0000 (14:48 -0700)]
RESTRICT AUTOMERGE
Revive runLimit check logic

The runLimit check logic was accidentally removed by
I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735

Bug: 142134328
Bug: 140632678
Test: Manually done with reported step
Test: StaticLayoutTest passes
Change-Id: Ib1d5efdcb9adcc18a6a43370dc016ea464f48148
(cherry picked from commit fd1a7e8663feb23ba912e1c519630a2385b452fc)

4 years agoForce FGS notifications to show for a minimum time
Evan Laird [Fri, 4 Oct 2019 18:18:59 +0000 (14:18 -0400)]
Force FGS notifications to show for a minimum time

It's possible for a service to do a start/stop foreground and cause a
couple of things to happen:

NotificationManagerService will enqueue a EnqueueNotificationRunnable,
post a PostNotificationRunnable (for the startForeground), and then also
enqueue a CancelNotificationRunnable. There is some racy behavior here
in that the cancel runnable can get triggered in between enqueue and
post runnables. If the cancel happens first, then
NotificationListenerServices will never get the message.

This behavior is technically allowed, however for foreground services we
want to ensure that there is a minmum amount of time that notification
listeners are aware of the foreground service so that (for instance) the
FGS notification can be shown.

This CL does two things to mitigate this problem:

1. Introduce checking in the CancelNotificationRunnable such that it
will not cancel until after PostNotificationRunnable has finished
executing.

2. Introduce a NotificationLifetimeExtender method that will allow a
lifetime extender to manage the lifetime of a notification that has been
enqueued but not inflated yet.

Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceLifetimeExtenderTest
Change-Id: I0680034ed9315aa2c05282524d48faaed066ebd0
Merged-In: I0680034ed9315aa2c05282524d48faaed066ebd0
(cherry picked from commit 3b8c4743f630dcd370bfc5dc9683b551983fbe28)

4 years agoRESTRICT AUTOMERGE
Seigo Nonaka [Mon, 16 Sep 2019 21:49:49 +0000 (14:49 -0700)]
RESTRICT AUTOMERGE
Do not compute outside given range in TextLine

This is second attempt of I646851973b3816bf9ba32dfe26748c0345a5a081
which breaks various layout test on application.
The empty string must be also handled by the TextLine since it
retrieves the default line height from the empty string.

Bug: 140632678
Test: StaticLayoutTest
Test: Manually done
Change-Id: I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735
(cherry picked from commit f582b9bc9834c80f48070b032637dd1c94ebe6f4)

4 years agoDO NOT MERGE revoke certain app-ops on suspend
Suprabh Shukla [Fri, 13 Sep 2019 00:35:22 +0000 (17:35 -0700)]
DO NOT MERGE revoke certain app-ops on suspend

Revoking an apps authorizations to use camera and record or play audio
while suspended. Appops watchers will also be notified of this change to
re-evaluate privileges at the time of suspension.

Test: atest FrameworksServicesTests:SuspendPackagesTest

Bug: 138636979
Change-Id: Ie95555856afdd56728125f7e60b6a78cf9fc0e58
Merged-In: Ie95555856afdd56728125f7e60b6a78cf9fc0e58
Merged-In: Ic5fb1807deceabfd956b666fa76f8bcc94020ac3
(cherry picked from commit ed5edb77dcdbf0e65acb58188698027036fb8d05)

4 years agoRESTRICT AUTOMERGE
Jeff Sharkey [Tue, 16 Jul 2019 22:50:42 +0000 (16:50 -0600)]
RESTRICT AUTOMERGE
Strict SQLiteQueryBuilder needs to be stricter.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change offers setStrictGrammar() to prevent this by outright
blocking subqueries in WHERE and HAVING clauses, and by requiring
that GROUP BY and ORDER BY clauses be composed only of valid columns.

This change also offers setStrictColumns() to require that all
untrusted column names are valid, such as those in ContentValues.

Relaxes to always allow aggregation operators on returned columns,
since untrusted callers can always calculate these manually.

Bug: 135270103
Bug: 135269143
Test: atest android.database.sqlite.cts.SQLiteQueryBuilderTest
Test: atest FrameworksCoreTests:android.database.sqlite.SQLiteTokenizerTest
Exempt-From-Owner-Approval: already approved in downstream branch
Change-Id: I6290afd19c966a8bdca71c377c88210d921a9f25
(cherry picked from commit 216bbc2a2e4f697d88f8fd633646e3c0433246f1)

4 years agoSet default phonebook access to ACCESS_REJECTED when user didn't choose
Zongheng Wang [Thu, 5 Sep 2019 20:44:28 +0000 (13:44 -0700)]
Set default phonebook access to ACCESS_REJECTED when user didn't choose
one

When there's no users' choice to tell us whether to share their
phonebook information to the Bluetooth device, set the phonebook access
permission to ACCESS_REJECTED.

Bug: 138529441
Test: Manual test
Change-Id: Iefabeb731b941f09fe1272ac7b7cd2feba75c8df
Merged-In: Iefabeb731b941f09fe1272ac7b7cd2feba75c8df
(cherry picked from commit 9b3cb0f06b7c4907c293aa65e68c7ed6e4962d4b)

4 years agoRESTRICT AUTOMERGE
Jeff Sharkey [Thu, 18 Jul 2019 00:51:28 +0000 (18:51 -0600)]
RESTRICT AUTOMERGE
Enable stricter SQLiteQueryBuilder options.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change starts using setStrictColumns() and setStrictGrammar()
on SQLiteQueryBuilder to block this class of attacks.  This means we
now need to define the projection mapping of valid columns, which
consists of both the columns defined in the public API and columns
read internally by DownloadInfo.Reader.

We're okay growing sAppReadableColumnsSet like this, since we're
relying on our trusted WHERE clause to filter away any rows that
don't belong to the calling UID.

Remove the legacy Lexer code, since we're now internally relying on
the robust and well-tested SQLiteTokenizer logic.

Bug: 135270103
Bug: 135269143
Test: atest DownloadProviderTests
Test: atest CtsAppTestCases:android.app.cts.DownloadManagerTest
Change-Id: Iec1e8ce18dc4a9564318e0473d9d3863c8c2988a
(cherry picked from commit 382d5c0c199f3743514e024d2fd921248f7b14b3)

4 years agofixes a security vulnerability in slice provider
Pinyao Ting [Thu, 8 Aug 2019 22:35:20 +0000 (15:35 -0700)]
fixes a security vulnerability in slice provider

Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
Merged-In: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
(cherry picked from commit 2b415a4c4465a6294e51ad1a8fcf2e6c1497853b)
(cherry picked from commit 46368e4f5cf4ff4582942bcc8ab23636c702daa3)

4 years agoAdd MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc).
Jonathan Scott [Tue, 25 Jun 2019 09:58:06 +0000 (10:58 +0100)]
Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc).

Test: Just adding a constant
Bug: 132261064
Change-Id: I1527be03a10fa1a2fde09e3e41d6b7e83a986fc0
Merged-In: I2bce277ff8f2de4614e19d5385fe6712b076f9c9
(cherry picked from commit 20e5d92613268c196b508865b7275b59f00688f5)

4 years ago[RESTRICT AUTOMERGE] Pass correct realCallingUid to startActivity() if provided by...
Bryan Ferris [Wed, 5 Jun 2019 01:02:55 +0000 (18:02 -0700)]
[RESTRICT AUTOMERGE] Pass correct realCallingUid to startActivity() if provided by PendingIntentRecord#sendInner()

Previously we'd ignore realCallingPid and realCallingUid that
PendingIntentRecord#sendInner() provided to startActivityInPackage().
Now we correctly pass it on, preserving past behaviour if none
provided.

Test: manual; we added logging statements to check the value of realCallingUid
in startActivitiesMayWait when launching the calendar app from the calendar widget
and verified that it was the calendar uid rather than the system uid.

Bug: 123013720
Change-Id: If0c0b67880c2e7a8774f31fbb1ba5f50544d2972
(cherry picked from commit b255e64a5d282f860bd58ae8f85158b5badce7ba)