Permalink
Browse files

front: Request less permissions

  • Loading branch information...
fzurita committed Feb 27, 2016
1 parent cf4d869 commit 42012bce35e9525e519427e1aad621ac23be365f
Showing with 3 additions and 8 deletions.
  1. +0 −1 AndroidManifest.xml
  2. +3 −7 src/paulscode/android/mupen64plusae/SplashActivity.java
View
@@ -18,7 +18,6 @@
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 = 2;
static final int NUM_PERMISSIONS = 1;
/**
* Asset version number, used to determine stale assets. Increment this number every time the
@@ -183,13 +183,10 @@ public void onCreate( Bundle savedInstanceState )
public void requestPermissions()
{
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
|| ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
{
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_EXTERNAL_STORAGE)
|| ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE))
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE))
{
//Show dialog asking for permissions
new AlertDialog.Builder(this)
@@ -242,7 +239,6 @@ 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 42012bc

Please sign in to comment.