From c334085636273895dba8e03c197f119456d6bc18 Mon Sep 17 00:00:00 2001 From: jruesga Date: Sat, 20 Oct 2012 20:13:05 +0200 Subject: [PATCH] Jail room mode This is the mode by default of the application. This change create an non-privileged space (like a jail) from which the user can not exit, This zone is the storage volumes. This hides all advanced functionalities that could give access to another filesystem zones and actions that could damage the system. * CleanUp --- res/values/strings.xml | 4 +- .../cyanogenmod/explorer/ExplorerApplication.java | 12 ++-- .../explorer/activities/NavigationActivity.java | 4 +- .../explorer/activities/SearchActivity.java | 4 +- .../explorer/commands/ExecutableCreator.java | 70 +++++++++--------- .../commands/shell/AsyncResultProgram.java | 2 +- .../explorer/commands/shell/IdentityCommand.java | 2 +- .../explorer/commands/shell/ListCommand.java | 6 +- .../explorer/commands/shell/ReadCommand.java | 6 +- src/com/cyanogenmod/explorer/console/Console.java | 4 +- .../explorer/console/ConsoleBuilder.java | 18 ++--- .../explorer/console/shell/ShellConsole.java | 8 +-- .../cyanogenmod/explorer/model/Permissions.java | 4 +- .../explorer/ui/dialogs/ActionsDialog.java | 2 +- .../explorer/ui/dialogs/ChooseConsoleDialog.java | 2 +- .../explorer/ui/dialogs/ExecutionDialog.java | 4 +- .../explorer/ui/dialogs/FilesystemInfoDialog.java | 30 +++++--- .../explorer/ui/dialogs/FsoPropertiesDialog.java | 16 +++-- .../explorer/ui/policy/CopyMoveActionPolicy.java | 4 +- .../explorer/ui/policy/DeleteActionPolicy.java | 2 +- .../explorer/ui/widgets/BreadcrumbView.java | 2 +- .../explorer/ui/widgets/NavigationView.java | 6 +- .../ui/widgets/NonFocusableButtonItem.java | 2 +- .../widgets/TransparentNonFocusableButtonItem.java | 2 +- .../cyanogenmod/explorer/util/CommandHelper.java | 82 +++++++++++----------- .../cyanogenmod/explorer/util/ExceptionUtil.java | 5 +- src/com/cyanogenmod/explorer/util/ParseHelper.java | 10 +-- .../cyanogenmod/explorer/util/StorageHelper.java | 4 +- .../commands/shell/ProcessIdCommandTest.java | 2 +- .../commands/shell/SendSignalCommandTest.java | 2 +- .../commands/shell/UncompressCommandTest.java | 20 +++--- 31 files changed, 180 insertions(+), 161 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index a86e2b5..08c264b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -96,7 +96,7 @@ An error was detected. The operation was unsuccessful. + non-privileged console) --> The operation requires elevated permissions. Try changing to a privileged console. @@ -113,7 +113,7 @@ The operation failed. A console couldn\'t be allocated. - + The operation can\'t be cancelled. The filesystem is read-only. Try to mount the diff --git a/src/com/cyanogenmod/explorer/ExplorerApplication.java b/src/com/cyanogenmod/explorer/ExplorerApplication.java index be3cdf8..c5bb40f 100644 --- a/src/com/cyanogenmod/explorer/ExplorerApplication.java +++ b/src/com/cyanogenmod/explorer/ExplorerApplication.java @@ -96,7 +96,7 @@ public final class ExplorerApplication extends Application { ExplorerSettings.SETTINGS_SUPERUSER_MODE, Boolean.TRUE, true); } catch (Throwable ex) { - Log.w(TAG, "cann't save console preference", ex); //$NON-NLS-1$ + Log.w(TAG, "can't save console preference", ex); //$NON-NLS-1$ } } else { try { @@ -104,10 +104,10 @@ public final class ExplorerApplication extends Application { ExplorerSettings.SETTINGS_SUPERUSER_MODE, Boolean.FALSE, true); } catch (Throwable ex) { - Log.w(TAG, "cann't save console preference", ex); //$NON-NLS-1$ + Log.w(TAG, "can't save console preference", ex); //$NON-NLS-1$ } } - + } } } @@ -228,7 +228,7 @@ public final class ExplorerApplication extends Application { /** * Method that changes the background console to a privileged console * - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated */ public static void changeBackgroundConsoleToPriviligedConsole() throws ConsoleAllocException { @@ -285,7 +285,7 @@ public final class ExplorerApplication extends Application { /** * Method that returns if the application is running in superuser mode - * + * * @return boolean If the application is running in superuser mode */ public static boolean isSuperuserMode() { @@ -299,7 +299,7 @@ public final class ExplorerApplication extends Application { /** * Method that returns if the application is running in advanced mode - * + * * @return boolean If the application is running in advanced mode */ public static boolean isAdvancedMode() { diff --git a/src/com/cyanogenmod/explorer/activities/NavigationActivity.java b/src/com/cyanogenmod/explorer/activities/NavigationActivity.java index f57ea4e..0f5c3cd 100644 --- a/src/com/cyanogenmod/explorer/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/explorer/activities/NavigationActivity.java @@ -209,7 +209,7 @@ public class NavigationActivity extends Activity SETTINGS_ADVANCE_MODE.getId()) == 0) { // Is it necessary to create or exit of the jail room? boolean jailRoom = !ExplorerApplication.isAdvancedMode(); - if (jailRoom != NavigationActivity.this.mJailRoom) { + if (jailRoom != NavigationActivity.this.mJailRoom) { if (jailRoom) { createJailRoom(); } else { @@ -671,7 +671,7 @@ public class NavigationActivity extends Activity ExplorerSettings.SETTINGS_SHOW_SYSTEM, ExplorerSettings.SETTINGS_SHOW_SYMLINKS})); } - + break; //###################### diff --git a/src/com/cyanogenmod/explorer/activities/SearchActivity.java b/src/com/cyanogenmod/explorer/activities/SearchActivity.java index fe897f0..ad7f4f0 100644 --- a/src/com/cyanogenmod/explorer/activities/SearchActivity.java +++ b/src/com/cyanogenmod/explorer/activities/SearchActivity.java @@ -321,7 +321,7 @@ public class SearchActivity extends Activity state.putParcelable(EXTRA_SEARCH_RESTORE, createSearchInfo()); } } catch (Throwable ex) { - Log.w(TAG, "The state cann't be saved", ex); //$NON-NLS-1$ + Log.w(TAG, "The state can't be saved", ex); //$NON-NLS-1$ } } @@ -336,7 +336,7 @@ public class SearchActivity extends Activity this.mRestoreState = state.getParcelable(EXTRA_SEARCH_RESTORE); } } catch (Throwable ex) { - Log.w(TAG, "The state cann't be restored", ex); //$NON-NLS-1$ + Log.w(TAG, "The state can't be restored", ex); //$NON-NLS-1$ } } diff --git a/src/com/cyanogenmod/explorer/commands/ExecutableCreator.java b/src/com/cyanogenmod/explorer/commands/ExecutableCreator.java index 2ed3674..ce377ee 100644 --- a/src/com/cyanogenmod/explorer/commands/ExecutableCreator.java +++ b/src/com/cyanogenmod/explorer/commands/ExecutableCreator.java @@ -36,7 +36,7 @@ public interface ExecutableCreator { * @param dir The absolute path of the new directory to establish as current directory * @return ChangeCurrentDirExecutable A {@link ChangeCurrentDirExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ChangeCurrentDirExecutable createChangeCurrentDirExecutable( String dir) throws CommandNotFoundException; @@ -49,7 +49,7 @@ public interface ExecutableCreator { * @param newGroup The new group of the file system object * @return ChangeOwnerExecutable A {@link ChangeOwnerExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ChangeOwnerExecutable createChangeOwnerExecutable( String fso, User newUser, Group newGroup) throws CommandNotFoundException; @@ -61,7 +61,7 @@ public interface ExecutableCreator { * @param newPermissions The new permissions of the file system object * @return ChangePermissionsExecutable A {@link ChangePermissionsExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ChangePermissionsExecutable createChangePermissionsExecutable( String fso, Permissions newPermissions) throws CommandNotFoundException; @@ -73,7 +73,7 @@ public interface ExecutableCreator { * @param src The absolute path to the source file system object * @param dst The absolute path to the destination file system object * @return CopyExecutable A {@link CopyExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ CopyExecutable createCopyExecutable(String src, String dst) throws CommandNotFoundException; @@ -83,7 +83,7 @@ public interface ExecutableCreator { * @param dir The absolute path of the new directory * @return CreateDirExecutable A {@link CreateDirExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ CreateDirExecutable createCreateDirectoryExecutable(String dir) throws CommandNotFoundException; @@ -94,7 +94,7 @@ public interface ExecutableCreator { * @param file The absolute path of the new file * @return CreateFileExecutable A {@link CreateFileExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ CreateFileExecutable createCreateFileExecutable(String file) throws CommandNotFoundException; @@ -103,7 +103,7 @@ public interface ExecutableCreator { * * @return CurrentDirExecutable A {@link CurrentDirExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ CurrentDirExecutable createCurrentDirExecutable() throws CommandNotFoundException; @@ -113,7 +113,7 @@ public interface ExecutableCreator { * @param dir The absolute path to the directory to be deleted * @return DeleteDirExecutable A {@link DeleteDirExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ DeleteDirExecutable createDeleteDirExecutable(String dir) throws CommandNotFoundException; @@ -123,7 +123,7 @@ public interface ExecutableCreator { * @param file The absolute path to the file to be deleted * @return DeleteFileExecutable A {@link DeleteFileExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ DeleteFileExecutable createDeleteFileExecutable(String file) throws CommandNotFoundException; @@ -133,7 +133,7 @@ public interface ExecutableCreator { * * @return DiskUsageExecutable A {@link DiskUsageExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ DiskUsageExecutable createDiskUsageExecutable() throws CommandNotFoundException; @@ -144,7 +144,7 @@ public interface ExecutableCreator { * @param dir The absolute path to the directory * @return DiskUsageExecutable A {@link DiskUsageExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ DiskUsageExecutable createDiskUsageExecutable(String dir) throws CommandNotFoundException; @@ -154,7 +154,7 @@ public interface ExecutableCreator { * * @param msg The message to expand * @return EchoExecutable A {@link EchoExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ EchoExecutable createEchoExecutable(String msg) throws CommandNotFoundException; @@ -164,7 +164,7 @@ public interface ExecutableCreator { * @param cmd The command to execute * @param asyncResultListener The listener where to return partial results * @return ExecExecutable A {@link ExecExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ExecExecutable createExecExecutable( String cmd, AsyncResultListener asyncResultListener) throws CommandNotFoundException; @@ -176,7 +176,7 @@ public interface ExecutableCreator { * @param query The term of the query * @param asyncResultListener The listener where to return partial results * @return FindExecutable A {@link FindExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ FindExecutable createFindExecutable( String directory, Query query, AsyncResultListener asyncResultListener) @@ -189,7 +189,7 @@ public interface ExecutableCreator { * @param asyncResultListener The listener where to return partial results * @return FolderUsageExecutable A {@link FolderUsageExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ FolderUsageExecutable createFolderUsageExecutable( String directory, AsyncResultListener asyncResultListener) @@ -199,7 +199,7 @@ public interface ExecutableCreator { * Method that creates an executable for retrieve the groups of the current user. * * @return GroupsExecutable A {@link GroupsExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ GroupsExecutable createGroupsExecutable() throws com.cyanogenmod.explorer.console.CommandNotFoundException; @@ -208,7 +208,7 @@ public interface ExecutableCreator { * Method that creates an executable for retrieve identity information of the current user. * * @return IdentityExecutable A {@link IdentityExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ IdentityExecutable createIdentityExecutable() throws CommandNotFoundException; @@ -218,7 +218,7 @@ public interface ExecutableCreator { * @param src The absolute path to the source fso * @param link The absolute path to the link fso * @return LinkExecutable A {@link LinkExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ LinkExecutable createLinkExecutable( String src, String link) throws CommandNotFoundException; @@ -228,7 +228,7 @@ public interface ExecutableCreator { * * @param src The directory where to do the listing * @return ListExecutable A {@link ListExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created * @see LIST_MODE */ ListExecutable createListExecutable(String src) @@ -240,7 +240,7 @@ public interface ExecutableCreator { * @param src The directory where to do the listing * @param followSymlinks If follow the symlink * @return ListExecutable A {@link ListExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created * @see LIST_MODE */ ListExecutable createFileInfoExecutable(String src, boolean followSymlinks) @@ -252,7 +252,7 @@ public interface ExecutableCreator { * @param mp The mount point to mount * @param rw Indicates if the operation mount the device as read-write * @return MountExecutable A {@link MountExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ MountExecutable createMountExecutable( MountPoint mp, boolean rw) throws CommandNotFoundException; @@ -262,7 +262,7 @@ public interface ExecutableCreator { * * @return MountPointInfoExecutable A {@link MountPointInfoExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ MountPointInfoExecutable createMountPointInfoExecutable() throws CommandNotFoundException; @@ -273,7 +273,7 @@ public interface ExecutableCreator { * @param src The absolute path to the source file system object * @param dst The absolute path to the destination file system object * @return MoveExecutable A {@link MoveExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ MoveExecutable createMoveExecutable(String src, String dst) throws CommandNotFoundException; @@ -284,7 +284,7 @@ public interface ExecutableCreator { * @param fso The absolute path to the file system object * @return ParentDirExecutable A {@link ParentDirExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ParentDirExecutable createParentDirExecutable(String fso) throws CommandNotFoundException; @@ -294,7 +294,7 @@ public interface ExecutableCreator { * * @return ProcessIdExecutable A {@link ProcessIdExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ProcessIdExecutable createShellProcessIdExecutable() throws CommandNotFoundException; @@ -306,7 +306,7 @@ public interface ExecutableCreator { * @param processName The process name * @return ProcessIdExecutable A {@link ProcessIdExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ProcessIdExecutable createProcessIdExecutable( int pid, String processName) throws CommandNotFoundException; @@ -318,7 +318,7 @@ public interface ExecutableCreator { * @param regexp The regular expression * @return ProcessIdExecutable A {@link ProcessIdExecutable} executable implementation * reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ QuickFolderSearchExecutable createQuickFolderSearchExecutable( String regexp) throws CommandNotFoundException; @@ -329,7 +329,7 @@ public interface ExecutableCreator { * @param file The file where to read the data * @param asyncResultListener The listener where to return partial results * @return ReadExecutable A {@link ReadExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ReadExecutable createReadExecutable( String file, AsyncResultListener asyncResultListener) @@ -342,7 +342,7 @@ public interface ExecutableCreator { * @param fso The absolute path to the file system object * @return ResolveLinkExecutable A {@link ResolveLinkExecutable} executable * implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ ResolveLinkExecutable createResolveLinkExecutable(String fso) throws CommandNotFoundException; @@ -352,7 +352,7 @@ public interface ExecutableCreator { * @param process The process which to send the signal * @param signal The signal to send * @return SendSignalExecutable A {@link SendSignalExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ SendSignalExecutable createSendSignalExecutable( int process, SIGNAL signal) throws CommandNotFoundException; @@ -363,7 +363,7 @@ public interface ExecutableCreator { * @param process The process which to send the signal * @param signal The signal to send * @return SendSignalExecutable A {@link SendSignalExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ SendSignalExecutable createKillExecutable( int process) throws CommandNotFoundException; @@ -374,7 +374,7 @@ public interface ExecutableCreator { * @param file The file where to write the data * @param asyncResultListener The listener where to return partial results * @return WriteExecutable A {@link WriteExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ WriteExecutable createWriteExecutable( String file, AsyncResultListener asyncResultListener) @@ -388,7 +388,7 @@ public interface ExecutableCreator { * @param src The array of source files to compress * @param asyncResultListener The listener where to return partial results * @return CompressExecutable A {@link CompressExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ CompressExecutable createCompressExecutable( CompressionMode mode, String dst, String[] src, @@ -402,7 +402,7 @@ public interface ExecutableCreator { * @param src The file to compress * @param asyncResultListener The listener where to return partial results * @return CompressExecutable A {@link CompressExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ CompressExecutable createCompressExecutable( CompressionMode mode, String src, AsyncResultListener asyncResultListener) @@ -416,7 +416,7 @@ public interface ExecutableCreator { * fit based on the src) * @param asyncResultListener The listener where to return partial results * @return UncompressExecutable A {@link UncompressExecutable} executable implementation reference - * @throws CommandNotFoundException If the executable cann't be created + * @throws CommandNotFoundException If the executable can't be created */ UncompressExecutable createUncompressExecutable( String src, String dst, AsyncResultListener asyncResultListener) diff --git a/src/com/cyanogenmod/explorer/commands/shell/AsyncResultProgram.java b/src/com/cyanogenmod/explorer/commands/shell/AsyncResultProgram.java index fe960b5..0b9e85a 100644 --- a/src/com/cyanogenmod/explorer/commands/shell/AsyncResultProgram.java +++ b/src/com/cyanogenmod/explorer/commands/shell/AsyncResultProgram.java @@ -390,7 +390,7 @@ public abstract class AsyncResultProgram } } } catch (Exception e) { - /** NON BLOCK**/ + /**NON BLOCK**/ } finally { this.mAlive = false; diff --git a/src/com/cyanogenmod/explorer/commands/shell/IdentityCommand.java b/src/com/cyanogenmod/explorer/commands/shell/IdentityCommand.java index 7c53ffe..0d741f4 100644 --- a/src/com/cyanogenmod/explorer/commands/shell/IdentityCommand.java +++ b/src/com/cyanogenmod/explorer/commands/shell/IdentityCommand.java @@ -157,7 +157,7 @@ public class IdentityCommand extends SyncResultProgram implements IdentityExecut * @param src The string to parsed into a {@link AID} * @param clazz The {@link User} or {@link Group} class from which create the AID object * @return AID The identity reference - * @throws ParseException If cann't create the {@link AID} reference from the string + * @throws ParseException If can't create the {@link AID} reference from the string * @throws NoSuchMethodException If the constructor can not be found. * @exception InstantiationException If the class cannot be instantiated * @exception IllegalAccessException If this constructor is not accessible diff --git a/src/com/cyanogenmod/explorer/commands/shell/ListCommand.java b/src/com/cyanogenmod/explorer/commands/shell/ListCommand.java index fdb0cbe..0250ac6 100644 --- a/src/com/cyanogenmod/explorer/commands/shell/ListCommand.java +++ b/src/com/cyanogenmod/explorer/commands/shell/ListCommand.java @@ -70,7 +70,7 @@ public class ListCommand extends SyncResultProgram implements ListExecutable { * @throws FileNotFoundException If the initial directory not exists * @throws NoSuchFileOrDirectory If the file or directory was not found * @throws IOException If initial directory couldn't be checked - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -112,7 +112,7 @@ public class ListCommand extends SyncResultProgram implements ListExecutable { * @throws FileNotFoundException If the initial directory not exists * @throws NoSuchFileOrDirectory If the file or directory was not found * @throws IOException If initial directory couldn't be checked - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -299,7 +299,7 @@ public class ListCommand extends SyncResultProgram implements ListExecutable { } } catch (Throwable ex) { //If parsing the file failed, ignore it and threat as a regular - //file (the destination file not exists or cann't be resolved) + //file (the destination file not exists or can't be resolved) } } break; diff --git a/src/com/cyanogenmod/explorer/commands/shell/ReadCommand.java b/src/com/cyanogenmod/explorer/commands/shell/ReadCommand.java index c51bf89..72bb888 100644 --- a/src/com/cyanogenmod/explorer/commands/shell/ReadCommand.java +++ b/src/com/cyanogenmod/explorer/commands/shell/ReadCommand.java @@ -49,13 +49,13 @@ public class ReadCommand extends AsyncResultProgram implements ReadExecutable { * {@inheritDoc} */ @Override - public void onStartParsePartialResult() {/** NON BLOCK **/} + public void onStartParsePartialResult() {/**NON BLOCK**/} /** * {@inheritDoc} */ @Override - public void onEndParsePartialResult(boolean cancelled) {/** NON BLOCK **/} + public void onEndParsePartialResult(boolean cancelled) {/**NON BLOCK**/} /** * {@inheritDoc} @@ -74,7 +74,7 @@ public class ReadCommand extends AsyncResultProgram implements ReadExecutable { * {@inheritDoc} */ @Override - public void onParseErrorPartialResult(String partialErr) {/** NON BLOCK **/} + public void onParseErrorPartialResult(String partialErr) {/**NON BLOCK**/} /** * {@inheritDoc} diff --git a/src/com/cyanogenmod/explorer/console/Console.java b/src/com/cyanogenmod/explorer/console/Console.java index 25629ee..3ffcecd 100644 --- a/src/com/cyanogenmod/explorer/console/Console.java +++ b/src/com/cyanogenmod/explorer/console/Console.java @@ -69,7 +69,7 @@ public abstract class Console /** * Method that allocates the console. * - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated */ public abstract void alloc() throws ConsoleAllocException; @@ -82,7 +82,7 @@ public abstract class Console * Method that reallocates the console. This method drops the actual console * and create a new one exactly as the current. * - * @throws ConsoleAllocException If the console cann't be reallocated + * @throws ConsoleAllocException If the console can't be reallocated */ public abstract void realloc() throws ConsoleAllocException; diff --git a/src/com/cyanogenmod/explorer/console/ConsoleBuilder.java b/src/com/cyanogenmod/explorer/console/ConsoleBuilder.java index 63ee7e7..b8edefc 100644 --- a/src/com/cyanogenmod/explorer/console/ConsoleBuilder.java +++ b/src/com/cyanogenmod/explorer/console/ConsoleBuilder.java @@ -61,7 +61,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If the console created is not a privileged console */ public static Console getConsole(Context context) @@ -80,7 +80,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If the console created is not a privileged console */ public static Console getConsole(Context context, boolean createIfNotExists) @@ -175,7 +175,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If the console created is not a privileged console */ //IMP! This must be invoked from the main activity creation @@ -192,7 +192,7 @@ public final class ConsoleBuilder { Preferences.savePreference( ExplorerSettings.SETTINGS_SUPERUSER_MODE, Boolean.FALSE, true); } catch (Throwable ex) { - Log.w(TAG, "cann't save console preference", ex); //$NON-NLS-1$ + Log.w(TAG, "can't save console preference", ex); //$NON-NLS-1$ } superuserMode = false; } @@ -248,7 +248,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @see NonPriviledgeConsole */ public static Console createNonPrivilegedConsole(Context context, String initialDirectory) @@ -270,7 +270,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If the console created is not a privileged console * @see PrivilegedConsole */ @@ -302,7 +302,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If the console created is not a privileged console * @see PrivilegedConsole */ @@ -323,7 +323,7 @@ public final class ConsoleBuilder { * @throws FileNotFoundException If the initial directory not exists * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If the console created is not a privileged console * @see PrivilegedConsole */ @@ -353,7 +353,7 @@ public final class ConsoleBuilder { DialogHelper.showToast(context, R.string.msgs_privileged_console_alloc_failed, Toast.LENGTH_LONG); } catch (Exception ex) { - Log.e(TAG, "cann't show toast", ex); //$NON-NLS-1$ + Log.e(TAG, "can't show toast", ex); //$NON-NLS-1$ } } diff --git a/src/com/cyanogenmod/explorer/console/shell/ShellConsole.java b/src/com/cyanogenmod/explorer/console/shell/ShellConsole.java index 4ba3e00..7250cf3 100644 --- a/src/com/cyanogenmod/explorer/console/shell/ShellConsole.java +++ b/src/com/cyanogenmod/explorer/console/shell/ShellConsole.java @@ -282,7 +282,7 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis Integer pid = processIdCmd.getResult(); if (pid == null) { throw new ConsoleAllocException( - "cann't retrieve the PID of the shell."); //$NON-NLS-1$ + "can't retrieve the PID of the shell."); //$NON-NLS-1$ } this.mShell.setPid(pid.intValue()); @@ -834,7 +834,7 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis * Method that checks the console status and restart the console * if this is unusable. * - * @throws ConsoleAllocException If the console cann't be reallocated + * @throws ConsoleAllocException If the console can't be reallocated */ private void checkConsole() throws ConsoleAllocException { try { @@ -995,7 +995,7 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis */ private boolean killCurrentCommand() { synchronized (this.mSync) { - //Is synchronous program? Otherwise it cann't be cancelled + //Is synchronous program? Otherwise it can't be cancelled if (!(this.mActiveCommand instanceof AsyncResultProgram)) { return false; } @@ -1054,7 +1054,7 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis */ private boolean sendSignalToCurrentCommand(SIGNAL signal) { synchronized (this.mSync) { - //Is synchronous program? Otherwise it cann't be cancelled + //Is synchronous program? Otherwise it can't be cancelled if (!(this.mActiveCommand instanceof AsyncResultProgram)) { return false; } diff --git a/src/com/cyanogenmod/explorer/model/Permissions.java b/src/com/cyanogenmod/explorer/model/Permissions.java index ffa0ab4..3d28539 100644 --- a/src/com/cyanogenmod/explorer/model/Permissions.java +++ b/src/com/cyanogenmod/explorer/model/Permissions.java @@ -250,7 +250,7 @@ public class Permissions implements Serializable, Comparable { * * @param rawPermissions The raw permissions * @return Permissions An object with all the permissions - * @throws ParseException If the permissions cann't be parsed + * @throws ParseException If the permissions can't be parsed * @see ParseHelper#parsePermission(String) */ public static Permissions fromRawString(String rawPermissions) throws ParseException { @@ -262,7 +262,7 @@ public class Permissions implements Serializable, Comparable { * * @param octalPermissions The octal permissions * @return Permissions An object with all the permissions - * @throws ParseException If the permissions cann't be parsed + * @throws ParseException If the permissions can't be parsed */ public static Permissions fromOctalString(String octalPermissions) throws ParseException { int size = octalPermissions.length(); diff --git a/src/com/cyanogenmod/explorer/ui/dialogs/ActionsDialog.java b/src/com/cyanogenmod/explorer/ui/dialogs/ActionsDialog.java index 23541bf..dfbb2f6 100644 --- a/src/com/cyanogenmod/explorer/ui/dialogs/ActionsDialog.java +++ b/src/com/cyanogenmod/explorer/ui/dialogs/ActionsDialog.java @@ -636,7 +636,7 @@ public class ActionsDialog implements OnItemClickListener, OnItemLongClickListen menu.removeItem(R.id.mnu_actions_open_parent_folder); } - // Remove jail room actions (actions that cann't be present when running in + // Remove jail room actions (actions that can't be present when running in // unprivileged mode) if (this.mJailRoom) { menu.removeItem(R.id.mnu_actions_create_link); diff --git a/src/com/cyanogenmod/explorer/ui/dialogs/ChooseConsoleDialog.java b/src/com/cyanogenmod/explorer/ui/dialogs/ChooseConsoleDialog.java index 4e42020..2db3328 100644 --- a/src/com/cyanogenmod/explorer/ui/dialogs/ChooseConsoleDialog.java +++ b/src/com/cyanogenmod/explorer/ui/dialogs/ChooseConsoleDialog.java @@ -148,7 +148,7 @@ public class ChooseConsoleDialog implements OnItemClickListener { Preferences.savePreference( ExplorerSettings.SETTINGS_SUPERUSER_MODE, superuser, true); } catch (Throwable ex) { - Log.w(TAG, "cann't save console preference", ex); //$NON-NLS-1$ + Log.w(TAG, "can't save console preference", ex); //$NON-NLS-1$ } } } diff --git a/src/com/cyanogenmod/explorer/ui/dialogs/ExecutionDialog.java b/src/com/cyanogenmod/explorer/ui/dialogs/ExecutionDialog.java index 83a11d2..7cd93c2 100644 --- a/src/com/cyanogenmod/explorer/ui/dialogs/ExecutionDialog.java +++ b/src/com/cyanogenmod/explorer/ui/dialogs/ExecutionDialog.java @@ -107,9 +107,9 @@ public class ExecutionDialog implements DialogInterface.OnClickListener { try { Thread.yield(); Thread.sleep(250L); - } catch (Throwable _throw) {/** NON BLOCK**/} + } catch (Throwable _throw) {/**NON BLOCK**/} } - } catch (Exception e) {/** NON BLOCK**/} + } catch (Exception e) {/**NON BLOCK**/} } return null; } diff --git a/src/com/cyanogenmod/explorer/ui/dialogs/FilesystemInfoDialog.java b/src/com/cyanogenmod/explorer/ui/dialogs/FilesystemInfoDialog.java index aa5dfc4..b76e4ed 100644 --- a/src/com/cyanogenmod/explorer/ui/dialogs/FilesystemInfoDialog.java +++ b/src/com/cyanogenmod/explorer/ui/dialogs/FilesystemInfoDialog.java @@ -25,6 +25,7 @@ import android.view.View.OnClickListener; import android.widget.Switch; import android.widget.TextView; +import com.cyanogenmod.explorer.ExplorerApplication; import com.cyanogenmod.explorer.R; import com.cyanogenmod.explorer.console.ConsoleBuilder; import com.cyanogenmod.explorer.model.DiskUsage; @@ -82,6 +83,7 @@ public class FilesystemInfoDialog implements OnClickListener { private OnMountListener mOnMountListener; private boolean mIsMountAllowed; + private final boolean mIsAdvancedMode; /** * Constructor of FilesystemInfoDialog. @@ -100,6 +102,7 @@ public class FilesystemInfoDialog implements OnClickListener { this.mMountPoint = mountPoint; this.mDiskUsage = diskUsage; this.mIsMountAllowed = false; + this.mIsAdvancedMode = ExplorerApplication.isAdvancedMode(); //Inflate the content LayoutInflater li = @@ -198,19 +201,25 @@ public class FilesystemInfoDialog implements OnClickListener { try { hasPrivileged = ConsoleBuilder.getConsole(this.mContext).isPrivileged(); } catch (Throwable ex) {/**NON BLOCK**/} - boolean mountAllowed = MountPointHelper.isMountAllowed(this.mMountPoint); - if (hasPrivileged) { - this.mSwStatus.setEnabled(mountAllowed); - if (!mountAllowed) { - this.mInfoMsgView.setText( - this.mContext.getString(R.string.filesystem_info_couldnt_be_mounted_msg)); + boolean mountAllowed = + MountPointHelper.isMountAllowed(this.mMountPoint) && !this.mIsAdvancedMode; + if (this.mIsAdvancedMode) { + if (hasPrivileged) { + if (!mountAllowed) { + this.mInfoMsgView.setText( + this.mContext.getString( + R.string.filesystem_info_couldnt_be_mounted_msg)); + this.mInfoMsgView.setVisibility(View.VISIBLE); + } + } else { this.mInfoMsgView.setVisibility(View.VISIBLE); + this.mInfoMsgView.setOnClickListener(this); } } else { - this.mInfoMsgView.setVisibility(View.VISIBLE); - this.mInfoMsgView.setOnClickListener(this); + this.mInfoMsgView.setVisibility(View.GONE); + this.mInfoMsgView.setOnClickListener(null); } - this.mIsMountAllowed = hasPrivileged && mountAllowed; + this.mIsMountAllowed = hasPrivileged && mountAllowed && this.mIsAdvancedMode; this.mSwStatus.setEnabled(this.mIsMountAllowed); this.mSwStatus.setChecked(MountPointHelper.isReadWrite(this.mMountPoint)); @@ -235,7 +244,8 @@ public class FilesystemInfoDialog implements OnClickListener { this.mInfoView.setVisibility(View.VISIBLE); this.mDiskUsageView.setVisibility(View.GONE); } - this.mInfoMsgView.setVisibility (this.mIsMountAllowed ? View.GONE : View.VISIBLE); + this.mInfoMsgView.setVisibility( + this.mIsMountAllowed || !this.mIsAdvancedMode ? View.GONE : View.VISIBLE); break; case R.id.filesystem_info_dialog_tab_disk_usage: diff --git a/src/com/cyanogenmod/explorer/ui/dialogs/FsoPropertiesDialog.java b/src/com/cyanogenmod/explorer/ui/dialogs/FsoPropertiesDialog.java index fcab731..a4aed46 100644 --- a/src/com/cyanogenmod/explorer/ui/dialogs/FsoPropertiesDialog.java +++ b/src/com/cyanogenmod/explorer/ui/dialogs/FsoPropertiesDialog.java @@ -36,6 +36,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.Spinner; import android.widget.TextView; +import com.cyanogenmod.explorer.ExplorerApplication; import com.cyanogenmod.explorer.R; import com.cyanogenmod.explorer.commands.AsyncResultListener; import com.cyanogenmod.explorer.commands.FolderUsageExecutable; @@ -119,6 +120,7 @@ public class FsoPropertiesDialog private boolean mIgnoreCheckEvents; private boolean mHasPrivileged; + private final boolean mIsAdvancedMode; private final boolean mComputeFolderStatistics; private FolderUsageExecutable mFolderUsageExecutable; @@ -147,6 +149,7 @@ public class FsoPropertiesDialog this.mHasChanged = false; this.mIgnoreCheckEvents = true; this.mHasPrivileged = false; + this.mIsAdvancedMode = ExplorerApplication.isAdvancedMode(); //Inflate the content LayoutInflater li = @@ -304,7 +307,7 @@ public class FsoPropertiesDialog setCheckBoxesPermissionsEnable(this.mChkUserPermission, this.mHasPrivileged); setCheckBoxesPermissionsEnable(this.mChkGroupPermission, this.mHasPrivileged); setCheckBoxesPermissionsEnable(this.mChkOthersPermission, this.mHasPrivileged); - if (!this.mHasPrivileged) { + if (!this.mHasPrivileged && this.mIsAdvancedMode) { this.mInfoMsgView.setVisibility(View.VISIBLE); this.mInfoMsgView.setOnClickListener(this); } @@ -447,7 +450,8 @@ public class FsoPropertiesDialog this.mInfoView.setVisibility(View.GONE); this.mPermissionsView.setVisibility(View.VISIBLE); } - this.mInfoMsgView.setVisibility(this.mHasPrivileged ? View.GONE : View.VISIBLE); + this.mInfoMsgView.setVisibility( + this.mHasPrivileged || !this.mIsAdvancedMode ? View.GONE : View.VISIBLE); break; case R.id.fso_info_msg: @@ -897,7 +901,9 @@ public class FsoPropertiesDialog void setMsg(String msg) { this.mInfoMsgView.setText(msg); this.mInfoMsgView.setVisibility( - this.mHasPrivileged && msg == null ? View.GONE : View.VISIBLE); + !this.mIsAdvancedMode || (this.mHasPrivileged && msg == null) ? + View.GONE : + View.VISIBLE); } /** @@ -920,7 +926,7 @@ public class FsoPropertiesDialog FsoPropertiesDialog.this.mFolderUsage = (FolderUsage)this.mFolderUsageExecutable.getFolderUsage().clone(); printFolderUsage(true, cancelled); - } catch (Exception ex) {/** NON BLOCK**/} + } catch (Exception ex) {/**NON BLOCK**/} } /** @@ -938,7 +944,7 @@ public class FsoPropertiesDialog FsoPropertiesDialog.this.mFolderUsage = (FolderUsage)(((FolderUsage)partialResults).clone()); printFolderUsage(true, false); - } catch (Exception ex) {/** NON BLOCK**/} + } catch (Exception ex) {/**NON BLOCK**/} } /** diff --git a/src/com/cyanogenmod/explorer/ui/policy/CopyMoveActionPolicy.java b/src/com/cyanogenmod/explorer/ui/policy/CopyMoveActionPolicy.java index 29f3044..b8de116 100644 --- a/src/com/cyanogenmod/explorer/ui/policy/CopyMoveActionPolicy.java +++ b/src/com/cyanogenmod/explorer/ui/policy/CopyMoveActionPolicy.java @@ -495,7 +495,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy { String src = linkRes.mSrc.getAbsolutePath(); String dst = linkRes.mDst.getAbsolutePath(); - // 1.- Current directory cann't be moved + // 1.- Current directory can't be moved if (currentDirectory != null && currentDirectory.startsWith(src)) { // Operation not allowed AlertDialog dialog = @@ -505,7 +505,7 @@ public final class CopyMoveActionPolicy extends ActionsPolicy { return false; } - // 2.- Destination cann't be a child of source + // 2.- Destination can't be a child of source if (dst.startsWith(src)) { // Operation not allowed AlertDialog dialog = diff --git a/src/com/cyanogenmod/explorer/ui/policy/DeleteActionPolicy.java b/src/com/cyanogenmod/explorer/ui/policy/DeleteActionPolicy.java index 470ae2d..8e0aa36 100644 --- a/src/com/cyanogenmod/explorer/ui/policy/DeleteActionPolicy.java +++ b/src/com/cyanogenmod/explorer/ui/policy/DeleteActionPolicy.java @@ -302,7 +302,7 @@ public final class DeleteActionPolicy extends ActionsPolicy { for (int i = 0; i < cc; i++) { FileSystemObject fso = files.get(i); - // 1.- Current directory cann't be deleted + // 1.- Current directory can't be deleted if (currentDirectory.startsWith(fso.getFullPath())) { // Operation not allowed AlertDialog dialog = diff --git a/src/com/cyanogenmod/explorer/ui/widgets/BreadcrumbView.java b/src/com/cyanogenmod/explorer/ui/widgets/BreadcrumbView.java index 6de8b2c..1fb939d 100644 --- a/src/com/cyanogenmod/explorer/ui/widgets/BreadcrumbView.java +++ b/src/com/cyanogenmod/explorer/ui/widgets/BreadcrumbView.java @@ -213,7 +213,7 @@ public class BreadcrumbView extends RelativeLayout implements Breadcrumb, OnClic } first = false; this.mBreadcrumbBar.addView(createBreadcrumbItem(f)); - } + } } } else { for (int i = 1; i < cc; i++) { diff --git a/src/com/cyanogenmod/explorer/ui/widgets/NavigationView.java b/src/com/cyanogenmod/explorer/ui/widgets/NavigationView.java index 2e86aa7..6e03313 100644 --- a/src/com/cyanogenmod/explorer/ui/widgets/NavigationView.java +++ b/src/com/cyanogenmod/explorer/ui/widgets/NavigationView.java @@ -222,7 +222,7 @@ public class NavigationView extends RelativeLayout implements private void init() { //Initialize variables this.mFiles = new ArrayList(); - + // Is in jail room? this.mJailRoom = !ExplorerApplication.isAdvancedMode(); @@ -546,7 +546,7 @@ public class NavigationView extends RelativeLayout implements // Check navigation security (don't allow to go outside the jail room if one // is created) final String fNewDir = checkJailRoomNavigation(newDir); - + synchronized (this.mSync) { //Check that it is really necessary change the directory if (!reload && this.mCurrentDir != null && this.mCurrentDir.compareTo(fNewDir) == 0) { @@ -998,7 +998,7 @@ public class NavigationView extends RelativeLayout implements /** * Method that ensures that the user don't go outside the jail room - * + * * @param newDir The new directory to navigate to * @return String */ diff --git a/src/com/cyanogenmod/explorer/ui/widgets/NonFocusableButtonItem.java b/src/com/cyanogenmod/explorer/ui/widgets/NonFocusableButtonItem.java index 75a433b..ab91677 100644 --- a/src/com/cyanogenmod/explorer/ui/widgets/NonFocusableButtonItem.java +++ b/src/com/cyanogenmod/explorer/ui/widgets/NonFocusableButtonItem.java @@ -22,7 +22,7 @@ import android.util.AttributeSet; import com.cyanogenmod.explorer.R; /** - * A class that represents a button from an action bar that cann't gain focus. + * A class that represents a button from an action bar that can't gain focus. */ public class NonFocusableButtonItem extends ButtonItem { diff --git a/src/com/cyanogenmod/explorer/ui/widgets/TransparentNonFocusableButtonItem.java b/src/com/cyanogenmod/explorer/ui/widgets/TransparentNonFocusableButtonItem.java index 119e7d0..bb099d7 100644 --- a/src/com/cyanogenmod/explorer/ui/widgets/TransparentNonFocusableButtonItem.java +++ b/src/com/cyanogenmod/explorer/ui/widgets/TransparentNonFocusableButtonItem.java @@ -20,7 +20,7 @@ import android.content.Context; import android.util.AttributeSet; /** - * A class that represents a button from an action bar that cann't gain focus + * A class that represents a button from an action bar that can't gain focus * without background. */ public class TransparentNonFocusableButtonItem extends NonFocusableButtonItem { diff --git a/src/com/cyanogenmod/explorer/util/CommandHelper.java b/src/com/cyanogenmod/explorer/util/CommandHelper.java index d1473d3..433a03d 100644 --- a/src/com/cyanogenmod/explorer/util/CommandHelper.java +++ b/src/com/cyanogenmod/explorer/util/CommandHelper.java @@ -104,7 +104,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -137,7 +137,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -172,7 +172,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -206,7 +206,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -238,7 +238,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -270,7 +270,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -302,7 +302,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -334,7 +334,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -369,7 +369,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -399,7 +399,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -430,7 +430,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -458,7 +458,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -496,7 +496,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -526,7 +526,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -558,7 +558,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -590,7 +590,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -622,7 +622,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -653,7 +653,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -689,7 +689,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -722,7 +722,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -755,7 +755,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -790,7 +790,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -826,7 +826,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -860,7 +860,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -891,7 +891,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -925,7 +925,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -957,7 +957,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -988,7 +988,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1021,7 +1021,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1053,7 +1053,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1083,7 +1083,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1115,7 +1115,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1151,7 +1151,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1199,7 +1199,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1252,7 +1252,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1306,7 +1306,7 @@ public final class CommandHelper { * @throws IOException If initial directory couldn't be checked * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1364,7 +1364,7 @@ public final class CommandHelper { * to attach to the default console * @return Object The result of the re-execution * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1394,7 +1394,7 @@ public final class CommandHelper { * @param console The console in which execute the program. null to attach * to the default console * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1422,7 +1422,7 @@ public final class CommandHelper { * @param console The console in which execute the program. null to attach * to the default console * @throws NoSuchFileOrDirectory If the file or directory was not found - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InsufficientPermissionsException If an operation requires elevated permissions * @throws CommandNotFoundException If the command was not found * @throws OperationTimeoutException If the operation exceeded the maximum time of wait @@ -1446,7 +1446,7 @@ public final class CommandHelper { //Mount point is already read-write } } else { - //For security or physical reasons the mount point cann't be + //For security or physical reasons the mount point can't be //mounted as read-write. Execute the command //and notify to the user } @@ -1515,7 +1515,7 @@ public final class CommandHelper { * @param console The console passed * @return Console The console passed if not is null. Otherwise, the default console * @throws InsufficientPermissionsException If an operation requires elevated permissions - * @throws ConsoleAllocException If the console cann't be allocated + * @throws ConsoleAllocException If the console can't be allocated * @throws InvalidCommandDefinitionException If the command has an invalid definition * @throws IOException If initial directory couldn't be checked * @throws FileNotFoundException If the initial directory not exists diff --git a/src/com/cyanogenmod/explorer/util/ExceptionUtil.java b/src/com/cyanogenmod/explorer/util/ExceptionUtil.java index 4754883..d26268e 100644 --- a/src/com/cyanogenmod/explorer/util/ExceptionUtil.java +++ b/src/com/cyanogenmod/explorer/util/ExceptionUtil.java @@ -25,6 +25,7 @@ import android.os.AsyncTask; import android.util.Log; import android.widget.Toast; +import com.cyanogenmod.explorer.ExplorerApplication; import com.cyanogenmod.explorer.R; import com.cyanogenmod.explorer.commands.SyncResultExecutable; import com.cyanogenmod.explorer.commands.shell.InvalidCommandDefinitionException; @@ -250,7 +251,9 @@ public final class ExceptionUtil { } // If console is privileged there is not need to change - if (relaunchable instanceof InsufficientPermissionsException && isPrivileged) { + // If we are in a jail room, resolve the error without do anymore + if (relaunchable instanceof InsufficientPermissionsException && + (isPrivileged || !ExplorerApplication.isAdvancedMode())) { translateException( context, relaunchable, quiet, false, null); diff --git a/src/com/cyanogenmod/explorer/util/ParseHelper.java b/src/com/cyanogenmod/explorer/util/ParseHelper.java index b455dd5..f05ebba 100644 --- a/src/com/cyanogenmod/explorer/util/ParseHelper.java +++ b/src/com/cyanogenmod/explorer/util/ParseHelper.java @@ -66,7 +66,7 @@ public final class ParseHelper { * @param parent The parent of the object * @param src The unix string style line * @return FileSystemObject The file system object reference - * @throws ParseException If the line cann't be parsed + * @throws ParseException If the line can't be parsed * @see #toFileSystemObject(String, String, boolean) */ public static FileSystemObject toFileSystemObject( @@ -82,7 +82,7 @@ public final class ParseHelper { * @param src The unix string style line * @param quick Do not resolve data (User and Group doesn't have a valid reference) * @return FileSystemObject The file system object reference - * @throws ParseException If the line cann't be parsed + * @throws ParseException If the line can't be parsed */ // // @@ -226,7 +226,7 @@ public final class ParseHelper { * * @param permissions The raw permissions * @return Permissions An object with all the permissions - * @throws ParseException If the permissions cann't be parsed + * @throws ParseException If the permissions can't be parsed * @{link "http://en.wikipedia.org/wiki/File_system_permissions"} */ public static Permissions parsePermission(String permissions) throws ParseException { @@ -308,7 +308,7 @@ public final class ParseHelper { * * @param src The disk usage line * @return DiskUsage The disk usage information - * @throws ParseException If the line cann't be parsed + * @throws ParseException If the line can't be parsed */ // Filesystem Size Used Free Blksize // /dev 414M 48K 414M 4096 @@ -348,7 +348,7 @@ public final class ParseHelper { * * @param src The mount point line * @return MountPoint The mount point information - * @throws ParseException If the line cann't be parsed + * @throws ParseException If the line can't be parsed */ // rootfs / rootfs ro,relatime 0 0 // tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0 diff --git a/src/com/cyanogenmod/explorer/util/StorageHelper.java b/src/com/cyanogenmod/explorer/util/StorageHelper.java index 0cb8672..3b37f7a 100644 --- a/src/com/cyanogenmod/explorer/util/StorageHelper.java +++ b/src/com/cyanogenmod/explorer/util/StorageHelper.java @@ -31,7 +31,7 @@ import java.lang.reflect.Method; * A helper class with useful methods for deal with storages. */ public final class StorageHelper { - + private static StorageVolume[] sStorageVolumes; /** @@ -50,7 +50,7 @@ public final class StorageHelper { StorageManager sm = (StorageManager) ctx.getSystemService(Context.STORAGE_SERVICE); Method method = sm.getClass().getMethod("getVolumeList"); //$NON-NLS-1$ sStorageVolumes = (StorageVolume[])method.invoke(sm); - + } catch (Exception ex) { //Ignore. Android SDK StorageManager class doesn't have this method //Use default android information from environment diff --git a/tests/src/com/cyanogenmod/explorer/commands/shell/ProcessIdCommandTest.java b/tests/src/com/cyanogenmod/explorer/commands/shell/ProcessIdCommandTest.java index 6a45fe6..dc18b59 100644 --- a/tests/src/com/cyanogenmod/explorer/commands/shell/ProcessIdCommandTest.java +++ b/tests/src/com/cyanogenmod/explorer/commands/shell/ProcessIdCommandTest.java @@ -30,6 +30,6 @@ public class ProcessIdCommandTest extends AbstractConsoleTest { return false; } - // cann't perform any test, because a running program in a shell is needed, and the PID of + // can't perform any test, because a running program in a shell is needed, and the PID of // the shell is not available for external use outside the console. } diff --git a/tests/src/com/cyanogenmod/explorer/commands/shell/SendSignalCommandTest.java b/tests/src/com/cyanogenmod/explorer/commands/shell/SendSignalCommandTest.java index 232bf37..8110900 100644 --- a/tests/src/com/cyanogenmod/explorer/commands/shell/SendSignalCommandTest.java +++ b/tests/src/com/cyanogenmod/explorer/commands/shell/SendSignalCommandTest.java @@ -30,5 +30,5 @@ public class SendSignalCommandTest extends AbstractConsoleTest { return false; } - // cann't perform any test, because a running program in a shell is needed. + // can't perform any test, because a running program in a shell is needed. } diff --git a/tests/src/com/cyanogenmod/explorer/commands/shell/UncompressCommandTest.java b/tests/src/com/cyanogenmod/explorer/commands/shell/UncompressCommandTest.java index 8aaffeb..2c37594 100644 --- a/tests/src/com/cyanogenmod/explorer/commands/shell/UncompressCommandTest.java +++ b/tests/src/com/cyanogenmod/explorer/commands/shell/UncompressCommandTest.java @@ -65,7 +65,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnTAR() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -76,7 +76,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnZIP() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -87,7 +87,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnTarGZIP() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -98,7 +98,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnTarBZIP() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -109,7 +109,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnTarLZMA() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -120,7 +120,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnGZIP() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -131,7 +131,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnBZIP() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -142,7 +142,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnLZMA() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -153,7 +153,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnCompress() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } /** @@ -164,7 +164,7 @@ public class UncompressCommandTest extends AbstractConsoleTest { @LargeTest @SuppressWarnings("unused") public void testArchiveUnXZ() throws Exception { - // Cann't not reproduce without sample compress file + // Can't not reproduce without sample compress file } -- 2.11.0