commit | d6fc59d5908b790ca5ad9438f07d6cfdfb702b98 | [log] [tgz] |
---|---|---|
author | Amy Zhang <amyjojo@google.com> | Wed Jun 24 21:26:04 2020 -0700 |
committer | Amy Zhang <amyjojo@google.com> | Tue Jun 30 19:44:21 2020 +0000 |
tree | d34277a80c131aa7595d3f8329cf93bd1091242f | |
parent | 554d2e74c7a63ca2b5dda0398bf17cf5386a1e12 [diff] |
Grant the privileged app - SampleTunerTvInputService access to the Tuner HAL service We have a new Tuner HAL design in Android R to support Android TV Broadcast TV solution Please see the design doc: https://docs.google.com/document/d/1ZeCs4BYCWB27fZnYRDW5O6i3HMsXE4ZGimiWugrmxDg/edit?usp=sharing The overall structure of this design is: Privileged apps use Tuner java framework to access the Tuner HAL through the Tuner JNI There is a system service - TunerResourceManager that would be used in the Tuner java framework to manager Tuner related resources Whenever the privileged apps request a resource, the TunerResourceManager checks its permission and priority to help Tuner java make decision Tuner HAL service access is also protected by the selinux policy Tuner HAL 1.0: https://source.corp.google.com/android/hardware/interfaces/tv/tuner/1.0/ Tuner HAL service sepolicy: https://source.corp.google.com/android/system/sepolicy/public/hal_tv_tuner.te?q=hal_tv_tuner.te TunerJava: https://source.corp.google.com/android/frameworks/base/media/java/android/media/tv/tuner/Tuner.java;l=197?q=%22This%20class%20is%20used%20to%20interact%20with%20hardware%20tuners%20devices.%22 TunerJNI: https://source.corp.google.com/android/frameworks/base/media/jni/android_media_tv_Tuner.cpp;l=926?q=android_media_tv_tuner TunerResourceManager: https://source.corp.google.com/android/frameworks/base/media/java/android/media/tv/tunerresourcemanager/TunerResourceManager.java?q=tunerresourcemanager SampleTunerTvInputService is an internal reference design of the privileged apps for vendors to refer It runs on the virtual Android device Cuttlefish TV with the default Tuner HAL implementation SampleTunerTvInputService: https://source.corp.google.com/android/packages/apps/TV/tuner/sampletunertvinput/ Test: Running SampleTunerTvInputService with LiveChannels on Cuttlefish to access Tuner HAL $adb shell ps -Z | grep sampletunertvinput u:r:sample_tuner_tis_app:s0:c232,c259,c512,c768 system 3459 345 932208 110828 0 0 S com.android.tv.samples.sampletunertvinput Bug: 158868205 Change-Id: I5d7bb49c9ad5ead4a4ea726afdb915c86433a9a9
git clone https://github.com/google/android-cuttlefish cd android-cuttlefish debuild -i -us -uc -b sudo dpkg -i ../cuttlefish-common_*_amd64.deb sudo apt-get install -f
aosp-master
if you don‘t know what you’re looking foraosp_cf_x86_phone
and click on userdebug
for the latest buildArtifacts
aosp_cf_x86_phone-img-xxxxxx.zip
-- it will always have img
in the name. Download this filecvd-host_package.tar.gz
. You should always download a host package from the same build as your images.mkdir cf cd cf tar xvf /path/to/cvd-host_package.tar.gz unzip /path/to/aosp_cf_x86_phone-img-xxxxxx.zip
Launch cuttlefish with:
$ HOME=$PWD ./bin/launch_cvd
Stop cuttlefish with:
$ HOME=$PWD ./bin/stop_cvd
You can use adb
to debug it, just like a physical device:
$ ./bin/adb -e shell
You can use the TightVNC JViewer. Once you have downloaded the TightVNC Java Viewer JAR in a ZIP archive, run it with
$ java -jar tightvnc-jviewer.jar -ScalingFactor=50 -Tunneling=no -host=localhost -port=6444
Click “Connect” and you should see a lock screen!