summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonas Kylmälä <joonas.kylmala@iki.fi>2020-11-16 15:24:46 -0500
committerJoonas Kylmälä <joonas.kylmala@iki.fi>2020-11-16 15:36:38 -0500
commit3172c26653c9486118b329189c69bcad7ed35cef (patch)
treec1c569a260a2c6692ee7b0b3334d309702feab7f
parent2ff3eb48b7d073d856525904aa0fe50e65a956ce (diff)
downloaddevice_samsung_midas_common-3172c26653c9486118b329189c69bcad7ed35cef.tar.gz
device_samsung_midas_common-3172c26653c9486118b329189c69bcad7ed35cef.tar.bz2
device_samsung_midas_common-3172c26653c9486118b329189c69bcad7ed35cef.zip
Port to Replicant 11
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
-rw-r--r--BoardConfigCommon.mk18
-rw-r--r--gatekeeper/Android.mk45
-rw-r--r--gatekeeper/SoftGateKeeper.h182
-rw-r--r--gatekeeper/SoftGateKeeperDevice.cpp116
-rw-r--r--gatekeeper/SoftGateKeeperDevice.h76
-rw-r--r--gatekeeper/module.cpp127
-rw-r--r--manifest.xml75
-rw-r--r--memtrack/Android.bp53
-rw-r--r--memtrack/Memtrack.cpp48
-rw-r--r--memtrack/Memtrack.h52
-rw-r--r--memtrack/android.hardware.memtrack@1.0-service.i9305.rc4
-rw-r--r--memtrack/service.cpp41
-rw-r--r--midas.mk39
-rw-r--r--sepolicy/file_contexts1
14 files changed, 27 insertions, 850 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index a485a7e..ddd711d 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -28,18 +28,6 @@ TARGET_NO_BOOTLOADER := true
BOARD_VENDOR := samsung
-# Kernel
-# To append the dtb to the zImage:
-# - Use BOARD_DTB_IMAGE_NAME with the right dtb
-# - Make sure that your kernel source doesn't have
-# any Android patches that would add the zImage-dtb
-# target.
-# The vendor/lineage/build/tasks/kernel.mk file
-# was modified to add support for that feature.
-TARGET_KERNEL_SOURCE := kernel/replicant/linux
-TARGET_KERNEL_CONFIG := replicant_defconfig
-BOARD_KERNEL_IMAGE_NAME := zImage-dtb
-
BOARD_USES_FULL_RECOVERY_IMAGE := false
BOARD_USES_RECOVERY_AS_BOOT := false
@@ -48,7 +36,7 @@ TARGET_USES_MKE2FS := true
# Disable VNDK at this point
BOARD_VNDK_VERSION := current
-BOARD_GPU_DRIVERS := lima kmsro swrast
+BOARD_GPU_DRIVERS := lima kmsro
TARGET_USES_64_BIT_BINDER := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
@@ -58,3 +46,7 @@ BOARD_USES_GENERIC_AUDIO := true
USE_XML_AUDIO_POLICY_CONF := 1
DEVICE_MANIFEST_FILE := device/samsung/midas-common/manifest.xml
+
+PRODUCT_FULL_TREBLE_OVERRIDE := true
+BUILD_BROKEN_USES_BUILD_HOST_STATIC_LIBRARY := true
+BOARD_VENDOR_SEPOLICY_DIRS += device/samsung/midas-common/sepolicy
diff --git a/gatekeeper/Android.mk b/gatekeeper/Android.mk
deleted file mode 100644
index 823bd2b..0000000
--- a/gatekeeper/Android.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Copyright (C) 2015 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := gatekeeper.default
-LOCAL_MODULE_RELATIVE_PATH := hw
-
-LOCAL_CFLAGS := -Wall -Wextra -Werror -Wunused
-LOCAL_SRC_FILES := \
- module.cpp \
- SoftGateKeeperDevice.cpp
-
-
-LOCAL_SHARED_LIBRARIES := \
- libbinder \
- libgatekeeper \
- liblog \
- libhardware \
- libbase \
- libutils \
- libcrypto \
- libhidlbase \
- libhidltransport \
- libhwbinder \
- android.hardware.gatekeeper@1.0 \
-
-LOCAL_STATIC_LIBRARIES := libscrypt_static
-LOCAL_C_INCLUDES := external/scrypt/lib/crypto
-include $(BUILD_SHARED_LIBRARY)
diff --git a/gatekeeper/SoftGateKeeper.h b/gatekeeper/SoftGateKeeper.h
deleted file mode 100644
index 2f4f4d7..0000000
--- a/gatekeeper/SoftGateKeeper.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright 2015 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.
- *
- */
-
-#ifndef SOFT_GATEKEEPER_H_
-#define SOFT_GATEKEEPER_H_
-
-extern "C" {
-#include <openssl/rand.h>
-#include <openssl/sha.h>
-
-#include <crypto_scrypt.h>
-}
-
-#include <android-base/memory.h>
-#include <gatekeeper/gatekeeper.h>
-
-#include <iostream>
-#include <unordered_map>
-#include <memory>
-
-namespace gatekeeper {
-
-struct fast_hash_t {
- uint64_t salt;
- uint8_t digest[SHA256_DIGEST_LENGTH];
-};
-
-class SoftGateKeeper : public GateKeeper {
-public:
- static const uint32_t SIGNATURE_LENGTH_BYTES = 32;
-
- // scrypt params
- static const uint64_t N = 16384;
- static const uint32_t r = 8;
- static const uint32_t p = 1;
-
- static const int MAX_UINT_32_CHARS = 11;
-
- SoftGateKeeper() {
- key_.reset(new uint8_t[SIGNATURE_LENGTH_BYTES]);
- memset(key_.get(), 0, SIGNATURE_LENGTH_BYTES);
- }
-
- virtual ~SoftGateKeeper() {
- }
-
- virtual bool GetAuthTokenKey(const uint8_t **auth_token_key,
- uint32_t *length) const {
- if (auth_token_key == NULL || length == NULL) return false;
- uint8_t *auth_token_key_copy = new uint8_t[SIGNATURE_LENGTH_BYTES];
- memcpy(auth_token_key_copy, key_.get(), SIGNATURE_LENGTH_BYTES);
-
- *auth_token_key = auth_token_key_copy;
- *length = SIGNATURE_LENGTH_BYTES;
- return true;
- }
-
- virtual void GetPasswordKey(const uint8_t **password_key, uint32_t *length) {
- if (password_key == NULL || length == NULL) return;
- uint8_t *password_key_copy = new uint8_t[SIGNATURE_LENGTH_BYTES];
- memcpy(password_key_copy, key_.get(), SIGNATURE_LENGTH_BYTES);
-
- *password_key = password_key_copy;
- *length = SIGNATURE_LENGTH_BYTES;
- }
-
- virtual void ComputePasswordSignature(uint8_t *signature, uint32_t signature_length,
- const uint8_t *, uint32_t, const uint8_t *password,
- uint32_t password_length, salt_t salt) const {
- if (signature == NULL) return;
- crypto_scrypt(password, password_length, reinterpret_cast<uint8_t *>(&salt),
- sizeof(salt), N, r, p, signature, signature_length);
- }
-
- virtual void GetRandom(void *random, uint32_t requested_length) const {
- if (random == NULL) return;
- RAND_pseudo_bytes((uint8_t *) random, requested_length);
- }
-
- virtual void ComputeSignature(uint8_t *signature, uint32_t signature_length,
- const uint8_t *, uint32_t, const uint8_t *, const uint32_t) const {
- if (signature == NULL) return;
- memset(signature, 0, signature_length);
- }
-
- virtual uint64_t GetMillisecondsSinceBoot() const {
- struct timespec time;
- int res = clock_gettime(CLOCK_BOOTTIME, &time);
- if (res < 0) return 0;
- return (time.tv_sec * 1000) + (time.tv_nsec / 1000 / 1000);
- }
-
- virtual bool IsHardwareBacked() const {
- return false;
- }
-
- virtual bool GetFailureRecord(uint32_t uid, secure_id_t user_id, failure_record_t *record,
- bool /* secure */) {
- failure_record_t *stored = &failure_map_[uid];
- if (user_id != stored->secure_user_id) {
- stored->secure_user_id = user_id;
- stored->last_checked_timestamp = 0;
- stored->failure_counter = 0;
- }
- memcpy(record, stored, sizeof(*record));
- return true;
- }
-
- virtual bool ClearFailureRecord(uint32_t uid, secure_id_t user_id, bool /* secure */) {
- failure_record_t *stored = &failure_map_[uid];
- stored->secure_user_id = user_id;
- stored->last_checked_timestamp = 0;
- stored->failure_counter = 0;
- return true;
- }
-
- virtual bool WriteFailureRecord(uint32_t uid, failure_record_t *record, bool /* secure */) {
- failure_map_[uid] = *record;
- return true;
- }
-
- fast_hash_t ComputeFastHash(const SizedBuffer &password, uint64_t salt) {
- fast_hash_t fast_hash;
- size_t digest_size = password.length + sizeof(salt);
- std::unique_ptr<uint8_t[]> digest(new uint8_t[digest_size]);
- memcpy(digest.get(), &salt, sizeof(salt));
- memcpy(digest.get() + sizeof(salt), password.buffer.get(), password.length);
-
- SHA256(digest.get(), digest_size, (uint8_t *) &fast_hash.digest);
-
- fast_hash.salt = salt;
- return fast_hash;
- }
-
- bool VerifyFast(const fast_hash_t &fast_hash, const SizedBuffer &password) {
- fast_hash_t computed = ComputeFastHash(password, fast_hash.salt);
- return memcmp(computed.digest, fast_hash.digest, SHA256_DIGEST_LENGTH) == 0;
- }
-
- bool DoVerify(const password_handle_t *expected_handle, const SizedBuffer &password) {
- uint64_t user_id = android::base::get_unaligned<secure_id_t>(&expected_handle->user_id);
- FastHashMap::const_iterator it = fast_hash_map_.find(user_id);
- if (it != fast_hash_map_.end() && VerifyFast(it->second, password)) {
- return true;
- } else {
- if (GateKeeper::DoVerify(expected_handle, password)) {
- uint64_t salt;
- GetRandom(&salt, sizeof(salt));
- fast_hash_map_[user_id] = ComputeFastHash(password, salt);
- return true;
- }
- }
-
- return false;
- }
-
-private:
-
- typedef std::unordered_map<uint32_t, failure_record_t> FailureRecordMap;
- typedef std::unordered_map<uint64_t, fast_hash_t> FastHashMap;
-
- std::unique_ptr<uint8_t[]> key_;
- FailureRecordMap failure_map_;
- FastHashMap fast_hash_map_;
-};
-}
-
-#endif // SOFT_GATEKEEPER_H_
diff --git a/gatekeeper/SoftGateKeeperDevice.cpp b/gatekeeper/SoftGateKeeperDevice.cpp
deleted file mode 100644
index a504fba..0000000
--- a/gatekeeper/SoftGateKeeperDevice.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2015 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 "SoftGateKeeper.h"
-#include "SoftGateKeeperDevice.h"
-
-namespace i9305 {
-
-int SoftGateKeeperDevice::enroll(uint32_t uid,
- const uint8_t *current_password_handle, uint32_t current_password_handle_length,
- const uint8_t *current_password, uint32_t current_password_length,
- const uint8_t *desired_password, uint32_t desired_password_length,
- uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length) {
-
- if (enrolled_password_handle == NULL || enrolled_password_handle_length == NULL ||
- desired_password == NULL || desired_password_length == 0)
- return -EINVAL;
-
- // Current password and current password handle go together
- if (current_password_handle == NULL || current_password_handle_length == 0 ||
- current_password == NULL || current_password_length == 0) {
- current_password_handle = NULL;
- current_password_handle_length = 0;
- current_password = NULL;
- current_password_length = 0;
- }
-
- SizedBuffer desired_password_buffer(desired_password_length);
- memcpy(desired_password_buffer.buffer.get(), desired_password, desired_password_length);
-
- SizedBuffer current_password_handle_buffer(current_password_handle_length);
- if (current_password_handle) {
- memcpy(current_password_handle_buffer.buffer.get(), current_password_handle,
- current_password_handle_length);
- }
-
- SizedBuffer current_password_buffer(current_password_length);
- if (current_password) {
- memcpy(current_password_buffer.buffer.get(), current_password, current_password_length);
- }
-
- EnrollRequest request(uid, &current_password_handle_buffer, &desired_password_buffer,
- &current_password_buffer);
- EnrollResponse response;
-
- impl_->Enroll(request, &response);
-
- if (response.error == ERROR_RETRY) {
- return response.retry_timeout;
- } else if (response.error != ERROR_NONE) {
- return -EINVAL;
- }
-
- *enrolled_password_handle = response.enrolled_password_handle.buffer.release();
- gatekeeper::password_handle_t *handle =
- reinterpret_cast<gatekeeper::password_handle_t *>(*enrolled_password_handle);
- //FIXIT: We need to move this module to host with gatekeeper pipe
- handle->hardware_backed = true;
-
- *enrolled_password_handle_length = response.enrolled_password_handle.length;
- return 0;
-}
-
-int SoftGateKeeperDevice::verify(uint32_t uid,
- uint64_t challenge, const uint8_t *enrolled_password_handle,
- uint32_t enrolled_password_handle_length, const uint8_t *provided_password,
- uint32_t provided_password_length, uint8_t **auth_token, uint32_t *auth_token_length,
- bool *request_reenroll) {
-
- if (enrolled_password_handle == NULL ||
- provided_password == NULL) {
- return -EINVAL;
- }
-
- SizedBuffer password_handle_buffer(enrolled_password_handle_length);
- memcpy(password_handle_buffer.buffer.get(), enrolled_password_handle,
- enrolled_password_handle_length);
- SizedBuffer provided_password_buffer(provided_password_length);
- memcpy(provided_password_buffer.buffer.get(), provided_password, provided_password_length);
-
- VerifyRequest request(uid, challenge, &password_handle_buffer, &provided_password_buffer);
- VerifyResponse response;
-
- impl_->Verify(request, &response);
-
- if (response.error == ERROR_RETRY) {
- return response.retry_timeout;
- } else if (response.error != ERROR_NONE) {
- return -EINVAL;
- }
-
- if (auth_token != NULL && auth_token_length != NULL) {
- *auth_token = response.auth_token.buffer.release();
- *auth_token_length = response.auth_token.length;
- }
-
- if (request_reenroll != NULL) {
- *request_reenroll = response.request_reenroll;
- }
-
- return 0;
-}
-
-} // namespace i9305
diff --git a/gatekeeper/SoftGateKeeperDevice.h b/gatekeeper/SoftGateKeeperDevice.h
deleted file mode 100644
index 05aceaa..0000000
--- a/gatekeeper/SoftGateKeeperDevice.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#ifndef SOFT_GATEKEEPER_DEVICE_H_
-#define SOFT_GATEKEEPER_DEVICE_H_
-
-#include "SoftGateKeeper.h"
-
-#include <memory>
-
-using namespace gatekeeper;
-
-namespace i9305 {
-
-/**
- * Software based GateKeeper implementation
- */
-class SoftGateKeeperDevice {
-public:
- SoftGateKeeperDevice() {
- impl_.reset(new SoftGateKeeper());
- }
-
- // Wrappers to translate the gatekeeper HAL API to the Kegyuard Messages API.
-
- /**
- * Enrolls password_payload, which should be derived from a user selected pin or password,
- * with the authentication factor private key used only for enrolling authentication
- * factor data.
- *
- * Returns: 0 on success or an error code less than 0 on error.
- * On error, enrolled_password_handle will not be allocated.
- */
- int enroll(uint32_t uid,
- const uint8_t *current_password_handle, uint32_t current_password_handle_length,
- const uint8_t *current_password, uint32_t current_password_length,
- const uint8_t *desired_password, uint32_t desired_password_length,
- uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length);
-
- /**
- * Verifies provided_password matches enrolled_password_handle.
- *
- * Implementations of this module may retain the result of this call
- * to attest to the recency of authentication.
- *
- * On success, writes the address of a verification token to auth_token,
- * usable to attest password verification to other trusted services. Clients
- * may pass NULL for this value.
- *
- * Returns: 0 on success or an error code less than 0 on error
- * On error, verification token will not be allocated
- */
- int verify(uint32_t uid, uint64_t challenge,
- const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length,
- const uint8_t *provided_password, uint32_t provided_password_length,
- uint8_t **auth_token, uint32_t *auth_token_length, bool *request_reenroll);
-private:
- std::unique_ptr<SoftGateKeeper> impl_;
-};
-
-} // namespace gatekeeper
-
-#endif //SOFT_GATEKEEPER_DEVICE_H_
diff --git a/gatekeeper/module.cpp b/gatekeeper/module.cpp
deleted file mode 100644
index a3d678c..0000000
--- a/gatekeeper/module.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2015 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 <hardware/hardware.h>
-#include <hardware/gatekeeper.h>
-#define LOG_TAG "I9305Gatekeeper"
-#include <cutils/log.h>
-
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "SoftGateKeeper.h"
-#include "SoftGateKeeperDevice.h"
-
-using i9305::SoftGateKeeperDevice;
-
-struct i9305_gatekeeper_device {
- gatekeeper_device device;
- SoftGateKeeperDevice *s_gatekeeper;
-};
-
-static i9305_gatekeeper_device s_device;
-
-static int enroll(const struct gatekeeper_device *dev __unused, uint32_t uid,
- const uint8_t *current_password_handle, uint32_t current_password_handle_length,
- const uint8_t *current_password, uint32_t current_password_length,
- const uint8_t *desired_password, uint32_t desired_password_length,
- uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length) {
-
- SoftGateKeeperDevice *s_gatekeeper = ((i9305_gatekeeper_device*)(dev))->s_gatekeeper;
- ALOGE("called %s with gate keeper %p device %p\n", __func__, s_gatekeeper, dev);
- if (s_gatekeeper == nullptr) {
- abort();
- return -EINVAL;
- }
-
- return s_gatekeeper->enroll(uid,
- current_password_handle, current_password_handle_length,
- current_password, current_password_length,
- desired_password, desired_password_length,
- enrolled_password_handle, enrolled_password_handle_length);
-}
-
-static int verify(const struct gatekeeper_device *dev __unused, uint32_t uid, uint64_t challenge,
- const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length,
- const uint8_t *provided_password, uint32_t provided_password_length,
- uint8_t **auth_token, uint32_t *auth_token_length, bool *request_reenroll) {
- SoftGateKeeperDevice *s_gatekeeper = ((i9305_gatekeeper_device*)(dev))->s_gatekeeper;
- ALOGE("called %s with gate keeper %p device %p\n", __func__, s_gatekeeper, dev);
- if (s_gatekeeper == nullptr) return -EINVAL;
- return s_gatekeeper->verify(uid, challenge,
- enrolled_password_handle, enrolled_password_handle_length,
- provided_password, provided_password_length,
- auth_token, auth_token_length, request_reenroll);
-}
-
-static int close_device(hw_device_t* dev __unused) {
- SoftGateKeeperDevice *s_gatekeeper = ((i9305_gatekeeper_device*)(dev))->s_gatekeeper;
- if (s_gatekeeper == nullptr) return 0;
- delete s_gatekeeper;
- s_gatekeeper = nullptr;
- ALOGE("called %s with gate keeper %p device %p\n", __func__, s_gatekeeper, dev);
- return 0;
-}
-
-static int i9305_gatekeeper_open(const hw_module_t *module, const char *name,
- hw_device_t **device) {
-
- if (strcmp(name, HARDWARE_GATEKEEPER) != 0) {
- abort();
- return -EINVAL;
- }
-
- memset(&s_device, 0, sizeof(s_device));
-
- SoftGateKeeperDevice *s_gatekeeper = new SoftGateKeeperDevice();
- if (s_gatekeeper == nullptr) return -ENOMEM;
-
- s_device.s_gatekeeper = s_gatekeeper;
-
- s_device.device.common.tag = HARDWARE_DEVICE_TAG;
- s_device.device.common.version = 1;
- s_device.device.common.module = const_cast<hw_module_t *>(module);
- s_device.device.common.close = close_device;
-
- s_device.device.enroll = enroll;
- s_device.device.verify = verify;
- s_device.device.delete_user = nullptr;
- s_device.device.delete_all_users = nullptr;
-
- *device = &s_device.device.common;
- ALOGE("called %s with gate keeper %p device %p\n", __func__, s_gatekeeper, *device);
-
- return 0;
-}
-
-static struct hw_module_methods_t gatekeeper_module_methods = {
- .open = i9305_gatekeeper_open,
-};
-
-struct gatekeeper_module HAL_MODULE_INFO_SYM __attribute__((visibility("default"))) = {
- .common = {
- .tag = HARDWARE_MODULE_TAG,
- .module_api_version = GATEKEEPER_MODULE_API_VERSION_0_1,
- .hal_api_version = HARDWARE_HAL_API_VERSION,
- .id = GATEKEEPER_HARDWARE_MODULE_ID,
- .name = "I9305 GateKeeper HAL",
- .author = "The Android Open Source Project",
- .methods = &gatekeeper_module_methods,
- .dso = 0,
- .reserved = {}
- },
-};
diff --git a/manifest.xml b/manifest.xml
index 760ebaa..15f6013 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -15,11 +15,11 @@
limitations under the License.
-->
-<manifest version="1.0" type="device" target-level="2">
+<manifest version="1.0" type="device" target-level="5">
<hal>
<name>android.hardware.graphics.mapper</name>
<transport arch="32+64">passthrough</transport>
- <version>2.0</version>
+ <version>2.1</version>
<interface>
<name>IMapper</name>
<instance>default</instance>
@@ -34,19 +34,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal>
- <name>android.hardware.configstore</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>ISurfaceFlingerConfigs</name>
- <instance>default</instance>
- </interface>
- </hal>
<hal format="hidl">
<name>android.hardware.audio.effect</name>
<transport>hwbinder</transport>
- <version>5.0</version>
+ <version>6.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
@@ -55,7 +46,7 @@
<hal format="hidl">
<name>android.hardware.audio</name>
<transport>hwbinder</transport>
- <version>5.0</version>
+ <version>6.0</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
@@ -64,7 +55,7 @@
<hal format="hidl">
<name>android.hardware.soundtrigger</name>
<transport>hwbinder</transport>
- <version>2.2</version>
+ <version>2.3</version>
<interface>
<name>ISoundTriggerHw</name>
<instance>default</instance>
@@ -89,18 +80,9 @@
</interface>
</hal>
<hal>
- <name>android.hardware.gatekeeper</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IGatekeeper</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal>
<name>android.hardware.drm</name>
<transport>hwbinder</transport>
- <version>1.0</version>
+ <version>1.3</version>
<interface>
<name>ICryptoFactory</name>
<instance>default</instance>
@@ -123,49 +105,4 @@
<instance>default</instance>
</interface>
</hal>
- <hal>
- <name>android.hardware.light</name>
- <transport>hwbinder</transport>
- <version>2.0</version>
- <interface>
- <name>ILight</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal>
- <name>android.hardware.memtrack</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IMemtrack</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal>
- <name>android.hardware.oemlock</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IOemLock</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal>
- <name>android.hardware.usb</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IUsb</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal>
- <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/memtrack/Android.bp b/memtrack/Android.bp
deleted file mode 100644
index fbacef5..0000000
--- a/memtrack/Android.bp
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2016 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.
-
-cc_library_shared {
- name: "android.hardware.memtrack@1.0-impl.i9305",
- defaults: ["hidl_defaults"],
- proprietary: true,
- relative_install_path: "hw",
- srcs: ["Memtrack.cpp"],
-
- shared_libs: [
- "libbase",
- "liblog",
- "libhidlbase",
- "libhidltransport",
- "libhardware",
- "libutils",
- "android.hardware.memtrack@1.0",
- ],
-
-}
-
-cc_binary {
- relative_install_path: "hw",
- defaults: ["hidl_defaults"],
- proprietary: true,
- name: "android.hardware.memtrack@1.0-service.i9305",
- init_rc: ["android.hardware.memtrack@1.0-service.i9305.rc"],
- srcs: ["service.cpp", "Memtrack.cpp"],
-
- shared_libs: [
- "liblog",
- "libbase",
- "libdl",
- "libutils",
- "libhardware",
- "libhidlbase",
- "libhidltransport",
- "android.hardware.memtrack@1.0",
- ],
-
-}
diff --git a/memtrack/Memtrack.cpp b/memtrack/Memtrack.cpp
deleted file mode 100644
index e27d140..0000000
--- a/memtrack/Memtrack.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2016 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 "android.hardware.memtrack@1.0-impl-i9305"
-
-#include <log/log.h>
-
-#include <hardware/hardware.h>
-
-#include "Memtrack.h"
-
-namespace android {
-namespace hardware {
-namespace memtrack {
-namespace V1_0 {
-namespace implementation {
-
-Memtrack::Memtrack() {}
-
-Memtrack::~Memtrack() {}
-
-
-Return<void> Memtrack::getMemory(int32_t, MemtrackType,
- getMemory_cb _hidl_cb) {
- hidl_vec<MemtrackRecord> records;
-
- _hidl_cb(MemtrackStatus::SUCCESS, records);
- return Void();
-}
-
-} // namespace implementation
-} // namespace V1_0
-} // namespace memtrack
-} // namespace hardware
-} // namespace android
diff --git a/memtrack/Memtrack.h b/memtrack/Memtrack.h
deleted file mode 100644
index 2d84f80..0000000
--- a/memtrack/Memtrack.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-#ifndef ANDROID_HARDWARE_MEMTRACK_V1_0_MEMTRACK_H
-#define ANDROID_HARDWARE_MEMTRACK_V1_0_MEMTRACK_H
-
-#include <android/hardware/memtrack/1.0/IMemtrack.h>
-#include <hidl/Status.h>
-
-#include <hidl/MQDescriptor.h>
-namespace android {
-namespace hardware {
-namespace memtrack {
-namespace V1_0 {
-namespace implementation {
-
-using ::android::hardware::memtrack::V1_0::IMemtrack;
-using ::android::hardware::memtrack::V1_0::MemtrackRecord;
-using ::android::hardware::memtrack::V1_0::MemtrackStatus;
-using ::android::hardware::memtrack::V1_0::MemtrackType;
-using ::android::hardware::Return;
-using ::android::hardware::Void;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::hidl_string;
-using ::android::sp;
-
-struct Memtrack : public IMemtrack {
- Memtrack();
- virtual ~Memtrack();
- Return<void> getMemory(int32_t pid, MemtrackType type, getMemory_cb _hidl_cb) override;
-};
-
-} // namespace implementation
-} // namespace V1_0
-} // namespace memtrack
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_MEMTRACK_V1_0_MEMTRACK_H
diff --git a/memtrack/android.hardware.memtrack@1.0-service.i9305.rc b/memtrack/android.hardware.memtrack@1.0-service.i9305.rc
deleted file mode 100644
index 62b5ae6..0000000
--- a/memtrack/android.hardware.memtrack@1.0-service.i9305.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service vendor.memtrack-hal-1-0 /vendor/bin/hw/android.hardware.memtrack@1.0-service.i9305
- class hal
- user system
- group system
diff --git a/memtrack/service.cpp b/memtrack/service.cpp
deleted file mode 100644
index 17b3643..0000000
--- a/memtrack/service.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018 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 "android.hardware.memtrack@1.0-service-i9305"
-
-#include <android/hardware/memtrack/1.0/IMemtrack.h>
-#include <hidl/HidlTransportSupport.h>
-#include <log/log.h>
-#include <utils/StrongPointer.h>
-#include "Memtrack.h"
-
-using android::hardware::configureRpcThreadpool;
-using android::hardware::joinRpcThreadpool;
-using android::hardware::memtrack::V1_0::IMemtrack;
-using android::hardware::memtrack::V1_0::implementation::Memtrack;
-
-int main(int /* argc */, char** /* argv */) {
- configureRpcThreadpool(1, true);
-
- android::sp<IMemtrack> memtrack = new Memtrack();
- if (memtrack->registerAsService() != ::android::OK) {
- ALOGE("Failed to register Memtrack HAL instance");
- return -1;
- }
-
- joinRpcThreadpool();
- return 1; // joinRpcThreadpool shouldn't exit
-}
diff --git a/midas.mk b/midas.mk
index 00d3183..1ac88a2 100644
--- a/midas.mk
+++ b/midas.mk
@@ -14,10 +14,6 @@
# limitations under the License.
#
-PRODUCT_PACKAGES += \
- android.hardware.memtrack@1.0-impl.i9305 \
- android.hardware.memtrack@1.0-service.i9305
-
# Graphics
PRODUCT_PACKAGES += \
gralloc.gbm \
@@ -36,14 +32,18 @@ PRODUCT_PACKAGES += \
PRODUCT_AAPT_CONFIG := normal
PRODUCT_AAPT_PREF_CONFIG := xhdpi
-# OEM Lock HAL
-PRODUCT_PACKAGES += \
- android.hardware.oemlock@1.0-service
-
# USB HAL
PRODUCT_PACKAGES += \
android.hardware.usb@1.0-service
+PRODUCT_PACKAGES += \
+ android.hardware.health@2.1-service \
+ android.hardware.health@2.1-impl \
+
+# Power HAL
+PRODUCT_PACKAGES += \
+ android.hardware.power-service.example \
+
# VNDK
PRODUCT_PACKAGES += \
vndk_package
@@ -60,9 +60,9 @@ PRODUCT_PACKAGES += \
# Audio
PRODUCT_PACKAGES += \
audio.stub.default \
- android.hardware.audio.effect@5.0-impl \
- android.hardware.audio@5.0-impl \
- android.hardware.soundtrigger@2.2-impl \
+ android.hardware.audio.effect@6.0-impl \
+ android.hardware.audio@6.0-impl \
+ android.hardware.soundtrigger@2.3-impl \
android.hardware.audio@2.0-service \
# A2DP
@@ -75,6 +75,7 @@ PRODUCT_PACKAGES += \
sound_trigger.stub.default \
PRODUCT_COPY_FILES += \
+ kernel/replicant/linux/zImage-dtb:kernel \
frameworks/av/media/libeffects/data/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \
frameworks/av/services/audiopolicy/config/audio_policy_configuration_stub.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/stub_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/stub_audio_policy_configuration.xml \
@@ -108,11 +109,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.vibrator@1.0-impl \
-# Power HAL packages
-PRODUCT_PACKAGES += \
- android.hardware.power@1.0-impl \
- android.hardware.power@1.0-service \
-
# Memory HAL packages
PRODUCT_PACKAGES += \
android.hidl.memory@1.0-impl \
@@ -126,16 +122,14 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.vr@1.0-impl \
-# Gatekeeper
-PRODUCT_PACKAGES += \
- android.hardware.gatekeeper@1.0-impl \
- android.hardware.gatekeeper@1.0-service \
-
# DRM – check if this needs to be removed!
PRODUCT_PACKAGES += \
android.hardware.drm@1.0-impl \
android.hardware.drm@1.0-service \
+PRODUCT_PACKAGES += \
+ android.hardware.gatekeeper@1.0-service.software
+
# Get root on the serial console for -eng builds
# This can help debugging early boot issues
ifeq ($(TARGET_BUILD_VARIANT),eng)
@@ -147,9 +141,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
persist.service.adb.enable=1 \
persist.sys.usb.config=adb
-# Hack to get a working GateKeeper
-PRODUCT_PACKAGES += gatekeeper.default
-
# Enable flashing through heimdall
PRODUCT_COPY_FILES += $(LOCAL_PATH)/resize2fs_partitions.sh:system/bin/resize2fs_partitions.sh
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
new file mode 100644
index 0000000..35d19da
--- /dev/null
+++ b/sepolicy/file_contexts
@@ -0,0 +1 @@
+/(vendor|system/vendor)/bin/hw/android\.hardware\.gatekeeper@1\.0-service\.software u:object_r:hal_gatekeeper_default_exec:s0