diff options
Diffstat (limited to 'core/java/android/net/TrafficStats.java')
-rw-r--r-- | core/java/android/net/TrafficStats.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java index 973fac1..ee3e165 100644 --- a/core/java/android/net/TrafficStats.java +++ b/core/java/android/net/TrafficStats.java @@ -238,6 +238,19 @@ public class TrafficStats { } } + /** {@hide} */ + public static void closeQuietly(INetworkStatsSession session) { + // TODO: move to NetworkStatsService once it exists + if (session != null) { + try { + session.close(); + } catch (RuntimeException rethrown) { + throw rethrown; + } catch (Exception ignored) { + } + } + } + /** * Get the total number of packets transmitted through the mobile interface. * |