Skip to content
Snippets Groups Projects
Commit 62a280b4 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dring: implement signal to retreive cache/data paths

The API to get data/cache paths are Java only.
Currently  we need to access files and cache paths but the design
keeps the possibility to access other paths using the name signal.

Refs #75320

Change-Id: I3f3d52b53633c713071bb0e31803291c51d27b46
parent 3b7aec5f
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
*/
package cx.ring.service;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
......@@ -80,4 +81,14 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
ret.add(audioParams.getBufferSize());
}
@Override
public void getAppDataPath(String name, StringVect ret) {
if (name.equals("files"))
ret.add(mService.getFilesDir().getAbsolutePath());
else if(name.equals("cache"))
ret.add(mService.getCacheDir().getAbsolutePath());
else
ret.add(mService.getDir(name, Context.MODE_PRIVATE).getAbsolutePath());
}
}
......@@ -50,6 +50,7 @@ public:
virtual void errorAlert(int alert){}
virtual void getHardwareAudioFormat(std::vector<int32_t>* /*params_ret*/){}
virtual void getAppDataPath(const std::string& /* name */, std::vector<std::string>* /*path_ret*/){}
};
%}
......@@ -187,4 +188,5 @@ public:
virtual void errorAlert(int alert){}
virtual void getHardwareAudioFormat(std::vector<int32_t>* /*params_ret*/){}
virtual void getAppDataPath(const std::string& /* name */, std::vector<std::string>* /*path_ret*/){}
};
\ No newline at end of file
......@@ -197,6 +197,7 @@ void init(ConfigurationCallback* confM, Callback* callM) {
exportable_callback<ConfigurationSignal::CertificateExpired>(bind(&ConfigurationCallback::certificateExpired, confM, _1 )),
exportable_callback<ConfigurationSignal::CertificateStateChanged>(bind(&ConfigurationCallback::certificateStateChanged, confM, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::GetHardwareAudioFormat>(bind(&ConfigurationCallback::getHardwareAudioFormat, confM, _1 )),
exportable_callback<ConfigurationSignal::GetAppDataPath>(bind(&ConfigurationCallback::getAppDataPath, confM, _1, _2 ))
};
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment