summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-23 20:54:11 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-23 20:54:11 +0000
commitc2e4b09ac2d23a866ca389f7152e4e8cd07e9ff9 (patch)
treef5be3cff58cf5d75398b2ad0d556e5531027a344
parentedbafe794f9638de61500ea2c299e8bc62a7562f (diff)
parent049bb224280d31cf2f9c1ca62226c8eb3b7110d5 (diff)
downloadgoldfish-oreo-cts-release.tar.gz
Merge cherrypicks of [2454758, 2454859, 2454837, 2454965, 2454984, 2455001, 2454760, 2454860, 2454838, 2454899, 2454970, 2455005, 2455027, 2454973, 2455006, 2455061, 2455007, 2454914, 2454987, 2454974] into oc-releaseandroid-security-8.0.0_r54android-security-8.0.0_r53android-security-8.0.0_r52android-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r3android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r2android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10android-cts-8.0_r1android-8.0.0_r9android-8.0.0_r7android-8.0.0_r51android-8.0.0_r50android-8.0.0_r49android-8.0.0_r48android-8.0.0_r47android-8.0.0_r46android-8.0.0_r45android-8.0.0_r44android-8.0.0_r43android-8.0.0_r42android-8.0.0_r41android-8.0.0_r40android-8.0.0_r4android-8.0.0_r39android-8.0.0_r38android-8.0.0_r37android-8.0.0_r36android-8.0.0_r35android-8.0.0_r32android-8.0.0_r31android-8.0.0_r30android-8.0.0_r3android-8.0.0_r29android-8.0.0_r28android-8.0.0_r2android-8.0.0_r17android-8.0.0_r16android-8.0.0_r15android-8.0.0_r13android-8.0.0_r12android-8.0.0_r11android-8.0.0_r10android-8.0.0_r1security-oc-releaseoreo-security-releaseoreo-releaseoreo-r6-releaseoreo-r5-releaseoreo-r4-releaseoreo-r3-releaseoreo-r2-releaseoreo-cts-release
Change-Id: I553bda5e86663208d37cf5dd37c25a82269f6577
-rw-r--r--data/etc/encryptionkey.imgbin0 -> 1048576 bytes
-rw-r--r--data/etc/handheld_core_hardware.xml3
-rw-r--r--data/etc/permissions/privapp-permissions-goldfish.xml32
-rw-r--r--fstab.ranchu4
-rw-r--r--init.goldfish.rc13
-rwxr-xr-xinit.ranchu-core.sh46
-rwxr-xr-xinit.ranchu-net.sh32
-rw-r--r--init.ranchu.rc41
-rw-r--r--manifest.xml35
-rw-r--r--overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml2
-rw-r--r--power/Android.mk11
-rw-r--r--qemu-props/qemu-props.c14
-rw-r--r--sensors/sensors_qemu.c4
13 files changed, 231 insertions, 6 deletions
diff --git a/data/etc/encryptionkey.img b/data/etc/encryptionkey.img
new file mode 100644
index 00000000..9e0f96a2
--- /dev/null
+++ b/data/etc/encryptionkey.img
Binary files differ
diff --git a/data/etc/handheld_core_hardware.xml b/data/etc/handheld_core_hardware.xml
index cf60e887..b2aaf134 100644
--- a/data/etc/handheld_core_hardware.xml
+++ b/data/etc/handheld_core_hardware.xml
@@ -72,6 +72,9 @@
<!-- Feature to specify if the device support managed users. -->
<feature name="android.software.managed_users" />
+ <feature name="android.software.picture_in_picture" />
+
+ <feature name="android.software.cts" />
<!-- devices with GPS must include android.hardware.location.gps.xml -->
<!-- devices with an autofocus camera and/or flash must include either
android.hardware.camera.autofocus.xml or
diff --git a/data/etc/permissions/privapp-permissions-goldfish.xml b/data/etc/permissions/privapp-permissions-goldfish.xml
new file mode 100644
index 00000000..7124fb8f
--- /dev/null
+++ b/data/etc/permissions/privapp-permissions-goldfish.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+
+<!--
+This XML file declares which signature|privileged permissions should be granted to privileged
+applications on GMS or Google-branded devices.
+It allows additional grants on top of privapp-permissions-platform.xml
+-->
+
+<permissions>
+ <privapp-permissions package="com.android.sdksetup">
+ <permission name="android.permission.BACKUP"/>
+ <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
+ </privapp-permissions>
+ <privapp-permissions package="com.android.dialer">
+ <permission name="android.permission.STATUS_BAR"/>
+ </privapp-permissions>
+</permissions> \ No newline at end of file
diff --git a/fstab.ranchu b/fstab.ranchu
index f155c5a7..b9eb7546 100644
--- a/fstab.ranchu
+++ b/fstab.ranchu
@@ -4,5 +4,5 @@
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/vda /system ext4 ro wait
/dev/block/vdb /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait
-/dev/block/vdc /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
-/devices/*/block/vdd auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
+/dev/block/vdc /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check,quota,forceencrypt=/dev/block/vdd
+/devices/*/block/vde auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
diff --git a/init.goldfish.rc b/init.goldfish.rc
index 784fee05..b1613a42 100644
--- a/init.goldfish.rc
+++ b/init.goldfish.rc
@@ -68,6 +68,12 @@ on boot
on fs
mount_all /fstab.goldfish
+#emulator is not much useful before boot complete
+#start it later
+on property:sys.boot_completed=1
+ setprop sys.usb.config adb
+ start adbd
+
service goldfish-setup /system/etc/init.goldfish.sh
user root
group root
@@ -104,3 +110,10 @@ service goldfish-logcat /system/bin/logcat -Q
service fingerprintd /system/bin/fingerprintd
class late_start
user system
+
+service bugreport /system/bin/dumpstate -d -p -B \
+ -o /data/data/com.android.shell/files/bugreports/bugreport
+ class main
+ disabled
+ oneshot
+ keycodes 114 115 116
diff --git a/init.ranchu-core.sh b/init.ranchu-core.sh
new file mode 100755
index 00000000..fd21a375
--- /dev/null
+++ b/init.ranchu-core.sh
@@ -0,0 +1,46 @@
+#!/system/bin/sh
+
+
+# ro.kernel.android.qemud is normally set when we
+# want the RIL (radio interface layer) to talk to
+# the emulated modem through qemud.
+#
+# However, this will be undefined in two cases:
+#
+# - When we want the RIL to talk directly to a guest
+# serial device that is connected to a host serial
+# device by the emulator.
+#
+# - We don't want to use the RIL but the VM-based
+# modem emulation that runs inside the guest system
+# instead.
+#
+# The following detects the latter case and sets up the
+# system for it.
+#
+qemud=`getprop ro.kernel.android.qemud`
+case "$qemud" in
+ "")
+ radio_ril=`getprop ro.kernel.android.ril`
+ case "$radio_ril" in
+ "")
+ # no need for the radio interface daemon
+ # telephony is entirely emulated in Java
+ setprop ro.radio.noril yes
+ stop ril-daemon
+ ;;
+ esac
+ ;;
+esac
+
+
+# disable boot animation for a faster boot sequence when needed
+boot_anim=`getprop ro.kernel.android.bootanim`
+case "$boot_anim" in
+ 0) setprop debug.sf.nobootanimation 1
+ ;;
+esac
+
+
+# take the wake lock
+echo "emulator_wake_lock" > /sys/power/wake_lock
diff --git a/init.ranchu-net.sh b/init.ranchu-net.sh
new file mode 100755
index 00000000..e4347d3b
--- /dev/null
+++ b/init.ranchu-net.sh
@@ -0,0 +1,32 @@
+#!/system/bin/sh
+
+# Setup networking when boot starts
+ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up
+route add default gw 10.0.2.2 dev eth0
+
+
+# Setup additionnal DNS servers if needed
+num_dns=`getprop ro.kernel.ndns`
+case "$num_dns" in
+ 2) setprop net.eth0.dns2 10.0.2.4
+ ;;
+ 3) setprop net.eth0.dns2 10.0.2.4
+ setprop net.eth0.dns3 10.0.2.5
+ ;;
+ 4) setprop net.eth0.dns2 10.0.2.4
+ setprop net.eth0.dns3 10.0.2.5
+ setprop net.eth0.dns4 10.0.2.6
+ ;;
+esac
+
+
+# set up the second interface (for inter-emulator connections)
+# if required
+my_ip=`getprop net.shared_net_ip`
+case "$my_ip" in
+ "")
+ ;;
+ *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
+ ;;
+esac
+
diff --git a/init.ranchu.rc b/init.ranchu.rc
index 6fb6e77c..c9abe1df 100644
--- a/init.ranchu.rc
+++ b/init.ranchu.rc
@@ -9,6 +9,9 @@ on init
symlink /dev/goldfish_pipe /dev/android_pipe
symlink /dev/goldfish_pipe /dev/qemu_pipe
+on post-fs-data
+ setprop vold.post_fs_data_done 1
+
on boot
setprop net.eth0.gw 10.0.2.2
setprop net.eth0.dns1 10.0.2.3
@@ -17,6 +20,7 @@ on boot
setprop ro.build.product generic
setprop ro.product.device generic
setprop ro.hardware.audio.primary goldfish
+ setprop ro.setupwizard.mode EMULATOR
# fake some battery state
setprop status.battery.state Slow
@@ -44,14 +48,37 @@ on boot
# start essential services
# These were written for the classic emulator, but are applicable to ranchu
start goldfish-logcat
- start goldfish-setup
+# start goldfish-setup
# enable Google-specific location features,
# like NetworkLocationProvider and LocationCollector
setprop ro.com.google.locationfeatures 1
-service goldfish-setup /system/etc/init.goldfish.sh
+#emulator is not much useful before boot complete
+#start it later
+on property:sys.boot_completed=1
+ setprop sys.usb.config adb
+ start adbd
+ start goldfish-logcat
+
+on property:qemu.adbd=start
+ setprop sys.usb.config adb
+ start adbd
+ start goldfish-logcat
+
+# allow goldfish-setup to take wake lock
+ chown root system /sys/power/wake_lock
+ chown root system /sys/power/wake_unlock
+
+service ranchu-setup /system/bin/init.ranchu-core.sh
+ class core
+ user root
+ group root
+ oneshot
+
+service ranchu-net /system/bin/init.ranchu-net.sh
+ class late_start
user root
group root wakelock
oneshot
@@ -68,6 +95,9 @@ service qemu-props /system/bin/qemu-props
group root
oneshot
+on property:qemu.logcat=start
+ start goldfish-logcat
+
# -Q is a special logcat option that forces the
# program to check wether it runs on the emulator
# if it does, it redirects its output to the device
@@ -83,3 +113,10 @@ service goldfish-logcat /system/bin/logcat -Q
service fingerprintd /system/bin/fingerprintd
class late_start
user system
+
+service bugreport /system/bin/dumpstate -d -p -B \
+ -o /data/data/com.android.shell/files/bugreports/bugreport
+ class main
+ disabled
+ oneshot
+ keycodes 114 115 116
diff --git a/manifest.xml b/manifest.xml
new file mode 100644
index 00000000..7d359a0c
--- /dev/null
+++ b/manifest.xml
@@ -0,0 +1,35 @@
+<manifest version="1.0" type="device">
+ <hal format="hidl">
+ <name>android.hardware.drm</name>
+ <transport arch="32">passthrough</transport>
+ <impl level="generic"></impl>
+ <version>1.0</version>
+ <!-- TODO(b/36371166): change to default -->
+ <interface>
+ <name>ICryptoFactory</name>
+ <instance>crypto</instance>
+ </interface>
+ <interface>
+ <name>IDrmFactory</name>
+ <instance>drm</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.graphics.allocator</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.power</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IPower</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 66026273..56fbf899 100644
--- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -18,7 +18,9 @@
-->
<resources>
+ <!-- cannot set this to true because O-CTS is testing the keyguard b/37465076
<bool name="def_lockscreen_disabled">true</bool>
+ -->
<!-- Allow users to use both the on-screen keyboard, as well as a real
keyboard -->
diff --git a/power/Android.mk b/power/Android.mk
index ffbc457a..38390880 100644
--- a/power/Android.mk
+++ b/power/Android.mk
@@ -27,3 +27,14 @@ LOCAL_SRC_FILES := power_qemu.c
LOCAL_MODULE := power.goldfish
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_CFLAGS += -DQEMU_HARDWARE
+LOCAL_SHARED_LIBRARIES := liblog libcutils
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
+LOCAL_SRC_FILES := power_qemu.c
+LOCAL_MODULE := power.ranchu
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_SHARED_LIBRARY)
diff --git a/qemu-props/qemu-props.c b/qemu-props/qemu-props.c
index a5dc819d..c80863a5 100644
--- a/qemu-props/qemu-props.c
+++ b/qemu-props/qemu-props.c
@@ -109,6 +109,20 @@ int main(void)
}
+ /* HACK start adbd periodically every minute, if adbd is already running, this is a no-op */
+ for(;;) {
+ usleep(60000000);
+ char temp[BUFF_SIZE];
+ property_get("sys.boot_completed", temp, "");
+ int is_boot_completed = (strncmp(temp, "1", 1) == 0) ? 1 : 0;
+ if (is_boot_completed) {
+ DD("start adbd ...");
+ property_set("qemu.adbd", "start");
+ } else {
+ DD("skip starting adbd ...");
+ }
+ }
+
/* finally, close the channel and exit */
close(qemud_fd);
DD("exiting (%d properties set).", count);
diff --git a/sensors/sensors_qemu.c b/sensors/sensors_qemu.c
index 6c41a9cf..9eee7465 100644
--- a/sensors/sensors_qemu.c
+++ b/sensors/sensors_qemu.c
@@ -355,7 +355,7 @@ static int sensor_device_poll_event_locked(SensorDevice* dev)
events[ID_TEMPERATURE].type = SENSOR_TYPE_AMBIENT_TEMPERATURE;
continue;
}
-
+
/* "proximity:<value>" */
if (sscanf(buff, "proximity:%g", params+0) == 1) {
new_sensors |= SENSORS_PROXIMITY;
@@ -742,7 +742,7 @@ static const struct sensor_t sSensorListInit[] = {
.fifoMaxEventCount = 0,
.stringType = 0,
.requiredPermission = 0,
- .flags = SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE,
+ .flags = SENSOR_FLAG_ON_CHANGE_MODE,
.reserved = {}
},