Snap for 12034474 from 9a26ed1a9b to mainline-tzdata6-release

Change-Id: I8a415b43b06cca60caa484fcefd6737c21e5d397
This commit is contained in:
Android Build Coastguard Worker 2024-07-01 08:33:47 +00:00
commit f6954b2ba3
31 changed files with 167 additions and 70 deletions

View file

@ -26,3 +26,6 @@ add_service(aocxd, aocx);
# allow managing thread priority # allow managing thread priority
allow aocxd self:global_capability_class_set sys_nice; allow aocxd self:global_capability_class_set sys_nice;
allow aocxd dumpstate:fd use;
allow aocxd dumpstate:fifo_file write;

View file

@ -0,0 +1,2 @@
# Allow dumpstate to talk to aocxd over binder
binder_call(dumpstate, aocxd)

View file

@ -21,3 +21,4 @@ genfscon sysfs /devices/platform/audiometrics/call_count u:ob
genfscon sysfs /devices/platform/audiometrics/offload_effects_id u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/offload_effects_id u:object_r:sysfs_pixelstats:s0
genfscon sysfs /devices/platform/audiometrics/offload_effects_duration u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/offload_effects_duration u:object_r:sysfs_pixelstats:s0
genfscon sysfs /devices/platform/audiometrics/bt_usage u:object_r:sysfs_pixelstats:s0 genfscon sysfs /devices/platform/audiometrics/bt_usage u:object_r:sysfs_pixelstats:s0
genfscon sysfs /devices/platform/audiometrics/speaker_version u:object_r:sysfs_pixelstats:s0

View file

@ -11,13 +11,8 @@ ifneq ($(wildcard vendor/google/services/LyricCameraHAL/src),)
$(call soong_config_set,gch,hwl_library,lyric) $(call soong_config_set,gch,hwl_library,lyric)
endif endif
# Check if we're in PDK build # Check if we're in the internal build
ifeq ($(wildcard vendor/google/camera),) ifneq ($(wildcard vendor/google/camera),)
# If vendor/google/camera doesn't exist, it's a PDK build.
$(call soong_config_set,lyric,pdk_build,true)
else
# Otherwise, it's an internal Google build.
$(call soong_config_set,lyric,pdk_build,false)
PRODUCT_SOONG_NAMESPACES += \ PRODUCT_SOONG_NAMESPACES += \
vendor/google/camera \ vendor/google/camera \

View file

@ -1 +1,5 @@
com.google.pixel.camera.services.binder.IServiceBinder/default u:object_r:camera_binder_service:s0 com.google.pixel.camera.services.binder.IServiceBinder/default u:object_r:camera_binder_service:s0
com.google.pixel.camera.services.cameraidremapper.ICameraIdRemapper/default u:object_r:camera_cameraidremapper_service:s0
com.google.pixel.camera.services.lyricconfigprovider.ILyricConfigProvider/default u:object_r:camera_lyricconfigprovider_service:s0

View file

@ -9,4 +9,10 @@ allow vendor_pbcs_app app_api_service:service_manager find;
allow vendor_pbcs_app cameraserver_service:service_manager find; allow vendor_pbcs_app cameraserver_service:service_manager find;
# Allow PBCS to add the ServiceBinder service to ServiceManager. # Allow PBCS to add the ServiceBinder service to ServiceManager.
add_service(vendor_pbcs_app, camera_binder_service); add_service(vendor_pbcs_app, camera_binder_service);
# Allow PBCS to add the CameraIdRemapper service to ServiceManager.
add_service(vendor_pbcs_app, camera_cameraidremapper_service);
# Allow PBCS to add the LyricConfigProvider service to ServiceManager.
add_service(vendor_pbcs_app, camera_lyricconfigprovider_service);

View file

@ -8,6 +8,8 @@ allow vendor_pcs_app {
app_api_service app_api_service
audioserver_service audioserver_service
cameraserver_service cameraserver_service
camera_cameraidremapper_service
camera_lyricconfigprovider_service
drmserver_service drmserver_service
mediametrics_service mediametrics_service
mediaserver_service mediaserver_service

View file

@ -1 +1,5 @@
type camera_binder_service, hal_service_type, protected_service, service_manager_type; type camera_binder_service, hal_service_type, protected_service, service_manager_type;
type camera_cameraidremapper_service, hal_service_type, protected_service, service_manager_type;
type camera_lyricconfigprovider_service, hal_service_type, protected_service, service_manager_type;

View file

@ -1,6 +1,6 @@
allow hal_camera_default camera_binder_service:service_manager find; allow hal_camera_default camera_binder_service:service_manager find;
# Allow Lyric Hal to find the LyricConfigProvider service through ServiceManager. # Allow Lyric Hal to find the LyricConfigProvider service through ServiceManager.
allow hal_camera_default vendor_camera_lyricconfigprovider_service:service_manager find; allow hal_camera_default camera_lyricconfigprovider_service:service_manager find;
allow hal_camera_default hal_pixel_remote_camera_service:service_manager find; allow hal_camera_default hal_pixel_remote_camera_service:service_manager find;

View file

@ -1,9 +1,5 @@
type hal_pixel_remote_camera_service, hal_service_type, protected_service, service_manager_type; type hal_pixel_remote_camera_service, hal_service_type, protected_service, service_manager_type;
type vendor_camera_lyricconfigprovider_service, hal_service_type, protected_service, service_manager_type;
type vendor_camera_isp_service, hal_service_type, protected_service, service_manager_type; type vendor_camera_isp_service, hal_service_type, protected_service, service_manager_type;
type vendor_camera_cameraidremapper_service, hal_service_type, protected_service, service_manager_type;
type vendor_image_processing_hal_service, hal_service_type, protected_service, service_manager_type; type vendor_image_processing_hal_service, hal_service_type, protected_service, service_manager_type;

View file

@ -1,9 +1,5 @@
com.google.pixel.camera.connectivity.hal.provider.ICameraProvider/default u:object_r:hal_pixel_remote_camera_service:s0 com.google.pixel.camera.connectivity.hal.provider.ICameraProvider/default u:object_r:hal_pixel_remote_camera_service:s0
com.google.pixel.camera.services.lyricconfigprovider.ILyricConfigProvider/default u:object_r:vendor_camera_lyricconfigprovider_service:s0
com.google.pixel.camera.isp.IIspService/default u:object_r:vendor_camera_isp_service:s0 com.google.pixel.camera.isp.IIspService/default u:object_r:vendor_camera_isp_service:s0
com.google.pixel.camera.services.cameraidremapper.ICameraIdRemapper/default u:object_r:vendor_camera_cameraidremapper_service:s0
com.google.android.imageprocessing.IImageProcessingHal u:object_r:vendor_image_processing_hal_service:s0 com.google.android.imageprocessing.IImageProcessingHal u:object_r:vendor_image_processing_hal_service:s0

View file

@ -1,9 +1,9 @@
# Allow PBCS to add the ServiceBinder service to ServiceManager. # Allow PBCS to add the ServiceBinder service to ServiceManager.
add_service(vendor_pbcs_app, camera_binder_service); add_service(vendor_pbcs_app, camera_binder_service);
# Allow PBCS to add the LyricConfigProvider service to ServiceManager. # Allow PBCS to add the LyricConfigProvider service to ServiceManager.
add_service(vendor_pbcs_app, vendor_camera_lyricconfigprovider_service); add_service(vendor_pbcs_app, camera_lyricconfigprovider_service);
# Allow PBCS to add the CameraIdRemapper service to ServiceManager. # Allow PBCS to add the CameraIdRemapper service to ServiceManager.
add_service(vendor_pbcs_app, vendor_camera_cameraidremapper_service); add_service(vendor_pbcs_app, camera_cameraidremapper_service);
# Allow PBCS to read debug system properties of the form vendor.camera.pbcs.debug.* # Allow PBCS to read debug system properties of the form vendor.camera.pbcs.debug.*
# and persist.vendor.camera.pbcs.debug.* # and persist.vendor.camera.pbcs.debug.*

View file

@ -1,6 +1,6 @@
allow vendor_pcs_app { allow vendor_pcs_app {
vendor_camera_lyricconfigprovider_service camera_lyricconfigprovider_service
vendor_camera_cameraidremapper_service camera_cameraidremapper_service
edgetpu_app_service edgetpu_app_service
}:service_manager find; }:service_manager find;

21
fingerprint/Android.bp Normal file
View file

@ -0,0 +1,21 @@
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_binary {
name: "dump_fingerprint",
srcs: ["dump_fingerprint.cpp"],
init_rc: ["init.fingerprint.dump.rc"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
shared_libs: [
"libbase",
"libdump",
"liblog",
],
vendor: true,
relative_install_path: "dump",
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 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.
*/
#include <android-base/file.h>
#include <dump/pixel_dump.h>
#include <log/log.h>
#include <stdio.h>
#include <string.h>
static constexpr const char *kTombstonesDirPath = "/data/vendor/tombstones/fingerprint/";
int main() {
printf("------ Fingerprint tombstones ------\n");
std::unique_ptr<DIR, decltype(&closedir)> tombstones_dir(opendir(kTombstonesDirPath), closedir);
if (tombstones_dir) {
dirent *entry;
while ((entry = readdir(tombstones_dir.get())) != nullptr) {
std::string file_name(entry->d_name);
if (!strcmp(file_name.c_str(), ".") || !strcmp(file_name.c_str(), ".."))
continue;
std::string file_path(kTombstonesDirPath + file_name);
dumpFileContent(file_name.c_str(), file_path.c_str());
}
}
return 0;
}

View file

@ -0,0 +1,3 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/fingerprint/sepolicy
PRODUCT_PACKAGES += dump_fingerprint

View file

@ -0,0 +1,2 @@
on post-fs-data
mkdir /data/vendor/tombstones/fingerprint 0770 system system

View file

@ -0,0 +1,5 @@
pixel_bugreport(dump_fingerprint)
allow dump_fingerprint fingerprint_vendor_data_file:dir r_dir_perms;
allow dump_fingerprint fingerprint_vendor_data_file:file r_file_perms;

View file

@ -0,0 +1,2 @@
/vendor/bin/dump/dump_fingerprint u:object_r:dump_fingerprint_exec:s0
/data/vendor/tombstones/fingerprint(/.*)? u:object_r:fingerprint_vendor_data_file:s0

View file

@ -0,0 +1 @@
allow hal_fingerprint trusty_log_device:chr_file r_file_perms;

View file

@ -1,5 +0,0 @@
type vendor_gps_file, file_type, data_file_type;
type sysfs_gps, sysfs_type, fs_type;
userdebug_or_eng(`
typeattribute vendor_gps_file mlstrustedobject;
')

View file

@ -1 +0,0 @@
vendor_internal_prop(vendor_gps_prop)

View file

@ -1,2 +0,0 @@
vendor.gps. u:object_r:vendor_gps_prop:s0
persist.vendor.gps. u:object_r:vendor_gps_prop:s0

View file

@ -1,9 +1,3 @@
type hal_gnss_pixel, domain;
hal_server_domain(hal_gnss_pixel, hal_gnss)
type hal_gnss_pixel_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_gnss_pixel)
#IPC between pixel and vendor HAL #IPC between pixel and vendor HAL
binder_call(hal_gnss_pixel, hal_gnss_default) binder_call(hal_gnss_pixel, hal_gnss_default)

View file

@ -19,38 +19,31 @@
#include <android-base/logging.h> #include <android-base/logging.h>
#include <android-base/stringprintf.h> #include <android-base/stringprintf.h>
#include <android-base/unique_fd.h> #include <android-base/unique_fd.h>
#include <log/log.h>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <glob.h> #include <glob.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/cdefs.h>
#include <unistd.h> #include <unistd.h>
#include <chrono> #include <cstdlib>
#include <vector> #include <vector>
#define NSEC_PER_SEC (1000LL * 1000LL * 1000LL)
#define DEV_GLOB "/sys/devices/platform/*.watchdog_cl*/watchdog/watchdog*" #define DEV_GLOB "/sys/devices/platform/*.watchdog_cl*/watchdog/watchdog*"
#define DEFAULT_INTERVAL 10s
#define DEFAULT_MARGIN 10s
using android::base::Basename; using android::base::Basename;
using android::base::StringPrintf; using android::base::StringPrintf;
using std::literals::chrono_literals::operator""s;
int main(int argc, char** argv) { int main(int __unused argc, char** argv) {
auto min_timeout_nsecs = std::numeric_limits<typeof(NSEC_PER_SEC)>::max();
android::base::InitLogging(argv, &android::base::KernelLogger); android::base::InitLogging(argv, &android::base::KernelLogger);
std::chrono::seconds interval = argc >= 2
? std::chrono::seconds(atoi(argv[1])) : DEFAULT_INTERVAL;
std::chrono::seconds margin = argc >= 3
? std::chrono::seconds(atoi(argv[2])) : DEFAULT_MARGIN;
LOG(INFO) << "gs_watchdogd started (interval " << interval.count()
<< ", margin " << margin.count() << ")!";
glob_t globbuf; glob_t globbuf;
int ret = glob(DEV_GLOB, GLOB_MARK, nullptr, &globbuf); int ret = glob(DEV_GLOB, GLOB_MARK, nullptr, &globbuf);
if (ret) { if (ret) {
@ -61,8 +54,7 @@ int main(int argc, char** argv) {
std::vector<android::base::unique_fd> wdt_dev_fds; std::vector<android::base::unique_fd> wdt_dev_fds;
for (size_t i = 0; i < globbuf.gl_pathc; i++) { for (size_t i = 0; i < globbuf.gl_pathc; i++) {
std::chrono::seconds timeout = interval + margin; int timeout_secs;
int timeout_secs = timeout.count();
std::string dev_path = StringPrintf("/dev/%s", Basename(globbuf.gl_pathv[i]).c_str()); std::string dev_path = StringPrintf("/dev/%s", Basename(globbuf.gl_pathv[i]).c_str());
int fd = TEMP_FAILURE_RETRY(open(dev_path.c_str(), O_RDWR | O_CLOEXEC)); int fd = TEMP_FAILURE_RETRY(open(dev_path.c_str(), O_RDWR | O_CLOEXEC));
@ -71,29 +63,39 @@ int main(int argc, char** argv) {
return 1; return 1;
} }
wdt_dev_fds.emplace_back(fd); ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout_secs);
ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeout_secs);
if (ret) { if (ret) {
PLOG(ERROR) << "Failed to set timeout to " << timeout_secs; PLOG(ERROR) << "Failed to get timeout on " << dev_path;
ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout_secs); continue;
if (ret) { } else {
PLOG(ERROR) << "Failed to get timeout"; min_timeout_nsecs = std::min(min_timeout_nsecs, NSEC_PER_SEC * timeout_secs);
} else {
interval = timeout > margin ? timeout - margin : 1s;
LOG(WARNING) << "Adjusted interval to timeout returned by driver: "
<< "timeout " << timeout_secs
<< ", interval " << interval.count()
<< ", margin " << margin.count();
}
} }
wdt_dev_fds.emplace_back(fd);
} }
globfree(&globbuf); globfree(&globbuf);
if (wdt_dev_fds.empty()) {
LOG(ERROR) << "no valid wdt dev found";
return 1;
}
timespec ts;
auto result = div(min_timeout_nsecs / 2, NSEC_PER_SEC);
ts.tv_sec = result.quot;
ts.tv_nsec = result.rem;
while (true) { while (true) {
timespec rem = ts;
for (const auto& fd : wdt_dev_fds) { for (const auto& fd : wdt_dev_fds) {
TEMP_FAILURE_RETRY(write(fd, "", 1)); TEMP_FAILURE_RETRY(write(fd, "", 1));
} }
sleep(interval.count());
if (TEMP_FAILURE_RETRY(nanosleep(&rem, &rem))) {
PLOG(ERROR) << "nanosleep failed";
return 1;
}
} }
} }

View file

@ -1,5 +1,5 @@
# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin # Pet watchdog timer every half of its timeout period.
service gs_watchdogd /system_ext/bin/gs_watchdogd 10 20 service gs_watchdogd /system_ext/bin/gs_watchdogd
class core class core
oneshot oneshot
seclabel u:r:gs_watchdogd:s0 seclabel u:r:gs_watchdogd:s0

10
power/Android.bp Normal file
View file

@ -0,0 +1,10 @@
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
prebuilt_etc {
name: "init.power-gs.rc",
src: "init.power-gs.rc",
vendor: true,
sub_dir: "init",
}

5
power/OWNERS Normal file
View file

@ -0,0 +1,5 @@
joaodias@google.com
frankvarela@google.com
krossmo@google.com
cozette@google.com
dennisyee@google.com

3
power/init.power-gs.rc Normal file
View file

@ -0,0 +1,3 @@
on property:sys.boot_completed=1
# Reduce pm_freeze_timeout value
write /sys/power/pm_freeze_timeout 1000

1
power/power.mk Normal file
View file

@ -0,0 +1 @@
PRODUCT_PACKAGES += init.power-gs.rc

View file

@ -1,3 +1,11 @@
on init
# Make foreground and background I/O priority different. none-to-rt was
# introduced in kernel 5.14. promote-to-rt was introduced in kernel 6.5.
# Write none-to-rt first and promote-to-rt next to support both older and
# newer kernel versions.
write /dev/blkio/blkio.prio.class none-to-rt
write /dev/blkio/blkio.prio.class promote-to-rt
on property:ro.build.type=userdebug on property:ro.build.type=userdebug
write /dev/sys/block/bootdevice/pixel/enable_pixel_ufs_logging 1 write /dev/sys/block/bootdevice/pixel/enable_pixel_ufs_logging 1
chown system /dev/sg3 chown system /dev/sg3