Commit Graph

2761 Commits

Author SHA1 Message Date
Svetoslav Ganov
8c35dcc7ae Fix a race in local settings caches
We send a handle to the generation tracker along with the first accessed
setting but don't send the generation id of when the setting was
actually looked up. So by the time the client gets the setting with the
generation tracker from which to get and cache the last generation the
setting may have changed. We need to pass the generation id along with
the value and the generation tracker.

bug:29458487

Change-Id: I0ac4955ba5b10b547f8fe653a7c28e048a4691eb
2016-06-17 15:30:45 -07:00
Chris Tate
453951d077 Merge "Don't back up/restore the "automatically restore app data" setting" into nyc-dev 2016-06-02 20:45:16 +00:00
TreeHugger Robot
43c3a7e5a7 Merge "make the notification enqueue rate threshold a setting" into nyc-dev 2016-06-02 15:08:03 +00:00
Chris Wren
763a9bb095 make the notification enqueue rate threshold a setting
Bug: 28693065
Change-Id: I08bd2ed342d5347c0075183b239558c50ada4a0a
2016-06-02 15:07:20 +00:00
Dianne Hackborn
e9a988caca Work on issue #28942589: Tune job scheduler
We now have a new settings key that provides all of the existing
tuning parameters, plus some newly redone ones for dealing with
different memory levels.

Changed the minimum batching for overall jobs from 2 to 1, so
we will never get in the way of immediately scheduling jobs
when the developer asks for this.  We should now be able to rely
on the doze modes to do better batching of jobs for us when it
is really important.

Also work on issue #28981330: Excessive JobScheduler wakeup alarms.
Use a work source with scheduled alarms to blame them on the app
whose job they are being scheduled for, and add a check for whether
a job's timing constraint has been satisfied before considering it
a possible candidate for the next alarm.  (If it is satisified,
the time is in the past, so we should not schedule an alarm for it.)

Finally clean up a bunch of the dumpsys output to make it easier
to understand.

Change-Id: I06cf2c1310448f47cf386f393e9b267335fabaeb
2016-05-31 18:16:19 -07:00
Christopher Tate
1d7d9404e0 Don't back up/restore the "automatically restore app data" setting
It stomps on the Setup Wizard intended [or user-supplied!] behavior.

Bug 29030834

Change-Id: Iabb0ff88b7f8b9130abb59af68872d02e5534140
2016-05-31 12:03:25 -07:00
Felipe Leme
a1b79bfd7a Allow apps to bypass Power Save restrictions when launched from a Notification's PendingIntent.
This scenario typically happens when the device is on Doze Mode and a
notification action is triggered from a Wear device.

In a nutshell, the workflow is:

- ProcessRecord has a flag telling whether a process has "whitelist
  management" privileges.
- When NotificationManager binds a new NotificationListenerService, it
  sets the BIND_ALLOW_WHITELIST_MANAGEMENT flag.
- On bind(), ActiveService asserts that only system apps can set that
  flag.
- On computeOomAdjLocked(), ActivityManagerService sets the
  ProcessRecord flag if necessary.
- Upon creating a notification, NotificationManager calls AM to mark its
  PendingIntents as coming from a notification.
- When PendingIntentRecord sends it to the target, it checks if it's
  from a notification and if so calls AM to do the temp whitelist.
- On unbind(), ActiveService removes the ProcessRecord flag if necessary.

Fixes: 28818704

Change-Id: I00d46036a2cbb73f7f733fd35bf0b743a02807a1
2016-05-27 11:45:09 -07:00
Seigo Nonaka
ce9f5e3657 Merge "Fix system locale propagation during user creation." into nyc-dev 2016-05-26 03:51:39 +00:00
Roozbeh Pournader
6686711ba2 Merge "Clear locales without changing layout direction." into nyc-dev 2016-05-20 19:42:31 +00:00
Seigo Nonaka
bd5cac67b8 Clear locales without changing layout direction.
Calling Configuration.setLocales with emtpy LocaleList may change the
layout direction to LTR. To clear the locales in Configuration without
layout direction change, introduce hidden API to Configuration.

Bug: 28695661
Change-Id: I47c339dffb83099bd329ddb60237dab27b05f593
2016-05-20 17:59:35 +00:00
Chris Tate
a3aaa5ee25 Merge "Back up / restore the 'mono audio' setting" into nyc-dev 2016-05-20 17:05:39 +00:00
Ta-wei Yen
4f2a1d0913 Merge "Hide VoicemailContract.setQuota()" into nyc-dev 2016-05-20 01:00:30 +00:00
Ta-wei Yen
0f712b164f Merge "Rename visual voicemail sync intent value" into nyc-dev 2016-05-20 01:00:04 +00:00
Christopher Tate
ea2d6e8e89 Back up / restore the 'mono audio' setting
Bug 28437565

Change-Id: I6028886eb1aa424edabca65ad9d11d984b82d198
2016-05-19 16:55:49 -07:00
Ta-wei Yen
467f067c8c Hide VoicemailContract.setQuota()
This method is a helper for internal use only.

+ Updated docs for QUOTA_OCCUPIED, QUOTA_TOTAL, and QUOTA_UNAVAILABLE.

Change-Id: Ib146926cd2bff50affe970a0123bcbec62ac3e70
Fixes:28842445
2016-05-19 12:02:25 -07:00
Seigo Nonaka
ea906b37df Fix system locale propagation during user creation.
Since Android N, the system locale is stored in Settings.System. Because
of this change, we need to propagate the previous user's system locale
to the newly created user.

When the user switch happens, updateUserConfigurationLocked is called
for the next user. Usually, some configuration values (font scale and
system locale) are overwritten by the next user's settings. However,
the first time the next user logs in (and only the first time), the
settings value is empty. So, we need to decide between keeping the
passed configuration's value or resetting to the default. For the
fontScale, it is reset to the default (issue 27187556). For the system
locale, the previous user's locale should be used. This CL addresses
this.

At the same time, the inherited configuration should be stored to the
settings, otherwise the inherited configuration is lost the next time
the second user logs in.

Bug: 27803966
Change-Id: I4632671316d26e00ab6fe80ff3433f097f0e0954
2016-05-19 13:28:05 +09:00
Abhijith Shastry
95fd74c1f7 Update BlockedNumberContract javadocs.
Include @return for all public methods.

BUG: 28842525
Change-Id: Ie0fddee1d889f188a77c45d8bdbf78ea9fe323ba
2016-05-18 16:39:56 -07:00
Robin Lee
d171df660e Merge "Lock down networking when waiting for always-on" into nyc-dev 2016-05-18 23:37:24 +00:00
Robin Lee
17e6183b85 Lock down networking when waiting for always-on
Fix: 26694104
Fix: 27042309
Fix: 28335277
Change-Id: I47a4c9d2b98235195b1356af3dabf7235870e4fa
2016-05-19 00:26:53 +01:00
Yohei Yukawa
23cbe85610 Move LocaleList to avoid layering violation.
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
2016-05-17 16:42:58 -07:00
Ta-wei Yen
153fcd7ba1 Rename visual voicemail sync intent value
Rename value of KEY_VVM_CELLULAR_DATA_REQUIRED_BOOL KEY_VVM_PREFETCH_BOOL

Change-Id: I13718333a8ddc38e8d2131b478562b76cf9aab64
Fixes:28819765
Fixes:28822093
2016-05-17 15:57:20 -07:00
Svetoslav Ganov
b35301e421 Merge "Make settings cahches generation mechanism robust." into nyc-dev 2016-05-13 22:22:32 +00:00
Svetoslav Ganov
04df738bcb Make settings cahches generation mechanism robust.
Settings is using a MemoryIntArray to communicate the settings table
version enabling apps to have up-to-date local caches. However, ashmem
allows an arbitrary process with a handle to the fd (even in read only
mode) to unpin the memory which can then be garbage collected. Here we
make this mechanism fault tolerant against bad apps unpinning the ashmem
region. First, we no longer unpin the ashmem on the client side and if
the ashmem region is purged and cannot be pinned we recreate it and
hook up again with the local app caches. The change also adds a test
that clients can only read while owner can read/write.

bug:28764789

Change-Id: I1ef79b4b21e976124b268c9126a55d614157059b
2016-05-13 15:14:14 -07:00
TreeHugger Robot
fec0d188c1 Merge "Don't show new-window item in Downloads per Gabe." into nyc-dev 2016-05-13 17:26:46 +00:00
Tingting Wang
e0cbda454c Rename CONTACT_METADATA_SYNC GService Flag.
Rename it to CONTACT_METADATA_SYNC_ENABLED.

BUG 28295805

Change-Id: Ib1f735b082a2ff6cca93e377b3eaaaf7cd396b8d
2016-05-10 17:29:00 -07:00
Steve McKay
f570c771f2 Don't show new-window item in Downloads per Gabe.
Also, fix regression...don't show "internal storage" option in Downloads.
All other modes, fix inconsistencies in presentation of
internal-storage/new-windows commands by eliminating launch mode inference.
Update VolumeInfo and MTP provider to send correct launch mode extra.

Bug: 28691735,28695347
Change-Id: Ic480925f4c8f1beee4da104a2259c1ce5f28a6a1
2016-05-10 16:25:58 -07:00
Tony Mak
13532bdd2e Merge "Fix enterprise contacts APIs naming and docs" into nyc-dev 2016-05-06 12:06:29 +00:00
Jason Monk
c91f5e2971 Merge "Add action to launch webview implementation settings" into nyc-dev 2016-05-05 16:56:20 +00:00
Abhijith Shastry
9a2384a7a6 Merge "Update BlockedNumberContract documentation." into nyc-dev 2016-05-04 18:14:38 +00:00
Renat Aksitov
d516e30b91 Merge "Voice Messaging Intent API." into nyc-dev 2016-05-04 18:02:47 +00:00
Tony Mak
c820cc5fb1 New settings key and policy transparency for managed profile settings
Bug: 28281560
Change-Id: I38d0c202088df410a28e78800de4e74377ec3216
2016-05-04 09:33:08 +00:00
Abhijith Shastry
1705fc4767 Update BlockedNumberContract documentation.
For secondary users, a SecurityException is thrown instead of UnsupportedOperationException.

BUG: 28294786
Change-Id: I6402b856eeb02c4c1d940606ae7e69f3ae9cb45d
2016-05-03 17:18:02 -07:00
Jason Monk
42d0121441 Add action to launch webview implementation settings
Bug: 28554048
Change-Id: I5ccdf5350c216949890d79b2b306b935a5949824
2016-05-03 14:16:56 -04:00
Renat Aksitov
c8dd93d4c8 Voice Messaging Intent API.
Adding missing items about MIME type and account type to the
"integration with the Contacts Provider" section.

Bug 28295510

Change-Id: I890458e62a714519be70e930fd53315c141ba354
2016-05-02 09:22:02 -07:00
Lorenzo Colitti
4a992cbde8 Merge changes I86257bc8,I5c2221c5 into nyc-dev
* changes:
  Use Netd's binder interface to set resolver configuration.
  Add Gservices settings for resolver configuration.
2016-05-02 12:49:19 +00:00
Pierre Imai
8e48e67827 Add Gservices settings for resolver configuration.
BUG: 25731675

Change-Id: I5c2221c5a2478fe2fa0fdf9ceeb13a932d758d33
2016-05-02 08:26:09 +00:00
Lorenzo Colitti
fb628c078c The legacy DHCP client is gone. Delete the settings.
Bug: 27192644
Change-Id: I5bc23f3e269e17d50fa2531a57fb0e2049ae18bf
2016-04-29 22:19:23 +09:00
TreeHugger Robot
8c2fb9edae Merge "Introduce "unlocking" vs "unlocked" nuance." into nyc-dev 2016-04-28 19:06:28 +00:00
Jeff Sharkey
ce18c81677 Introduce "unlocking" vs "unlocked" nuance.
There is a narrow window of time during user unlock where we're
reconciling user storage and dispatching the "unlock" status to
various internal system services.  While in this "unlocking" state,
apps need to be told that the user still isn't actually "unlocked"
so they don't try making calls to AccountManager, etc.

The majority of internal services are interested in merging together
both the "unlocking" and "unlocked" state, so update them.

Clarify naming in AccountManagerService to make it clear that a local
list is being used, which mirrors the naming in MountService.

To match UX/PM requested behavior, move PRE_BOOT_COMPLETED dispatch
after the user is unlocked, but block BOOT_COMPLETED dispatch until
after all PRE_BOOT receivers are finished to avoid ANRs.

Bug: 28040947, 28164677
Change-Id: I57af2351633d9159f4483f19657ce0b62118d1ce
2016-04-28 10:51:39 -06:00
Lorenzo Colitti
c5be12e7ac Make isCaptivePortal perform both HTTP and HTTPS probes.
Also a couple of minor cleanups and logging tweaks.

Bug: 26075613
Change-Id: I67b09e96d72764179339b616072bb2ce06aabf33
2016-04-28 11:23:10 +09:00
TreeHugger Robot
8b5e9f1bcf Merge "Update background data restrictions intent javadoc." into nyc-dev 2016-04-27 21:16:00 +00:00
Felipe Leme
2850b56b9e Update background data restrictions intent javadoc.
BUG: 26820898
Change-Id: Ib2ed6835708ec77926fe49264ccf65a0aaf9a984
2016-04-26 13:57:00 -07:00
Svetoslav Ganov
f71d7feef2 Merge "Ensure local settings caches are not stale" into nyc-dev 2016-04-26 18:36:28 +00:00
Svet Ganov
53a441ca8e Ensure local settings caches are not stale
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.

This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.

The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.

We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.

The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.

bug:18826179

Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
2016-04-26 11:31:55 -07:00
Julia Reynolds
a0676c9207 Merge changes from topic 'api_review' into nyc-dev
* changes:
  Api review: Settings.
  Reduce spacing.
2016-04-26 15:29:11 +00:00
Julia Reynolds
0aa7d615c2 Api review: Settings.
Hide notification policy setting.

Bug: 28295513
Change-Id: Ic117285c3eb07cb4bf399e233adad835772b9673
2016-04-25 14:57:33 -04:00
Ricky Wai
149a6c9034 Fix enterprise contacts APIs naming and docs
Bug: 28295752
Change-Id: I504af42ab1146c6c82f54773c25450d41445345c
2016-04-25 12:14:53 +01:00
Jeff Sharkey
f07c7b9fd0 API changes for DownloadManager and JobScheduler.
To support moving DownloadManager, add new JobScheduler network type
constraint that matches "any network except roaming."  Also add an
API to get a specific JobInfo by ID.

Since the default network can be different on a per-app basis, and
individual apps may be blocked due to app standby, evaluate job
connectivity constraints on a per-UID basis.  To implement this
cleanly, add NetworkInfo.isMetered() to match the isRoaming() API.

Add new DownloadManager APIs to support charging and device idle
constraints, which are plumbed through to JobScheduler under the
hood when scheduled.

Add filtering to JobScheduler dumpsys to omit noisy details for
packages the caller isn't interested in.

Bug: 28098882, 26571724, 19821935
Change-Id: I09ca7184ef7ce6adba399f579d415a5fb2ea6110
2016-04-24 14:39:34 -06:00
Ruben Brunk
6ada702993 Merge "Add settings for altering VR display behavior." into nyc-dev 2016-04-20 19:51:51 +00:00
Trevor Johns
59c9a93fc2 Merge changes from topic 'merge_docs_nyc-dev' into nyc-dev
* changes:
  Remove links to createAndInitializeUser() and createUser()
  Resolve merge conflicts of a5060ee to nyc-dev
2016-04-20 18:35:57 +00:00