768 Commits

Author SHA1 Message Date
Peter Kalauskas
192925e112 Allow light HAL to exit if it's a lazy HAL
Test: Manual
Change-Id: I3dfd0201125f6522ef68784211720d1fbd54941e
2019-01-23 15:29:04 -08:00
Chih-Hung Hsieh
f32ace5d56 Fix/suppress services/core google-explicit-constructor warnings
* Add explicit to conversion constructors/operators

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Id2493c1e248e774042dc67f39ada6bb3a4521d0c
2019-01-02 14:25:32 -08:00
Chenbo Feng
47df5df025 Delete unused import
The hasBpfSupport() check from BpfUtils is not used by the native helper
in framework. Remove them.

Bug: 111441138
Test: Build without failure.
Change-Id: Icdd01bf1a03efd7883e4939d0d730303ec1004e7
2018-12-13 00:46:20 +00:00
Chenbo Feng
441febd86a Rename android bpf library
The bpf support library in android is renamed to libbpf_android to make
it compatible with external bcc project. Fix the Android.bp file here to
prevent build break.

Bug: 112334572
Test: No build breakage.
Change-Id: I183eb99d30afdf5c77b8c491c0c79013e2ed89ee
2018-11-07 18:21:23 -08:00
Nick Kralevich
3889888278 set O_CLOEXEC on /dev/tun open
Ensure that this file descriptor cannot leak across exec boundaries, in
the unlikely event that system_server does an exec().

Test: device boots and no problems.
Change-Id: I45691b7780026ea288e57db73fcc88820a2b06b1
2018-11-01 12:21:35 -07:00
Chenbo Feng
5bb4fea967 Move bpf project to system/bpf
The bpf project now have a new project directory in system/bpf instead
of inside netd. The network related bpf library is renamed to
libnetdbpf. Fix the dependency issue in framework to make sure no
regression.

Test: -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
Bug: 112334572
Change-Id: Ibd477bf17d18d516aa520fb1569f4a395ef9abf0
2018-10-17 03:46:35 +00:00
Treehugger Robot
a788eabd72 Merge "Remove ArcVideoBridge service from framework/base." 2018-10-10 03:06:40 +00:00
Tri Vo
c37724cf32 Replace libsuspend with android.system.suspend@1.0
This change only replaces libsuspend's suspend loop with the one in
android.system.suspend@1.0.

Native wake lock behavior is unaffected as they are still handled via
/sys/power/wake_[un]lock.

Bug: 78888165
Test: device boots, suspends when left alone
Change-Id: I5e1e9048b0fc316aa6692687684ac11f44466f7e
2018-09-28 10:41:12 -07:00
Chih-Yu Huang
b09d10911b Remove ArcVideoBridge service from framework/base.
We implement ArcVideoBridge as HIDL for both ArcCodec and
ArcVideoEncoder. This CL removes the original implementaion.

Bug: 111683541
Test: pass one Media CTS and check ArcVideoEncoder and ArcCodec works
Change-Id: I5e5e350d73c0dcc7cbd5da481b5841396e52b844
Merged-In: I5e5e350d73c0dcc7cbd5da481b5841396e52b844
(cherry picked from commit cb529e771396512152991bcc415da28914a266c2)
2018-09-17 09:26:22 -07:00
arty.ho
4237ed70b2 Allocate new native handle to store sidebandStream
When we get sidebandStream from TvInput, we only store the address of
native handle, the address point to native_handle_t in _hidl_replay.
After openStream is finished, the _hidl_replay will be freed
automatically, therefore we will use the freed memory in
setSidebandStrem, It will cause the writeNativeHandle fail in
setSidebandStrem.

Change-Id: Idd2e8343670ef5a3048836f1db978cd7c04378b7
2018-09-10 12:36:09 +00:00
rleix
212d9f76ba Merge "Fix the system_error while calling thread::join() in NativeCallbackThread."
am: 56104e6fb8

Change-Id: Idc11c245841a45882ddb90849c35e98d678947cc
2018-08-06 13:46:14 -07:00
rleix
4d5db38cc3 Fix the system_error while calling thread::join() in NativeCallbackThread.
system_server crashed because the system_error "resource_deadlock_would_occur"
occurred while calling thread::join(). It is caused by the value of thread is same
with the calling thread. Correct it using std::this_thread::get_id() to check
whether it is the same thread with the calling thread.

Bug: 70603039
Test step:
     Step 1 : Flash DUT and boot it.
     Step 2 : Connect with PC via USB.
     Step 3 : Run the following adb command and check the DUT: 
              adb shell
              su
              ps -A | grep broadcastradio
              kill xxx(the process id of android.hardware.broadcastradio@intel-service)

Change-Id: Ia21282c4cc631a0788496081b1821be28929fae6
Signed-off-by: Lei,RayX <rayx.lei@intel.com>
2018-08-06 18:04:24 +00:00
android-build-team Robot
c609e5e4b7 Merge "Clearer GnssDebug text output" into pi-dev
am: 5cdf0dadc4

Change-Id: Ie978e9cd8f880a66aabf45543977da2d4cb8d30f
2018-05-07 11:10:04 -07:00
Wyatt Riley
b6a50f0784 Clearer GnssDebug text output
Bug: 33089503
Test: Builds, runs, more readable on device
Change-Id: I64b844538c26ce457ae066f5be084a80cf37bb7c
2018-05-04 07:54:06 -07:00
Steven Moreland
620e522919 rename hidl_enum_{iterator,range}
This is actually a range, not an iterator.

Bug: 78573628
Test: m
Change-Id: Iee444b9580de39ebad105165173093c6099df062
2018-05-02 00:07:40 +00:00
Yu-Han Yang
5205762e45 Handle Gnss Hal service death gracefully
Bug: 37460011
Fixes: 37460011
Test: adb shell
ps -A | grep 'gnss@1.0' | awk '{print $2}' | xargs kill

Change-Id: I6ff675fc198ab709d50637367f0b4648b55b021f
2018-04-30 14:56:21 -07:00
Yu-Han Yang
23d921627c Refactor GnssNavigationMessageProvider
Bug: 77974819
Change-Id: I1a904c7436fd3c47e0c0616f39af1ca6c039011a
Fixes: 77974819
Test: m -j ROBOTEST_FILTER=GnssNavigationMessageProviderTest RunFrameworksServicesRoboTests
2018-04-25 19:18:45 -07:00
Yu-Han Yang
8de2150960 Refactor GnssMeasurementsProvider
Bug: 77974102
Change-Id: I9d993bd7a4a32ab2eef293c0efae3109348e7577
Fixes: 77974102
Test: m -j ROBOTEST_FILTER=GnssMeasurementsProviderTest RunFrameworksServicesRoboTests
2018-04-24 21:18:06 -07:00
Yu-Han Yang
890ca8b508 Refactor GnssGeofenceProvider
Bug: 77974401
Change-Id: Id377b14f9f6c47e031a863ee9096c9b5c66ebf08
Fixes: 77974401
Test: m -j ROBOTEST_FILTER=GnssGeofenceProviderTest RunFrameworksServicesRoboTests
2018-04-23 22:01:46 -07:00
TreeHugger Robot
4257db35fe Merge "Refactor GnssBatchingProvider" into pi-dev 2018-04-24 03:56:20 +00:00
Yu-Han Yang
3557cc71ea Refactor GnssBatchingProvider
Bug: 77974758
Fixes: 77974758
Test: m -j ROBOTEST_FILTER=GnssBatchingProviderTest RunFrameworksServicesRoboTests

Change-Id: I907265358abdd5486dc1040c7d7bf912942bcb1d
2018-04-19 17:57:08 -07:00
Tomasz Wasilczyk
1923eb9193 Remove setDeviceConnectionState hack for radio mute/unmute.
Bug: 77863406
Test: it builds, it didn't work anyway
Change-Id: Ib77d34d4c425e341faa52c6e99f7e289be04f433
2018-04-16 11:56:00 -07:00
Yu-Han Yang
66c7ea91b4 Implements GNSS satellite blacklist
Bug: 38269641

Test: m -j ROBOTEST_FILTER=GnssSatelliteBlacklistHelperTest RunFrameworksServicesRoboTests
Test: atest SettingsBackupTest
Test: Tested with adb on device

Change-Id: Ifaa330bf74353ea5c8826f0000d1935258b8dbf2
2018-04-05 08:57:04 -07:00
Tomasz Wasilczyk
1faccac773 Fix image fetching.
Also, while we're here, reduce logs verbosity.

Test: open car.Media app with radio service selected, tune to a station
      (requires a patch with image support against radio app)
Bug: 75970985

Change-Id: I4e56dcdc8bacbb5e63f67eba4a0b0a126245b415
2018-04-04 11:15:51 -07:00
TreeHugger Robot
86021cff1b Merge "Workaround HAL 1.1 program list fetching limitation by preferring FM." into pi-dev 2018-03-30 17:50:11 +00:00
TreeHugger Robot
322929af8d Merge "Move HIDL calls away from the main thread" into pi-dev 2018-03-30 17:20:26 +00:00
Tomasz Wasilczyk
dffc226e01 Workaround HAL 1.1 program list fetching limitation by preferring FM.
Bug: 75970985
Test: manual
Change-Id: I842e9b4765c5ec2479950e88b6f33aa2264a9d0b
2018-03-30 07:37:01 -07:00
Yu-Han Yang
6d31735c8a Move HIDL calls away from the main thread
class_init is running under application main thread. A sequence
of 10 back to back HIDL calls is a power up vulnerability, as
watchdog may kick in if application main thread is taking too
long.

Bug: 63707763
Fixes: 63707763
Test: Tested on Taimen and verified GPS works.
Change-Id: Ia8833e7bc5f2bd6186c1f74f84c5387640cc44df
2018-03-29 11:30:01 -07:00
Tomasz Wasilczyk
64faa5b60f Merge "Indicate whether BandConfig initialization is required or not." into pi-dev 2018-03-29 17:27:56 +00:00
Tomasz Wasilczyk
27926edc3b Indicate whether BandConfig initialization is required or not.
The broadcastradio HAL 1.x requires waiting for onConfigChanged callback
to indicate the initialization is done, while HAL 2.0 does not have the
config setting (at the tuner session level) at all.

This change makes it possible to cleanly workaround race condition in the
radio app retaining support for both HAL revisions. Future versions of the
RadioManager will provide a method to open a session without taking care
about these nuances.

Bug: 74353024
Test: manual
Change-Id: I5de2d5e5c33626fcf0cfbbaf121d0b13e53d0bae
2018-03-29 07:45:06 -07:00
TreeHugger Robot
0fba0640a1 Merge "ALSA jack detection support - match upstream kernel" into pi-dev 2018-03-27 21:50:15 +00:00
Andrew Chant
afaef83e0a ALSA jack detection support - match upstream kernel
Match upstream Linux kernel support for UAC2 jack detection.
The patch that was included upstream names USB input and
output jack controls by ending them in
"Input Jack" or "Output Jack" respectively.

see 5a222e84945 ('ALSA: usb-audio: UAC2 jack detection') in
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git

Update UsbAlsaJackDetector appropriately.

Test: Verified on a UAC2 device with the above kernel patch,
tinymix -D 1 produced:
...
2       BOOL    1       Headset - Input Jack                     Off
...
9       BOOL    1       Headset - Output Jack                    On
With a headset connected,  and when the jack was unplugged, Youtube
paused.

Bug: 70632415
Change-Id: I2e5dd48c7a9d174aabbb3a3315496fb30f7a545a
2018-03-27 21:49:53 +00:00
Jerry Zhang
df101a4596 Merge "Write descriptors for Mtp in UsbService" into pi-dev 2018-03-27 02:49:02 +00:00
TreeHugger Robot
a106a1a6b4 Merge "Deprecating unused fields from GnssMeasurement" into pi-dev 2018-03-23 13:41:46 +00:00
Jerry Zhang
6d319b8aaa Write descriptors for Mtp in UsbService
The current model for setting up a functionfs
function is:

UsbDeviceManager#setCurrentFunctions() ->
intent is sent to MtpReceiver to write the descriptors ->
init/hal waits for descriptors to write, then pulls up gadget ->
Gadget is configured, a USB_STATE intent starts MtpServer

The main downside of this is a lack of reliability because
the Mtp process could be killed at any point. Normally, a
gadget is unbound if its control endpoint is closed. no_disconnect
works around this, but is still a little janky. In addition, the
extra intent delays the startup of the gadget.

With the new model, UsbDeviceManager writes the descriptors
on initialization. Since it is a system service, it won't be killed.

UsbDeviceManager#setCurrentFunctions() ->
init/hal pulls up gadget ->
Gadget is configured, a USB_STATE intent starts MtpServer
MtpServer calls UsbManager#getControlFd to get a dup of the control
endpoint.

Also modify permissions so system server can access mtp files.

Bug: 72877174
Test: Change usb configurations to ptp/mtp
Change-Id: Id17d2b5930f4e1f37ec1b4f00add9d594174ad49
2018-03-22 11:35:19 -07:00
Wyatt Riley
4cbcb411b1 Deprecating unused fields from GnssMeasurement
Deprecating CarrierPhase, that are redundant
with AccumualtedDeltaRange fields (that remain in place)
Adding additional enum per partner feedback

Bug: 71908529
Bug: 72405353
Test: GnssLogger on device GnssMeasurement screen & file

Change-Id: I524e47aa9420d83d87b22334378e0c9a800cf179
2018-03-16 13:12:14 -07:00
Tomasz Wasilczyk
940c6919c8 Fix basic broadcastradio HAL 1.1/2.0 functionality.
This change fixes a few minor gaps preventing the reference radio app
from accessing HAL 1.1 and 2.0 devices:
- createAmFmSelector not detecting the radio band
- don't allow configuration-dependant operations before the configuration
  is applied
- allow the initial configuration to be auto-selected

Bug: 74353024
Test: manual
Change-Id: If47872c1bf4cf57c6c39715218d90df9701c372d
2018-03-08 10:00:34 -08:00
Wyatt Riley
46ac956776 Fix GnssMeasurement JNI for 1.1
Passing the GnssMeasurement JavaObject as reference
Harmonizing variable name styles for 1.0 vs. 1.1

Change-Id: Ia28c159cbda91f89e7387bcf3c404c41375e6be8
Fixes: 74021441
Test: Runs on device, and works with GnssLogger
(cherry picked from commit 7155f8a9f61a68c3a33a72893d01f64f0d890bd8)
2018-03-06 19:55:17 +00:00
TreeHugger Robot
0f67a6da37 Merge "Handling concurrent location & SV status update" 2018-02-22 00:33:42 +00:00
Wyatt Riley
049a52daab Merge "Handling additional enum for carrier half cycle" 2018-02-21 21:39:43 +00:00
Tomasz Wasilczyk
9678d36bfc Merge "Add twasilczyk and randolphs to broadcast radio directories OWNERS." 2018-02-21 00:51:37 +00:00
Tomasz Wasilczyk
fb8adc8b2c Add twasilczyk and randolphs to broadcast radio directories OWNERS.
Test: none
Change-Id: Ib21e81a8e77f7bc321e0ff71fa259e63956bf9ae
2018-02-20 19:36:56 +00:00
Wyatt Riley
bb9bc84682 Handling additional enum for carrier half cycle
Working with both 1.0 and 1.1 IGnssMeasurementCallback's
Also formally deprecating the Carrier Phase fields

Bug: 71908529
Test: Gnss & Measurements still run on device (w/1.0 HAL)

Change-Id: I229350217a6fb61ca403e0515e1fd9d8fed2cc1b
2018-02-20 09:52:52 -08:00
Wyatt Riley
26465d267a Handling concurrent location & SV status update
Move handling of location and SV status updates to
existing handler thread.
Change SV status JNI output for thread safety.
Synchronize updates to LocationExtras (many entry
points)
Adding some DeleteLocalRef cleanups

Bug: 72481417
Fixes: 72949246
Fixes: 73090867

Test: GPS works on device, and adb shell dumpsys location
shows extras

Change-Id: I3eda8884597ad1cdf5aec6d1b7c33ab49401410f
2018-02-20 08:17:35 -08:00
Risan
918e02f1e9 Change libmojo_bp to libmojo
Cleaning up since we have libmojo Android.bp target now.

Bug: 72927715
Test: Compiled
Change-Id: I6350ce53c6b97a2c43d53a45b8634bdc27409ab6
2018-02-20 01:39:31 +00:00
TreeHugger Robot
91e58646c2 Merge "Implement requestLocationCb" 2018-02-17 01:10:07 +00:00
Yu-Han Yang
e7baef38d8 Implement requestLocationCb
- For network location, send a single request and inject it.

- For fused location, send a 'streaming' request for 30 sec duration and
1 Hz updates.

Bug: 72405645

Test: locally added a cts in LocationManager to trigger the flow.

Change-Id: I8ce73976e4e62836037bf3563f239719c9a89305
2018-02-16 10:26:38 -08:00
Andrew Chant
5f53db38b2 Merge changes from topic "uac_jackdetect"
* changes:
  Add a selected UsbAlsaDevice
  ALSA jack detection support
  Synchronize UsbAlsaDevice, rename playback/capture.
2018-02-14 19:00:23 +00:00
Andrew Chant
07a97da51f ALSA jack detection support
Adds support for ALSA jack detection for USB.
Spawns a new thread for ALSA jack detection on device
insert.  If the device doesn't support ALSA jack detection,
the thread terminates.

Test: UAC2 audio accessory and a kernel
which supports USB ALSA Jack detection, switching between
speaker and USB works perfectly with plug/unplug at jack.

Bug: 68337205
Bug: 70632415
Change-Id: I1800660ad4d2341f19ce7be6d6b01f81a7f2d1a6
2018-02-13 16:42:35 -08:00
Tomasz Wasilczyk
e6a72cce0b Remove broadcastradio HAL 1.2 support from the framework.
Bug: 62945293
Test: it boots
Change-Id: I7f434ed7ef07d0cf9afa93c17e78f2bf80f43b36
2018-02-10 12:40:14 +00:00