Commit 40ae364d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added getDataPath, getConfigPath and getCachePath to AndroidPlatformHelper

parent df7f5059
......@@ -40,18 +40,19 @@ import android.os.Build;
* This class is instanciated directly by the linphone library in order to access specific features only accessible in java.
**/
public class AndroidPlatformHelper{
public class AndroidPlatformHelper {
private Context mContext;
private WifiManager.WifiLock mWifiLock;
private WifiManager.MulticastLock mMcastLock;
private ConnectivityManager mConnectivityManager;
private PowerManager mPowerManager;
private WakeLock mWakeLock;
public AndroidPlatformHelper(Object ctx_obj){
Context ctx = (Context) ctx_obj;
WifiManager wifiMgr = ctx.getSystemService(WifiManager.class);
mPowerManager = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);
mConnectivityManager = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
public AndroidPlatformHelper(Object ctx_obj) {
mContext = (Context) ctx_obj;
WifiManager wifiMgr = mContext.getSystemService(WifiManager.class);
mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mConnectivityManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidPlatformHelper");
mWakeLock.setReferenceCounted(true);
......@@ -61,7 +62,7 @@ public class AndroidPlatformHelper{
mWifiLock.setReferenceCounted(true);
}
public Object getPowerManager(){
public Object getPowerManager() {
return mPowerManager;
}
......@@ -85,26 +86,44 @@ public class AndroidPlatformHelper{
Log.i("getDnsServers() returning");
return servers;
}
public void acquireWifiLock(){
public String getDataPath() {
return mContext.getFilesDir().getAbsolutePath();
}
public String getConfigPath() {
return mContext.getFilesDir().getAbsolutePath();
}
public String getCachePath() {
return mContext.getCacheDir().getAbsolutePath();
}
public void acquireWifiLock() {
Log.i("acquireWifiLock()");
mWifiLock.acquire();
}
public void releaseWifiLock(){
public void releaseWifiLock() {
Log.i("releaseWifiLock()");
mWifiLock.release();
}
public void acquireMcastLock(){
public void acquireMcastLock() {
Log.i("acquireMcastLock()");
mMcastLock.acquire();
}
public void releaseMcastLock(){
public void releaseMcastLock() {
Log.i("releaseMcastLock()");
mMcastLock.release();
}
public void acquireCpuLock(){
public void acquireCpuLock() {
Log.i("acquireCpuLock()");
mWakeLock.acquire();
}
public void releaseCpuLock(){
Log.i("releaseCpuLock()");
mWakeLock.release();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment