SDL: show Marshmallow permission dialog for recording audio
Updated SuperTux
This commit is contained in:
@@ -93,6 +93,8 @@ import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import java.util.TreeSet;
|
||||
import android.app.UiModeManager;
|
||||
import android.Manifest;
|
||||
|
||||
|
||||
public class MainActivity extends Activity
|
||||
{
|
||||
@@ -1490,6 +1492,20 @@ public class MainActivity extends Activity
|
||||
setRequestedOrientation(Globals.HorizontalOrientation ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
|
||||
{
|
||||
if (permissions.length == 0 || grantResults.length == 0)
|
||||
{
|
||||
Log.i("SDL", "libSDL: Permission request dialog was aborted");
|
||||
return;
|
||||
}
|
||||
if (Manifest.permission.RECORD_AUDIO.equals(permissions[0]))
|
||||
{
|
||||
Log.i("SDL", "libSDL: Record audio permission: " + (grantResults[0] == PackageManager.PERMISSION_GRANTED ? "GRANTED" : "DENIED"));
|
||||
}
|
||||
}
|
||||
|
||||
public FrameLayout getVideoLayout() { return _videoLayout; }
|
||||
|
||||
DemoGLSurfaceView mGLView = null;
|
||||
|
||||
Reference in New Issue
Block a user