Commit 41bf34e8 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed crash when running on Android < 23

parent 835c0fa7
......@@ -22,6 +22,9 @@ package org.linphone.tester;
import android.Manifest;
import android.app.Activity;
import android.os.Bundle;
import org.linphone.mediastream.Version;
import java.util.ArrayList;
public class SuitesActivity extends Activity {
......@@ -36,12 +39,14 @@ public class SuitesActivity extends Activity {
protected void onStart() {
super.onStart();
ArrayList<String> permissionsList = new ArrayList<>();
permissionsList.add(Manifest.permission.READ_EXTERNAL_STORAGE);
permissionsList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (Version.sdkAboveOrEqual(23)) {
ArrayList<String> permissionsList = new ArrayList<>();
permissionsList.add(Manifest.permission.READ_EXTERNAL_STORAGE);
permissionsList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
String[] permissions = new String[permissionsList.size()];
permissions = permissionsList.toArray(permissions);
requestPermissions(permissions, 0);
String[] permissions = new String[permissionsList.size()];
permissions = permissionsList.toArray(permissions);
requestPermissions(permissions, 0);
}
}
}
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