Commit Graph

11894 Commits

Author SHA1 Message Date
Rubin Xu
1985486fbf Make DPM.isActivePasswordSufficient() synchronous again
At the moment isActivePasswordSufficient() can return stale result
immediately after a password change since the latest password metrics
information is pushed from LSS to DPMS asynchronously (this is to
avoid deadlock between LSS and DPMS due to lock inversion). Fix this
by moving the password metrics ground truth to LSS, and make DPMS
query LSS about the password metrics when needed.

Bug: 37090873
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest com.android.server.locksettings
Test: atest DeviceAdminHostSideTestApi24#testResetPassword_nycRestrictions
Test: atest DeviceAdminHostSideTestApi24#testRunDeviceOwnerPasswordTest
Test: atest MixedManagedProfileOwnerTest#testPasswordQualityWithoutSecureLockScreen
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest MixedManagedProfileOwnerTest#testPasswordSufficientInitially

Change-Id: Ib1d1716024b8a6a6554afdb4ee9824d457ed8308
2019-08-23 13:38:14 +01:00
Mehdi Alizadeh
0635808404 Skip using the AppPredictionService if the component is not available am: a1c18a81af
am: f4c7bf02e4

Change-Id: I082e8c3b8aa6d7ef134de4ac54caa54f9b7a832b
2019-08-16 18:59:17 -07:00
Mehdi Alizadeh
f4c7bf02e4 Skip using the AppPredictionService if the component is not available
am: a1c18a81af

Change-Id: I8ca1aaf0b36ee04b7b63a5d04b3fae460e7c554b
2019-08-16 18:50:22 -07:00
Mehdi Alizadeh
a1c18a81af Skip using the AppPredictionService if the component is not available
This CL adds a safeguard in ShareSheet to avoid calls to
AppPredictionService when the service is defined but is not available,
for example in the case of a wrong AiAi apk pushed from GooglePlay.

Bug: 138595943
Test: Manual test by removing the AiAi package from device

Change-Id: I4109c5122faa753d5111ee45698301cb6ccdd7b5
2019-08-16 23:57:46 +00:00
Kevin Chyn
04dcb5896a Merge changes from topic "biometric-tests"
* changes:
  4/n: Make BiometricDialogView testable
  3/n: Move task stack listener to SystemUI
  2/n: Update BiometricService with cleaner lifecycle
  1/n: Update BiometricDialog (SystemUI side) with cleaner lifecycle
2019-08-16 20:28:23 +00:00
Kevin Chyn
050315f61a 3/n: Move task stack listener to SystemUI
Simplifies the dismissal of the dialog, and allows for better
synchronization of when the client should receive the error. The only time
that BiometricService should dismiss the dialog is when authentication
is canceled due to another client, which is almost always due to
allowed-but-weird app behavior.

Bug: 135082347

Test: atest BiometricServiceTest
Test: atest BiometricDialogImplTest
Test: atest CommandQueueTest
Change-Id: I10daa798115e51af8a854759e30033c28e6636ba
2019-08-15 15:34:42 -07:00
Yinglei Wang
0e2aacc021 Merge "Add directional accessibility scroll actions to ResolverDrawerLayout" 2019-08-14 23:43:54 +00:00
TreeHugger Robot
c48b34afec Merge "Rewrite AtomicDirectory." 2019-08-13 02:26:42 +00:00
Hai Zhang
f592aa85c9 Rewrite AtomicDirectory.
The previous version didn't close its FDs for directories, and called
fsync() on the wrong FDs. To make sure a rename() is persisted, we
need to call fsync() on the FD of the parent directory, because file
names are stored in directory entries instead of inodes.

Also removed the need for dedicated native code by calling the Os
class directly.

Fixes: 139302541
Bug: 138866253
Test: presubmit
Change-Id: I67fe98811814acba5158d760766a2ef3b121225a
2019-08-12 23:49:07 +00:00
Noah Zimmt
f0631bdb57 Merge "Reduce calls to installd when resolving volume" 2019-08-12 20:08:05 +00:00
Makoto Onuki
3fedfcb409 Merge "Introduce framework-minus-apex and create jobscheduler-framework.jar" 2019-08-12 18:49:51 +00:00
Makoto Onuki
62242c48e0 Introduce framework-minus-apex and create jobscheduler-framework.jar
Bug: 137763703
Test: Clean local build + "flash -w" and boot
Test: Presubmit
Test: atest CtsJobSchedulerTestCases
Test: ./cts/tests/signature/runSignatureTests.sh
Change-Id: Ie2a5a7a17f903ac18de0bcdde5be25311a62fa01
2019-08-12 18:11:57 +00:00
TreeHugger Robot
9a73418069 Merge "Avoid leaking FileOutputStream in AtomicDirectory." 2019-08-12 17:48:46 +00:00
Noah Zimmt
e42bc52da0 Reduce calls to installd when resolving volume
Optimizes PackageHelper#resolveInstallVolume to aggressively avoid
querying volume storage statistics unless absolutely neeeded.

The previous implementation queries storage data for each volume on the
device before evaluating which volume to select. The new implementation
defers querying storage stats for a given volume until it is absolutely
neccessary.

For example, if the application is already installed to a particular
volume, only that volume needs to be queried for available space.

In addition, querying for available space on a volume is done in two
steps. The first step does not take into account freeable cache; only
if this pessimistic assessment of available space fails do we call
installd to obtain cache information.

Bug: 138450974
Test: atest frameworks/base/core/tests/coretests/src/android/content/pm/PackageHelperTests.java
&& atest cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
Change-Id: I403318de364d41019cb3d43e93b91cdd06fe1b9c
2019-08-12 16:43:16 +00:00
Hai Zhang
fa3d2016ae Avoid leaking FileOutputStream in AtomicDirectory.
Bug: 138866253
Test: presubmit
Change-Id: I32adb56d207ec18de0e55664f3ac9eb575a4e3f2
2019-08-09 16:38:52 -07:00
yingleiw
9cf48483a3 Add directional accessibility scroll actions to ResolverDrawerLayout
Also added action expand/collapse/dismiss.

Test: tested with twisted talkback and the chooser menu (select "send a
copy" for one item in google drive) that scroll down has the same effect
as scroll forward (expand the menu). Also tested the other added
commands.
Bug: 136277517
Change-Id: I5447603e6bc8fca5a180c9abad532de35dcd5f35
2019-08-08 14:38:34 -07:00
TreeHugger Robot
893735c812 Merge "Fixes usage of WallpaperManager to make it optional." 2019-08-08 20:34:01 +00:00
Kweku Adams
18535a83db Merge "Ensuring parity between JobScheduler's proto and text dumps." 2019-08-08 17:33:09 +00:00
Rajeev Kumar
0f8ad443c2 Merge "Stop showing disclosure UI when isDisclosureEnabled is false." am: 6452cc3cc1 am: f9e3e40676 am: 2123aad7ab am: df003a7ba1
am: a9ba0f30ca

Change-Id: Iaf5f03f1cbe7285a141a263821d00d507716031c
2019-08-08 10:07:23 -07:00
Rajeev Kumar
a9ba0f30ca Merge "Stop showing disclosure UI when isDisclosureEnabled is false." am: 6452cc3cc1 am: f9e3e40676 am: 2123aad7ab
am: df003a7ba1

Change-Id: I463fa34afc551e61b7367525acc1a180d0d7376b
2019-08-08 09:56:34 -07:00
Rajeev Kumar
df003a7ba1 Merge "Stop showing disclosure UI when isDisclosureEnabled is false." am: 6452cc3cc1 am: f9e3e40676
am: 2123aad7ab

Change-Id: I286356883be0a88252a4ca7468f2413c73df97c7
2019-08-08 09:46:18 -07:00
Rajeev Kumar
2123aad7ab Merge "Stop showing disclosure UI when isDisclosureEnabled is false." am: 6452cc3cc1
am: f9e3e40676

Change-Id: I6a7f6b2783441465bdc0a1331b4183b742d9523c
2019-08-08 09:24:14 -07:00
Rajeev Kumar
f9e3e40676 Merge "Stop showing disclosure UI when isDisclosureEnabled is false."
am: 6452cc3cc1

Change-Id: Ie616ed1e05c45a30b5ab20873fa07f963f0d3e49
2019-08-08 09:13:56 -07:00
Rajeev Kumar
6452cc3cc1 Merge "Stop showing disclosure UI when isDisclosureEnabled is false." 2019-08-08 15:42:51 +00:00
Nicolas Geoffray
a98e4142f6 Merge "Notify the ART runtime when boot is complete." am: f83748ae28 am: 6b9ab57b2d am: ed22d5f05c am: 8f93d19459
am: 6e16874401

Change-Id: Icc2ec9b98c8b507f2431ef60a4cd7bbe11bab430
2019-08-08 06:02:32 -07:00
Nicolas Geoffray
6e16874401 Merge "Notify the ART runtime when boot is complete." am: f83748ae28 am: 6b9ab57b2d am: ed22d5f05c
am: 8f93d19459

Change-Id: Iddebb915552b39cfb4cbe59bb67eb1c2aae0c8ea
2019-08-08 05:53:00 -07:00
Nicolas Geoffray
8f93d19459 Merge "Notify the ART runtime when boot is complete." am: f83748ae28 am: 6b9ab57b2d
am: ed22d5f05c

Change-Id: I88c5ab8807446464854d59f95ffc2877fa6aa963
2019-08-08 05:43:38 -07:00
Nicolas Geoffray
ed22d5f05c Merge "Notify the ART runtime when boot is complete." am: f83748ae28
am: 6b9ab57b2d

Change-Id: I5466b6f73087c6dea67c9b7cfaa3bf55bacb8a23
2019-08-08 05:32:55 -07:00
Nicolas Geoffray
6b9ab57b2d Merge "Notify the ART runtime when boot is complete."
am: f83748ae28

Change-Id: Iea67d64570657173832ee0d61288dc97af11496b
2019-08-08 05:11:55 -07:00
David Srbecky
6d0d7066cf Notify the ART runtime when boot is complete.
Needed for jit-zygote performance improvements.

Test: device boots
Bug: 119800099
Change-Id: I1e46f49d94440384473430d8afebe29fbee9c68e
2019-08-08 07:57:35 +00:00
Rajeev Kumar
cd497ef6f3 Stop showing disclosure UI when isDisclosureEnabled is false.
Bug: 137395050
Change-Id: Ic7768f7d3306f5d9d5c5c988afda4e8710c4ccd0
Test: Manual tests
2019-08-08 03:09:38 +00:00
Eugene Susla
f366188dac Merge "Use dataclass codegen on a few initial framework classes" 2019-08-07 22:51:23 +00:00
Felipe Leme
34a861add1 Fixes usage of WallpaperManager to make it optional.
As the main javadoc states:
"An app can check whether wallpapers are supported for the current user,
by calling {@link #isWallpaperSupported()}, and whether setting of
wallpapers is allowed, by calling {@link #isSetWallpaperAllowed()}."

Test: manual verification on automotive
Test: atest CtsAppTestCases:android.app.cts.WallpaperManagerTest # on automotive

Bug: 138939803

Change-Id: I88946f92ff54e556d289c41c28e22da3a4b8c8b8
2019-08-07 21:08:52 +00:00
Eugene Susla
3b2fe616fd Use dataclass codegen on a few initial framework classes
Test: presubmit
Change-Id: Ide3c21596f6489fdb1db8f72e1436a01b10f56ed
2019-08-06 21:29:29 -07:00
Beth Thibodeau
bf2b3d382a Merge "Stop timer when notification is not visible" into qt-r1-dev am: f7ad427d8b am: 84b999ccb1
am: d8c9f1a833

Change-Id: I628048a82b76818e0c23251b8bed60519ddf6a84
2019-08-06 13:47:32 -07:00
Beth Thibodeau
d8c9f1a833 Merge "Stop timer when notification is not visible" into qt-r1-dev am: f7ad427d8b
am: 84b999ccb1

Change-Id: I2ae849e3b8a5a449d380fc391841689a0438ddd7
2019-08-06 13:38:28 -07:00
Beth Thibodeau
84b999ccb1 Merge "Stop timer when notification is not visible" into qt-r1-dev
am: f7ad427d8b

Change-Id: I49db80e1342ed8e82a21246c2f3a5f195e249b1c
2019-08-06 13:28:53 -07:00
Beth Thibodeau
3ea5a1fcbe Merge "Stop timer when notification is not visible" into qt-r1-dev
am: f7ad427d8b

Change-Id: I601b736974dffc1a4f5b8ced66d1d97127a42541
2019-08-06 13:28:50 -07:00
Beth Thibodeau
f7ad427d8b Merge "Stop timer when notification is not visible" into qt-r1-dev 2019-08-06 20:11:27 +00:00
Beth Thibodeau
4e4c86e1b5 Stop timer when notification is not visible
This combines ag/8888937 and ag/9019277 into one CL, plus fixes another issue
where the timer could restart if the user had removed a notification and then
restarted the stream

Fixes: 138261464
Test: manual, atest NotificationMediaTemplateViewWrapperTest

Also checked the changes on the master branch since that had very
obvious issues when locking / unlocking the phone before

Change-Id: I6a0bbc675d33a5c7d4ce7f0884aec19606bff4fa
2019-08-06 13:21:20 -04:00
Eugene Susla
c40f4c706c Merge "Addresses further review comments from ag/8000041" 2019-08-06 16:44:45 +00:00
Roshan Pius
2bb6734240 Merge "Merge "XmlUtils: Fix hex parsing in readThisByteArrayXml" into qt-qpr1-dev am: 2883327fba" into qt-qpr1-dev-plus-aosp
am: defbe4d33e

Change-Id: I2c00bc9087566de626666f82380d353c961c3ea7
2019-08-06 03:21:49 -07:00
Roshan Pius
2e463f4b42 Merge "XmlUtils: Fix hex parsing in readThisByteArrayXml" into qt-qpr1-dev
am: 2883327fba

Change-Id: I98cc9d175a028e760d072bd3af4d56e7857ca5d6
2019-08-06 02:32:52 -07:00
Eugene Susla
3156a4ce21 Addresses further review comments from ag/8000041
Including:
 - An API to opt out of Int/StringDefs generation on per-field basis
 - A way to customize Builder
 - Non-optional fields are passed in Builder constructor
 - Various adjustments to SampleDataclass examples, as requested

Test: . $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/runTest.sh
Change-Id: I32d2eec52f05d505ff07779d923e4793d3036579
2019-08-05 16:54:41 -07:00
Roshan Pius
2883327fba Merge "XmlUtils: Fix hex parsing in readThisByteArrayXml" into qt-qpr1-dev 2019-08-05 23:51:37 +00:00
Adrian Roos
304f75603b GestureNav: Log exclusion rect heights am: 5f2c9a14f5 am: fde134f106
am: e4b2440287

Change-Id: If3f626a85dcf93482ad580e93c1c5b49299fd78f
2019-08-05 14:43:57 -07:00
Adrian Roos
fde134f106 GestureNav: Log exclusion rect heights
am: 5f2c9a14f5

Change-Id: I6b72f4b68773a21575296601f5545746d012524e
2019-08-05 14:17:15 -07:00
Adrian Roos
5f2c9a14f5 GestureNav: Log exclusion rect heights
Logs the rejected and requested exclusion rect heights.

Test: adb shell device_config put android:window_manager key_system_gesture_exclusion_log_debounce_millis 1000
Bug: 135152789
Change-Id: Ie12640f4bf0a8b40b666e604188a0bedd85e8981
Exempt-From-Owner-Approval: DeviceConfig.java: Adding constant to WindowManager namespace.
2019-08-05 21:19:40 +02:00
Noah Zimmt
4e878506d7 Merge "Avoid calling installd where not needed" 2019-08-05 19:06:08 +00:00
Noah Zimmt
b255807189 Avoid calling installd where not needed
The method StorageStatsManager#getCacheBytes is called several times
during package installation. It calls
InstalldNativeService::getUserSize via a binder call.

The runtime of getUserSize is variable; I have traces where it takes
50ms and traces where it takes 500ms.

The return value of getUserSize used to take into account freeable cache
space when determining available space on a given volume. In most cases,
it is possible to first do a pessimistic check of the space available on
the volume - forgoing the installd call - and only consider cache space
if the pessimistic check fails.

This avoids a binder call + the time spend in getUserSize for most
installs.

Bug: None
Test: atest frameworks/base/core/tests/coretests/src/android/content/pm/PackageHelperTests.java
cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
Change-Id: Icaecee732ef330fee1b409d2dd76723822c25959
2019-08-05 11:25:22 -07:00