198 Commits

Author SHA1 Message Date
Matthew Williams
900c67fc51 Add job persistance as a setter in the API
Bug: 15936795
Change-Id: I11e5a722bab5838dc151670256ed09dfaa7fdaa7
2014-07-10 16:51:27 -07:00
Adrian Roos
c42a1e1071 Add AlarmClock API to AlarmManager
Adds a new kind of alarm that represents an alarm clock and
a way to query the next scheduled alarm clock.

Deprecates Settings.System.NEXT_ALARM_FORMATTED.

Bug: 14589952
Change-Id: I297eeeff36d07adcda010afac183d0f5ee37dc99
2014-07-10 17:07:36 +00:00
Matthew Williams
43c4f41adb am 8e8c1401: Fix build.
* commit '8e8c140114cb3a4f1cf448c4492c13769738ca12':
  Fix build.
2014-06-11 17:02:53 +00:00
Christopher Tate
0188bee2c5 am d8f71d34: Merge "Out with the old; in with the new" into lmp-preview-dev
* commit 'd8f71d34c3c7fb161a1586de8edb52161c32d672':
  Out with the old; in with the new
2014-06-11 17:02:18 +00:00
Matthew Williams
46919f3583 Fix build.
Two tests were breaking the build.

Change-Id: If424a552d3fedb912fa94870b88c60dc3750b69a
2014-06-10 16:11:08 -07:00
Christopher Tate
7060b04f6d Out with the old; in with the new
Switch to the official "JobScheduler" etc naming.

Bug 14997851

Change-Id: I73a61aaa9af0740c114d08188bd97c52f3ac86b7
2014-06-10 12:51:55 -07:00
Matthew Williams
f53c295ae3 am 3b471117: Merge "Add OnNetworkActive to TaskManager and simplify locking." into lmp-preview-dev
* commit '3b4711176e77640d697e94137e65fa93c8363f5c':
  Add OnNetworkActive to TaskManager and simplify locking.
2014-06-10 14:55:46 +00:00
Matthew Williams
effacfa75b Add OnNetworkActive to TaskManager and simplify locking.
Bug: 14993295
Hooks up a ConnectivityManager.NetworkActiveListener.
    
Previously was using 3 locks where 1 would suffice,
negligible to no performance issues b/c most of the previous locks
were nested.

Added OnNetworkActiveListener so that the ConnectivityController can kick of
tasks when it knows that the network is active.

Fixed some bugs that stopped timecontroller from executing tasks.

Requesting a retry will not add a deadline to that task. However backed-off
tasks are run as soon as they are ready, subject to their constraints.

Added receiver to listen for package removal and user removal, which will
delete any outstanding jobs for that uid.

Change-Id: I4c4523af558b927f19b8a215878fcc7198abb93f
2014-06-09 17:18:11 -07:00
Matthew Williams
38b200fe6c am 1a2f47d4: Merge "Add persistence of tasks for TaskManager & BatteryController" into lmp-preview-dev
* commit '1a2f47d4cdc0ea40dff1b88f7976d64c19d687b1':
  Add persistence of tasks for TaskManager & BatteryController
2014-06-05 20:08:54 +00:00
Matthew Williams
3d86fd2bb9 Add persistence of tasks for TaskManager & BatteryController
Tasks are persisted only if the client has the RECEIVE_BOOT_COMPLETED
permission. This applies to both periodic and one-off tasks.
Write out task as xml, using PersistableBundle for the extras data.
Todo: Add persistable bundle to xml when ag/468207 is merged.

Also added BatteryController logic.

Change-Id: I23eeeb8b3bc6ba155e7fa4ec25857a68ee8b1567
2014-06-05 18:28:43 +00:00
Amith Yamasani
5b5aa4072f Handle saving and restoring ints in application restrictions
Unit tests for restrictions types and proper escaping.

Change-Id: Iac35521faf5798398a89fecbad82fcdd256a4146
2014-06-01 20:17:37 -07:00
Chris Wren
92af372fc6 add tests for ValidateNotificationPeople.getExtraPeople()
Change-Id: Ieb8acce58574c25cccce674b4494f75d96b57125
2014-05-29 16:14:31 +00:00
Sreeram Ramachandran
4ddebf7f5b Fix build.
Change-Id: I5dab09d2d8a9cff56fa17bb4e8c14b365449399b
2014-05-14 03:56:33 -07:00
Paul Jensen
a7b9796345 Get ConnectivityServiceTest building again after 8f80cc8.
Change-Id: I4520011ba2076d8fac1ca234cb9a79c774992671
2014-05-14 03:56:33 -07:00
Narayan Kamath
629f766827 am 80edaa67: am 24c089a8: Fix build.
* commit '80edaa676bd59409f8a82e12c035bee96e653004':
  Fix build.
2014-04-11 10:57:28 +00:00
Narayan Kamath
24c089a8b5 Fix build.
isScreenOn was changed to isInteractive.

Change-Id: I381d0b0ca745b61e64ac6309c2a6307696f52be0
2014-04-11 10:50:43 +00:00
Matthew Williams
c798e4f549 am 4701b51a: am bb87ac7f: DO NOT MERGE: Downgrade expedited to normal on reschedule.
* commit '4701b51af216ce2b6fa9fa508ebba47bf13063c7':
  DO NOT MERGE: Downgrade expedited to normal on reschedule.
2014-03-25 09:57:36 +00:00
Matthew Williams
bb87ac7f97 DO NOT MERGE: Downgrade expedited to normal on reschedule.
bug: 12033540
Expedited was previously tracked by a redundant internal variable, ostensibly
as an optimisation. This variable could differ from the value in the bundle
depending on how the operation is initialised, which led to confusion. Now an
expedited sync will only be treated as such on its first execution.

Change-Id: Ibfc4e9e49b86c82f2364a6ef55f887705a053eb6
2014-03-24 14:42:06 -07:00
Matthew Williams
cde7086b90 Merge "Downgrade expedited to normal on reschedule." 2014-03-21 21:59:07 +00:00
Ashish Sharma
a3f828ba30 Update the tests to deal with the new timestamps in idletimer module.
Change-Id: I1a8368d84ef806f1501b0a1f5e817388a1d10518
2014-03-18 16:38:58 -07:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
David Christie
d63b4314b8 Merge "Log history of location requests in LocationManager. -Assists with debugging power issues. Bug: 12824233" 2014-02-13 20:25:01 +00:00
Matthew Williams
6428046767 Downgrade expedited to normal on reschedule.
bug: 12033540
Expedited was previously tracked by a redundant internal variable, ostensibly
as an optimisation. This variable could differ from the value in the bundle
depending on how the operation is initialised, which led to confusion. Now an
expedited sync will only be treated as such on its first execution.

Change-Id: I9979102317aecbe8bc53a36381d4b2782ac131be

Conflicts:
	services/core/java/com/android/server/content/SyncOperation.java
	services/core/java/com/android/server/content/SyncQueue.java
2014-02-06 17:22:08 +00:00
Adam Connors
776c555d95 Extend DeviceOwner concept to accommodate ProfileOwners
ProfileOwners, like DeviceOwners, are Device Admins that have
additional priviledges. ProfileOwners however are scoped per
user.

Change-Id: I1e22c85878e0672121e6ebbe97fca38591f992b2
2014-02-06 10:07:19 +00:00
David Christie
2ff96af24d Log history of location requests in LocationManager.
-Assists with debugging power issues.
Bug: 12824233

Change-Id: Iaaef0dbe00154c7668034a166587671b75d1f3c7
2014-02-03 13:53:10 -08:00
Ying Wang
ba09ada20e Include subdirectory Android.mks.
Change-Id: I6e6bc721dbcf127b52f2a60f255c9fc677d3be29
(cherry picked from commit c459bfea7e7be4343387dee137d4a5be9742fd91)
2014-01-09 20:41:57 +00:00
Ying Wang
c459bfea7e Include subdirectory Android.mks.
Change-Id: I6e6bc721dbcf127b52f2a60f255c9fc677d3be29
2014-01-09 11:02:03 -08:00
Lorenzo Colitti
4598ea4e5e am 263c4788: am 30253d7a: am 2daa0c93: Merge "Add address flags and scope to LinkAddress."
* commit '263c4788dcf45f104f8668fd6621d1a7c39689b9':
  Add address flags and scope to LinkAddress.
2013-12-09 18:34:44 +00:00
Lorenzo Colitti
64483947fd Add address flags and scope to LinkAddress.
This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
   Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
   Since most callers don't know about flags and scope, provide
   constructors that default the flags to zero and determine the
   scope from the address. Addresses notified by the kernel will
   have these properly set. Make multicast addresses invalid.
   Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
   address and prefix information between two LinkAddress
   objects. This is necessary because an interface can't have
   two addresses with the same address/prefix but different
   flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
   to identify existing addresses to add/remove using
   isSameAddressAs instead of implicit equals(). Specifically:
   - If addLinkAddress is called with an address that is already
     present, the existing address's flags and scope are updated.
     This allows, for example, an address on an interface to go
     from preferred to deprecated when it expires, without it
     having to be removed and re-added.
   - If removeLinkAddress is called with an address that is
     present but with different flags, it deletes that address
     instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
   notification methods to take just a LinkAddress instead of
   LinkAddress, flags, and scope. While I'm at it, change the
   order of the arguments for consistency with the other
   functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
2013-12-06 13:54:35 +09:00
Lorenzo Colitti
317d15c155 am 4806fdfb: am f226bc60: Merge "Use LinkAddress in address notifications."
* commit '4806fdfbd0fecf91584396fc0f620c97a05ab837':
  Use LinkAddress in address notifications.
2013-12-02 20:53:06 +00:00
Lorenzo Colitti
5ad421a3d0 Use LinkAddress in address notifications.
Currently address{Updated,Removed} pass in the address as a
string such as "fe80::1/64". Use LinkAddresses instead, since
that's what it is.

This makes the code more robust in the unlikely case that netd
passes in an invalid string. In the future we can move flags and
scope into the LinkAddress itself and simplify the code further.

Bug: 9180552
Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
2013-11-26 21:55:15 +09:00
Lorenzo Colitti
5ae4a531cc Pass DNS server info notifications to observers.
These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

[Cherry-pick of 416740ad4d9132005a71dc0883334e852235a18a]

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
2013-11-25 17:27:17 +09:00
Lorenzo Colitti
a9626c1c95 Minor cleanups to NetdCallbackReceiver.onEvent.
- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

[Cherry-pick of 59be800e7fe81842aa8c77b91319f58ab165983d]

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
2013-11-25 17:25:45 +09:00
Lorenzo Colitti
416740ad4d Pass DNS server info notifications to observers.
These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
2013-11-18 12:04:14 +09:00
Lorenzo Colitti
59be800e7f Minor cleanups to NetdCallbackReceiver.onEvent.
- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
2013-11-04 18:30:20 +09:00
Matthew Williams
d08d6686c5 resolved conflicts for merge of 94b51810 to master
Change-Id: Ida818f066b66c356a84c80e5eab0a4e2cf4ebd49
2013-10-14 10:39:41 -07:00
Matthew Williams
94b518101c am e0a2bdaf: am 32551ae5: Merge "Fix infinite boot-loop bug in SM." into klp-dev
* commit 'e0a2bdaf61a7a72e92d614f81f86e7fd441b38e4':
  Fix infinite boot-loop bug in SM.
2013-10-11 14:33:18 -07:00
Matthew Williams
632515b9d0 Fix infinite boot-loop bug in SM.
Bug:11064918
If the ContentResolver sync API is used with the empty ("")
string as a provider, the ContentService will throw an RTE.
This cl addresses all the entry points of the API that could
allow this, as well as adds an ifEmpty check at the point of
failure.
Also removed RTE throws from public functions(no point in
crashing the phone).

Change-Id: I57427d12a6cafb3e6d7a32ca0c10b05315b20580
2013-10-11 13:18:22 -07:00
Alex Klyubin
87e385effb am aa947f15: am a9bce468: am 84742149: Merge "Make EntropyMixer mix in output of Hardware RNG into Linux RNG."
* commit 'aa947f15314a4239de91a1cd0bea085e3399d43e':
  Make EntropyMixer mix in output of Hardware RNG into Linux RNG.
2013-10-03 15:23:23 -07:00
Alex Klyubin
aa947f1531 am a9bce468: am 84742149: Merge "Make EntropyMixer mix in output of Hardware RNG into Linux RNG."
* commit 'a9bce46876d6f1f82727ab6922748fcc6b43c767':
  Make EntropyMixer mix in output of Hardware RNG into Linux RNG.
2013-10-03 15:21:08 -07:00
Alex Klyubin
6ab3d20d3c Make EntropyMixer mix in output of Hardware RNG into Linux RNG.
On devices with Hardware RNG (HW RNG), this makes EntropyMixer
periodically (every three hours) read 512 bytes from HW RNG and mix
them into the Linux RNG.

This is done without increasing Linux RNG's entropy estimates to
avoid having to trust the quality of the HW RNG. This approach cannot
reduce the quality of the Linux RNG output, but may increase it.

Change-Id: Ifde851004301ffd41b2189151a64a0c5989c630f
2013-10-03 15:07:37 -07:00
Matthew Williams
06485a7c6e Pending op fix didn't merge properly from KLP-dev.
Manually merge in Cl c/342668. Add another test to ensure that it
WAI.

Change-Id: Iae603328d525cc71e4e31ad30a13384efc50f823
2013-09-16 15:23:41 -07:00
Matthew Williams
86f4b37d19 Merge "Refactor SyncManager rename authority->target" 2013-09-16 18:29:36 +00:00
Matthew Williams
8ef2204c8f Refactor SyncManager rename authority->target
fix bug that was stopping any sync service sync from
from taking place.
Change-Id: Ib3f46d43be630d4196fbf0ca32da03b6e7a6a5b9
2013-09-13 19:22:50 -07:00
Jeff Sharkey
123eeea6d6 am e2d76fa8: am cecccecc: Merge changes Ib1274847,I2eb2a1bf into klp-dev
* commit 'e2d76fa8c6d0f5c3d1a73a3ec9756c4bc545806d':
  Fix SDK build.
  Request all tethering interfaces, fix corruption.
2013-09-11 17:23:29 -07:00
Jeff Sharkey
e4984bea95 Request all tethering interfaces, fix corruption.
netd now tracks statistics for tethered interfaces across tethering
sessions, so switch to asking for all tethering stats.  (Currently
we're double-counting all tethering data, ever since it started
tracking across sessions.)

Also catch OOME to handle corrupt stats files, which we then dump to
DropBox and then start over.

Bug: 5868832, 9796109
Change-Id: I2eb2a1bf01b993dd198597d770fe0e022466c6b9
2013-09-10 21:03:30 -07:00
Matthew Williams
56dbf8f236 Fix broken javadocs
Change-Id: Ibf7f2ed92919efd36fffa963447b1a443c0bb9db
2013-09-05 15:58:24 -07:00
Lorenzo Colitti
7421a01f18 Add a simple test for NetworkManagementService.
For now, this only tests network observers. It works by starting
NetworkManagementService with a fake netd socket, feeding it
inputs, and seeing if the appropriate observer methods are
called.

Bug: 10232006
Change-Id: I827681575642a4ee13ae48b81272521544b676bd
2013-08-23 18:30:19 +09:00
Matthew Williams
ba35271e91 Use pending.xml to persist sync ops.
Support pending ops by producing badly formed xml.
fixed bug that stopped alarm manager from updating if the
next alarm time is in the past.
Use new AlarmManager API for old AM behaviour - to set
exact alarms.

Change-Id: I57090f9c7155996298be7ec968a88f17ac1938a7
2013-08-16 12:01:22 -07:00
David Christie
ba530545f7 Revert "Fix broken unit test"
This reverts commit 0ca981fe42c43a4b7c345f4a0a2b3b2a519be5da.

Change-Id: I67f5e7227a8a874158c4f0954e62a77a317f1edd
2013-08-06 17:28:03 +00:00