mirror of
https://github.com/yurisieucuti/treble_evolution.git
synced 2024-11-24 08:36:19 +00:00
47 lines
1.9 KiB
Diff
47 lines
1.9 KiB
Diff
From cf95007923bc00daa88a2831843ff5ebc962f494 Mon Sep 17 00:00:00 2001
|
|
From: Pierre-Hugues Husson <phh@phh.me>
|
|
Date: Thu, 17 May 2018 20:28:35 +0200
|
|
Subject: [PATCH 05/51] Don't crash if there is IR HAL is not declared
|
|
|
|
Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
|
|
---
|
|
.../core/java/com/android/server/ConsumerIrService.java | 8 --------
|
|
.../core/jni/com_android_server_ConsumerIrService.cpp | 2 +-
|
|
2 files changed, 1 insertion(+), 9 deletions(-)
|
|
|
|
diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java
|
|
index ee6d808aa549..be8e2bb95ece 100644
|
|
--- a/services/core/java/com/android/server/ConsumerIrService.java
|
|
+++ b/services/core/java/com/android/server/ConsumerIrService.java
|
|
@@ -53,14 +53,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
|
|
mWakeLock.setReferenceCounted(true);
|
|
|
|
mHasNativeHal = getHalService();
|
|
-
|
|
- if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONSUMER_IR)) {
|
|
- if (!mHasNativeHal) {
|
|
- throw new RuntimeException("FEATURE_CONSUMER_IR present, but no IR HAL loaded!");
|
|
- }
|
|
- } else if (mHasNativeHal) {
|
|
- throw new RuntimeException("IR HAL present, but FEATURE_CONSUMER_IR is not set!");
|
|
- }
|
|
}
|
|
|
|
@Override
|
|
diff --git a/services/core/jni/com_android_server_ConsumerIrService.cpp b/services/core/jni/com_android_server_ConsumerIrService.cpp
|
|
index 63daa3503bd5..d068ec06fc14 100644
|
|
--- a/services/core/jni/com_android_server_ConsumerIrService.cpp
|
|
+++ b/services/core/jni/com_android_server_ConsumerIrService.cpp
|
|
@@ -36,7 +36,7 @@ static sp<IConsumerIr> mHal;
|
|
|
|
static jboolean getHidlHalService(JNIEnv * /* env */, jobject /* obj */) {
|
|
// TODO(b/31632518)
|
|
- mHal = IConsumerIr::getService();
|
|
+ mHal = IConsumerIr::tryGetService();
|
|
return mHal != nullptr;
|
|
}
|
|
|
|
--
|
|
2.25.1
|
|
|