Skip to content

Commit 23ca210

Browse files
authored
Remove Platform.logEvent(). (#1169)
Long past obsolete.
1 parent a05fd9e commit 23ca210

5 files changed

Lines changed: 0 additions & 66 deletions

File tree

android/src/main/java/org/conscrypt/Platform.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -457,28 +457,6 @@ public static void checkServerTrusted(X509TrustManager tm, X509Certificate[] cha
457457
}
458458
}
459459

460-
/**
461-
* Logs to the system EventLog system.
462-
*/
463-
@SuppressWarnings("LiteralClassName")
464-
public static void logEvent(String message) {
465-
try {
466-
Class<?> processClass = Class.forName("android.os.Process");
467-
Object processInstance = processClass.getDeclaredConstructor().newInstance();
468-
Method myUidMethod = processClass.getMethod("myUid", (Class[]) null);
469-
int uid = (Integer) myUidMethod.invoke(processInstance);
470-
471-
Class<?> eventLogClass = Class.forName("android.util.EventLog");
472-
Object eventLogInstance = eventLogClass.getDeclaredConstructor().newInstance();
473-
Method writeEventMethod =
474-
eventLogClass.getMethod("writeEvent", Integer.TYPE, Object[].class);
475-
writeEventMethod.invoke(eventLogInstance, 0x534e4554 /* SNET */,
476-
new Object[] {"conscrypt", uid, message});
477-
} catch (Exception e) {
478-
// Fail silently
479-
}
480-
}
481-
482460
static SSLEngine wrapEngine(ConscryptEngine engine) {
483461
// For now, don't wrap on Android.
484462
return engine;

common/src/main/java/org/conscrypt/ConscryptEngine.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,6 @@ private void beginHandshakeInternal() throws SSLException {
441441
handshake();
442442
releaseResources = false;
443443
} catch (IOException e) {
444-
// Write CCS errors to EventLog
445-
String message = e.getMessage();
446-
// Must match error reason string of SSL_R_UNEXPECTED_CCS (in ssl/ssl_err.c)
447-
if (message.contains("unexpected CCS")) {
448-
String logMessage = String.format("ssl_unexpected_ccs: host=%s", getPeerHost());
449-
Platform.logEvent(logMessage);
450-
}
451444
closeAll();
452445
throw SSLUtils.toSSLHandshakeException(e);
453446
} finally {

common/src/main/java/org/conscrypt/ConscryptFileDescriptorSocket.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ public final void startHandshake() throws IOException {
246246
return;
247247
}
248248
}
249-
250-
// Write CCS errors to EventLog
251-
String message = e.getMessage();
252-
// Must match error string of SSL_R_UNEXPECTED_CCS
253-
if (message.contains("unexpected CCS")) {
254-
String logMessage =
255-
String.format("ssl_unexpected_ccs: host=%s", getHostnameOrIP());
256-
Platform.logEvent(logMessage);
257-
}
258-
259249
throw e;
260250
}
261251

openjdk/src/main/java/org/conscrypt/Platform.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,6 @@ static void checkServerTrusted(X509TrustManager tm, X509Certificate[] chain, Str
343343
}
344344
}
345345

346-
/**
347-
* Logs to the system EventLog system.
348-
*/
349-
@SuppressWarnings("unused")
350-
static void logEvent(@SuppressWarnings("unused") String message) {}
351-
352346
/**
353347
* For unbundled versions, SNI is always enabled by default.
354348
*/

platform/src/main/java/org/conscrypt/Platform.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -264,27 +264,6 @@ static void checkServerTrusted(X509TrustManager tm, X509Certificate[] chain, Str
264264
}
265265
}
266266

267-
/**
268-
* Logs to the system EventLog system.
269-
*/
270-
static void logEvent(String message) {
271-
try {
272-
Class processClass = Class.forName("android.os.Process");
273-
Object processInstance = processClass.newInstance();
274-
Method myUidMethod = processClass.getMethod("myUid", (Class[]) null);
275-
int uid = (Integer) myUidMethod.invoke(processInstance);
276-
277-
Class eventLogClass = Class.forName("android.util.EventLog");
278-
Object eventLogInstance = eventLogClass.newInstance();
279-
Method writeEventMethod = eventLogClass.getMethod(
280-
"writeEvent", new Class[] {Integer.TYPE, Object[].class});
281-
writeEventMethod.invoke(eventLogInstance, 0x534e4554 /* SNET */,
282-
new Object[] {"conscrypt", uid, message});
283-
} catch (Exception e) {
284-
// Do not log and fail silently
285-
}
286-
}
287-
288267
static SSLEngine wrapEngine(ConscryptEngine engine) {
289268
return new Java8EngineWrapper(engine);
290269
}

0 commit comments

Comments
 (0)