Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

device-generic-goldfish: Commit

device/generic/goldfish


Commit MetaInfo

Revision1bff005b3dfa358722d4f0e74448c6154008ec2c (tree)
Time2017-06-24 05:44:50
Authorbohu <bohu@goog...>
Commiterandroid-build-team Robot

Log Message

Emulator: update goldfish to 0ff252b9

Bug: 37302997

Test: Build and run sdk_google_aw_x86-userdebug emulator

To commit
0ff252b95a21998caa20403da724d6d7a0f50174 oc-emu-dev
Author: bohu <bohu@google.com>
Date: Mon Jun 27 18:23:28 2016 -0700
Enable bugreport service

Change-Id: Ie04a6f7c3a19415b63db5850dc3b9aa0488af555
(cherry picked from commit bceb8ad4f4290b0076a4315644d79cbd1b713a67)
(cherry picked from commit 0319174f8eb0f97cfe27c70d95b91d006ee6c1ce)

Change Summary

Incremental Difference

Binary files /dev/null and b/data/etc/encryptionkey.img differ
--- a/data/etc/handheld_core_hardware.xml
+++ b/data/etc/handheld_core_hardware.xml
@@ -72,6 +72,9 @@
7272 <!-- Feature to specify if the device support managed users. -->
7373 <feature name="android.software.managed_users" />
7474
75+ <feature name="android.software.picture_in_picture" />
76+
77+ <feature name="android.software.cts" />
7578 <!-- devices with GPS must include android.hardware.location.gps.xml -->
7679 <!-- devices with an autofocus camera and/or flash must include either
7780 android.hardware.camera.autofocus.xml or
--- /dev/null
+++ b/data/etc/permissions/privapp-permissions-goldfish.xml
@@ -0,0 +1,32 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<!--
3+ ~ Copyright (C) 2017 The Android Open Source Project
4+ ~
5+ ~ Licensed under the Apache License, Version 2.0 (the "License");
6+ ~ you may not use this file except in compliance with the License.
7+ ~ You may obtain a copy of the License at
8+ ~
9+ ~ http://www.apache.org/licenses/LICENSE-2.0
10+ ~
11+ ~ Unless required by applicable law or agreed to in writing, software
12+ ~ distributed under the License is distributed on an "AS IS" BASIS,
13+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ ~ See the License for the specific language governing permissions and
15+ ~ limitations under the License
16+ -->
17+
18+<!--
19+This XML file declares which signature|privileged permissions should be granted to privileged
20+applications on GMS or Google-branded devices.
21+It allows additional grants on top of privapp-permissions-platform.xml
22+-->
23+
24+<permissions>
25+ <privapp-permissions package="com.android.sdksetup">
26+ <permission name="android.permission.BACKUP"/>
27+ <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
28+ </privapp-permissions>
29+ <privapp-permissions package="com.android.dialer">
30+ <permission name="android.permission.STATUS_BAR"/>
31+ </privapp-permissions>
32+</permissions>
\ No newline at end of file
--- a/fstab.ranchu
+++ b/fstab.ranchu
@@ -4,5 +4,5 @@
44 # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
55 /dev/block/vda /system ext4 ro wait
66 /dev/block/vdb /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait
7-/dev/block/vdc /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
8-/devices/*/block/vdd auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
7+/dev/block/vdc /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check,quota,forceencrypt=/dev/block/vdd
8+/devices/*/block/vde auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
--- a/init.goldfish.rc
+++ b/init.goldfish.rc
@@ -68,6 +68,12 @@ on boot
6868 on fs
6969 mount_all /fstab.goldfish
7070
71+#emulator is not much useful before boot complete
72+#start it later
73+on property:sys.boot_completed=1
74+ setprop sys.usb.config adb
75+ start adbd
76+
7177 service goldfish-setup /system/etc/init.goldfish.sh
7278 user root
7379 group root
@@ -104,3 +110,10 @@ service goldfish-logcat /system/bin/logcat -Q
104110 service fingerprintd /system/bin/fingerprintd
105111 class late_start
106112 user system
113+
114+service bugreport /system/bin/dumpstate -d -p -B \
115+ -o /data/data/com.android.shell/files/bugreports/bugreport
116+ class main
117+ disabled
118+ oneshot
119+ keycodes 114 115 116
--- /dev/null
+++ b/init.ranchu-core.sh
@@ -0,0 +1,46 @@
1+#!/system/bin/sh
2+
3+
4+# ro.kernel.android.qemud is normally set when we
5+# want the RIL (radio interface layer) to talk to
6+# the emulated modem through qemud.
7+#
8+# However, this will be undefined in two cases:
9+#
10+# - When we want the RIL to talk directly to a guest
11+# serial device that is connected to a host serial
12+# device by the emulator.
13+#
14+# - We don't want to use the RIL but the VM-based
15+# modem emulation that runs inside the guest system
16+# instead.
17+#
18+# The following detects the latter case and sets up the
19+# system for it.
20+#
21+qemud=`getprop ro.kernel.android.qemud`
22+case "$qemud" in
23+ "")
24+ radio_ril=`getprop ro.kernel.android.ril`
25+ case "$radio_ril" in
26+ "")
27+ # no need for the radio interface daemon
28+ # telephony is entirely emulated in Java
29+ setprop ro.radio.noril yes
30+ stop ril-daemon
31+ ;;
32+ esac
33+ ;;
34+esac
35+
36+
37+# disable boot animation for a faster boot sequence when needed
38+boot_anim=`getprop ro.kernel.android.bootanim`
39+case "$boot_anim" in
40+ 0) setprop debug.sf.nobootanimation 1
41+ ;;
42+esac
43+
44+
45+# take the wake lock
46+echo "emulator_wake_lock" > /sys/power/wake_lock
--- /dev/null
+++ b/init.ranchu-net.sh
@@ -0,0 +1,32 @@
1+#!/system/bin/sh
2+
3+# Setup networking when boot starts
4+ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up
5+route add default gw 10.0.2.2 dev eth0
6+
7+
8+# Setup additionnal DNS servers if needed
9+num_dns=`getprop ro.kernel.ndns`
10+case "$num_dns" in
11+ 2) setprop net.eth0.dns2 10.0.2.4
12+ ;;
13+ 3) setprop net.eth0.dns2 10.0.2.4
14+ setprop net.eth0.dns3 10.0.2.5
15+ ;;
16+ 4) setprop net.eth0.dns2 10.0.2.4
17+ setprop net.eth0.dns3 10.0.2.5
18+ setprop net.eth0.dns4 10.0.2.6
19+ ;;
20+esac
21+
22+
23+# set up the second interface (for inter-emulator connections)
24+# if required
25+my_ip=`getprop net.shared_net_ip`
26+case "$my_ip" in
27+ "")
28+ ;;
29+ *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
30+ ;;
31+esac
32+
--- a/init.ranchu.rc
+++ b/init.ranchu.rc
@@ -9,6 +9,9 @@ on init
99 symlink /dev/goldfish_pipe /dev/android_pipe
1010 symlink /dev/goldfish_pipe /dev/qemu_pipe
1111
12+on post-fs-data
13+ setprop vold.post_fs_data_done 1
14+
1215 on boot
1316 setprop net.eth0.gw 10.0.2.2
1417 setprop net.eth0.dns1 10.0.2.3
@@ -17,6 +20,7 @@ on boot
1720 setprop ro.build.product generic
1821 setprop ro.product.device generic
1922 setprop ro.hardware.audio.primary goldfish
23+ setprop ro.setupwizard.mode EMULATOR
2024
2125 # fake some battery state
2226 setprop status.battery.state Slow
@@ -44,14 +48,37 @@ on boot
4448 # start essential services
4549 # These were written for the classic emulator, but are applicable to ranchu
4650 start goldfish-logcat
47- start goldfish-setup
51+# start goldfish-setup
4852
4953
5054 # enable Google-specific location features,
5155 # like NetworkLocationProvider and LocationCollector
5256 setprop ro.com.google.locationfeatures 1
5357
54-service goldfish-setup /system/etc/init.goldfish.sh
58+#emulator is not much useful before boot complete
59+#start it later
60+on property:sys.boot_completed=1
61+ setprop sys.usb.config adb
62+ start adbd
63+ start goldfish-logcat
64+
65+on property:qemu.adbd=start
66+ setprop sys.usb.config adb
67+ start adbd
68+ start goldfish-logcat
69+
70+# allow goldfish-setup to take wake lock
71+ chown root system /sys/power/wake_lock
72+ chown root system /sys/power/wake_unlock
73+
74+service ranchu-setup /system/bin/init.ranchu-core.sh
75+ class core
76+ user root
77+ group root
78+ oneshot
79+
80+service ranchu-net /system/bin/init.ranchu-net.sh
81+ class late_start
5582 user root
5683 group root wakelock
5784 oneshot
@@ -68,6 +95,9 @@ service qemu-props /system/bin/qemu-props
6895 group root
6996 oneshot
7097
98+on property:qemu.logcat=start
99+ start goldfish-logcat
100+
71101 # -Q is a special logcat option that forces the
72102 # program to check wether it runs on the emulator
73103 # if it does, it redirects its output to the device
@@ -83,3 +113,10 @@ service goldfish-logcat /system/bin/logcat -Q
83113 service fingerprintd /system/bin/fingerprintd
84114 class late_start
85115 user system
116+
117+service bugreport /system/bin/dumpstate -d -p -B \
118+ -o /data/data/com.android.shell/files/bugreports/bugreport
119+ class main
120+ disabled
121+ oneshot
122+ keycodes 114 115 116
--- /dev/null
+++ b/manifest.xml
@@ -0,0 +1,35 @@
1+<manifest version="1.0" type="device">
2+ <hal format="hidl">
3+ <name>android.hardware.drm</name>
4+ <transport arch="32">passthrough</transport>
5+ <impl level="generic"></impl>
6+ <version>1.0</version>
7+ <!-- TODO(b/36371166): change to default -->
8+ <interface>
9+ <name>ICryptoFactory</name>
10+ <instance>crypto</instance>
11+ </interface>
12+ <interface>
13+ <name>IDrmFactory</name>
14+ <instance>drm</instance>
15+ </interface>
16+ </hal>
17+ <hal format="hidl">
18+ <name>android.hardware.graphics.allocator</name>
19+ <transport>hwbinder</transport>
20+ <version>2.0</version>
21+ <interface>
22+ <name>IAllocator</name>
23+ <instance>default</instance>
24+ </interface>
25+ </hal>
26+ <hal format="hidl">
27+ <name>android.hardware.graphics.mapper</name>
28+ <transport arch="32+64">passthrough</transport>
29+ <version>2.0</version>
30+ <interface>
31+ <name>IMapper</name>
32+ <instance>default</instance>
33+ </interface>
34+ </hal>
35+</manifest>
--- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -18,7 +18,9 @@
1818 -->
1919
2020 <resources>
21+ <!-- cannot set this to true because O-CTS is testing the keyguard b/37465076
2122 <bool name="def_lockscreen_disabled">true</bool>
23+ -->
2224
2325 <!-- Allow users to use both the on-screen keyboard, as well as a real
2426 keyboard -->
--- a/qemu-props/qemu-props.c
+++ b/qemu-props/qemu-props.c
@@ -109,6 +109,20 @@ int main(void)
109109 }
110110
111111
112+ /* HACK start adbd periodically every minute, if adbd is already running, this is a no-op */
113+ for(;;) {
114+ usleep(60000000);
115+ char temp[BUFF_SIZE];
116+ property_get("sys.boot_completed", temp, "");
117+ int is_boot_completed = (strncmp(temp, "1", 1) == 0) ? 1 : 0;
118+ if (is_boot_completed) {
119+ DD("start adbd ...");
120+ property_set("qemu.adbd", "start");
121+ } else {
122+ DD("skip starting adbd ...");
123+ }
124+ }
125+
112126 /* finally, close the channel and exit */
113127 close(qemud_fd);
114128 DD("exiting (%d properties set).", count);
--- a/sensors/sensors_qemu.c
+++ b/sensors/sensors_qemu.c
@@ -355,7 +355,7 @@ static int sensor_device_poll_event_locked(SensorDevice* dev)
355355 events[ID_TEMPERATURE].type = SENSOR_TYPE_AMBIENT_TEMPERATURE;
356356 continue;
357357 }
358-
358+
359359 /* "proximity:<value>" */
360360 if (sscanf(buff, "proximity:%g", params+0) == 1) {
361361 new_sensors |= SENSORS_PROXIMITY;
@@ -742,7 +742,7 @@ static const struct sensor_t sSensorListInit[] = {
742742 .fifoMaxEventCount = 0,
743743 .stringType = 0,
744744 .requiredPermission = 0,
745- .flags = SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE,
745+ .flags = SENSOR_FLAG_ON_CHANGE_MODE,
746746 .reserved = {}
747747 },
748748
Show on old repository browser