Loading java/src/com/android/inputmethod/research/ResearchLog.java +9 −10 Original line number Original line Diff line number Diff line Loading @@ -207,23 +207,22 @@ public class ResearchLog { * called. The cached value is returned in future calls. * called. The cached value is returned in future calls. */ */ public JsonWriter getInitializedJsonWriterLocked() { public JsonWriter getInitializedJsonWriterLocked() { if (mJsonWriter != NULL_JSON_WRITER || mFile == null) return mJsonWriter; try { try { if (mJsonWriter == NULL_JSON_WRITER && mFile != null) { final JsonWriter jsonWriter = createJsonWriter(mContext, mFile); final JsonWriter jsonWriter = createJsonWriter(mContext, mFile); if (jsonWriter != null) { if (jsonWriter != null) { jsonWriter.beginArray(); jsonWriter.beginArray(); mJsonWriter = jsonWriter; mJsonWriter = jsonWriter; mHasWrittenData = true; mHasWrittenData = true; } } } } catch (final IOException e) { } catch (IOException e) { Log.w(TAG, "Error in JsonWriter; disabling logging", e); Log.w(TAG, "Error in JsonWriter; disabling logging", e); try { try { mJsonWriter.close(); mJsonWriter.close(); } catch (IllegalStateException e1) { } catch (final IllegalStateException e1) { // Assume that this is just the json not being terminated properly. // Assume that this is just the json not being terminated properly. // Ignore // Ignore } catch (IOException e1) { } catch (final IOException e1) { Log.w(TAG, "Error in closing JsonWriter; disabling logging", e1); Log.w(TAG, "Error in closing JsonWriter; disabling logging", e1); } finally { } finally { mJsonWriter = NULL_JSON_WRITER; mJsonWriter = NULL_JSON_WRITER; Loading Loading
java/src/com/android/inputmethod/research/ResearchLog.java +9 −10 Original line number Original line Diff line number Diff line Loading @@ -207,23 +207,22 @@ public class ResearchLog { * called. The cached value is returned in future calls. * called. The cached value is returned in future calls. */ */ public JsonWriter getInitializedJsonWriterLocked() { public JsonWriter getInitializedJsonWriterLocked() { if (mJsonWriter != NULL_JSON_WRITER || mFile == null) return mJsonWriter; try { try { if (mJsonWriter == NULL_JSON_WRITER && mFile != null) { final JsonWriter jsonWriter = createJsonWriter(mContext, mFile); final JsonWriter jsonWriter = createJsonWriter(mContext, mFile); if (jsonWriter != null) { if (jsonWriter != null) { jsonWriter.beginArray(); jsonWriter.beginArray(); mJsonWriter = jsonWriter; mJsonWriter = jsonWriter; mHasWrittenData = true; mHasWrittenData = true; } } } } catch (final IOException e) { } catch (IOException e) { Log.w(TAG, "Error in JsonWriter; disabling logging", e); Log.w(TAG, "Error in JsonWriter; disabling logging", e); try { try { mJsonWriter.close(); mJsonWriter.close(); } catch (IllegalStateException e1) { } catch (final IllegalStateException e1) { // Assume that this is just the json not being terminated properly. // Assume that this is just the json not being terminated properly. // Ignore // Ignore } catch (IOException e1) { } catch (final IOException e1) { Log.w(TAG, "Error in closing JsonWriter; disabling logging", e1); Log.w(TAG, "Error in closing JsonWriter; disabling logging", e1); } finally { } finally { mJsonWriter = NULL_JSON_WRITER; mJsonWriter = NULL_JSON_WRITER; Loading