Permalink
Browse files

front: Reverted permission changes.

  • Loading branch information...
1 parent 53f95c4 commit 2add88d0e1408e3e92b6a30b64a5f5de03a3a5ca @fzurita fzurita committed Mar 17, 2016
Showing with 7 additions and 3 deletions.
  1. +1 −0 AndroidManifest.xml
  2. +6 −3 src/paulscode/android/mupen64plusae/SplashActivity.java
View
@@ -18,6 +18,7 @@
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
@@ -67,7 +67,7 @@
static final int PERMISSION_REQUEST = 177;
//Total number of permissions requested
- static final int NUM_PERMISSIONS = 1;
+ static final int NUM_PERMISSIONS = 2;
/**
* Asset version number, used to determine stale assets. Increment this number every time the
@@ -191,10 +191,12 @@ public void onCreate( Bundle savedInstanceState )
public void requestPermissions()
{
- if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED ||
+ ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
{
// Should we show an explanation?
- if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE))
+ if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_EXTERNAL_STORAGE) ||
+ ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE))
{
//Show dialog asking for permissions
new AlertDialog.Builder(this)
@@ -247,6 +249,7 @@ public void onClick(DialogInterface dialog, int which)
public void actuallyRequestPermissions()
{
ActivityCompat.requestPermissions(this, new String[] {
+ Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE }, PERMISSION_REQUEST);
}

0 comments on commit 2add88d

Please sign in to comment.