Commit Graph

468813 Commits

Author SHA1 Message Date
Martijn Coenen
0fc9f5ef31 Check for null ApplicationInfo object in SMS.
Bug: 149448096
Test: builds
Change-Id: I783c35323ecb82721b47c1d97e211b93a2ec0d48
2020-02-14 19:46:40 +01:00
Ytai Ben-Tsvi
406619f4f3 Avoid risk of deadlock between APM and sound trigger
Sound trigger calls into audio policy manager (APM) for the sake of
allocating and releasing audio sessions.
APM calls into sound trigger for the sake of notifying it of
external capture session start/end.

Both calls are essentially synchronous, i.e. required for the
completion of the operations that trigger them.
Since both services use coarse locks to protect their state, if both
those calls happen concurrently, a deadlock would result.

The fix is to invoke
AudioPolicyManager::{acquire/release}SoundTriggerSession()
outside of the critical section of SoundTriggerModule.

Bug: 148691451
Change-Id: I157367b9e43963e37344958e1647e9f6c29d5e6e
2020-02-14 10:43:36 -08:00
Ivan Lozano
0d496a7107 Remove execute-only memory related code.
The kernel no longer enforces XOM layouts, and the build system no
longer generates XOM binaries. As a result, the zygote code to mark XOM
sections of memory readable for apps with targetSdkVersion<Q.

Bug: 147300048
Test: m -j
Change-Id: I0abb0abb54f8f5a538da9194a900e6a64e574bfe
Merged-In: I0abb0abb54f8f5a538da9194a900e6a64e574bfe
2020-02-14 18:43:24 +00:00
Evgenii Stepanov
fc27d03bef Refactor NativeHeapTagging compat feature.
Move the logic to startProcessLocked so that it can use app info/flags.

Bug: 135754954
Test: NFC
Change-Id: I50cfb8d0ec4ce1f79dec56b8bef09752a1b37490
Merged-In: Ief86185c6866640700e2548259df9ba1fb617e4d
(cherry picked from commit 5750d3b153)
2020-02-14 10:43:18 -08:00
Amit Mahajan
3d70a9a87a Change Context parameter to @NonNull.
per API-council feedback.

Test: basic sanity; only an annotation change
Bug: 148380226
Change-Id: Ife6befc7be5cd488265135d6c77c0557c7545f38
2020-02-14 10:42:33 -08:00
Eric Laurent
9fc16485f1 Merge "AudioSystem: add owner UID to setPhoneState API." 2020-02-14 18:40:55 +00:00
Kyeongkab.Nam
bd228498f5 Add encoding information to TvTrackInfo
Add TIF API for getting encoding in order for TV App to use it.

Test: m framework update-api
Bug: 112835103
Change-Id: I975dda20f129cb05d55eb59a1a60bcdb22b2533e
2020-02-14 10:40:29 -08:00
Ivan Lozano
c69853642b Merge "Remove execute-only memory related code." 2020-02-14 18:39:51 +00:00
Stanislav Zholnin
90516b9200 Stack Trace sampling and reporting.
Sampling is done in cycles where length of single cycle is
configurable server side.
During one sampling cycle only one stack trace / message is reported.

Two sampling strategies are used in this CL.

1. Sampling uniformly packages and appops, and waiting only for
messages coming from sampled package (all other packages are
silenced to presereve system resources). All appops are recorded,
but sampled appop has preference and replaces any previous stack
trace / message. This strategy is created to focus on all packages
and all apps uniformly.

2. Creating list of rarely used packages - packages which were not
using any dangerous permissions for more than a week. Any newly
installed app is automatically added to this list, including apps
which were updated. Whenever message is received for rarely used
package, there is 50% probability that this message will replace
whatever is being sampled in current sampling cycle. This strategy
is created to focus on newly installed apps, on apps which are used
infrequently and on apps which use dangerous permissions infrequently.

Bug:136134050
Test: atest android.app.appops.cts.RuntimeMessageCollectionTest
Change-Id: I3109b38bf0482481acf945d5441a26bfe704c9b5
2020-02-14 18:33:30 +00:00
Alex Kershaw
7f7195bf2c Log cross-profile metrics
Log metrics for the new app-op permission INTERACT_ACROSS_PROFILES and
each of the new app-facing and DPC-facing APIs where possible.

Simple getters do not have logging. Setters have logging but only when
the value has changed.

I always moved the logging into a separate private method. This is done
to keep the logging code from overpowering the actual logic in the
corresponding methods, particularly when there are conditions attached
to when we want to log.

There are also a few minor clean-ups in CrossProfileAppsServiceImpl.

Bug: 136249261
Bug: 149370554
Bug: 149318411
Bug: 149370875
Bug: 149370515
Test: atest com.android.cts.devicepolicy.CrossProfileAppsHostSideTest
Test: atest
com.android.cts.devicepolicy.CrossProfileAppsPermissionHostSideTest
Test: atest com.android.cts.devicepolicy.ManagedProfileCrossProfileTest
Test: atest com.android.cts.devicepolicy.ManagedProfileTest
Change-Id: Ibf2899f9b9974387ed1ba62fd02ece54a4c1564b
2020-02-14 18:32:32 +00:00
David Su
60892133a4 Merge changes from topic "api-review-requirepmf"
* changes:
  SettingsLib: Rename requirePMF to requirePmf
  Wifi: Rename requirePMF to requirePmf
2020-02-14 18:27:15 +00:00
Matt Pietal
f11642dbde Merge changes I179b9b3a,I705648c9
* changes:
  Controls UI - Theme + color alignment
  Controls UI - Support thumbnail template
2020-02-14 18:25:50 +00:00
Darryl Johnson
f8398cd079 Merge "Protect against assumptions of an existing home stack." 2020-02-14 18:24:57 +00:00
Patrick Baumann
d28bf33cf2 Adds QUERY_ALL_PACKAGES permission to rollbacktest
Test: atest com.android.tests.rollback.host.StagedRollbackTest
Bug: None
Change-Id: I499bf5f5ac8032db584aa307b2329533eb38fd36
2020-02-14 10:10:45 -08:00
Jeffrey Huang
260613f89f Allow statsd to link against libprotoutil
Bug: 145923087
Test: m -j
Change-Id: I8e21903d8a1c142499ee5b772da54b0fcbae3b67
2020-02-14 10:08:22 -08:00
Collin Fijalkovich
24d1336f17 Cache PowerManager binder calls
Use PropertyInvalidatedCache to save on redundant
binder calls for isPowerSaveMode and isInteractive.

Bug: 140788621
Test: atest BatterySaverTest
Test: atest PowerManagerTest
Change-Id: I849a48eb7c901d3178097d33dce01630dbb78267
2020-02-14 10:03:44 -08:00
Keun young Park
1f8ae73034 UserController: migrate MetricsLogger to StatsLog for boottime metrics
Bug: 132691841
Test: check statsd dump
Change-Id: I19d5f4f35d2307acee3d39405ccea7cf338dd5e0
2020-02-14 09:54:08 -08:00
Song Pan
5300771cf8 Fix TEST_MAPPING file for integrity component.
Test: N/A.
Bug: 145290357
Change-Id: I7f7912cb71d62c79c4315ddd61cb49bdd8b68917
2020-02-14 17:51:01 +00:00
Matt Casey
ef1c687d03 Remove drop shadow from corner handles.
Ran into some visual issues with it, reverting to old treatment for now.

Bug: 144022299
Test: Visual verification
Change-Id: Id9370b5cef8dbc032791d36192ddbe285a790a9e
2020-02-14 12:46:58 -05:00
Anna Malova
87f6cf271b Flip flag to use WebView's implementation of libpac.
Bug: 148516710
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
Change-Id: I69843f78534b6acd61816629ae129883b197d9cc
2020-02-14 17:37:48 +00:00
Jorim Jaggi
62709b5a8e Merge "Check to show IME after committing finish drawing windows" 2020-02-14 17:37:25 +00:00
Miranda Kephart
ee5149b33c Merge "Implement motion spec for screenshot corner animation" 2020-02-14 17:36:44 +00:00
TreeHugger Robot
98cd7b7ae9 Merge "Implemented TargetUser.toString()" 2020-02-14 17:29:06 +00:00
Evan Rosky
bed2d1b57c SystemUI Split via TaskOrganizer
Use the early TaskOrganizer concepts to implement Split-screen
in system-ui.

This includes changes to both FW and SystemUI. The changes to
FW involve removing the use of split-screen specific behavior (like
minimize dock and direct ordering) and also reducing things that
care about primary vs secondary. It also changed ActivityStack
to inherit bounds from parent** when in split-mode so that sysui
only needs to manipulate the tile and/or reparent stacks to
effect their geometry.

This means a lot of layout logic moves to SystemUI. The bulk of
the work done in ActivityStack which is split-screen related is
moved into SplitDisplayLayout. This basically takes a snapshot of
display configuration and manages the sizes of splits and their
snap targets.

Intermediate dragging of divider bar now only moves root task leashes
around rather than talking to WM. This includes position as well
as crop (which used to be stack crop). Once the user releases
the divider bar, it will calculate (based on snaps) the new
root task sizes and update their configurations via
WindowContainerTransaction. Because the interim updates are only
on the leashes, no configuration updates occur until the end.

Entering/Exiting split-mode is now handled by SplitScreentaskOrganizer#
onTaskInfoChanged. This is effectively a state-machine that
looks at the current split task membership vs. previous and then decides
when to move things into/out-of split tasks and how to coordinate with the
DividerView.

Minimized dock is relegated to a purely system-ui concept. To
accomplish this, **the home *stack* is set to the minimizedhomebounds
by systemui. This means that it's relative position to its parent is
negative! This allows us to leave the split sizes constant, have
their children inherit the "actual" split sizes, but keep the
home stack unchanging in its minimized size. We just adjust the crop
negative to reveal it.

IME handling is done through the same mechanism as app-driven IME
animation... only Divider receives the control instead of the app.
This allows synchronized animation of split tasks with IME. To
account for insets, though, when IME is opened, the bottom stack
will be repositioned in WM.

Bug: 133381284
Test: Manual, use split-screen, rotate device, launch unresizable
      apps in split, use divider snap to close/maximize apps, etc.
Change-Id: I103f68030a170e2fd3d8f2125b81cf33af412793
2020-02-14 09:25:43 -08:00
Anton Hansson
7f5585cf9a Merge "Enable compat checking & lint for module_lib api" 2020-02-14 17:19:03 +00:00
Abhijeet Kaur
8425e266d1 Add synchronization locks to shared objects
Make methods that read/write mBugreportInfos lock protected and add
"Locked" suffix to the method name. BugreportInfo objects are read/write
in different functions, to keep the code clean, add lock protected
getter/setter methods.

Bug: 142217059
Test: Takes interactive/full bugreports as expected
Change-Id: Iaadd6c9dce5009e40dd015e3b62bcd6e36966e00
2020-02-14 17:07:25 +00:00
Joshua Tsuji
2e78ec4a47 Pull shared testable subclasses into their own files.
This makes it easier to fix the tests after adding new dependencies to the BubbleController constructor.

Test: atest SystemUITests
Change-Id: Iea67826f6dd1e994dca9d6425dd85a4db2cabaf2
2020-02-14 12:04:17 -05:00
Ivan Lozano
15bdfea216 Remove execute-only memory related code.
The kernel no longer enforces XOM layouts, and the build system no
longer generates XOM binaries. As a result, the zygote code to mark XOM
sections of memory readable for apps with targetSdkVersion<Q.

Bug: 147300048
Test: m -j
Change-Id: I0abb0abb54f8f5a538da9194a900e6a64e574bfe
2020-02-14 11:56:31 -05:00
Cindy Zhou
e9a33feb4e Merge "Enable CFI in libjni_pacprocessor" 2020-02-14 16:37:59 +00:00
Derek Sollenberger
db8164c0ac Merge "Move RenderNodeAnimator to android.graphics.animation package" 2020-02-14 16:32:50 +00:00
Philip P. Moltmann
47f42fedee Merge "Track noted app-ops for appop permissions" 2020-02-14 16:26:26 +00:00
Abhijeet Kaur
944bafb7a7 Merge "Refactor bugreport files creation and getfd methods" 2020-02-14 16:25:37 +00:00
Vishnu Nair
11b35e66e9 Merge "[wm] Add APIs to notify task focused & task focus lost" 2020-02-14 16:24:00 +00:00
Aran Ink
780d450e70 Simplify GlobalActionsFlatLayout and fix dismiss
Add a touch handler to the ScrollView container to catch touches
outside of the power, wallet, and controls UIs.

Adjust MultiListLayout and GloblActionsLayout to allow a very
simple row-based layout for the new power menu design, instead
of having to use ListGridLayout.

Extract the AirplaneMode action into its own class, instead of
defining it inline.

Bump emergency to the top of the list of global actions to
ensure it's top-priority and positioned correctly for global
actions layouts without a separated view.

Fixes: 149299063

Test: Manual. Enable quick controls -- tapping beneath the controls
area should dismiss the GlobalActionsDialog. Dismissing should
still work in either the grid (no Controls) or column (no wallet
or controls) layouts. Tapping actions, swiping cards in Quick
Access Wallet, and interacting with control items should still
work as expected.

Change-Id: Iad32045837edb0be6c9f36ec5d663483bda6f5de
2020-02-14 11:09:31 -05:00
Riddle Hsu
eb628a5333 Fix invalid launch state reported to "am start -W"
If a launching activity starts another activity before it
finishes drawing, because it becomes invisible, it is dropped
from active transition info. The waiting result should not use
the intermediate state as the launch is completed.

Bug: 123355661
Bug: 149326995
Test: atest ActivityMetricsLoggerTests#testConsecutiveLaunch
Change-Id: I9a5776cc7895a8d62ca28700c18efa4fd8b7c33d
2020-02-15 00:06:13 +08:00
TreeHugger Robot
404ff05038 Merge "Remove last calls to Dep.get from GlobalActionsDialog" 2020-02-14 15:48:17 +00:00
Abhijeet Kaur
8217a65de0 Null Pointer check on ApplicationInfo object before invoking method
Test: builds
Change-Id: I53444e604b9c5eec79f824aadb4d7a8867cbef9e
2020-02-14 15:48:14 +00:00
Alex Kershaw
5eab48c38e Add cross-profile metrics to proto file
This has been split out from the CL adding the metrics to unblock other
CLs.

Bug: 136249261
Bug: 149370554
Bug: 149318411
Bug: 149370875
Bug: 149370515
Test: none required as just a proto file change
Change-Id: I1c1b129449faed8f1ef43b0798e538b6637f188a
2020-02-14 15:45:28 +00:00
TreeHugger Robot
80ebc88e1f Merge "Include rowContentBindStage mock in NotificationEntryManagerTest." 2020-02-14 15:40:51 +00:00
TreeHugger Robot
94dd284a57 Merge "Fix broken tests and add tests for empty state screens." 2020-02-14 15:31:58 +00:00
Matt Pietal
f8cf084c54 Controls UI - Theme + color alignment
Ignore theme colors and use dark colors by default at all times for
controls. Apply latest color changes to match design.

Bug: 149485215
Test: visual
Change-Id: I179b9b3a4469f7373f7a2d5174d435fdda1b6ac0
2020-02-14 10:25:11 -05:00
TreeHugger Robot
6fb74aeefc Merge "Adds the validator adaptive_sleep back to SystemSettingsValidators" 2020-02-14 15:07:31 +00:00
Chalard Jean
48c3f95878 [NS D01] Remove candidates that don't satisfy the request.
This is exactly equivalent to the previous version (though a bit
more expensive) but is useful for followup changes. See [NS D03]
to see a sample of how this will be used.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: I39f3c248bd2f23f7b22bd89d2e1e031653fe9ddb
2020-02-14 23:40:49 +09:00
Alan Stokes
0f6a550746 Don't destroy ART profiles after package move.
They don't get moved, so instead of deleting a redundant copy we are
deleting the only copy.

Bug: 149200535
Test: Manual. After repro steps in bug app is moved, profiles are not
deleted.

Change-Id: Id6af14ca4611a668135330565fce976cab7610ef
2020-02-14 14:34:16 +00:00
Zim
3ce38499e4 Enforce the preserveLegacyExternalStorage manifest attribute
In Q, a manifest flag requestLegacyExternalStorage was
introduced to grant legacy apps full access to external storage.

This flag was sticky across app updates so an app already installed on
a users device would typically always have the legacy_storage appop
even if it received an update to stop requesting the manifest flag.

With the R scoped storage model, we would like to break this
stickiness for 2 reasons:
1. Increase the impact of the storage restrictions
2. Ease testing. Because of the stickyness it is difficult
for apps targeting R to actually lose their legacy_storage appop

Unfortunately, we have to still provide a path for apps who care about
migirating their data on external storage from unreachable locations
on R devices. The canonical example is an app with 3 versions:
(1) Qcannot_migrate, (2) Qcan_migrate, (3) Rcannot_migrate

An update from: 1 -> 2 -> 3 will be fine because (2) will migrate the
apps data. However, apps can very well update from (1) - (3) thereby
losing access to their data in unreachable storage locations on R devices.

To facilitate this migration, apps (targeting R) can explicitly
request the preserveLegacyExternalStorage manifest flag. This will
ensure that if they get updated on a device with a previous version of
their app with the legacy_storage appop, they'll keep legacy_storage
status. Of course, fresh installs (of target R apps) will not have the
legacy_storage appop even if they have requestLegacyExternalStorage
and preserveLegacyExternalStorage flags.

By default, this new flag will be false, legacy status will *not* be
preserved (the legacy_storage appop will *not* be sticky). But apps
that care about migrating data can set the flag to true and
will preserve whatever legacy status they had on an existing install.

Test: atest RestrictedPermissionsTest
Test: atest RestrictedStoragePermissionSharedUidTest
Bug: 148944140
Change-Id: Ifd3410ed1a60f4c0e8414fce904139b539e13ad8
2020-02-14 14:33:51 +00:00
Zim
b14fba21d3 Support preserveLegacyExternalStorage manifest attribute
Parsed the manifest and included in the relevant PackageManager data
structures.

Test: atest RestrictedPermissionsTest
Test: atest RestrictedStoragePermissionSharedUidTest
Bug: 148944140
Change-Id: I785e707aa4c879ea163c1611c1693fea74f4ac82
2020-02-14 14:33:51 +00:00
Zim
752ff5a127 Introduce preserveLegacyExternalStorage manifest attribute
This attribute will default to false and does nothing in the false
state.

In the true state, it will allow an updating app preserve any legacy
storage access from the existing installed version on device.

Test: atest RestrictedPermissionsTest
Test: atest RestrictedStoragePermissionSharedUidTest
Bug: 148944140
Change-Id: Id5b6d7aadd9d9844c8bd1164087a9e093481e234
2020-02-14 14:33:45 +00:00
Matt Pietal
5bdfba4755 Controls UI - Support thumbnail template
Allow the background image to be changed. Use the i18n 'Loading...'
text.

Bug: 148207527
Test: manual, home mock apk for camera
Change-Id: I705648c948aaf34ab624ded4fdbef415791c2481
2020-02-14 09:22:21 -05:00
Alex Johnston
aaa1b446fc Modified DPM KEYGUARD_DISABLE_SECURE_NOTIFICATIONS restriction
* Introduced logic that allows the profile owner of an
  organization-owned device (COPE PO) to set the restriction
  KEYGUARD_DISABLE_SECURE_NOTIFICATIONS on the parent profile.

Bug: 149007069
Test: Manual testing with TestDPC
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testSetKeyguardDisabledFeatures
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetKeyguardDisabledFeatures
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testSetKeyguardDisabledFeatures
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetKeyguardDisabledFeaturesLogged

Change-Id: I06d8985471bdae3386ba68d67467f136668a4ca4
2020-02-14 14:13:22 +00:00
Isabelle Taylor
ccd475380b Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 5c4b6301d5 am: 288fdeb4cd
Change-Id: I82f49f1256bd5f81049d8b6f224ef507e63a48fb
2020-02-14 14:00:39 +00:00