Commit Graph

4674 Commits

Author SHA1 Message Date
Alex Salo
ef79062cba Merge "Add INTELLIGENCE_ATTENTION experiment namespace" 2019-01-24 07:09:47 +00:00
Soonil Nagarkar
397ad580d3 Add whitelist for location settings piercing
Use a whitelist to control which packages may use location piercing
settings on LocationRequest.

Test: Manually
Bug: 118883513
Change-Id: I16e8496c49b6bef016cb7f090969ed97a39e38c2
2019-01-23 22:47:57 -08:00
TreeHugger Robot
3eee2c51b6 Merge "Automatically turning off battery saver at a high percentage." 2019-01-24 04:19:26 +00:00
Alex Salo
cbd05e6b56 Add INTELLIGENCE_ATTENTION experiment namespace
Test: m update-api
Bug: 111939367
Change-Id: Ia1476c678efcb4045ed928eeda4b4c4f55bcd753
2019-01-23 19:45:10 -08:00
Jeff Sharkey
6474100f22 Merge "Migrate to single sanely-sized thumbnails." 2019-01-23 23:47:19 +00:00
Hyunyoung Song
d41cd56850 Merge "Add Setting.Secure for theme customization." 2019-01-23 22:41:07 +00:00
TreeHugger Robot
ac3f33c5b2 Merge "Change the old experiment setup to use the new API" 2019-01-23 22:37:05 +00:00
Kweku Adams
b243a996ca Automatically turning off battery saver at a high percentage.
This introduces a setting that turns off sticky Battery Saver above a
certain threshold and disables Battery Saver if it was enabled due to
the sticky setting.

Bug: 112232746
Test: atest com.android.server.power.batterysaver.BatterySaverStateMachineTest
Test: atest android.provider.SettingsBackupTest
Change-Id: Ib9a9fd627a56529404b41fbabedf8bb4a372074e
2019-01-23 13:54:27 -08:00
Victor Hsieh
293595faa2 Change the old experiment setup to use the new API
Vendors can still set the default behavior by pm.dexopt.priv-app-oob*
system properties, but still the experiment flag can override the
behavior.

This change also removes the audit log because the setting provider is
not ready.  The old code works because we use the default system property
(which may be inconsistent to settings).

Test: cmd package compile -m speed -f com.google.android.dialer
      am start com.google.android.dialer
      cat /proc/`pidof com.google.android.dialer`/maps |grep oat |grep /data
      # Compiled code IS mapped as executable
Test: device_config put fsi_boot oob_enabled true
      pkill com.google.android.dialer; am start ...
      # Compiled code is NOT mapped as executable
Test: device_config put fsi_boot oob_enabled false
      # Compiled code IS mapped as executable
Test: device_config put fsi_boot oob_enabled true
      device_config put fsi_boot oob_whitelist com.android.vending,com.example
      # Compiled code is NOT mapped as executable
Test: device_config put fsi_boot oob_enabled true
      device_config put fsi_boot oob_whitelist com.android.vending,com.google.android.dialer
      # Compiled code IS mapped as executable
Test: device_config reset untrusted_clear
      # Compiled code IS mapped as executable
Test: atest DexManagerTests
Bug: 120793002
Change-Id: I67f29ac593bd2c33dc8c75ce2135cf9ec5490650
2019-01-23 10:17:51 -08:00
Jeff Sharkey
36ee36238c Migrate to single sanely-sized thumbnails.
Instead of generating only a handful of thumbnail "kinds", none of
which scale with display density, shift to generating only a single
thumbnail whose dimensions are limited to half the smallest screen
width of the device.

This change also shifts to storing thumbnails on the relevant volume
where the source data actually came from.  This solves the problem
of having to GC thumbnails for a storage device that we haven't seen
in a long time.

Bug: 119887587
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I2ce6c5051b7058d2f1bba523c077e84a1f0b46e9
2019-01-23 11:03:53 -07:00
Michael Wachenschwanz
b9877a0137 Merge "Add Task Root package info to UsageEvent" 2019-01-23 18:03:40 +00:00
Michael Groover
d15f8b9ad5 Merge "Revoke 'always allow' adb grants after period of inactivity" 2019-01-23 16:47:48 +00:00
Yiwen Chen
57406a7e0e Merge "Add Ramping Ringer platform flags and fix some Ringtone bugs." 2019-01-23 15:20:08 +00:00
Varun Shah
f71cb5ac32 Merge "Revert "Optimize service restart logic."" 2019-01-23 12:45:24 +00:00
Michael Wachenschwanz
0b4ab1f171 Add Task Root package info to UsageEvent
Bug: 113094946
Test: manual (use "adb shell dumpsys usagestats apptimelimit" to verify
apps at the root of tasks are considered active)
Test: atest cts/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java#testTaskRootEventField
Test: atest cts/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java#testUsageSourceAttribution
Test: atest UsageStatsDatabaseTest

Change-Id: I40f86743d33c13892de0e59ae02c9ebddb606ee7
2019-01-22 22:19:21 -08:00
Varun Shah
4311f21b06 Revert "Optimize service restart logic."
This reverts commit 16522412eb.

Reason for revert: solution needs some adjustments - will update with a better solution.

Change-Id: I74ed92225017a8c1ac23176ed176663acfef7578
2019-01-23 05:59:31 +00:00
Jeff Sharkey
8a83ae1069 Merge "Sanity check raw paths against requested volume." 2019-01-23 05:47:17 +00:00
Yiwen Chen
3d3ad02312 Add Ramping Ringer platform flags and fix some Ringtone bugs.
Bug: 120789399
Test: When finish the whole change, flash into a dev phone to test first.
Change-Id: Ifd952cf7dfc8fedb6b1b95d276fd8a46e79d172b
2019-01-22 21:41:24 -08:00
Michael Groover
9e7b06efe3 Revoke 'always allow' adb grants after period of inactivity
Bug: 111656592
Change-Id: I679078dc3e8f61f33ca0922a47777eedb6a933de
Fixes: 116512306
Test: atest AdbDebuggingManagerTest
2019-01-22 20:46:20 -08:00
Ivan Chiang
035808eea0 Merge "Add new column into Root to get the supported query args" 2019-01-23 02:56:02 +00:00
Ivan Chiang
ad4ba486b9 Merge "Fix CTS test fail for isTreeUri check in findDocumentPath method" 2019-01-23 02:54:33 +00:00
Varun Shah
359263d17c Merge "Optimize service restart logic." 2019-01-23 02:30:19 +00:00
TreeHugger Robot
f749198d19 Merge "Add exp flag for min number of sys gen smart replies in notifications" 2019-01-22 22:36:37 +00:00
TreeHugger Robot
9b90262605 Merge "Add a DeviceConfig namespace for the NOTIFICATION_ASSITANT package." 2019-01-22 22:35:52 +00:00
Amin Shaikh
b25e9c753c Add Setting.Secure for theme customization.
Change-Id: I71e6fb7182d2f743452ca9f230c1794fac09f61a
Fixes: 122302585
Test: make
2019-01-22 16:52:27 -05:00
Jeff Sharkey
5199727294 Merge "Add nullability annotations for some apis and update java doc" 2019-01-22 21:37:50 +00:00
Jeff Sharkey
3f64ec57dd Sanity check raw paths against requested volume.
When callers are inserting or updating raw "_data" paths, we need to
sanity check them to make sure they're not "crossing the streams"
between storage devices.  For example, it would be really broken to
insert a file on the SD card into the "internal" storage volume.

This also enforces that callers don't "cross the streams" between
multiple storage volumes on devices that support them, since
otherwise they'd end up with very confusing behavior, such as
the same underlying file being inserted into multiple databases.

Also, the "internal" storage volume should really only be used for
common media (such as ringtones), and it shouldn't be allowed to
point into private app data directories, since MODE_WORLD_READABLE
has been deprecated for many years now.

Bug: 117932814
Test: atest MediaProviderTests
Test: atest cts/tests/tests/media/src/android/media/cts/MediaScanner*
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I267eacd45bbd270b8ce9b28de9d6e209f780f31a
2019-01-22 13:55:25 -07:00
Varun Shah
16522412eb Optimize service restart logic.
If a non-persistent service is being restarted and it was killed due to
low memory previously, instead of restarting the service in one second,
we now restart it based on its last known oom_adj value. The backoff
logic of consistent restarts remains the same.

Additionally, when the service is due to restart, if the memory pressure
is still considered to be critical, the new logic will further delay the
service restart.

Initial test results: # of restarts dropped by 40-50% on average with
the optimized logic when the memory pressure was gradually increased.

Tested manually via memeater. Increased the memory pressure by 500 mb
at a time via the following command: adb shell memeater 500
On a 4gb device, no significant restarts were noticed when memory
pressure was increased by 2gb in total. When increased by 3gb in total,
services started to restart and the above results were observed via
the logged output over a 5 min period.

Bug: 79848281
Test: manually (steps listed above)
Change-Id: Idcd1300882321c6033e569736150a8bf7889678b
2019-01-22 12:24:59 -08:00
Gustav Sennton
1aebc9b561 Add a DeviceConfig namespace for the NOTIFICATION_ASSITANT package.
The notification_assistant package will contain flags controling the
default Android Platform implementation of the Notification Assistant
(named ExtServices).
The flags will be read in
android.ext.services.notification.AssistantSettings.

Bug: 120792826
Test: build
Change-Id: Ib57ca8bb707e1582f315390d5d2eb833033b7d25
2019-01-22 19:31:06 +00:00
Alex Salo
1e84afbac2 Merge "Add ADAPTIVE_SLEEP setting" 2019-01-22 18:10:44 +00:00
Ivan Chiang
857a2221ec Add nullability annotations for some apis and update java doc
- Add nullability annotations for some methods
- Update the java doc of isRootsUri to make it more clear

Change-Id: I8b065d526e11fe8d71bb1aec223918e7559967e0
Fix: 122549058
Test: make
2019-01-22 18:59:54 +08:00
TreeHugger Robot
a2eeced7b7 Merge "Adding native flag namespace(netd)." 2019-01-22 04:36:25 +00:00
Svetoslav Ganov
4188aeb5d6 Merge "Use proper API to get op name" 2019-01-22 03:51:14 +00:00
Remi NGUYEN VAN
b0d60c4cf8 Merge "Add NetworkMonitor constants to SystemApi" 2019-01-22 01:46:12 +00:00
Ajay Panicker
454e59d5a1 Merge "Add Filtering for snoop logs based on L2CAP and RFCOMM Channels (2/4)" 2019-01-22 00:00:12 +00:00
Alex Salo
1dea1e6503 Add ADAPTIVE_SLEEP setting
Test: make RunSettingsRoboTests
Bug: 111939367
Change-Id: I92f78cd8730d94444024cdce24ddadee24f79176
2019-01-21 14:39:29 -08:00
Gustav Sennton
a31f6aede1 Add exp flag for min number of sys gen smart replies in notifications
For system (assistant) generated smart replies we want to ensure the
replies don't seem biased (see example [1]). Therefore we here add an
experiment flag that determines the minimum number of replies N to show
in a notification. If we can't fit N replies into the notification we
remove all replies from that notification (i.e. we show zero replies).

[1] Example of biased replies:
Message: "Hi, how are you?"
Replies: "Good", "Great!", "Bad"
using only one reply here ("Good") might be seen as biased.

Bug: 120779592
Test: atest SystemUITests
Test: call "adb shell settings put global
smart_replies_in_notifications_flags enabled=true,min_num_replies=X" for
different values of X and ensure the behaviour is correct.
Change-Id: I898850f7895d0fd43ec6788095162f3138cd62cb
2019-01-21 15:03:26 +00:00
Remi NGUYEN VAN
d0a933476c Add NetworkMonitor constants to SystemApi
NetworkMonitor lives in the NetworkStack which must only use system
APIs. This includes constants used by NetworkMonitor and captive portal
login.

Bug: 112869080
Test: m
(Cherry-pick of aosp I4879568d3fbf9435767c8d4d0ab5198d421a2f4f)

Change-Id: I8b5f0bb61c3ef0d2f33af7dd67b72ac6c5a1d1b5
2019-01-21 21:07:10 +09:00
chenbruce
db279e8b39 Adding native flag namespace(netd).
For experiment flag testing, adding netd flag in DeviceConfig.

Test: add sepolicy, m -j, check GetServerConfigurableFlag function in netd
Bug:122050512
Change-Id: Ie24cdd145d955b1d6d6bae8e4b5c20740eb8ed95
2019-01-21 18:10:49 +08:00
Ivan Chiang
c26d3c28c2 Add new column into Root to get the supported query args
DocumentsContract:
- Add @Public column Root#COLUMN_QUERY_ARGS
- Update java doc

DocumentsProvider:
- Update java doc

FileSystemProvider & ExternalStorageProvider
- Add supported query args into Roots

Bug: 121234248
Test: manual
Change-Id: Ia944200ee1a44d75c9ad683564218e3d0dcef885
2019-01-21 15:44:53 +08:00
Ivan Chiang
c60c80a7f2 Fix CTS test fail for isTreeUri check in findDocumentPath method
Remove the isTreeUri check

Test: atest DocumentsTest
Change-Id: I19108a3dfac4963e8c700bb15273ce3051cabae8
Fix: 121342931
2019-01-21 11:26:43 +08:00
Jeff Sharkey
4260098e02 Merge "Filter volumes to only those the caller can see." 2019-01-21 00:54:31 +00:00
Jeff Sharkey
3036089cfa Filter volumes to only those the caller can see.
Don't return volumes that caller can't actually use.  Also add feature
to indicate that device supports "virtual disk" feature to verify
secondary external storage behaviors.

Bug: 117932814
Test: atest MediaProviderTests
Test: atest cts/tests/tests/media/src/android/media/cts/MediaScanner*
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I66091c532ab5dac5032a82b136c590ac5a2a983a
2019-01-20 14:57:38 -07:00
Jeff Sharkey
ef033dada9 Merge "Better volume name argument checking." 2019-01-20 21:52:00 +00:00
Svet Ganov
65f1b9ef44 Use proper API to get op name
Test: atest CtsAppOpstTestCases

Change-Id: Ibc5d9775092e6d82e7beb7163d91c1f9ea87e1be
2019-01-20 13:42:57 -08:00
Jeff Sharkey
8559e65694 Better volume name argument checking.
Bug: 117932814
Test: atest MediaProviderTests
Test: atest cts/tests/tests/media/src/android/media/cts/MediaScanner*
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I799d04a30e5328c1b9266357f192a3e65e24a28d
2019-01-20 11:37:03 -07:00
Jeff Sharkey
f4246a1c17 Merge "Better scanning of secondary storage volumes." 2019-01-20 17:55:05 +00:00
Jeff Sharkey
1eda2caa98 Better scanning of secondary storage volumes.
There's been a long-standing bug where secondary external storage
volumes were being scanned into a single "external" database.  We've
had the logic in MediaProvider for a long time to support individual
databases on a per-UUID basis, but that regressed at some point.

This change revives that logic, which has the benefit of greatly
speeding up media scanning of secondary storage devices, since we can
preserve those databases instead of churning the primary "external"
database whenever they're ejected and reinserted.

Future work will clean up stale databases in the recently added idle
maintenance service.

Bug: 117932814, 122060093
Test: atest MediaProviderTests
Test: atest cts/tests/tests/media/src/android/media/cts/MediaScanner*
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ib48577a2146758acd882db0b1767e88f3a70247f
2019-01-19 17:27:16 -07:00
Jeff Sharkey
f81494a161 Return valid path for secondary storage devices.
Bug: 122900949
Test: manual
Change-Id: I3ce5ca49720dc1854dd5207d29f59fa85821f23e
2019-01-19 13:26:20 -07:00
Jayachandran Chinnakkannu
a09c7737aa Merge "Cellular data stall recovery based on networkStatus" am: 44631dfc26 am: e9dc415e2b
am: 58a61cc734

Change-Id: I0196a9f1da64efd6a811139bb9d2de7e39defe11
2019-01-18 16:18:57 -08:00