Commit Graph

4289 Commits

Author SHA1 Message Date
Lucas Dupin
c81702eb62 Reach gesture implementation
Add configurable doze gesture. OEMs should define the gesture type
on a device overlay.

Bug: 111414690
Test: look at logs in adb shell dumpsys activity service com.android.systemui
Test: manual with alternative sensor event
Change-Id: I048b99b53151427006e42eb6b4780a420020cd78
2018-08-16 11:59:29 -07:00
Mathew Inwood
97157bfc5c Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 11:44:29 +00:00
Andrew Lehmer
d42decc7af Merge "Double tap and lift should take to lock screen" 2018-08-13 15:54:27 +00:00
Lucas Dupin
4359b559f2 Double tap and lift should take to lock screen
The current ambient display design doesn't make sense when the
display is not 'always on', let's wake-up directly to the lock
screen instead.

Change-Id: I217720dcf01a507f43e9da6e1970b2246fb75211
Test: double tap from AOD or screen off
Test: lift from AOD or screen off
Test: receive pulsing notification, long press
Fixes: 73148491
Fixes: 111881300
Bug: 111414690
2018-08-10 14:05:02 -07:00
Zimuzo Ezeozue
88ee680e4c Merge "Unclone autofill service setting in managed profile" 2018-08-10 17:14:13 +00:00
Mathew Inwood
6750f2e118 Add @UnsupportedAppUsage annotations
For packages:
  android.providers.settings
  android.provider

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I3865ac184fcb6f52c6bfab9729611b065b27722e
2018-08-10 09:29:25 +01:00
Jeff Sharkey
0ce83aeb2b Add "owner_package_name" column.
To support new storage features in Q, we need to start tracking the
"owner" of each inserted file.  This change introduces the schema
change to insert the column, including logic to derive values for
existing well-known package-specific paths.  Populate the column for
any newly inserted media based on the calling package.

Bug: 111893193
Test: adb shell am instrument -w com.android.providers.media.tests
Change-Id: Ibf5656423c22e7e540ab4a3a3efb99b8af944e16
2018-08-09 20:37:16 +00:00
Michal Karpinski
201bc0c14e Log various information about non-foreground activity starts
Logging activity starts to TRON, but only if the caller app
doesn't have any foreground activity present.

Example event:
08-03 15:21:30.813  1231  3220 I sysui_multi_action: [757,1513,758,4,805,1533306090812,1514,10147,1515,com.google.android.talk,1516,1018,1517,0,1518,1000,1519,1000,1520,0,1521,10147,1522,com.google.android.talk,1523,1018,1524,0,1525,pendingintent:u0a12:com.google.android.talk/com.google.android.apps.hangouts.phone.ConversationActivity,1526,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1527,1,1528,com.google.android.apps.hangouts.phone.conversationlist,1540,1,1541,com.google.android.apps.hangouts.phone.BabelHomeActivity,1542,3146240,1543,{com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity},1544,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1545,com.google.android.talk,1546,1,1547,0,1551,0,1552,0]

Bug: b/111866309
Context: go/activity-starts-logging-tron
Test: 1) enable logging with: adb shell settings put global activity_starts_logging_enabled 1
      2) open some activities and observe: adb logcat -b events | grep "sysui_multi_action: \[757,1513"
Test: atest FrameworksServicesTests:ActivityStarterTests
Change-Id: Id63806a2d08a50f404268194a05c6e94bd7e9724
2018-08-08 14:55:05 +01:00
Makoto Onuki
c874f0ecf8 Merge "No longer keep track of contacts affinity (2/4)" 2018-08-06 16:07:07 +00:00
ykhung
61f5c2b81a Add @SystemApi annotation for Predictive Settings ringer gesture.
Fixes: 111573823
Test: manual test.

Change-Id: I469296c6283bb5e6fe9b8c0f6a1203e651cc33ee
2018-08-06 02:44:44 +00:00
Makoto Onuki
aa2dd62c06 No longer keep track of contacts affinity (2/4)
Test: atest android.provider.cts.contacts
Test: atest ContactsProviderTests ContactsProviderTests2
Change-Id: I10e66441a9766947c7c14ae25022deadac5a9c7c
Bug: 111210683
2018-08-02 23:11:39 +00:00
TreeHugger Robot
38663ab205 Merge "Add 2 Settings.Global keys for Settings ExternalProvider." 2018-08-01 18:12:10 +00:00
Zimuzo
9822ffc49e Unclone autofill service setting in managed profile
The autofill service setting was cloned from the personal
profile to the managed profile in ag/2126240 to fix a bug where the
Settings UI did not control the managed profile. That fix caused
unintended interactions between both profiles. The setting has
now been 'uncloned' and a separate UI control introduced for each
profile in ag/4666600.

BUG: 3803359
Test: Tested manually by setting up a work profile and verifying that
the setting can be changed independently.

Change-Id: I7b5cac69cb8b4b0782538cb86f818904d6ad238d
2018-08-01 18:14:10 +01:00
TreeHugger Robot
94efa9cb6f Merge "Settings: Add a setting to toggle wifi scan throttling" 2018-08-01 16:42:29 +00:00
Fan Zhang
f5d74c7665 Add 2 Settings.Global keys for Settings ExternalProvider.
Bug: 111941143
Test: rebuild
Change-Id: I8ee5b17601f85fc2ab9f7dea2824800405a188c5
2018-08-01 09:37:32 -07:00
Roshan Pius
adb9394832 Settings: Add a setting to toggle wifi scan throttling
Scan throttling affects apps which are used by testers for survey-like
application. Add a hidden setting which can be toggled via adb commands
to turn off all scan throttling.

Bug: 111763749
Test: Unit tests
Test: `adb shell settings put global wifi_scan_throttle_enabled 0` on
user build.
Change-Id: I6c9a468c573239914b88de0afcdd7e477429cb16
2018-08-01 07:55:46 -07:00
TreeHugger Robot
57fcafd02b Merge "Move some global settings to secure settings" 2018-07-31 17:13:27 +00:00
Beverly
91d0a63a58 Move some global settings to secure settings
The following Settings are being moved to Settings.Secure
from Settings.Global since they are settings that exist
per user
- CHARGING_SOUNDS_ENABLED
- CHARGING_VIBRATION_ENABLED
- ZEN_DURATION
- SHOW_ZEN_UPGRADE_NOTIFICATION
- SHOW_ZEN_SETTINGS_SUGGESTION
- ZEN_SETTINGS_UPDATE
- ZEN_SETTINGS_SUGGESTION_VIEWED
zen_duration used to be a global setting -> move it to
Settings.Secure since users can set different values

Fixes: 110926544
Test: make RunSettingsLibRoboTests -j40 ROBOTEST_FILTER=ZenDurationDialogTest
Test: manual upgrade
Change-Id: Ifa36affe3e52e67a54698a8cf2c3424343877179
2018-07-31 11:42:05 -04:00
Jeff Sharkey
30b77bce53 Rewrite MediaStore thumbnail internals.
Keeps existing public APIs intact, but rewrite the internal to pave
the way for storage changes coming in Q.  All thumbnail generation
and reading now happens in MediaProvider, since apps won't have
direct access to MiniThumbFile files in Q.

Instead, InternalThumbnails now uses openTypedAssetFileDescriptor()
to open the original Uri, but with an EXTRA_SIZE indicating that
it'd like a thumbnail of a specific size.  This uses best-practices
which allow apps obtaining a Uri permission grant to a specific
media Uri to request a thumbnail of that media without additional
permissions.  This also lets us use CancellationSignal to cancel
thumbnail requests that are no longer needed, and we start checking
this signal at each query() point internally.

Move internals to use ExecutorService pattern, which will let us
expand the thread pool in a future CL based on device capabilities.

Previous logic that asynchronously generated thumbnails after certain
actions is now replaced with simpler invalidation.  This paves the
way for us to move proactive thumbnail generation to be driven by an
idle maintenance service, to be better stewards of battery life.  We
continue to generate thumbnails on-demand when not yet cached.

ThumbnailUtils already handles extracting EXIF thumbnails, so we don't
need to duplicate that work locally.

Flag that enables dumping of all raw SQL for debugging purposes on
a per-process basis.

Bug: 111268862, 111890672
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ibcdbc564c8fee09ddd33ebccc470fa5cbdff97b4
2018-07-28 17:40:04 -06:00
Felipe Leme
68b2222546 Created new Settings preferences for internal autofill state.
Currently, these preferences can only be changed through 'cmd autofill', but
moving them to the Settings provider will let us manage them through the
Settings -> Developer Options screen:

- AUTOFILL_LOGGING_LEVEL
- AUTOFILL_MAX_PARTITIONS_SIZE
- AUTOFILL_MAX_VISIBLE_DATASETS

Test: manual verification
Test: atest CtsAutoFillServiceTestCases FrameworksCoreTests:SettingsBackupTest

Bug: 65700540

Change-Id: I6c864d032bc0b2c3b7c24f300af37883adbaf0d0
2018-07-26 09:18:47 -07:00
Kevin Chyn
aa580f4edc Add secure setting for using face on keyguard
Bug: 111321762

Test: builds
Change-Id: I5a2ec8d1d11be2085f2526c9b73a5206b668c8c8
2018-07-19 12:41:28 -07:00
Hui Yu
0ed84f1263 Better Handling of Battery Stats History Overflow
Previously battery history is kept in the in-memory mHistoryBuffer
with size of 512KB (96KB on low memory device). When the buffer is
close to full we drop certain types of history. When the buffer is
full the whole buffer is reset and we lost elder history. On a
device with long battery life this problem is more frequent.

This CL changes mHistoryBuffer to 128KB (64KB on low memory device).
When the buffer is full, it is saved to history file on file system.
By default we allow 32 history files (64 history files on low-memory
device) which gives us 4MB history (compare to 512KB today).

The MAX_HISTORY_BUFFER and MAX_HISTORY_FILES can be remote configured
through GServices or P/H.

In case of history exceeding 4MB, the oldest history file is deleted
and new history file is open.

This change increases battery history by using disk file and the
chance of losing history is greatly reduced.

Bug: 67297625
Test: adb shell dumpsys batterystats --history
Change-Id: Id9aafea761649d7323b97d1e44135f7880a95414
2018-07-13 17:31:19 -07:00
Julia Reynolds
b992c34510 Merge "Add notification settings to backup&restore" 2018-07-13 14:17:07 +00:00
Julia Reynolds
afc94d724c Add notification settings to backup&restore
Change-Id: I421c7487955ee339f88e3957c973375d0f87e2ff
Fixes: 35655737
Test: presubmit unit tests
2018-07-12 12:41:34 -04:00
Jeff Sharkey
5aae0c9df7 Utility methods useful for working with files.
Part of getting DocumentsUI ready for building against public API.

Test: builds
Bug: 110959821
Change-Id: I7cc0acd5ac3bcc89790cb49f34291ae523e44019
2018-07-11 14:41:24 -06:00
Olivier Gaillard
d2af61a1e8 Merge "Add experiment flag to control binder call stats." 2018-07-09 19:09:47 +00:00
Lucas Dupin
4b4c530ced Revert "Add theme mode design let user can choose theme self"
The CL was intended only for P as a temporary solution.
This reverts commit f0800fa3bd.

Test: switch wallpapers, observe theme
Bug: 110758454
Change-Id: If10e4d87b6ddac10063b2671abd99e0baccdf92e
2018-07-04 11:22:18 -07:00
Olivier Gaillard
1d7f615eec Add experiment flag to control binder call stats.
For instance, to enabled detailed tracking locally.
adb shell settings put global binder_calls_stats detailed_tracking=true

Also adds the ability to turn off data collection completely and
changing the sampling interval. Uploading data through westworld can
re-use the same flag once implemented.

Test: Unit tested

Change-Id: I808c9902b8124ab643d9b197703d537da040ae3e
2018-07-04 13:36:46 +01:00
Yohei Yukawa
1893bd162a Stop restoring spell checker settings
This CL logically reverts the following CL (and some subsequent
changes) to stop restoring spell checker related secure settings.

 * Ib8382f0296f0726b64494d3b1fd8237e13adb540
   06cbaddb87

Reason for revert:
Although we believe it would be great if we can seamlessly migrate to
a new phone with keeping spell checker related settings, there still
remain several tricky scenarios.

 * We are not ready to distinguish whether a certain spell checker
   related setting was explicitly set by the user or programmatically
   set by some components in the previoud device.  This includes the
   case where TextServicesManagerService (TSMS) itself automatically
   updates those settings e.g. by selecting a default spell checker
   service from the pre-installed ones.  We are not sure if trying to
   migrate such an auto-selected setting to a new device actually
   makes sense, especially if it happens without any user
   confirmation.

 * We have a strict rule about what spell checker service can be
   selected automatically, and the rule has been that only
   pre-installed spell checker services can be automatically selected
   by the system, unless some system components that have
   WRITE_SECURE_SETTINGS permission overrides it. Mechanically
   selecting a spell checker service just because it was enabled in
   the previous device may not fit this model well.

 * Unlike IMEs, currently the Android OS allows only one spell checker
   service to be enabled.  This means that if the new device doesn't
   have the corresponding spell checker service, the user will lose
   spell checking functionality even if the device pre-installs
   functional spell checker service.  This problem is hard to notice
   because unlike IMEs spell checker service does not have its own UI.

 * Also unlike IMEs, spell checker related secure settings are still
   hidden and not published as public APIs.  Those settings do not
   have no official compatibility story across devices yet.

 * It is also possible that the default spell checker service in the
   previous device is not published to all the devices thus there is
   no way for the the new device to install it.

This CL therefore excludes spell checker related settings from
backup/restore, as a short-term answer to above scenarios until we
come up with better ideas to deal nicely with them.

Bug: 110367605
Test: atest FrameworksCoreTests:android.provider.SettingsBackupTest
Test: atest FrameworksCoreTests:android.provider.SettingsValidatorsTest
Change-Id: I8e4a0d4b3b758a84d5a075fa52851b1e8dd707eb
2018-07-02 11:31:42 -07:00
Beverly
28c3d164d9 Only play in-call notification if ringer is normal
- Add secure setting to enable/disable in call notifications
- Can toggle system setting using the following adb command:
adb shell settings put secure in_call_notification_enabled [0/1]

Bug: 71586014
Test: manual
Change-Id: I32e1d1d6dcae806e655ae6875a43d07ca83e77f4
2018-06-29 16:52:14 -04:00
TreeHugger Robot
c39a8ac6e7 Merge "Remove sleep_timeout setting from backup" 2018-06-28 17:34:11 +00:00
Bernardo Rufino
338832fad8 Remove sleep_timeout setting from backup
It is not user-configurable.

Bug: 79779285
Test: atest SettingsBackupTest
Test: # w/ LocalTransport
      adb shell settings put secure sleep_timeout 5000
      adb shell bmgr backupnow com.android.providers.settings
      adb shell settings put secure sleep_timeout 3000
      adb shell bmgr restore 1 com.android.providers.settings
      adb shell settings get secure sleep_timeout => ensure 3000

Change-Id: I68bf2f91cc3d4c00463468a6abaef3b64d5c10b9
2018-06-28 16:32:42 +00:00
Andrew Zeng
6badc28ecc Update notification settings Javadoc links.
Change-Id: If9ed94473fb5c0607fa44b9a42c62837878ffd00
2018-06-27 21:09:15 +00:00
TreeHugger Robot
b9d084d696 Merge "Use correct validator for SELECTED_SPELL_CHECKER_SUBTYPE" 2018-06-25 21:15:54 +00:00
TreeHugger Robot
67f17cd690 Merge "Handle tri-state location permission." 2018-06-25 18:41:07 +00:00
Yohei Yukawa
4bc81e836c Use correct validator for SELECTED_SPELL_CHECKER_SUBTYPE
This CL fixes a bug that COMPONENT_NAME_VALIDATOR is mistakenly used
for SELECTED_SPELL_CHECKER_SUBTYPE secure settings due to a comment
bug.  ANY_INTEGER_VALIDATOR should be used instead because it stores
the hashcode of SpellCheckerSubtype.

This CL also addresses the comment bug, which caused this issue.

Fix: 110363012
Test: atest FrameworksCoreTests:android.provider.SettingsBackupTest
Test: atest FrameworksCoreTests:android.provider.SettingsValidatorsTest
Test: manually verified as follows
 1. In a source device, complete the setup wizard (without restoring
    the previous settings) then run 'adb shell bmgr backupnow --all'
 2. In a destination device, restore settings by choosing the option
    from a cloud backup.
 3. Check logcat. Make sure that the following message is not shown.
      SettingsBackupAgent: Attempted restore of selected_spell_checker_subtype setting, but its value didn't pass validation, value: 0
Test: manually verified as follows
 1. In a source device
  1.1. complete the setup wizard without restoring the previous
       settings
  1.2. Open Settings -> System -> Languages & input -> Advanced
       -> Spell checker -> Languages
  1.3. Select 'French'
  1.4. adb shell settings get secure selected_spell_checker_subtype
       -> Make sure it shows '102517'
  1.5. adb shell bmgr backupnow --all
 2. In a destination device
  2.1. Restore settings by choosing the option from a cloud backup.
  2.2. adb shell settings get secure selected_spell_checker_subtype
       -> Make sure it shows '102517'
Change-Id: I560395a2ccd5bcf1bf7446123b892b23ab14f9f5
2018-06-25 11:35:19 -07:00
Wei Wang
dd070f2fd9 Handle tri-state location permission.
Use noteOp instead of checkOp as checkOp doesn't consider
background status.

Watch location permission changes caused by background status.

Restrict age of last location for foreground-only apps.

Bug: 80318398
Test: Manual
Change-Id: I3499d4150478b6f501966953f8e4a08169f3557c
2018-06-22 14:12:20 -07:00
TreeHugger Robot
751bd5b621 Merge "Link Speed Metrics Proto" 2018-06-20 19:28:39 +00:00
TreeHugger Robot
664e0d66c7 Merge "Wifi Usability Metrics Proto Update" 2018-06-20 18:03:16 +00:00
Jong Wook Kim
e4aa37fe48 Link Speed Metrics Proto
Add a histogram of link speed values with count and rssi values.

Collect this metrics only when enabled in settings. By default, we don't
collect this metrics.

Bug: 78354985
Test: Settings Unittest
Change-Id: I683dfb45a01de5e1243d612a117a5544b0d4dc05
2018-06-18 18:21:45 -07:00
Jong Wook Kim
411cab97c6 Wifi Usability Metrics Proto Update
Generate WifiIsUnusableEvent when there is a data stall or a firmware
alert. In WifiIsUnusableEvent, store metrics related to time, packet
counts, trigger reason, and score.

Also, log ExperimentValues that we plan to change through global
settings varaible.

This logging is enabled by setting WIFI_IS_UNUSABLE_EVENT_METRICS_ENABLED
to 1. By default, this metric is not collected.

Manual Check Process:
- Connect to a network
- adb shell settings put global wifi_is_unusable_event_metrics_enabled 1
- adb shell dumpsys wifi wifiMetricsProto
- Move away from the ap to trigger data stall
- adb shell dumpsys wifi | grep -10 WifiIsUnusableEventList
- Verify that there is a WifiIsUnusableEvent

Bug: 77603216
Test: Unittest (settings core/tests/coretests).
Test: Manual Check.
Change-Id: I2d8425a420f5ba18e3eee0e11b6f35f6239a97b2
2018-06-18 17:32:03 -07:00
Android Build Merger (Role)
383d04261f [automerger] Add documentation for additional flag to disable Home. am: 8f36f14e16
Change-Id: I2f6222308e1e6b6fbb8536a543230a8dd7aeb9ab
2018-06-19 00:24:22 +00:00
Michael Kwan
8f36f14e16 Add documentation for additional flag to disable Home.
Bug: 79545325
Change-Id: Ia3cf3108a5b1ea7d76d0d85c36f7fbc98bb4d82e
2018-06-18 14:27:24 -07:00
Kevin Chyn
114e58a6f9 Merge "Don't back up Assist Gesture setup/sensitivity" into pi-dev
am: a74fbef8ce

Change-Id: I28f349b3674126a85731489fd8119b41385934a7
2018-06-18 05:49:12 -07:00
Kevin Chyn
b5b29a8c70 Merge "Merge "Don't back up Assist Gesture setup/sensitivity" into pi-dev am: a74fbef8ce" into pi-dev-plus-aosp
am: fe611a5700

Change-Id: I1aba793c0c71573e06d52f14aec823a4f6d3ad93
2018-06-15 23:07:17 -07:00
Kevin Chyn
ecc07726e2 Merge "Don't back up Assist Gesture setup/sensitivity" into pi-dev
am: a74fbef8ce

Change-Id: Ib14cc5a35991dec3623ecf2dfdb72cbbccd7e53e
2018-06-15 22:49:30 -07:00
TreeHugger Robot
4fa7af169b Merge "Add emergency dialer option on power menu" 2018-06-14 09:52:27 +00:00
Wesley.CW Wang
8d07276f23 Add emergency dialer option on power menu
Add a button on power menu to launch emergency dialer.
Add FASTER_EMERGENCY_PHONE_CALL_ENABLED to SettingsBackupTest blacklist.

Test: Manually
Change-Id: I9c920e31433c0ac23165f917d8dd2befaaa4938d
Bug: 80376488
2018-06-14 15:06:20 +08:00
Beverly
dec19a768f Get rid of unnecessary todo
Test: builds
Change-Id: I7feffec1e06112030d2e02055555684827c22fcd
2018-06-12 15:53:05 -04:00
Kevin Chyn
6df6b027f0 Don't back up Assist Gesture setup/sensitivity
Fixes: 72715022

Test: With two devices, set up one, back up onto the other.
      SUW for Assist Gesture does not get skipped
Test: atest SettingsBackupTest

Change-Id: Id7348542a618c0366f89c47833af6f66bf52b18f
2018-06-11 16:13:00 -07:00