diff options
| author | Jorge Ruesga <jorge@ruesga.com> | 2012-11-17 02:04:40 +0100 |
|---|---|---|
| committer | Jorge Ruesga <jorge@ruesga.com> | 2012-11-17 02:04:40 +0100 |
| commit | 5056c53f5893ea8a103459cccdb490bde6a61e70 (patch) | |
| tree | e8c39d5409e0e67760d3ac73669124a22c168f65 | |
| parent | a0eb955991e6e6275c0276b0e651785e30d3e64a (diff) | |
| download | android_packages_apps_CMFileManager-5056c53f5893ea8a103459cccdb490bde6a61e70.tar.gz android_packages_apps_CMFileManager-5056c53f5893ea8a103459cccdb490bde6a61e70.tar.bz2 android_packages_apps_CMFileManager-5056c53f5893ea8a103459cccdb490bde6a61e70.zip | |
CMFileManager: Remove duplicate code
Remove duplicate code for creation of privileged console
Change-Id: I124286f6f33385f8c0faa98406b12fba67310775
| -rw-r--r-- | src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java b/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java index 34ff8c4e..331e8245 100644 --- a/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java +++ b/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java @@ -375,19 +375,9 @@ public final class ConsoleBuilder { throws FileNotFoundException, IOException, InvalidCommandDefinitionException, ConsoleAllocException, InsufficientPermissionsException { try { - PrivilegedConsole console = new PrivilegedConsole(initialDirectory); - console.setBufferSize(context.getResources().getInteger(R.integer.buffer_size)); - console.alloc(); - if (console.getIdentity().getUser().getId() != ROOT_UID) { - //The console is not a privileged console - try { - console.dealloc(); - } catch (Throwable ex) { - /**NON BLOCK**/ - } - throw new InsufficientPermissionsException(null); - } - return console; + // Create the privileged console + return createPrivilegedConsole(context, initialDirectory); + } catch (ConsoleAllocException caEx) { //Show a message with the problem? Log.w(TAG, context.getString(R.string.msgs_privileged_console_alloc_failed), caEx); |
