Snap for 11641371 from a6cd2c4a8d to 24Q3-release

Change-Id: I6701e54ee0d48b34322a5f3d8dd2feeb00e7bc06
This commit is contained in:
Android Build Coastguard Worker 2024-03-28 23:02:07 +00:00
commit 3c5df18d11
19 changed files with 236 additions and 1 deletions

View file

@ -0,0 +1,5 @@
PRODUCT_PACKAGES += PixelSupportPrebuilt
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pixelsupport/sepolicy/vendor
PRODUCT_PUBLIC_SEPOLICY_DIRS += device/google/gs-common/pixelsupport/sepolicy/product/public
PRODUCT_PRIVATE_SEPOLICY_DIRS += device/google/gs-common/pixelsupport/sepolicy/product/private

View file

@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIGBzCCA++gAwIBAgIVAJriiL3+mR75mIC8e0Xqoz59LduNMA0GCSqGSIb3DQEBCwUAMIGSMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEU
MBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxLjAsBgNVBAMMJWNvbV9nb29n
bGVfYW5kcm9pZF9hcHBzX3BpeGVsX3N1cHBvcnQwIBcNMjIxMjEyMTM1MDA3WhgPMjA1MjEyMTIx
MzUwMDdaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91
bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxLjAsBgNV
BAMMJWNvbV9nb29nbGVfYW5kcm9pZF9hcHBzX3BpeGVsX3N1cHBvcnQwggIiMA0GCSqGSIb3DQEB
AQUAA4ICDwAwggIKAoICAQCSWvRumhZOIAZmWKcuVjc1l3OIIWc/nSRVnsfdzeRqK0jwVFcTqMDs
kmZtEj/UTW+N91ExRzWvAQ027AcE7TGF3X2iKKAfpSB0fpVQato5RIzOrRb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09e8T45Y+//eMlrbORJAbji
H5cfD9aSO2z4slN4B4w+Fw9Kn+a7bsN2xhv7lvAgQ92aq9g/YS1YysZ7kSoCpmKl7rN+0V/RGRVP
ab2Cb0C3+JewTnOAF30e7zVs9Vaq3oTAV4XFYNiDRUBU/rvv8EIZKcBdufFJmCGYUpmm1EQQdsTt
mFMPEh5I4Qd0sy+HKvLjThcMGHqDX0bCeXkbFZdj0GXPOOt5LX8NZBdnsbVgENrZml318uLEj3ZU
DlojsfsTlVcs5eIPX6Dkx0OdgVcMAXnLF+vjP/ygWuLqiPFPCrZD1b+2g2P9Yip3e221tuyca42b
q3bvQEBwOsA=
-----END CERTIFICATE-----

View file

@ -0,0 +1,2 @@
[@PIXELSUPPORT]
ALL : device/google/gs-common/pixelsupport/sepolicy/product/private/certs/pixelsupport.x509.pem

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<policy>
<!--
* A signature is a hex encoded X.509 certificate or a tag defined in
keys.conf and is required for each signer tag.
* A signer tag may contain a seinfo tag and multiple package stanzas.
* A default tag is allowed that can contain policy for all apps not signed with a
previously listed cert. It may not contain any inner package stanzas.
* Each signer/default/package tag is allowed to contain one seinfo tag. This tag
represents additional info that each app can use in setting a SELinux security
context on the eventual process.
* When a package is installed the following logic is used to determine what seinfo
value, if any, is assigned.
- All signatures used to sign the app are checked first.
- If a signer stanza has inner package stanzas, those stanza will be checked
to try and match the package name of the app. If the package name matches
then that seinfo tag is used. If no inner package matches then the outer
seinfo tag is assigned.
- The default tag is consulted last if needed.
-->
<!-- PixelSupport app key -->
<signer signature="@PIXELSUPPORT" >
<seinfo value="PixelSupport" />
</signer>
</policy>

View file

@ -0,0 +1,11 @@
typeattribute pixelsupport_app coredomain;
app_domain(pixelsupport_app)
# Access the network.
net_domain(pixelsupport_app)
# Access bluetooth.
bluetooth_domain(pixelsupport_app)
allow pixelsupport_app app_api_service:service_manager find;
allow pixelsupport_app radio_service:service_manager find;

View file

@ -0,0 +1,2 @@
# Pixel Support App
user=_app seinfo=PixelSupport name=com.google.android.apps.pixel.support domain=pixelsupport_app type=app_data_file isPrivApp=true levelFrom=user

View file

@ -0,0 +1,2 @@
type pixelsupport_app, domain;

View file

@ -0,0 +1,2 @@
set_prop(pixelsupport_app, vendor_gti_prop)

View file

@ -17,3 +17,19 @@ sh_binary {
vendor: true,
sub_dir: "dump",
}
cc_binary {
name: "touch_gti_ical",
srcs: ["touch_gti_ical.cpp"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
shared_libs: [
"libbase",
"libcutils",
"liblog",
],
vendor: true,
}

View file

@ -1,3 +1,4 @@
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/sepolicy
PRODUCT_PACKAGES += dump_gti0.sh
PRODUCT_PACKAGES += touch_gti_ical

View file

@ -24,3 +24,15 @@ on property:sys.boot_completed=1
chown system system /proc/goog_touch_interface/gti.0/ss_base
chown system system /proc/goog_touch_interface/gti.0/ss_diff
chown system system /proc/goog_touch_interface/gti.0/ss_raw
on property:vendor.touch.gti0.ical=*
setprop vendor.touch.gti0.ical.state init
start touch_gti0_ical
wait_for_prop vendor.touch.gti0.ical.state done
service touch_gti0_ical /vendor/bin/touch_gti_ical 0 ${vendor.touch.gti0.ical}
class main
user system
group system shell
disabled
oneshot

View file

@ -24,3 +24,15 @@ on property:sys.boot_completed=1
chown system system /proc/goog_touch_interface/gti.1/ss_base
chown system system /proc/goog_touch_interface/gti.1/ss_diff
chown system system /proc/goog_touch_interface/gti.1/ss_raw
on property:vendor.touch.gti1.ical=*
setprop vendor.touch.gti1.ical.state init
start touch_gti1_ical
wait_for_prop vendor.touch.gti1.ical.state done
service touch_gti1_ical /vendor/bin/touch_gti_ical 1 ${vendor.touch.gti1.ical}
class main
user system
group system shell
disabled
oneshot

View file

@ -1,2 +1,2 @@
/vendor/bin/dump/dump_gti0\.sh u:object_r:dump_gti_exec:s0
/vendor/bin/touch_gti_ical u:object_r:gti_ical_exec:s0

View file

@ -0,0 +1,8 @@
type gti_ical, domain;
type gti_ical_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(gti_ical)
allow gti_ical sysfs_touch_gti:file rw_file_perms;
allow gti_ical sysfs_touch_gti:dir search;
set_prop(gti_ical, vendor_gti_prop)

View file

@ -0,0 +1 @@
system_public_prop(vendor_gti_prop)

View file

@ -0,0 +1 @@
vendor.touch.gti0. u:object_r:vendor_gti_prop:s0

View file

@ -0,0 +1 @@
set_prop(vendor_init, vendor_gti_prop)

View file

@ -0,0 +1 @@
vendor.touch.gti1. u:object_r:vendor_gti_prop:s0

View file

@ -0,0 +1,101 @@
/*
** 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.
*/
#define LOG_TAG "touch_gti_ical"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef __ANDROID__
#include <cutils/properties.h>
#include <cutils/log.h>
#else
#define property_set
#define property_get
#define ALOGI printf
#define ALOGW printf
#endif
int main(int argc, char *argv[])
{
char *line = NULL;
size_t len = 0;
FILE *ical_fd;
const char *ical_state_prop[2] = {
[0] = "vendor.touch.gti0.ical.state",
[1] = "vendor.touch.gti1.ical.state",
};
const char *ical_result_prop[2] = {
[0] = "vendor.touch.gti0.ical.result",
[1] = "vendor.touch.gti1.ical.result",
};
const char *ical_sysfs[2] = {
[0] = "/sys/devices/virtual/goog_touch_interface/gti.0/interactive_calibrate",
[1] = "/sys/devices/virtual/goog_touch_interface/gti.1/interactive_calibrate",
};
const char *ical_state_prop_path = ical_state_prop[0];
const char *ical_result_prop_path = ical_result_prop[0];
const char *ical_sysfs_path = ical_sysfs[0];
if (argc < 3) {
ALOGW("No target dev or command for interactive_calibrate sysfs.\n");
property_set(ical_state_prop[0], "done");
property_set(ical_state_prop[1], "done");
return 0;
}
if (strncmp(argv[1], "1", strlen(argv[1])) == 0 ||
strncmp(argv[1], "gti1", strlen(argv[1])) == 0 ||
strncmp(argv[1], "gti.1", strlen(argv[1])) == 0) {
ical_state_prop_path = ical_state_prop[1];
ical_result_prop_path = ical_result_prop[1];
ical_sysfs_path = ical_sysfs[1];
}
property_set(ical_result_prop_path, "na");
property_set(ical_state_prop_path, "running");
if (access(ical_sysfs_path, F_OK | R_OK | W_OK)) {
ALOGW("Can't access %s\n", ical_sysfs_path);
property_set(ical_state_prop_path, "done");
return 0;
}
ical_fd = fopen(ical_sysfs_path, "r+");
if (ical_fd == NULL) {
ALOGW("Can't fopen %s\n", ical_sysfs_path);
property_set(ical_state_prop_path, "done");
return 0;
}
if (strncmp(argv[2], "read", strlen(argv[2])) == 0) {
getline(&line, &len, ical_fd);
if (line != NULL) {
property_set(ical_state_prop_path, "read");
property_set(ical_result_prop_path, line);
ALOGI("read: %s => %s", ical_sysfs_path, line);
free(line);
}
} else {
property_set(ical_state_prop_path, argv[2]);
fwrite(argv[2], 1, strlen(argv[2]), ical_fd);
ALOGI("write: %s => %s\n", argv[2], ical_sysfs_path);
}
property_set(ical_state_prop_path, "done");
fclose(ical_fd);
return 0;
}