From 74aee37f8871419836e7757225b72833f5734b9b Mon Sep 17 00:00:00 2001
From: paweldomas <pawel.domas@jitsi.org>
Date: Tue, 4 Jun 2013 17:20:11 +0200
Subject: [PATCH] Default properties on Android. Close stream.

Changes the method used to load default properties file on Android.
Closes the stream after loading.
---
 .../configuration/ConfigurationServiceImpl.java   | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java b/src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java
index 581e0b13..e5ea194a 100644
--- a/src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java
+++ b/src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java
@@ -1559,7 +1559,20 @@ private void loadDefaultProperties(String fileName)
         {
             Properties fileProps = new Properties();
 
-            fileProps.load(ClassLoader.getSystemResourceAsStream(fileName));
+            InputStream fileStream;
+            if(OSUtils.IS_ANDROID)
+            {
+                fileStream
+                        = getClass().getClassLoader()
+                                .getResourceAsStream(fileName);
+            }
+            else
+            {
+                fileStream = ClassLoader.getSystemResourceAsStream(fileName);
+            }
+
+            fileProps.load(fileStream);
+            fileStream.close();
 
             // now get those properties and place them into the mutable and
             // immutable properties maps.
-- 
GitLab