Update vold to use KM4.1
This CL updates vold to use the Keymaster 4.1 interface, but does not yet call any of the new methods. Test: Boot the device Change-Id: I4574a2f6eead3b71d1e89488b496b734694620c7
This commit is contained in:
parent
e3d2051668
commit
ae8f06fe1c
4 changed files with 22 additions and 7 deletions
|
@ -44,6 +44,7 @@ cc_defaults {
|
|||
shared_libs: [
|
||||
"android.hardware.keymaster@3.0",
|
||||
"android.hardware.keymaster@4.0",
|
||||
"android.hardware.keymaster@4.1",
|
||||
"android.hardware.boot@1.0",
|
||||
"libbase",
|
||||
"libbinder",
|
||||
|
@ -58,6 +59,7 @@ cc_defaults {
|
|||
"libincfs",
|
||||
"libhidlbase",
|
||||
"libkeymaster4support",
|
||||
"libkeymaster4_1support",
|
||||
"libkeyutils",
|
||||
"liblog",
|
||||
"liblogwrap",
|
||||
|
@ -232,10 +234,12 @@ cc_binary {
|
|||
|
||||
"android.hardware.keymaster@3.0",
|
||||
"android.hardware.keymaster@4.0",
|
||||
"android.hardware.keymaster@4.1",
|
||||
"libhardware",
|
||||
"libhardware_legacy",
|
||||
"libhidlbase",
|
||||
"libkeymaster4support",
|
||||
"libkeymaster4_1support",
|
||||
"libutils",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
#include <cutils/properties.h>
|
||||
|
||||
#include <hardware/hw_auth_token.h>
|
||||
#include <keymasterV4_0/authorization_set.h>
|
||||
#include <keymasterV4_0/keymaster_utils.h>
|
||||
#include <keymasterV4_1/authorization_set.h>
|
||||
#include <keymasterV4_1/keymaster_utils.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#include "Keymaster.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <keymasterV4_0/authorization_set.h>
|
||||
#include <keymasterV4_0/keymaster_utils.h>
|
||||
#include <keymasterV4_1/authorization_set.h>
|
||||
#include <keymasterV4_1/keymaster_utils.h>
|
||||
|
||||
namespace android {
|
||||
namespace vold {
|
||||
|
|
17
Keymaster.h
17
Keymaster.h
|
@ -24,13 +24,24 @@
|
|||
#include <utility>
|
||||
|
||||
#include <android-base/macros.h>
|
||||
#include <keymasterV4_0/Keymaster.h>
|
||||
#include <keymasterV4_0/authorization_set.h>
|
||||
#include <keymasterV4_1/Keymaster.h>
|
||||
#include <keymasterV4_1/authorization_set.h>
|
||||
|
||||
namespace android {
|
||||
namespace vold {
|
||||
|
||||
namespace km = ::android::hardware::keymaster::V4_0;
|
||||
namespace km {
|
||||
|
||||
using namespace ::android::hardware::keymaster::V4_1;
|
||||
|
||||
// Surprisingly -- to me, at least -- this is totally fine. You can re-define symbols that were
|
||||
// brought in via a using directive (the "using namespace") above. In general this seems like a
|
||||
// dangerous thing to rely on, but in this case its implications are simple and straightforward:
|
||||
// km::ErrorCode refers to the 4.0 ErrorCode, though we pull everything else from 4.1.
|
||||
using ErrorCode = ::android::hardware::keymaster::V4_0::ErrorCode;
|
||||
|
||||
} // namespace km
|
||||
|
||||
using KmDevice = km::support::Keymaster;
|
||||
|
||||
// C++ wrappers to the Keymaster hidl interface.
|
||||
|
|
Loading…
Reference in a new issue