Fix issue 1027 (Fix crash when auto start at boot)
This commit is contained in:
parent
cd7c95ce72
commit
0e445bff1e
1 changed files with 6 additions and 1 deletions
|
@ -18,6 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
|
import org.linphone.core.LinphoneCoreFactoryImpl;
|
||||||
|
import org.linphone.core.LpConfig;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -27,7 +30,9 @@ public class BootReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
|
||||||
if (LinphonePreferences.instance().isAutoStartEnabled()) {
|
String path = context.getFilesDir().getAbsolutePath() + "/.linphonerc";
|
||||||
|
LpConfig lpConfig = LinphoneCoreFactoryImpl.instance().createLpConfig(path);
|
||||||
|
if (lpConfig.getBool("app", "auto_start", false)) {
|
||||||
Intent lLinphoneServiceIntent = new Intent(Intent.ACTION_MAIN);
|
Intent lLinphoneServiceIntent = new Intent(Intent.ACTION_MAIN);
|
||||||
lLinphoneServiceIntent.setClass(context, LinphoneService.class);
|
lLinphoneServiceIntent.setClass(context, LinphoneService.class);
|
||||||
context.startService(lLinphoneServiceIntent);;
|
context.startService(lLinphoneServiceIntent);;
|
||||||
|
|
Loading…
Reference in a new issue