Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5056c53f authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

CMFileManager: Remove duplicate code

Remove duplicate code for creation of privileged console

Change-Id: I124286f6f33385f8c0faa98406b12fba67310775
parent a0eb9559
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -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);