summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mark Teffeteller <mteffeteller@google.com> 2024-12-05 02:38:06 +0000
committer Mark Teffeteller <mteffeteller@google.com> 2024-12-05 02:38:06 +0000
commit3c2e67e31368bd50a1e18a2124f15d97bec74573 (patch)
tree9379ff429166b670a35c5d28e7be528bf9816e5b
parentf85810e94b7ac02b0b5b8974ab389e0251b1af26 (diff)
Call transport connection initialization in the ID service.
Bug: 369313906 Test: atest frameworks/base/services/tests/security/intrusiondetection/src/com/android /server/security/intrusiondetection/IntrusionDetectionServiceTest.java Flag: android.security.afl_api Change-Id: I9f302e9f9daeeba7d7d2e5f95fffc81942e97837
-rw-r--r--services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java10
-rw-r--r--services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java14
2 files changed, 12 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java
index 2ddbeab5c8d8..a16e66de09a9 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java
@@ -50,7 +50,7 @@ public class IntrusionDetectionEventTransportConnection implements ServiceConnec
private static final String PRODUCTION_BUILD = "user";
private static final String PROPERTY_BUILD_TYPE = "ro.build.type";
private static final String PROPERTY_INTRUSION_DETECTION_SERVICE_NAME =
- "intrusiondetection_service_name";
+ "debug.intrusiondetection_package_name";
private static final long FUTURE_TIMEOUT_MILLIS = 60 * 1000; // 1 min
private static final String TAG = "IntrusionDetectionEventTransportConnection";
private final Context mContext;
@@ -147,9 +147,9 @@ public class IntrusionDetectionEventTransportConnection implements ServiceConnec
}
private String getSystemPropertyValue(String propertyName) {
- String comamandString = "getprop " + propertyName;
+ String commandString = "getprop " + propertyName;
try {
- Process process = Runtime.getRuntime().exec(comamandString);
+ Process process = Runtime.getRuntime().exec(commandString);
BufferedReader reader =
new BufferedReader(new InputStreamReader(process.getInputStream()));
String propertyValue = reader.readLine();
@@ -175,6 +175,10 @@ public class IntrusionDetectionEventTransportConnection implements ServiceConnec
mIntrusionDetectionEventTransportConfig =
getSystemPropertyValue(PROPERTY_INTRUSION_DETECTION_SERVICE_NAME);
}
+ Slog.d(
+ TAG,
+ "mIntrusionDetectionEventTransportConfig: "
+ + mIntrusionDetectionEventTransportConfig);
if (TextUtils.isEmpty(mIntrusionDetectionEventTransportConfig)) {
Slog.e(TAG, "Unable to find a valid config for the transport service");
diff --git a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java
index 0287b415b9c2..8ff1c7f22ffb 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java
@@ -232,12 +232,10 @@ public class IntrusionDetectionService extends SystemService {
return;
}
- // TODO: temporarily disable the following for the CTS IntrusionDetectionManagerTest.
- // Enable it when the transport component is ready.
- // if (!mIntrusionDetectionEventTransportConnection.initialize()) {
- // callback.onFailure(ERROR_TRANSPORT_UNAVAILABLE);
- // return;
- // }
+ if (!mIntrusionDetectionEventTransportConnection.initialize()) {
+ callback.onFailure(ERROR_TRANSPORT_UNAVAILABLE);
+ return;
+ }
mDataAggregator.enable();
mState = STATE_ENABLED;
@@ -252,9 +250,7 @@ public class IntrusionDetectionService extends SystemService {
return;
}
- // TODO: temporarily disable the following for the CTS IntrusionDetectionManagerTest.
- // Enable it when the transport component is ready.
- // mIntrusionDetectionEventTransportConnection.release();
+ mIntrusionDetectionEventTransportConnection.release();
mDataAggregator.disable();
mState = STATE_DISABLED;
notifyStateMonitors();