Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-CMFileManager: Commit

packages/apps/CMFileManager


Commit MetaInfo

Revision04abecbd076213fb735d3569c3e12cb6175c6f93 (tree)
Time2016-01-25 05:30:47
AuthorMichael Bestas <mikeioannina@cyan...>
CommiterMichael Bestas

Log Message

Improve permission string & cleanup code

Change-Id: Id0e4be70019fd03c165d4f95f1b5f6323e2802ea

Change Summary

Incremental Difference

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -842,6 +842,7 @@
842842 <string name="welcome_msg">Welcome to the CyanogenMod file manager.\n\nThis app allows you to explore the file system and do operations that could break your device. To prevent damage, the app will start in a safe, low-privileged mode.\n\nYou can access the advanced, full-privileged mode via Settings. It\'s your responsibility to ensure that an operation doesn\'t break your system.\n\nThe CyanogenMod Team</string>
843843
844844 <string name="activity_not_found_exception">Couldn\'t find an app to open this file</string>
845- <string name="storage_permissions_denied">Storage permissions denied!</string>
845+
846+ <string name="storage_permissions_denied">The app cannot run without permission to write to external storage.</string>
846847
847848 </resources>
--- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
+++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java
@@ -32,6 +32,7 @@ import android.content.res.XmlResourceParser;
3232 import android.database.Cursor;
3333 import android.graphics.Color;
3434 import android.graphics.drawable.Drawable;
35+import android.Manifest;
3536 import android.net.Uri;
3637 import android.nfc.NfcAdapter;
3738 import android.nfc.NfcEvent;
@@ -495,14 +496,13 @@ public class NavigationActivity extends Activity
495496
496497 private static final int REQUEST_CODE_STORAGE_PERMS = 321;
497498 private boolean hasPermissions() {
498- String permission = "android.permission.WRITE_EXTERNAL_STORAGE";
499- int res = checkCallingOrSelfPermission(permission);
499+ int res = checkCallingOrSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
500500 return (res == PackageManager.PERMISSION_GRANTED);
501501 }
502502
503503 private void requestNecessaryPermissions() {
504504 String[] permissions = new String[] {
505- "android.permission.WRITE_EXTERNAL_STORAGE"
505+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
506506 };
507507 requestPermissions(permissions, REQUEST_CODE_STORAGE_PERMS);
508508 }
Show on old repository browser