Snap for 11981331 from 735afdceb3 to 24Q4-release

Change-Id: I1819d1a8632a7fa9719a9b2020e94edca78abec3
This commit is contained in:
Android Build Coastguard Worker 2024-06-17 23:04:26 +00:00
commit c7a783220e
14 changed files with 199 additions and 26 deletions

35
CopyEfsTest/Android.bp Normal file
View file

@ -0,0 +1,35 @@
// Copyright (C) 2024 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.
package {
default_applicable_licenses: ["device_google_zuma_license"],
}
java_test_host {
name: "CopyEfsTest",
// Include all test java files
srcs: ["src/**/*.java"],
static_libs: [
"junit",
"platform-test-annotations",
"truth",
],
libs: [
"tradefed",
"compatibility-host-util",
"compatibility-tradefed",
],
test_suites: ["device-tests"],
test_config: "AndroidTest.xml",
}

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2024 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.
-->
<configuration description="Runs 16K developer option test.">
<option name="test-suite-tag" value="apct"/>
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
<option name="force-root" value="true" />
</target_preparer>
<test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
<option name="jar" value="CopyEfsTest.jar" />
</test>
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
<!-- Unlock screen -->
<option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
<!-- Dismiss keyguard, in case it's set as "Swipe to unlock" -->
<option name="run-command" value="wm dismiss-keyguard" />
<!-- Collapse notifications -->
<option name="run-command" value="cmd statusbar collapse" />
<!-- dismiss all system dialogs before launch test -->
<option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS" />
</target_preparer>
</configuration>

View file

@ -0,0 +1,97 @@
/*
* Copyright (C) 2024 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.
*/
package com.android.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import android.platform.test.annotations.AppModeFull;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
import com.android.tradefed.testtype.junit4.DeviceTestRunOptions;
import com.android.tradefed.util.RunUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.BufferedReader;
import java.io.StringReader;
@RunWith(DeviceJUnit4ClassRunner.class)
public class CopyEfsTest extends BaseHostJUnit4Test {
@Test
@AppModeFull
public void copyEfsTest() throws Exception {
getDevice().enableAdbRoot();
// This test can be run on OEM unlocked device only as unlocking bootloader requires
// manual intervention.
String result = getDevice().getProperty("ro.boot.flash.locked");
assumeTrue("0".equals(result));
final String dataFstype = getFsTypeFor("/data");
assertTrue(!dataFstype.isEmpty());
if (!dataFstype.equals("ext4")) {
getDevice().executeShellCommand("cmd recovery wipe ext4");
RunUtil.getDefault().sleep(10000);
// Wait for 2 mins device to be online againg
getDevice().waitForDeviceOnline(120000);
getDevice().enableAdbRoot();
}
assertEquals("ext4", getFsTypeFor("/data"));
String dataBlockDev = getBlockDevFor("/data");
assertEquals(dataBlockDev, getBlockDevFor("/mnt/vendor/efs"));
assertEquals(dataBlockDev, getBlockDevFor("/mnt/vendor/efs_backup"));
assertEquals(dataBlockDev, getBlockDevFor("/mnt/vendor/modem_userdata"));
}
private String[] getMountInfo(String mountPoint) throws Exception {
String result = getDevice().executeShellCommand("cat /proc/mounts");
BufferedReader br = new BufferedReader(new StringReader(result));
String line;
while ((line = br.readLine()) != null) {
final String[] fields = line.split(" ");
final String device = fields[0];
final String partition = fields[1];
final String fsType = fields[2];
if (partition.equals(mountPoint)) {
return fields;
}
}
return null;
}
private String getFsTypeFor(String mountPoint) throws Exception {
String[] result = getMountInfo(mountPoint);
if (result == null) {
return "";
}
return result[2];
}
private String getBlockDevFor(String mountPoint) throws Exception {
String[] result = getMountInfo(mountPoint);
if (result == null) {
return "";
}
return result[0];
}
}

View file

@ -9,16 +9,8 @@ service copy_efs_files_to_data /vendor/bin/copy_efs_files_to_data
on post-fs-data && property:ro.boot.flash.locked=0 && property:ro.fstype.data=ext4
mkdir /data/vendor/copied 0775 radio system
restorecon_recursive /data/vendor/copied
restorecon_recursive /mnt/vendor
mount_all /vendor/etc/fstab.efs
mount_all /vendor/etc/fstab.persist
exec_start copy_efs_files_to_data
umount_all /vendor/etc/fstab.efs
umount_all /vendor/etc/fstab.persist
mount_all /vendor/etc/fstab.efs.from_data
restorecon_recursive /mnt/vendor/efs
restorecon_recursive /mnt/vendor/efs_backup
restorecon_recursive /mnt/vendor/modem_userdata
restorecon_recursive /mnt/vendor/persist
restorecon_recursive /data/vendor/ss
setprop ro.vendor.persist.status mounted

View file

@ -1,4 +1,12 @@
on property:ro.vendor.persist.status=mounted
# for modem related functions
restorecon_recursive /mnt/vendor/efs
chown radio system /mnt/vendor/efs
restorecon_recursive /mnt/vendor/efs_backup
chown radio system /mnt/vendor/efs_backup
restorecon_recursive /mnt/vendor/modem_userdata
chown radio system /mnt/vendor/modem_userdata
# for battery defender
mkdir /mnt/vendor/persist/battery 0700 system system

View file

@ -605,12 +605,6 @@ on property:persist.vendor.radio.no_modem_board=1
on fs
mount_all --early
restorecon_recursive /mnt/vendor/efs
chown radio system /mnt/vendor/efs
restorecon_recursive /mnt/vendor/efs_backup
chown radio system /mnt/vendor/efs_backup
restorecon_recursive /mnt/vendor/modem_userdata
chown radio system /mnt/vendor/modem_userdata
# Mount modem partition
mount_all /vendor/etc/fstab.modem --early

View file

@ -8,19 +8,19 @@ $BIN_DIR/mkdir -p $CHECKPOINT_DIR
function copy_files_to_data()
{
block_device=$1
partition_name=$(basename $1)
mount_point=$2
tmpdir=$CHECKPOINT_DIR/$partition_name.img
build_checkpoint=$CHECKPOINT_DIR/$partition_name
if [ ! -e $build_checkpoint ]; then
$BIN_DIR/rm -rf $tmpdir
$BIN_DIR/rm -rf $build_checkpoint
cp -rp $mount_point $tmpdir
$BIN_DIR/mkdir -p $tmpdir
$BIN_DIR/dump.f2fs -rfPo $tmpdir $block_device
if [ $? -ne 0 ]; then
echo "Failed to cp -rp $mount_point $tmpdir"
echo "Failed to $BIN_DIR/dump.f2fs -rfPo $tmpdir $block_device"
return
fi
fsync `find $tmpdir -type fd`
mv $tmpdir $build_checkpoint
if [ $? -ne 0 ]; then
echo "mv $tmpdir $build_checkpoint"
@ -31,12 +31,8 @@ function copy_files_to_data()
echo "Successfully copied $mount_point to $build_checkpoint"
}
chmod g+rx -R /mnt/vendor/efs
chmod g+rx -R /mnt/vendor/efs_backup
chmod g+rx -R /mnt/vendor/modem_userdata
copy_files_to_data "/dev/block/by-name/efs" "/mnt/vendor/efs"
copy_files_to_data "/dev/block/by-name/efs_backup" "/mnt/vendor/efs_backup"
copy_files_to_data "/dev/block/by-name/modem_userdata" "/mnt/vendor/modem_userdata"
chmod g+rx -R /mnt/vendor/persist
copy_files_to_data "/dev/block/by-name/persist" "/mnt/vendor/persist"

View file

@ -59,7 +59,6 @@
<!-- Camera -->
<permission name="android.permission.CAMERA" fixed="false"/>
<!-- Camera Connectivity -->
<permission name="android.permission.ACCESS_FINE_LOCATION" fixed="false"/>
<permission name="android.permission.POST_NOTIFICATIONS" fixed="false"/>
<permission name="android.permission.BLUETOOTH_CONNECT" fixed="false"/>
<permission name="android.permission.BLUETOOTH_SCAN" fixed="false"/>

View file

@ -43,6 +43,7 @@ include device/google/gs-common/misc_writer/misc_writer.mk
include device/google/gs-common/gyotaku_app/gyotaku.mk
include device/google/gs-common/bootctrl/bootctrl_aidl.mk
include device/google/gs-common/betterbug/betterbug.mk
include device/google/gs-common/fingerprint/fingerprint.mk
include device/google/zuma/dumpstate/item.mk
@ -360,12 +361,13 @@ PRODUCT_COPY_FILES += \
device/google/zuma/conf/init.zuma.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.zuma.rc \
device/google/zuma/conf/init.persist.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.persist.rc
ifeq (true,$(PRODUCT_16K_DEVELOPER_OPTION))
ifeq (true,$(filter $(DEVICE_PAGE_AGNOSTIC) $(PRODUCT_16K_DEVELOPER_OPTION),true))
PRODUCT_COPY_FILES += \
device/google/zuma/conf/init.efs.16k.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.efs.rc \
device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.efs.from_data:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.efs.from_data \
PRODUCT_PACKAGES += copy_efs_files_to_data
PRODUCT_PACKAGES += fsck.f2fs.vendor
else
PRODUCT_COPY_FILES += \
device/google/zuma/conf/init.efs.4k.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.efs.rc
@ -948,7 +950,9 @@ PRODUCT_PACKAGES += ShannonRcs
# Exynos RIL and telephony
# Multi SIM(DSDS)
SIM_COUNT := 2
$(call soong_config_set,sim,sim_count,$(SIM_COUNT))
SUPPORT_MULTI_SIM := true
# Support NR
SUPPORT_NR := true
# Support 5G on both stacks

View file

@ -114,7 +114,7 @@
</hal>
<hal format="aidl" optional="true">
<name>com.google.hardware.pixel.display</name>
<version>11-12</version>
<version>12</version>
<interface>
<name>IDisplay</name>
<instance>default</instance>

View file

@ -130,7 +130,8 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
"/sys/devices/platform/hdcp/hdcp1_success_count",
"/sys/devices/platform/hdcp/hdcp1_fail_count",
"/sys/devices/platform/hdcp/hdcp0_count",
}
},
.SpeakerVersionPath = "/sys/devices/platform/audiometrics/speaker_version"
};
const struct UeventListener::UeventPaths ueventPaths = {

View file

@ -55,6 +55,7 @@ cc_binary {
"libbinder_ndk",
"libprotobuf-cpp-lite",
"server_configurable_flags",
"libaconfig_storage_read_api_cc",
],
static_libs: [
"libpixelusb-aidl",

View file

@ -602,6 +602,11 @@ ScopedAStatus Usb::switchRole(const string& in_portName, const PortRole& in_role
fp = fopen(filename.c_str(), "w");
if (fp != NULL) {
int ret = fputs(convertRoletoString(in_role).c_str(), fp);
if (ret == EAGAIN) {
ALOGI("role switch busy, retry in %d ms", ROLE_SWAP_RETRY_MS);
std::this_thread::sleep_for(std::chrono::milliseconds(ROLE_SWAP_RETRY_MS));
ret = fputs(convertRoletoString(in_role).c_str(), fp);
}
fclose(fp);
if ((ret != EOF) && ReadFileToString(filename, &written)) {
written = Trim(written);

View file

@ -79,6 +79,7 @@ constexpr char kGadgetName[] = "11210000.dwc3";
#define DISPLAYPORT_IRQ_HPD_COUNT_CHECK 3
#define DISPLAYPORT_POLL_WAIT_MS 100
#define ROLE_SWAP_RETRY_MS 700
#define SVID_DISPLAYPORT "ff01"
#define SVID_THUNDERBOLT "8087"