| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 package org.webrtc; | 11 package org.webrtc; |
| 12 | 12 |
| 13 public class CallSessionFileRotatingLogSink { | 13 public class CallSessionFileRotatingLogSink { |
| 14 static { | 14 static { |
| 15 System.loadLibrary("jingle_peerconnection_so"); | 15 System.loadLibrary("jingle_peerconnection_so"); |
| 16 } | 16 } |
| 17 | 17 |
| 18 private long nativeSink; | 18 private long nativeSink; |
| 19 | 19 |
| 20 public static byte[] getLogData(String dirPath) { | 20 /* TODO(nisse): Reimplement in plain java. |
| 21 return nativeGetLogData(dirPath); | 21 public static byte[] getLogData(String dirPath) { |
| 22 } | 22 return nativeGetLogData(dirPath); |
| 23 | 23 } |
| 24 */ |
| 24 public CallSessionFileRotatingLogSink( | 25 public CallSessionFileRotatingLogSink( |
| 25 String dirPath, int maxFileSize, Logging.Severity severity) { | 26 String dirPath, int maxFileSize, Logging.Severity severity) { |
| 26 nativeSink = nativeAddSink(dirPath, maxFileSize, severity.ordinal()); | 27 nativeSink = nativeAddSink(dirPath, maxFileSize, severity.ordinal()); |
| 27 } | 28 } |
| 28 | 29 |
| 29 public void dispose() { | 30 public void dispose() { |
| 30 if (nativeSink != 0) { | 31 if (nativeSink != 0) { |
| 31 nativeDeleteSink(nativeSink); | 32 nativeDeleteSink(nativeSink); |
| 32 nativeSink = 0; | 33 nativeSink = 0; |
| 33 } | 34 } |
| 34 } | 35 } |
| 35 | 36 |
| 36 private static native long nativeAddSink(String dirPath, int maxFileSize, int
severity); | 37 private static native long nativeAddSink(String dirPath, int maxFileSize, int
severity); |
| 37 private static native void nativeDeleteSink(long nativeSink); | 38 private static native void nativeDeleteSink(long nativeSink); |
| 38 private static native byte[] nativeGetLogData(String dirPath); | |
| 39 } | 39 } |
| OLD | NEW |