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

Commit 694a1401 authored by Danny Baumann's avatar Danny Baumann
Browse files

Don't prompt for superuser access when picking a file.

The file picker is chrooted anyway, so it's confusing to the user to see
a superuser prompt in that case.

Change-Id: Ied492fc2270a343e17057efd252606f230d02180
parent 3755dde4
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -428,11 +428,7 @@ public class EditorActivity extends Activity implements TextWatcher {
     */
    private boolean initializeConsole() {
        try {
            // Is there a console allocate
            if (!ConsoleBuilder.isAlloc()) {
                // Create a console
                ConsoleBuilder.getConsole(this);
            }
            ConsoleBuilder.createDefaultConsole(this);
            // There is a console allocated. Use it.
            return true;
        } catch (Throwable _throw) {
+1 −1
Original line number Diff line number Diff line
@@ -574,7 +574,7 @@ public class NavigationActivity extends Activity
            public void run() {
                //Create the default console (from the preferences)
                try {
                    Console console = ConsoleBuilder.getConsole(NavigationActivity.this);
                    Console console = ConsoleBuilder.createDefaultConsole(NavigationActivity.this);
                    if (console == null) {
                        throw new ConsoleAllocException("console == null"); //$NON-NLS-1$
                    }
+2 −5
Original line number Diff line number Diff line
@@ -305,11 +305,8 @@ public class PickerActivity extends Activity
     */
    private boolean initializeConsole() {
        try {
            // Is there a console allocate
            if (!ConsoleBuilder.isAlloc()) {
            // Create a ChRooted console
            ConsoleBuilder.createDefaultConsole(this, false, false);
            }
            // There is a console allocated. Use it.
            return true;
        } catch (Throwable _throw) {
+1 −5
Original line number Diff line number Diff line
@@ -200,11 +200,7 @@ public class ShortcutActivity extends Activity implements OnCancelListener, OnDi
     */
    private boolean initializeConsole() {
        try {
            // Is there a console allocate
            if (!ConsoleBuilder.isAlloc()) {
                // Create a console
                ConsoleBuilder.getConsole(this);
            }
            ConsoleBuilder.createDefaultConsole(this);
            // There is a console allocated. Use it.
            return true;
        } catch (Throwable _throw) {
+0 −19
Original line number Diff line number Diff line
@@ -94,13 +94,6 @@ public final class ConsoleBuilder {
                return null;
            }
            createDefaultConsole(context);
        } else {
            // Need to change the console? Is the appropriate console for the current mode?
            if (FileManagerApplication.getAccessMode().
                    compareTo(AccessMode.ROOT) == 0 && !isPrivileged()) {
                // Force to change the console
                createDefaultConsole(context);
            }
        }
        return sHolder.getConsole();
    }
@@ -404,18 +397,6 @@ public final class ConsoleBuilder {
        }
    }

    /**
     * Method that returns if the current console is a privileged console
     *
     * @return boolean If the current console is a privileged console
     */
    public static boolean isAlloc() {
        if (sHolder != null && sHolder.getConsole() != null) {
            return true;
        }
        return false;
    }

    /**
     * Method that returns if the current console is a privileged console
     *