756 Commits

Author SHA1 Message Date
Dianne Hackborn
4870e9d5eb More work on device idle mode and other power stuff.
Add idle mode support to the alarm manager.  Introduce
a new concept of flags associated with alarms to tell
the alarm manager how to treat the alarm -- they allow
everything from the alarm that will bring us out of idle
mode, to alarms that are allowed when idle or should
also bring us out of idle.  The standalone boolean is
now also a flag.

(Note there is currently no protection from user space
setting the flags however it wants; I will be working
on that in a follow-up change.)

When in idle mode, the alarm manager pushes all alarms
that shouldn't execute during that time over to a
separate list that is not executed until out of idle.
To help with this, I reworked a bit how Alarm objects
are managed, so that when rebatching or moving between
lists we don't have to allocated new objects but can
just use the same existing instance.

Also tweaked the sync manager to deal with idle mode,
which currently just means doing the same thing as when
low on storage -- turning off sync.

Add new ACTION_CHARGING and ACTION_DISCHARGING broadcasts
that apps can listen for to know when the device is actively
charging and discharging.  These are better than the old
POWER_CONNECTED and POWER_DISCONNECTED ones because we only
report charging when we actually see that there is enough
power being provided to charge the battery (and will report
discharging if there is not enough power).

The job controller uses these new actions for scheduling
jobs that want to run while plugged in.  Removed the
"stable charging" stuff while doing so, since the new
charging state serves as an even better signal for that.

Introduced two new process states: FOREGROUND_SERVICE and
TOP_SLEEPING.  This will allow us to treat foreground services
specially (such as still allowing network access to them for
background music playback) while not mixing them together with
whatever happens to be the top activity while the device is
asleep.

Also some other small cleanup here and there.

Change-Id: I7a9808b578bad6f50deb8e1baf919298512a0d3a
2015-04-09 14:05:17 -07:00
Jorim Jaggi
25e12abc5b Add ability to start voice interaction session directly
Add internal API's for SystemUI to start a voice interaction session
directly, without using an intent.

Make the assist gesture use that ability, if available.

Change-Id: I88ce3c7514714eb45666884847193585a07417a9
2015-04-03 11:11:51 -07:00
Santos Cordon
885b3ef519 Merge "New generic intent for SIM Activation" 2015-04-01 22:38:26 +00:00
Santos Cordon
15a13781ad New generic intent for SIM Activation
New hidden intents and permissions for a generic SIM-activation
activity.  New activity will handle generic SIM setup requests and then
delegate to the appropriate activation method (OTASP, HFA,
CARRIER_SETUP).

Change-Id: I1b22200544abefe486ec961b67a6e77b4d15aec3
2015-04-01 15:35:55 -07:00
Ruben Brunk
095d999045 Merge "Add CameraService to system server." 2015-03-31 22:27:53 +00:00
Ruben Brunk
9d21ee5d77 Add CameraService to system server.
- Adds a camera service to system server that forwards events to the
  mediaserver camera service.
- Notify the camera service when the device user changes.

Bug: 19186859
Change-Id: I172a2ce46c8e8a131ae7e8dd99d60c5f4f0d6668
2015-03-31 12:01:22 -07:00
Neil Fuller
cea283535c resolved conflicts for merge of 962a11ad to master
Change-Id: I8c6ac62d7267629c019997bb343d863aa56264eb
2015-03-31 11:15:39 +01:00
Neil Fuller
efd9290789 am 25c5296b: Merge "An updater for all timezone data on a device"
* commit '25c5296b0d85979ad216195000b857dce8127ab1':
  An updater for all timezone data on a device
2015-03-31 09:31:48 +00:00
Fabrice Di Meglio
1c1b47125d Add IntentFilter auto verification
The purpose of this feature is to prompt the Disambiguation dialog
to Users as less as possible.

- add the new "autoVerify" property to the IntentFilter class
- add new APIs to PackageManager:
 verifyIntentFilter(int, int, List<String>),
 getIntentVerificationStatus(String, int),
 updateIntentVerificationStatus(String, int, int),
 getIntentFilterVerifications(String)
for supporting IntentFilter verification
- add support for multi-user
- update PackageManager for IntentFilter verification:
basically when we are installing a new package, ask for verification
of all domains from the IntentFilters that have the "autoVerify" to true.
This means that the PackageManager will send a well defined protected
broadcast (with a new INTENT_FILTER_NEEDS_VERIFICATION action) to
an IntentFilter verifier to do the real job of verification.
We are passing in the broadcast Intent all the necessary data for
doing the verification. The PackageManager will receive as response
the result code of the domain verifications and, if needed, the list
of domains that have failed the verification.
- add a new INTENT_FILTER_VERIFICATION_AGENT permission that needs to
be set by an intent filter verifier to be considered as a trustable
party by the PackageManager.
- add also a new BIND_INTENT_FILTER_VERIFIER permission for securing
the binding between the PackageManager and a service doing the
intent filter verifications.
- add ResolveInfo filterNeedsVerification which is a boolean
to knows if the IntentFilter is of a type that needs a verification
(action VIEW, category BROWABLE, HTTP/HTTPS data URI)
- add new "domain-preferred-apps" / "d" dump command for listing the
prefered Apps for all domains
- add new "intent-filter-verifiers" / "ivf" command for listing the
IntentFilterVerifier used
- introduce the IntentVerificationService which is a basic service
for verifying IntentFilters. This service will send HTTPS requests
to the domain declared in the IntentFilter(s) for doing the
verification. This service has a low priority level so that it
can be replaced by a more sophisticated one if needed. This service
is updating the PackageManager intent verification states thru
the updateIntentVerificationStatus(...) API.
- update MockPackageManager

Change-Id: I0bfed193d0bf1f7c7ac79f6c1b160b7ab93b5fb5
2015-03-30 10:58:35 -07:00
Neil Fuller
5a680f2e27 An updater for all timezone data on a device
The existing one, being deleted here, did not work properly: it only
updated the file used by libcore and bionic, it did not update the ICU
data.

Most of the installation logic exists in code in libcore/tzdata that is
independent of the server code so that it can be tested.

Bug: 19941636
Change-Id: Id0985f8c5be2f12858ee8bf52acf52bdb2df8741
2015-03-26 15:16:32 +00:00
Bryce Lee
a223d65830 am 3309be5e: am 21b7e6de: am c831b978: Merge "Add isScreenBrightnessBoosted and a broadcast when underlying value changes." into lmp-mr1-modular-dev
* commit '3309be5e7bc782d89adaf4abca5f1f81649c655f':
  Add isScreenBrightnessBoosted and a broadcast when underlying value changes.
2015-03-25 16:52:30 +00:00
Zoltan Szatmary-Ban
9c5dfa5c79 Data Usage public API
Added new API consisting of android.app.usage.NetworkUsageManager and
android.app.usage.NetworkUsageStats. Through them data usage on a
network interface can be programmatically queried. Both summary and
details are available.

Bug: 19208876
Change-Id: I0e0c4b37ae23ad1e589d4b0c955b93f28ba4333e
2015-03-25 15:53:38 +00:00
Bryce Lee
84d6c0fbf6 Add isScreenBrightnessBoosted and a broadcast when underlying
value changes.

Bug: 18334219
Change-Id: I20051e97633017711574a063b8061f95c3b616c5
2015-03-17 10:43:08 -07:00
Christopher Tate
6597e3435f Notification listener backup & restore
We now back up & restore the set of enabled notification listeners.  Post-
restore, a listener that had been enabled on the ancestral device will be
enabled on the current device as soon as it's installed, matching the
user's previous configuration.  After this has happened the enable/disable
state for that app is not "sticky"; disabling it again will work as
expected.

The infrastructure for accomplishing this is general: it can be leveraged
by any ManagedServices derivative.  There's a bit of extra wiring in the
settings provider to support the restore-time information flow as well.
This is because ManagedServices -- like many other parts of the system --
monitors writes to the settings provider and does work in response to new
writes of the elements that it cares about.  Unfortunately this means that
there is no way to use the BackupAgent's restoreFinished() hook to post-
process the restored data: by the time it is run, the ManagedService's
observers have already executed and culled any unknown components from
the description that was just pushed into settings.

As of this patch, the settings provider's restore logic knows that a
particular settings element will require a message to interested observers
about the restore-driven change.  The message is delivered as a broadcast,
and is sent after the new value has been committed to the settings db.
Adding other system ManagedService handling that parallels this will only
require adding a new corresponding entry to the table of individual settings
for which the relevant "this settings element is being restored" broadcast
is sent, found in SettingsHelper.

(It isn't sent for all settings elements because very few settings elements
have semantics that require it; 3rd party code won't be running yet during
platform restore anyway; and sending up to hundreds of broadcasts during
setup & restore is far from ideal.)

Bug 19254153

Change-Id: Ib8268c6cb273862a3ee089d2764f3bff4a299103
2015-03-16 16:24:28 -07:00
Dianne Hackborn
b9a5e4ad30 Add new debug feature to automatically create heap dumps.
Not yet working, unless you turn off SELinux enforcing.
We need to update SElinux to allow the system process
to give apps access to /data/system/heapdump/javaheap.bin.

Currently watching can only be enabled through the shell,
such as:

adb shell am set-watch-heap com.android.systemui 1024

The last number is the process pss size in bytes, so this is
asking us to warn if it goes about 1K which will be all the
time.

Change-Id: I2089e5db2927afca0bf01a363c6247ee5dcb26e8
2015-03-06 16:42:03 -08:00
Adam Powell
e30c9af356 Add ChooserTargetService API
A ChooserTargetService can be implemented by apps that wish to offer
additional deep-link targets for the system intent chooser to in turn
offer to the user. This allows apps to create contextually relevant
shortcuts for UI flows that would otherwise require several steps of
explicit disambiguation. For example, a chat app might offer one-touch
access to recent conversations when sharing a photo to it from
elsewhere.

The chooser implementation must limit the number of
ChooserTargetServices it elects to query in order to respect available
system resources. Only the system chooser is permitted to bind to a
ChooserTargetService.

Change-Id: Ia7e075ee649c51cf2035f20aee166c5a27d91aeb
2015-03-04 14:23:30 -08:00
Christopher Tate
73570db59f Use scheduled job rather than periodic alarms for key/value backups
Instead of a runs-forever periodic alarm that drives key/value backup
passes, we instead schedule-on-demand a trigger job that will kick off
the pass after a batching interval.  The key semantic change is that
we now never wake for key/value backup work unless we've been explicitly
asked to do so.  We also use a rather longer batching interval than
was previously the case.

Bug 19536032

Change-Id: Ie377562b2812c9aeda0ee73770dfa94af6017778
2015-03-02 18:01:28 -08:00
Jim Miller
ba67aee02c Add fingerprint settings support to the framework
- cleanup thread issue and simplify native FingerprintService methods
- add new permissions and enforce them
- add fingerprint hardware detection API

Change-Id: I87c2243ea2412061f1e85b044138480d0161bcdf
2015-02-27 12:03:32 -08:00
Filip Gruszczynski
cfb3185a27 am 0fbcc708: am 1e74b5d6: Merge "Burn in protection." into lmp-mr1-modular-dev
* commit '0fbcc7086fe742e641915ed5f097119d01613cb5':
  Burn in protection.
2015-02-25 21:47:12 +00:00
Filip Gruszczynski
d2e8640c2c Burn in protection.
Bug: 19373758
Change-Id: I7242f73acadd21bdee03262b4205c8af0734fccb
2015-02-25 12:22:49 -08:00
Mike Lockwood
98a0b38819 AndroidManifest.xml: Remove two obsolete protected broadcasts
android.media.action.USB_AUDIO_ACCESSORY_PLUG and android.media.action.USB_AUDIO_DEVICE_PLUG
were removed in a previous change.

Change-Id: I22d09b9a0eb4f6f29a31a50ed8bfa7e09c52b064
2015-01-27 15:07:29 -08:00
Dianne Hackborn
5f86b66c9b am 24bc8d76: am 29807195: Merge "Fix issue #18901214: APR: Frequent crash in android" into lmp-mr1-dev
automerge: d17218e

* commit 'd17218e7df24da8a2bcf6e7714dc0151155c3286':
  Fix issue #18901214: APR: Frequent crash in android
2015-01-05 23:16:42 +00:00
Dianne Hackborn
b182955a1e Fix issue #18901214: APR: Frequent crash in android
The ShutdownActivity was implemented in the system server
code, which is no longer part of the boot class path.  This would
work fine when requesting a shutdown from the primary user, since
in that case the activity would be loaded in to the main system
process which also has the system service code loaded.

However, when executed from a secondary user, we need to spin up
a new system process for it; that system process is just a regular
app process, without the system service code, so *boom*.

To fix this, move ShutdownActivity to the framework jar.

Change-Id: Icb831cd6ed619da5feede5605c45ef177a892fbc
2015-01-05 14:40:24 -08:00
Jing Zhao
a0973778ca am 8d50d0fb: am 23ad6efb: am df1d07b4: Add checking to find AppDirectedSmsProxy for App Directed SMS feature
* commit '8d50d0fb27c1958dbd047bb8a46d7183d873f131':
  Add checking to find AppDirectedSmsProxy for App Directed SMS feature
2014-12-09 00:19:03 +00:00
Cheuksan Wang
8b3f47b35a am 673f443f: am 695b5d25: am 0752da22: Merge "add system|signature protection to android.permission.BIND_CARRIER_MESSAGING_SERVICE" into lmp-mr1-dev
* commit '673f443f7e92956399c322b31a14178436fa723b':
  add system|signature protection to android.permission.BIND_CARRIER_MESSAGING_SERVICE
2014-12-09 00:18:12 +00:00
Jing Zhao
df1d07b4c7 Add checking to find AppDirectedSmsProxy for App Directed SMS feature
Adding new system permission android.permission.CARRIER_FILTER_SMS

Bug: 18609762
Change-Id: I80a133653101cd4ec1793e726faf3601e2970224
2014-12-05 20:42:33 +00:00
Cheuksan Wang
981344861c add system|signature protection to
android.permission.BIND_CARRIER_MESSAGING_SERVICE

Bug: 18005911
Change-Id: Iacb16a20c5cef4a55be0187af0a47e0cb82b409b
2014-12-05 19:04:55 +00:00
Cheuksan Wang
412766a7d6 am 29ac679f: am dba26aa2: am 109ec376: Merge "new SMS/MMS carrier app API" into lmp-mr1-dev
* commit '29ac679f9f85a68eca03c262e740d62f8af66797':
  new SMS/MMS carrier app API
2014-12-04 21:55:19 +00:00
Cheuksan Wang
109ec376da Merge "new SMS/MMS carrier app API" into lmp-mr1-dev 2014-12-04 00:19:06 +00:00
Mike Lockwood
008dfadb31 Remove obsolete AudioManager audio dock plugged Intents
We have no code that listens for AudioManager.ACTION_ANALOG_AUDIO_DOCK_PLUG
and AudioManager.ACTION_DIGITAL_AUDIO_DOCK_PLUG

Change-Id: I96a746c84e5a4b17df1b9fbdbb5de77e6bc39714
2014-12-02 12:23:04 -08:00
Cheuksan Wang
b72eb97e4b new SMS/MMS carrier app API
Changes based on api council review

BUG: 18005911
Change-Id: I23bd207ce70f7fa201d6d964c1700cfc44cb009b
2014-12-01 18:11:07 -08:00
Andres Morales
8f70a2558b am ffc71028: am 83f4847f: am 59093d92: Merge "Define permission for system apps to query size of block" into lmp-mr1-dev
* commit 'ffc710281c38aba9546d200a25d6b19b0f85470a':
  Define permission for system apps to query size of block
2014-11-25 18:51:42 +00:00
Andres Morales
6b0c7acd7f Define permission for system apps to query size of block
Allows ManagedProvisioning to determine whether there's a
challenge and thus whether to disable NFC provisioning.

Other implementation option: new hidden boolean API method.
Can't think of benefit of new API method "isBlockInUse", other
than doesn't leak PDB size and is more explicitly tied to the
use case. Open to either impl if anyone has opinions on the matter.

Bug: 18508767
Change-Id: I28d2eb5a0837ff85cb91f140b17ce1dd843fe9d6
2014-11-25 15:55:28 +00:00
Jeff Davidson
c79924f741 am b431a198: am e6bc5adf: am e0cb56b0: Merge "Enforce VPN control "permission" with an actual permission." into lmp-mr1-dev
* commit 'b431a198ec255be7efb30b4c81a779a4eb5009f6':
  Enforce VPN control "permission" with an actual permission.
2014-11-18 02:30:54 +00:00
Jeff Davidson
e0cb56b02e Merge "Enforce VPN control "permission" with an actual permission." into lmp-mr1-dev 2014-11-17 21:02:10 +00:00
Abhijith Shastry
e3435feed4 am 0f064207: am 530f25d6: am fb8db1c8: Merge "new sms/mms carrier app API" into lmp-mr1-dev
* commit '0f0642075e42f415d7f5244c5d94fe726756afa0':
  new sms/mms carrier app API
2014-11-14 19:16:33 +00:00
Abhijith Shastry
fb8db1c84b Merge "new sms/mms carrier app API" into lmp-mr1-dev 2014-11-13 22:15:46 +00:00
Cheuksan Wang
f9c50c45c6 new sms/mms carrier app API
BUG: 18005911

Change-Id: Ib961badc1ccac270f1244f8d971d9abec324b73f
2014-11-12 15:29:41 -08:00
Jeff Davidson
bc19c181c8 Enforce VPN control "permission" with an actual permission.
The current implementation uses a whitelist of package names. Use a
system|signature permission instead of rolling our own security and
add that permission to the existing set of whitelisted packages
(SystemUI and VpnDialogs).

In addition to being less of a security risk (using well-known methods
like Context.enforceCallingPermission rather than manually querying
PackageManager and checking UIDs for package names), this enables
other system-privileged apps to control VPN as needed per the below
bug.

Bug: 18327583
Change-Id: I38617965c40d62cf1ac28e3cb382c0877fb1275d
2014-11-12 08:56:20 -08:00
Alan Viverette
3b54b6d78c am cf7f3b6b: am a9b503ae: Merge "Fix Material styling in remaining dialogs and layouts" into lmp-mr1-dev automerge: 0aaebd4
* commit 'cf7f3b6be252f313536e58cc62763075d4f45e5a':
  Fix Material styling in remaining dialogs and layouts
2014-11-11 18:39:44 +00:00
Alan Viverette
f89b58ca83 Fix Material styling in remaining dialogs and layouts
Also updates existing row and dialog layouts to use preferred list item
or dialog padding as appropriate, fixes incorrect activity themes, and
updates ChooseAccountActivity variants for Material.

BUG: 18314215
BUG: 18292562
Change-Id: I2fde4ba6db80d839104abdaa334a46ad1861600f
2014-11-10 16:14:27 -08:00
Evan Charlton
12fc80b2b2 am 13cf9cf1: am 3caf6fc7: Merge "Apply @hide / @SystemApi to android.telecom.*" into lmp-mr1-dev automerge: e2e649f
* commit '13cf9cf1d3f426d82a2af46c36bdf308ff43d428':
  Apply @hide / @SystemApi to android.telecom.*
2014-11-10 22:42:46 +00:00
Evan Charlton
0e094d926c Apply @hide / @SystemApi to android.telecom.*
Move the android.telecom.* namespace back to @hide, and also mark it
with @SystemApi so that system-privileged apps can use them.

Bug: 18302450
Change-Id: I33ae1b9b0dfdb1c5eff51ca3c829196bcfc9411c
2014-11-10 11:52:31 -08:00
Jeff Davidson
3527aa01cd am fb68a976: am dd40ccf3: am b42bdef5: Merge "Rename BROADCAST_SCORE_NETWORKS to BROADCAST_NETWORK_PRIVILEGED." into lmp-mr1-dev
* commit 'fb68a9762087a262146eec5d0e0d3fbdbdf25b6b':
  Rename BROADCAST_SCORE_NETWORKS to BROADCAST_NETWORK_PRIVILEGED.
2014-11-05 21:48:16 +00:00
Jeff Davidson
b42bdef51c Merge "Rename BROADCAST_SCORE_NETWORKS to BROADCAST_NETWORK_PRIVILEGED." into lmp-mr1-dev 2014-11-05 21:33:16 +00:00
Jeff Davidson
161977998f Rename BROADCAST_SCORE_NETWORKS to BROADCAST_NETWORK_PRIVILEGED.
This is necessary/desired for two reasons:

1. UX around network scoring shipped with L despite lacking underlying
platform support. We do not want network scoring applications to
trigger this UX on L devices, and therefore we must break the contract
of what defines a network scorer so that apps build against the new
contract don't trigger the old UX.

2. As a start towards generalizing the term "score" for a potentially
broader role in the future, though that role is very much undefined.

Bug: 18160480
Change-Id: If228977513e32e45bc44dbeda24aa18436fdfca6
2014-11-04 10:55:49 -08:00
Santos Cordon
71a4f2129f am 082f4978: am 04f3eebe: am 27be7b35: Merge "Split Telecom PhoneAccount registration permissions." into lmp-mr1-dev
* commit '082f49786ec25b254992781a5ad3c67e75ceb8ee':
  Split Telecom PhoneAccount registration permissions.
2014-11-03 08:09:40 +00:00
Santos Cordon
2ef87ee728 Split Telecom PhoneAccount registration permissions.
Bug: 18106506
Change-Id: Ic825b44c2dc42709073a3990f6a7ca8e372025e9
2014-10-31 14:44:30 -07:00
Evan Charlton
b2dda69031 am 4d4b2cfd: am 2ad5eb53: Merge "Move telecom permission to the public API" into lmp-mr1-dev automerge: 8e25057
* commit '4d4b2cfd4c611800787b71d0896c6d8781875732':
  Move telecom permission to the public API
2014-10-28 07:16:08 +00:00
Evan Charlton
cef5a5404a Move telecom permission to the public API
Make REGISTER_PROVIDER_OR_SUBSCRIPTION and REGISTER_CONNECTION_MANAGER
part of the public API so that they can be used by third-party apps.

Bug: 18114695
Change-Id: I1b8578cbc82e95ea78b4a2166f4a23650a0c375f
2014-10-24 15:40:35 -07:00