13908 Commits

Author SHA1 Message Date
Yohei Yukawa
a6a152e7de Switch to SystemService lifecycle in TSMS.
Like we did this for InputMethodManagerService [1],
TextServicesManagerService (TSMS) needs to be recognized by
SystemServiceManager with SystemService lifecycle mechanism so that we
can receive SystemService#onUnlockUser() event, which is necessary to
make TSMS encryption-aware.

As a preparation, with this CL we only does mechcanical migration to
SystemService lifecycle mechanism in TSMS.  Hence no user-visible
behavior change should occur.

  [1]: Ic17667df60b30e5355b61a3601ad27a000cab3a3
       1e33dc8fdf3f722ecd32cc586b2a9515de24a242

Bug: 27456430
Change-Id: Ib3cc799d384f259b4fa3f5295f2da198df015eb8
2016-03-07 13:41:15 -08:00
Andreas Gampe
abcbe2f62e Frameworks/base: OtaDexopt needs to move artifacts on boot
Make OtaDexoptService a bootstrap service. It needs to start
immediately after the PackageManagerService so that it can move
A/B artifacts into their new place.

Add a method to Installer for the move.

Bug: 25612095
Change-Id: Idcf759b3c947088b416d54d2fa269ef27daf93ab
2016-03-03 13:15:59 -08:00
Fyodor Kupolov
e3f400de60 Merge "Added dump method to NetworkTimeUpdateService" into nyc-dev 2016-03-02 18:18:37 +00:00
Fyodor Kupolov
32af07acec Added dump method to NetworkTimeUpdateService
Bug: 23983739
Change-Id: I98f175f438793f6478d5995d88ae127a5a6c1bda
2016-02-26 16:54:25 -08:00
Gustav Sennton
c7db48b0ca Don't run WebView-preparation during an encryption boot phase.
When a device is booting up in an encrypted state WebView won't find the
packages needed for loading WebView and might thus try to use incorrect
webview packages. This in itself might cause us to incorrectly change
the webview provider setting but also causes us to crash the system
server if we try to enabled/disable a package that cannot be seen by the
package manager.

Bug: 27353062
Change-Id: I9349778506e8bec1c56b9b786fe4ed15c7c3260d
2016-02-25 13:49:26 +00:00
Lorenzo Colitti
1142b2654a resolve merge conflicts of 51e4acb29d to nyc-dev
Also add the appropriate changes to api/test-current.txt, which
is not present on mm-wireless-dev from which this change came.

Change-Id: Ic4df6d0f89add73b7e5252ef662de07a4e8fce31
2016-02-24 15:19:15 +09:00
Pavel Zhamaitsiak
02b3e6bfc5 Add Connectivity Metrics Logger service
This service can be used to pass events to metrics collection service

Change-Id: I213874300693cd121f2c8676f70893315de4c4c0
2016-02-23 17:32:53 +09:00
Tao Bao
9de7952aa9 Merge "Add support for update-on-boot feature." into nyc-dev 2016-02-22 19:24:25 +00:00
Polina Bondarenko
280c5b2155 Merge "Added hardwareproperties SystemService" into nyc-dev 2016-02-22 09:27:21 +00:00
Tao Bao
e8a403d57c Add support for update-on-boot feature.
Add a separate system service RecoverySystemService to handle recovery
related requests (calling uncrypt to de-encrypt the OTA package on the
/data partition, setting up bootloader control block (aka BCB) and etc).

We used to trigger uncrypt in ShutdownThread before rebooting into
recovery. Now we expose new SystemApi (RecoverySystem.processPackage())
to allow the caller (e.g. GmsCore) to call that upfront before
initiating a reboot. This will reduce the reboot time and get rid of the
progress bar ("processing update package"). However, we need to reserve
the functionality in ShutdownThread to optionally call uncrypt if
finding that's still needed.

In order to support the update-on-boot feature, we also add new
SystemApis scheduleUpdateOnBoot() and cancelScheduledUpdate() into
android.os.RecoverySystem. They allow the caller (e.g. GmsCore) to
schedule / cancel an update by setting up the BCB, which will be read by
the bootloader and the recovery image. With the new SystemApis, an
update package can be processed (uncrypt'd) in the background and
scheduled to be installed at the next boot.

Bug: 26830925
Change-Id: Ic606fcf5b31c54ce54f0ab12c1768fef0fa64560
2016-02-19 11:31:45 -08:00
Polina Bondarenko
f8754ac212 Added hardwareproperties SystemService
Add HardwarePropertiesManagerService which call native methods to
get CPU, GPU, battery temperatures, CPU usage info, fan speeds.
Restrict hardware properties retrieval only for device and profile
owners.

Bug: 26945055
Change-Id: I4d6b30b78e575532d5e9cfa59ef6cd81355439d4
2016-02-19 18:24:29 +01:00
Antonio Cansado
cd42acd951 Implementation of data usage callbacks.
NetworkStatsService will register data usage requests
and keep data usage stats scoped to the request.

There are different types of data usage requests
- scoped to a set of NetworkTemplate; these are restrictred to
device owners and carrier apps and allow the caller to monitor
all activity on the specified interfaces.
- scoped to all uids visible to the user, if the user has
android.Manifest.permission#PACKAGE_USAGE_STATS permission.
The set of uids may change over time, so we keep track of that.
- scoped to a set of uids given by the caller, granted that
the caller has access to those uids.
- scoped to the caller's own data usage. This doesn't require
PACKAGE_USAGE_STATS.

Bug: 25812785
Change-Id: Ie11f35fc1f29d0dbe82f7fc924b169bb55c76708
2016-02-17 18:43:53 -08:00
Wei Liu
f0a9d699fe Merge "DO NOT MERGE ANYWHERE Start the FingnerprintService only if it has FEATURE_FINGERPRINT." 2016-02-04 23:42:49 +00:00
Wei Liu
9086b10d6b DO NOT MERGE ANYWHERE Put the start of RttService behind a flag.
We can set config.disable_rtt in the init script to disable the
RttService.

b/26877020

Change-Id: Ifb7fedc4764329dc09cae41f06bf6d5fc7426e5f
(cherry picked from commit c47749f9908b5d98397379fb3bf80d330f9c8283)
2016-02-04 18:24:34 +00:00
Wei Liu
eac5a80775 DO NOT MERGE ANYWHERE Start the FingnerprintService only if it has FEATURE_FINGERPRINT.
b/26877020

Change-Id: Idfef31edb7e67ae60c1b2205df326ed1c5657618
(cherry picked from commit aae35640cd4e08186c01875e8d14962258e3d365)
2016-02-04 18:06:38 +00:00
Andreas Gampe
a89087542f Frameworks/base: Add A/B OTA preopting
Add an OTA Dexopt service. Refactor package manager service and
package dex optimizer to reuse some code. Add knowledge about
OTA flag to installer.

Bug: 25612095
Change-Id: I7dd6bb468fea44b9d3acf0ac7d7404fb02d0f30a
2016-02-01 15:38:21 -08:00
Jim Miller
4f93c58b39 Add account locked notification when users are encrypted
Fixes bug 26407543

Change-Id: Ic66669cd5f75b5fa41449e33133439752cef112b
2016-01-27 20:27:42 -08:00
Peng Xu
a35b5539a9 Dynamic Sensor Discovery Implementation
Defined the dynamic sensor meta data type and UUID of sensor, as well
as the broadcast intent that is related to dynamic sensor status
change.

Modify SensorManager, SystemSensorManager and the JNI layer to support
dynamic sensor discovery.

Added SensorNotificationService to notify apps that sensor connected
or disconnected via broadcast.

Change-Id: I28adfb005357d7e3983d65117d6865830c75027d
2016-01-27 16:37:22 -08:00
Arunesh Mishra
a772e5fc06 SoundTrigger API improvements.
This CL implements the SoundTrigger API improvements as given in b/22860713. Only the java-level
parts are implemented in this CL.

Key changes include:

* Addition of a SoundTriggerManager/SoundTriggerDetector system API to manage
  the sound-trigger based sound models.
* Addition of a SoundTriggerService service that manages all sound models
  including voice (keyphrase) and sound-trigger based models.
* Includes logic to write sound-trigger based models to the database.
* VoiceInteractionManager service now uses SoundTriggerService instead of
  SoundTriggerHelper.

Bug: 22860713
Change-Id: I7b5c0ed80702527c4460372efeb5e542d3693a69
2016-01-27 12:49:20 -08:00
Fyodor Kupolov
aae84105d1 Merge "Use SystemService lifecycle API in input method service" 2016-01-22 18:21:15 +00:00
Fyodor Kupolov
1e33dc8fdf Use SystemService lifecycle API in input method service
Change-Id: Ic17667df60b30e5355b61a3601ad27a000cab3a3
2016-01-21 12:06:11 -08:00
David Brazdil
a0e10434c4 Extract APKs on install or OTA
ART will unzip APKs in memory during launch if an OAT file is not
present. To save the time and memory, this patch will invoke dex2oat
with '--compiler-filter=verify-at-runtime' to unzip the APK during
install or after an OTA.

Change-Id: I16583f9450ad60356123a29f7a6a649b2ab9999f
2016-01-21 09:36:12 +00:00
Tao Bao
370f0fedf5 Merge "Stop rebooting into recovery if uncrypt fails." 2016-01-21 00:27:39 +00:00
Tao Bao
4fd6c26410 Stop rebooting into recovery if uncrypt fails.
uncrypt needs to be called when an OTA package sits on /data. If uncrypt
fails or gets skipped (likely due to unexpected runtime restart during
the reboot), we should abort the rebooting. Because otherwise a) it
would fail for sure when reboots into recovery; b) useful logs would be
gone once it reboots.

Bug: 26444951
Change-Id: Ic3bc682b03f003f197e277ed6b6886e85f364754
2016-01-19 14:33:40 -08:00
Calin Juravle
7bdf3cff92 Merge "Enable profile guided compilation on the framework side" 2016-01-19 19:51:51 +00:00
Calin Juravle
db4a79a5d7 Enable profile guided compilation on the framework side
The background compilation service will trigger a profile based
compilation instead of a full one. If no profile information is
available the compilation is skipped (see installd).

Note that the end decision whether or not to compile a package is taken
by dext2oat. We can't make the decision here because this service runs
under system server which cannot read app's profile data.

Bug: 26080105
Change-Id: I457ea8dea0557839c1f7cdc241770055732b0a4a
2016-01-19 11:44:27 -08:00
Etan Cohen
3da7357951 Merge "NAN: baseline NAN manager for discovery." into mm-wireless-dev
am: e540b64aaf

* commit 'e540b64aaf58460f7930a5e4937cee660215c948':
  NAN: baseline NAN manager for discovery.
2016-01-15 01:29:48 +00:00
Etan Cohen
20d329b08d NAN: baseline NAN manager for discovery.
Initial framework for user API (all @hide for now). Supports:
- NAN configuration
- Publish/Subscribe = Discovery
- Message passing
- Notifications

Bug: 26216681
Change-Id: I72e467756a02f7b80c52fae916b9a47c8174af42
2016-01-14 11:34:07 -08:00
Dongwon Kang
57c54f25d8 MediaResourceMonitorService: Lift the condition for launching
Bug:26548364
Change-Id: If10a8b1c4b2dcdcdab16c9dcc899d37af1224505
2016-01-14 10:11:43 -08:00
Dongwon Kang
ab064b3b36 Merge "Add a way for SystemUI to receive media resource (e.g. A/V codec) usage" 2016-01-13 18:21:00 +00:00
Dongwon Kang
2034a4c4c5 Add a way for SystemUI to receive media resource (e.g. A/V codec) usage
Bug: 26175834
Change-Id: If506a533c5c7b567e770217a9430bf68b539677a
2016-01-12 10:54:34 -08:00
Jeff Sharkey
4175be2f4e Triage SearchManagerService for missing apps.
Searchables aren't available until after the user is unlocked.  We
could scan for them while locked, but we're aiming for a minimalist
environment, and scanning them while locked would require us to send
a changed broadcast on every boot.

Switch to using new SystemService lifecycle for faster event
delivery.  Restore broken global search observer.  Verified that
apps on external storage are handled correctly.

Bug: 26471205
Change-Id: Id99ffe2ea6db37a394454cc7dfa4eab10280ff35
2016-01-09 14:57:47 -07:00
Jeff Sharkey
2f3e35376a More work towards triaging missing app behavior.
Many places across the platform query package details without
gracefully handling packages or components that go missing for
various reasons.  This can cause annoying user data loss, such as
resetting back to built-in apps or dropping of accounts, etc.

This change verifies that system callers have thought about these
edge cases by logging if they use default matching behaviors without
explicitly marking themselves as being "triaged."  (The logging is
currently disabled by default.)

Also creates explicit definitions of supported flags for various
incoming PackageManager calls, and defines a clear distinction
between flag types:

-- GET-style flags are used to request additional data that may have
been elided to save wire space.

-- MATCH-style flags are used to include components or packages that
would have otherwise been omitted from a result set by current system
state.

There are a handful of existing GET flags that better fit under the
MATCH definition, so this change clones them to new constants and
marks the old ones as deprecated.

Fixes bug in JobSchedulerService to consider jobs from apps on
external storage.  Revert some dialer behavior back to being
untriaged.

Change-Id: I9b6ab0968241e3479bddbd78de0c51e3b9917318
2016-01-04 13:19:02 -07:00
Jeff Sharkey
2a9e3f8e68 Better named encryption flags, start triaging.
Create distinct flags for encryption aware, unaware, and both, and
name them like the other MATCH_ flags.

Start adding logic to help triage all system internal callers to
verify that they've done their homework and thought about how to
handle apps while locked.  Call sites in the system should either
ask for explicit matching behavior, or explicitly use the DEFAULT
match flag to indicate that they've been triaged to use the
default state-based matching.

Bug: 26250295
Change-Id: I86214e5c4f71a6dc72f06930800388713aecd107
2015-12-19 15:00:09 -07:00
Ruben Brunk
dd18a0b695 Add a framework service tracking VR mode state.
- Implement a "VR mode" that may be enabled by a focused Activity.
- Add a system service that tracks the current VR mode state and notifies
  other core framework services of mode changes.
- Extend NotificationListenerService to allow the bind/unbind lifecycle
  of specified listeners to be triggered by system events.

Bug: 22855417
Bug: 25479708

Change-Id: I1ac8692bbb5521bb6c7cfb9d2b56b98b720f8568
2015-12-17 10:09:17 -08:00
Alan Viverette
ba398eaafe Remove DayNight themes from public API (again)
Bug: 22628106
Change-Id: Id55c9e626813c70671a93aedf8b1e0cdaed45ec1
2015-12-16 15:28:23 -05:00
Gustav Sennton
6258dcd7ea Add functionality for changing WebView provider.
Make it possible to change WebView provider (through a Developer
setting) and kill all apps using the old provider.
This includes checking the signatures of the WebView providers to make
sure they are valid.

Now that we can change WebView provider through a setting it is possible
to change provider while some provider is being updated. Because of this
we now keep track of which provider should be in use in
WebViewUpdateService to make sure we use the correct provider at all
times.

We now also read WebView package meta data (name, package name, and
signature) from a separate xml file.

Main bug: crbug.com/546185

Bug: 25338573

Change-Id: I660fd1a40a5388f6569a06a7f0d029e8ff65945a
2015-12-11 14:29:44 +00:00
Jack Yu
6714030083 merge from master
Change-Id: Ic03669db3f4595336a7dbc13ffc77d055d11acf9
2015-12-10 12:27:58 -08:00
Nicolas Geoffray
27c0737969 Remove performBootDexOpt and am's ensurePackageDexOpt.
Except common shared libraries and boot image, all compilations
are now done through BackgroundDexOptService.

Change-Id: Ib736e253c38b0c8085bc94e45f4e61a048f66e26
2015-11-11 12:19:08 +00:00
Makoto Onuki
e1aef85ff1 Use the SystemService lifecycle mechanism for AudioService
This will be needed to refactor user restriction handling.

Change-Id: I4b77a020d631714e7f94bce5559190e3b78ec72c
2015-10-15 17:28:35 -07:00
Bryce Lee
535570a7ce am 979a22ea: am 6ad696c3: am f0740e0a: Merge "Add ThermalObserver system service to capture thermal state uevents." into cw-e-dev
* commit '979a22eaf9c62637c02ebd6f92ef6ea2888aa5be':
  Add ThermalObserver system service to capture thermal state uevents.
2015-09-27 15:11:22 +00:00
Bryce Lee
979a22eaf9 am 6ad696c3: am f0740e0a: Merge "Add ThermalObserver system service to capture thermal state uevents." into cw-e-dev
* commit '6ad696c35b80f70f19de304b53bdbfc6f5a265d8':
  Add ThermalObserver system service to capture thermal state uevents.
2015-09-26 06:55:22 +00:00
Bryce Lee
bc58f59da6 Add ThermalObserver system service to capture thermal state uevents.
Bug: 21445745
Change-Id: I980d60b66ca51942a1fd62502d6cf1f09208fc3a
2015-09-25 16:43:01 -07:00
Alex Hills
03f46af3e1 am d04c6d19: resolved conflicts for 693e11e5 to mnc-dr-dev-plus-aosp
* commit 'd04c6d19a589a2a0f60650675438c59ac6900f45':
  Cherry-pick system theme rebase to fix square UI on round watches
2015-09-14 21:24:53 +00:00
Alex Hills
d04c6d19a5 resolved conflicts for 693e11e5 to mnc-dr-dev-plus-aosp
Change-Id: I701841759a80f434a09b086492e817ca23a6a2e6
2015-09-14 17:03:58 -04:00
Alan Viverette
3d2337eeb5 Cherry-pick system theme rebase to fix square UI on round watches
Our system themes were based on configurations that were added post-
init of the system theme.

I96e695441543379e4d5fdf3cc6f18d9e6cf953b4 broke this, because there
was a race condition in the code for rebasing themes

If8fecde76d62738a8e55eddf898eafc468afdba2 (the cherry-picked commit)
fixes the race condition and adds the rebasing back in.

This change cherry picks If8fecde76d62738a8e55eddf898eafc468afdba2.

Bug:23387146
Change-Id: I0725028e48599fc6cd9731ae16c71474dd5827e5
2015-09-14 10:56:02 -04:00
Yasuhiro Matsuda
6d444185e5 resolved conflicts for merge of fcf9ab5a to master
Change-Id: I69ad6e525430c5c4fc3c274b8bf6ebf653716124
2015-09-03 00:12:30 +09:00
Yasuhiro Matsuda
fcf9ab5ab3 am ebf9465d: resolved conflicts for merge of ef57e5e0 to stage-aosp-master
* commit 'ebf9465d213336819b15e3b21d02afce64470d4f':
  Add trace code to system server.
2015-09-02 14:31:26 +00:00
Yasuhiro Matsuda
ebf9465d21 resolved conflicts for merge of ef57e5e0 to stage-aosp-master
Change-Id: I1c31b38936dc74619dea27f0d5eecab43360bb8c
2015-09-02 22:57:53 +09:00
Yasuhiro Matsuda
1ab43d5978 Add trace code to system server.
- Add TRACE_TAG_SYSTEM_SERVER for tracing system server code.
- Add a few more tracing code to the code paths related to boot.

BUG: 21739901
BUG: 22207144
Change-Id: I08b424d2f83783f512c3818394099909cd55f327
2015-08-27 12:22:07 +09:00