Commit Graph

72701 Commits

Author SHA1 Message Date
Pavel Grafov
6a40f09083 Make ENSURE_VERIFY_APPS global even when set by PO.
Currently only device owner can set global user restrictions.
With this CL ENSURE_VERIFY_APPS will be global no matter who
enforces it, DO or PO.

To make it possible for system apps to check who enforces a
particular restriction in this case a new API method is added
to UserManager: getUserRestrictionSources which returns a list
of users who enforce the restriction.

Bug:31000521
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.UserRestrictionsTest (ag/1732744)
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Test: installed M on a Nexus5x device, created a managed profile with some user restrictions, and checked that after upgrading M->O all restrictions are preserved and split correctly into base, global and local.
Change-Id: I543d3ec9ef0cf2b730da6f7406021c0bba43b785
2017-01-16 18:29:01 +00:00
Jesse Hall
b12249b671 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
2017-01-14 17:31:56 -08:00
TreeHugger Robot
18de051c98 Merge "Send EXTRA_USER with DevicePolicy lock broadcasts" 2017-01-14 17:12:57 +00:00
Bartosz Fabianowski
9e0642287e Merge "Add install reason" 2017-01-14 12:58:20 +00:00
TreeHugger Robot
40d88717b3 Merge "Stop preloading EGL/GLES in Zygote" 2017-01-14 02:35:56 +00:00
Aurimas Liutikas
673de10bd0 Merge "Remove unused classes from com.android.internal.widget" 2017-01-14 01:23:10 +00:00
Chris Craik
2553b92c0c Support shadows and reordering in ViewOverlay am: 36d9a6dfba
am: 2369a6d753

Change-Id: I1f6574a4b9a1d24ccd4fc78cbc7e3368d815f8f5
2017-01-14 00:35:02 +00:00
Jesse Hall
9c9cc3e94d Stop preloading EGL/GLES in Zygote
It's not clear this actually makes much difference on modern
devices/drivers. With updatable graphics drivers, we'd have to be able
to unload the preloaded driver from processes that don't use the
system driver, which is additional complexity and risk.

On bullhead and sailfish, meminfo actually showed slightly more memory
available while sitting at launcher just after boot with this change
than previously. Looking at detailed stats, the differences appeared
to mostly within run-to-run variation, but there wasn't evidence of a
regression.

Bug: 33531483
Test: boot through lockscreen/launcher
Change-Id: I1892302c1750cdbeaf5b9979f8da4dc6bd7b3e75
2017-01-13 15:32:38 -08:00
Zak Cohen
9013325c3a Merge changes from topic 'vrmode'
* changes:
  Set ui mode in UiModeManagerService to vrheadset when VR mode is enabled.
  Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
2017-01-13 23:15:00 +00:00
Chris Craik
2369a6d753 Support shadows and reordering in ViewOverlay
am: 36d9a6dfba

Change-Id: I1e7c33d68b5e2350b8b0ac589c46fdc250424b1a
2017-01-13 22:07:43 +00:00
Rob Carr
1ce0793ab4 Merge "Expose SurfaceControl method to screenshot to GraphicBuffer." 2017-01-13 21:29:09 +00:00
Andrew Scull
8203155664 resolve merge conflicts of ad4aa1ce7d to nyc-mr1-dev am: eb35ad9969 am: 3aac3ebee1
am: 3c9b36482f

Change-Id: I2eb73ac546ce8be144ec96fcac573caa2c5e8a13
2017-01-13 21:23:27 +00:00
Andrew Scull
3c9b36482f resolve merge conflicts of ad4aa1ce7d to nyc-mr1-dev am: eb35ad9969
am: 3aac3ebee1

Change-Id: Id7be6d9656b292ec1bf526750db8081022267c4a
2017-01-13 21:16:31 +00:00
TreeHugger Robot
3127190898 Merge "Move all time ticks to bg handlers, and post" 2017-01-13 20:11:12 +00:00
TreeHugger Robot
7fdd4d831b Merge "Fix ScoredNetwork: unparcel bundle in toString." 2017-01-13 20:06:31 +00:00
TreeHugger Robot
284d9401ac Merge "Refactor LockSettingsService to unify the handling of pattern and password" 2017-01-13 19:30:49 +00:00
Jason Monk
cd26af7054 Move all time ticks to bg handlers, and post
This will hopefully avoid blaming sysui for ANRs when the system
is hosed.

Test: Manual, build, push, wait for time to change
Change-Id: I1661ac1a997ad8917b449dd175229d8b77f583c9
2017-01-13 13:43:22 -05:00
Kang Li
96b39666a7 Merge "Adds tests for b/34095835." 2017-01-13 18:15:25 +00:00
Ashutosh Joshi
24f2a6f939 Merge "Add an uncalibrated acclerometer sensor type." 2017-01-13 17:47:33 +00:00
Andrew Scull
3aac3ebee1 resolve merge conflicts of ad4aa1ce7d to nyc-mr1-dev
am: eb35ad9969

Change-Id: I4fd9ce4c79db5a10f28008c89205fc9c8ef2888f
2017-01-13 17:17:49 +00:00
Kang Li
64b018e0eb Adds tests for b/34095835.
Bug: 34095835

Test: reproduced the bug in b/34095835 to ensure that it is covered by
the test. Manually ran the tests.

Change-Id: I28a887341906dc443e1a854ddba51cd1b4daeead
2017-01-13 08:35:13 -08:00
Bartosz Fabianowski
a34f53f61b Add install reason
This CL allows a reason to be specified when installing a package. The
install reason is a sticky piece of metadata: When a package is e.g.
installed via enterprise policy and an update is then manually
installed or sideloaded, the install reason will remain "policy."
The install reason is tracked separately for each user.

With this CL, two install reasons exist: "policy" and "unknown." Other
install reasons will likely be supported in the future.

Bug: 32692748
Bug: 33415829
Test: Tested manually with "adb install" / "adb uninstall"

Change-Id: I0c9b9e1b8eb666bb6962564f6efd97e41703cd86
2017-01-13 16:51:28 +01:00
Andrew Scull
eb35ad9969 resolve merge conflicts of ad4aa1ce7d to nyc-mr1-dev
Change-Id: I97ef31536cd06495a08a3f94f81df2d1376186e0
2017-01-13 15:28:36 +00:00
Andrew Scull
ad4aa1ce7d resolve merge conflicts of e4cefbf4fc to nyc-dr1-dev
Change-Id: Ib536a33ba381c28397320edd516d52727e5bdacc
2017-01-13 13:16:09 +00:00
Andrei Stingaceanu
564328b21e AutoSize TextView (part 6) - introduce autoSizeMaxTextSize
Using textSize as maxTextSize for autosizing is buggy and
unclean. Introduce and use new autoSizeMaxTextSize attribute for
TextView.

Also while doing this optimized the auto-size process by removing
unnecessary computations:

1. If auto-size is enabled than setTextSize(...) is no-op.
2. After setting the text size internally and from the auto-size
context onMeasure() will stop doing another round of redundant
measurements..

Bug: 33449596
Bug: 32221168
Test: atttached in the same topic
Change-Id: Ieecaea6df0aebb4c182bdd1114e3c6fc5066bed1
2017-01-13 11:52:00 +00:00
Winson Chung
27379c0f89 Merge "Ensure that we always resume task overlay activities if requested." 2017-01-13 07:02:51 +00:00
Keisuke Kuroyanagi
846946ec06 Merge "Make selection end handle stick to selection at line end." 2017-01-13 06:39:22 +00:00
Chris Craik
36d9a6dfba Support shadows and reordering in ViewOverlay
Bug: 32726440
Test: manual
Change-Id: Ic5d7efdee5a493b7768b9db8150f65f97b3f0a64
2017-01-12 19:17:19 -08:00
Sundeep Ghuman
7a9612f032 Fix ScoredNetwork: unparcel bundle in toString.
Calling isEmpty will ensure the bundle is unparceled before converting
to a string.

Test: dumped network_score
Change-Id: Icaa4e736af55c6112805a2ce0e829739bbb5b312
2017-01-12 18:45:52 -08:00
Winson Chung
cbcadc981b Ensure that we always resume task overlay activities if requested.
- Distinguish between task overlays that need to be resumed and
  those that should not.

Bug: 34240533
Test: Open PiP, tap to show menu.
Change-Id: Ibdb54d544c501a492260f02cdc2de40c5c1a66d1
2017-01-12 17:23:18 -08:00
Philip P. Moltmann
331a4bb8d4 Do not write if apply() did not change the file.
am: 1f99f81bdc

Change-Id: I4dd94b4f862f6c3d5ada9961d75cc2f91886edf1
2017-01-13 01:10:01 +00:00
Philip P. Moltmann
889a420a9e Only persist last Shared Preferences state
am: d15c4f1da5

Change-Id: I6431d4b7d07064eec5013d01b5bda76b1ed35e14
2017-01-13 01:09:03 +00:00
Philip P. Moltmann
1f99f81bdc Do not write if apply() did not change the file.
Bug: 33385963
Test: SharedPreferences CTS tests
Change-Id: I39955f8fbcdaa54faa539a3c503e12cb00808136
2017-01-12 16:43:30 -08:00
Philip P. Moltmann
d15c4f1da5 Only persist last Shared Preferences state
If multiple async shared preferences writes are queued, all but the
last one can be ignored as they will be overwritten by the last one
anyway.

For commit() we need to make sure that we have at least persisted the
state of the commit.

Generation counts are 64 bit, hence they never overflow.

Test: Produced a lot of SharedPreferences.Editor.apply and did not see
excessive writes anymore, ran SharedPreferences CTS tests
Bug: 33385963
Change-Id: I3968ed4b71befee6eeb90bea1666a0bb646544f6
(cherry picked from commit 31d6889f4c)
2017-01-12 16:42:59 -08:00
TreeHugger Robot
fac595ae56 Merge "Add activity action for Configure Wi-Fi settings." 2017-01-12 23:25:50 +00:00
TreeHugger Robot
07323a9824 Merge "Add structured sort data to ContentResolver.query." 2017-01-12 22:21:53 +00:00
TreeHugger Robot
317d0c9887 Merge "Send Snooze callback for Assistant" 2017-01-12 20:54:52 +00:00
Robert Carr
6486d31dcb Expose SurfaceControl method to screenshot to GraphicBuffer.
A graphic buffer is most useful, as we can both attach it
to starting windows, and directly use it in Sys-UI. The old
codepath for starting windows/saved surfaces, is co-existing
at the moment, so I don't make large attempts to clean up
the existing screenshot code.

Bug: 31339431
Test: Manual test in combination with other branches
Change-Id: I562fdd5460dbce3201ba090272e8731850780f20
2017-01-12 11:16:34 -08:00
TreeHugger Robot
d96cc6e250 Merge changes I2ff9bd44,I946e681e,If72df07b
* changes:
  Handle content insets for snapshots
  Always remove starting window in performShow
  Initial implementation of snapshots
2017-01-12 17:39:15 +00:00
TreeHugger Robot
4064710ac8 Merge "Introduce set/getFontVariationSettings." 2017-01-12 16:59:24 +00:00
Jeff Sharkey
0078e1b777 Add support for fallback categories.
When an app doesn't define a category, look for a fallback category
in a hard-coded list.  This change only defines a fallback for a
single package, but device-specific overlays can be used to provide
more detailed fallback lists.

The precidence order is: app manifest > installer hint > fallback

Test: builds, boots, fallback categories work
Bug: 33815939
Change-Id: I1f5ca76fb7e5743a4500c0a1230a754266f34d9e
2017-01-12 09:53:44 -07:00
Jeff Sharkey
9bc89af3f1 Add API for apps to declare their "category".
Upcoming platform features need to cluster apps together into broad
categories to help summarize information to users.  (For example,
when presenting battery, network, and disk usage.)

We are tightly limiting the set of categories to keep them easily
presentable to users when summarizing information.  This feature is
not designed to be a general-purpose taxonomy, nor should it be
allowed to become one.

Older apps may not have defined a category in their manifests, so
allow the installing app to define a category on their behalf.

Test: builds, boots
Bug: 33815939
Change-Id: I785b882ee7c18072ef47d56e0fc19ad72888e1b7
2017-01-12 09:53:44 -07:00
Andrew Scull
e4cefbf4fc Don't save password metrics to disk.
On FBE devices, don't save the metrics to disk but compute them when the
password is first entered and only store them in RAM.

Merged-in: 5daf273b7e
Bug: 32793550
Change-Id: Icee7f615167761177b224b342970a36c7d90f6ba
2017-01-12 16:01:59 +00:00
Julia Reynolds
7967230de2 Send Snooze callback for Assistant
On selection of a snooze context SnoozeCriterion.

Test: runtest systemui-notification & make cts-verifier
Change-Id: Iaca567100c29295fbbf1d327195a114106909652
2017-01-12 10:40:11 -05:00
Jorim Jaggi
e2c77f9035 Handle content insets for snapshots
Pass information about content insets of a snapshotted task to
SystemUI and use it there to correctly offset the snapshot
when drawing.

Test: Open app, go to recents, make sure app aligns before
and after the animation.
Bug: 31339431
Change-Id: I2ff9bd44534bd8f66b591385da1e1e3aec40b6c5
2017-01-12 16:28:19 +01:00
Jorim Jaggi
02886a82d8 Initial implementation of snapshots
All this functionality is hidden behind a flag. If this flag is
active, we disable the regular screenshots.

Instead, we take a screenshot when an app transition for which a
task is disappearing is starting. The screenshot gets stored
into a gralloc buffer. SystemUI uses a new method to retrieve
a snapshot gralloc buffer and then draws it using GraphicBuffer.
createHardwareBitmap().

When starting an existing activity in an existing tasks, or when
bringing an existing tasks to front from recents, we add a new
snapshot starting window. For that, we reuse the existing
starting window, but when creating the window, we use a fake
window that draws the contents of the starting window.

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Bug: 31339431
Change-Id: If72df07b3e56f30413db5029d0887b8c9665aaf4
2017-01-12 16:28:01 +01:00
Rubin Xu
1de89b3bec Refactor LockSettingsService to unify the handling of pattern and password
Also fix LockSettingsStorageTests. More unit tests on LockSettingsService
to be added in the next CL.

Bug: 33126408
Test: runtest frameworks-services -c com.android.server.LockSettingsStorageTests
Change-Id: I0f143b26fed1d5ae122fba3b57bd39c7793ad8d9
2017-01-12 14:33:33 +00:00
TreeHugger Robot
b237ddcb84 Merge "Remove PO support from HardwarePropertiesManager" 2017-01-12 14:01:26 +00:00
Keisuke Kuroyanagi
7c263ddd58 Make selection end handle stick to selection at line end.
At line break, one offset can be mapped to two phisical
position: previous line end and next line start.
Previously, all cursor handles are placed at next line
start.
With this CL, selection end handle is placed at the
previous line end in such cases.

Test: FrameworksCoreTests
Bug: 21305922

Change-Id: I00d9f9a0cd417ca92534e93b3d3f655cd62f25d3
2017-01-12 19:24:18 +09:00
Sundeep Ghuman
23ccbcd404 Modify WifiNetworkScoreCache to print full Score.
Test: dumped network_score and verified printout
Change-Id: I3689449db91e8c5e96bed349749f074c5626bd03
2017-01-12 01:44:24 -08:00