private ListView mBookmarksListView;
- private boolean mJailRoom;
+ private boolean mChRooted;
/**
* {@inheritDoc}
Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$
}
- // Is in jail room?
- this.mJailRoom = !ExplorerApplication.isAdvancedMode();
+ // Is ChRooted?
+ this.mChRooted = !ExplorerApplication.isAdvancedMode();
//Request features
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
*/
private List<Bookmark> loadBookmarks() {
// Bookmarks = HOME + FILESYSTEM + SD STORAGES + USER DEFINED
- // In jail room mode = SD STORAGES + USER DEFINED (from SD STORAGES)
+ // In ChRooted mode = SD STORAGES + USER DEFINED (from SD STORAGES)
List<Bookmark> bookmarks = new ArrayList<Bookmark>();
- if (!this.mJailRoom) {
+ if (!this.mChRooted) {
bookmarks.add(loadHomeBookmarks());
bookmarks.addAll(loadFilesystemBookmarks());
}
if (cursor != null && cursor.moveToFirst()) {
do {
Bookmark bm = new Bookmark(cursor);
- if (this.mJailRoom && StorageHelper.isPathInStorageVolume(bm.mPath)) {
+ if (this.mChRooted && StorageHelper.isPathInStorageVolume(bm.mPath)) {
continue;
}
bookmarks.add(bm);
// Advanced mode
if (key.compareTo(ExplorerSettings.
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) {
- createJailRoom();
+ // Is it necessary to create or exit of the ChRooted?
+ boolean chRooted = !ExplorerApplication.isAdvancedMode();
+ if (chRooted != NavigationActivity.this.mChRooted) {
+ if (chRooted) {
+ createChRooted();
} else {
- exitJailRoom();
+ exitChRooted();
}
}
}
/**
* @hide
*/
- boolean mJailRoom;
+ boolean mChRooted;
/**
* @hide
*/
private void init() {
this.mHistory = new ArrayList<History>();
- this.mJailRoom = !ExplorerApplication.isAdvancedMode();
+ this.mChRooted = !ExplorerApplication.isAdvancedMode();
}
/**
throw new ConsoleAllocException("console == null"); //$NON-NLS-1$
}
} catch (Throwable ex) {
- if (!NavigationActivity.this.mJailRoom) {
+ if (!NavigationActivity.this.mChRooted) {
//Show exception and exists
Log.e(TAG, getString(R.string.msgs_cant_create_console), ex);
// We don't have any console
Preferences.getSharedPreferences().getString(
ExplorerSettings.SETTINGS_INITIAL_DIR.getId(),
(String)ExplorerSettings.SETTINGS_INITIAL_DIR.getDefaultValue());
- if (NavigationActivity.this.mJailRoom) {
+ if (NavigationActivity.this.mChRooted) {
// Initial directory is the first external sdcard (sdcard, emmc, usb, ...)
StorageVolume[] volumes =
StorageHelper.getStorageVolumes(NavigationActivity.this);
new ExplorerSettings[]{ExplorerSettings.SETTINGS_LAYOUT_MODE}));
break;
case R.id.ab_view_options:
- // If we are in jail room, then don't show non-secure items
- if (this.mJailRoom) {
+ // If we are in ChRooted mode, then don't show non-secure items
+ if (this.mChRooted) {
showSettingsPopUp(view,
Arrays.asList(new ExplorerSettings[]{
ExplorerSettings.SETTINGS_SHOW_DIRS_FIRST}));
}
// Check if console selection is allowed
- if (this.mJailRoom) {
+ if (this.mChRooted) {
menu.removeItem(R.id.mnu_console);
}
}
/**
- * Method that creates a jail room, protecting the user to break anything in the device
+ * Method that creates a ChRooted environment, protecting the user to break anything in
+ * the device
* @hide
*/
- void createJailRoom() {
- // If we are in a jail room, then do nothing
- if (this.mJailRoom) return;
- this.mJailRoom = true;
+ void createChRooted() {
+ // If we are in a ChRooted mode, then do nothing
+ if (this.mChRooted) return;
+ this.mChRooted = true;
int cc = this.mNavigationViews.length;
for (int i = 0; i < cc; i++) {
- this.mNavigationViews[i].createJailRoom();
+ this.mNavigationViews[i].createChRooted();
}
// Remove the selection
}
/**
- * Method that exits from a jail room
+ * Method that exits from a ChRooted
* @hide
*/
- void exitJailRoom() {
- // If we aren't in a jail room, then do nothing
- if (!this.mJailRoom) return;
- this.mJailRoom = false;
+ void exitChRooted() {
+ // If we aren't in a ChRooted mode, then do nothing
+ if (!this.mChRooted) return;
+ this.mChRooted = false;
int cc = this.mNavigationViews.length;
for (int i = 0; i < cc; i++) {
- this.mNavigationViews[i].exitJailRoom();
+ this.mNavigationViews[i].exitChRooted();
}
}
try {
// Is there a console allocate
if (!ConsoleBuilder.isAlloc()) {
- // Create a jail room console
+ // Create a ChRooted console
ConsoleBuilder.createDefaultConsole(this, false, false);
}
// There is a console allocated. Use it.
private int mId;
private String mCurrentDir;
- private boolean mJailRoom;
+ private boolean mChRooted;
private List<FileSystemObject> mFiles;
private List<FileSystemObject> mSelectedFiles;
}
/**
- * Method that returns if the view is in a jail room.
+ * Method that returns if the view is in a ChRooted environment.
*
- * @return boolean If the view is in a jail room
+ * @return boolean If the view is in a ChRooted environment
*/
- public boolean getJailRoom() {
- return this.mJailRoom;
+ public boolean getChRooted() {
+ return this.mChRooted;
}
/**
- * Method that sets if the view is in a jail room.
+ * Method that sets if the view is in a ChRooted environment.
*
- * @param jailRoom If the view is in a jail room
+ * @param chRooted If the view is in a ChRooted environment
*/
- public void setJailRoom(boolean jailRoom) {
- this.mJailRoom = jailRoom;
+ public void setChRooted(boolean chRooted) {
+ this.mChRooted = chRooted;
}
/**
dest.writeString(this.mCurrentDir);
}
//- 2
- dest.writeInt(this.mJailRoom ? 1 : 0);
+ dest.writeInt(this.mChRooted ? 1 : 0);
//- 3
dest.writeInt(this.mSelectedFiles == null ? 0 : 1);
if (this.mSelectedFiles != null) {
this.mCurrentDir = in.readString();
}
//- 2
- this.mJailRoom = (in.readInt() == 1);
+ this.mChRooted = (in.readInt() == 1);
//- 3
int hasSelectedFiles = in.readInt();
if (hasSelectedFiles == 1) {
defaultValue);
SearchSortResultMode mode = SearchSortResultMode.fromId(value);
- // Is in jail room?
- boolean jailRoom = !ExplorerApplication.isAdvancedMode();
+ // Are we in ChRooted environment?
+ boolean chRooted = !ExplorerApplication.isAdvancedMode();
//Process all the data
final List<SearchResult> result =
SearchHelper.convertToResults(
FileHelper.applyUserPreferences(
- this.mFiles, MimeTypeHelper.ALL_MIME_TYPES, true, jailRoom),
+ this.mFiles, MimeTypeHelper.ALL_MIME_TYPES, true, chRooted),
this.mQueries);
if (mode.compareTo(SearchSortResultMode.NAME) == 0) {
Collections.sort(result, new Comparator<SearchResult>() {
final Context mContext;
private final boolean mGlobal;
private final boolean mSearch;
- private final boolean mJailRoom;
+ private final boolean mChRooted;
/**
* @hide
this.mContext = context;
this.mGlobal = global;
this.mSearch = search;
- this.mJailRoom = !ExplorerApplication.isAdvancedMode();
+ this.mChRooted = !ExplorerApplication.isAdvancedMode();
//Initialize dialog
init(context, global ? R.id.mnu_actions_global : R.id.mnu_actions_fso);
menu.removeItem(R.id.mnu_actions_open_parent_folder);
}
- // Remove jail room actions (actions that can't be present when running in
+ // Remove not-ChRooted actions (actions that can't be present when running in
// unprivileged mode)
- if (this.mJailRoom) {
+ if (this.mChRooted) {
menu.removeItem(R.id.mnu_actions_create_link);
menu.removeItem(R.id.mnu_actions_create_link_global);
menu.removeItem(R.id.mnu_actions_execute);
* Method that changes the path of the breadcrumb.
*
* @param newPath The new path
- * @param jailRoom If the breadcrumb should be in a jail room
+ * @param chRooted If the breadcrumb should be in a ChRooted environment
*/
- void changeBreadcrumbPath(final String newPath, boolean jailRoom);
+ void changeBreadcrumbPath(final String newPath, boolean chRooted);
/**
* Method that adds a new breadcrumb listener.
* {@inheritDoc}
*/
@Override
- public void changeBreadcrumbPath(final String newPath, final boolean jailRoom) {
+ public void changeBreadcrumbPath(final String newPath, final boolean chRooted) {
//Sets the current path
this.mCurrentPath = newPath;
//Remove all views
this.mBreadcrumbBar.removeAllViews();
- //The first is always the root (if not in a jail room)
- if (!jailRoom) {
+ // The first is always the root (except if we are in a ChRooted environment)
+ if (!chRooted) {
this.mBreadcrumbBar.addView(createBreadcrumbItem(new File(FileHelper.ROOT_DIRECTORY)));
}
//Add the rest of the path
String[] dirs = newPath.split(File.separator);
int cc = dirs.length;
- if (jailRoom) {
+ if (chRooted) {
boolean first = true;
for (int i = 1; i < cc; i++) {
File f = createFile(dirs, i);
private OnNavigationRequestMenuListener mOnNavigationRequestMenuListener;
private OnFilePickedListener mOnFilePickedListener;
- private boolean mJailRoom;
+ private boolean mChRooted;
private NAVIGATION_MODE mNavigationMode;
NavigationViewInfoParcelable parcel = new NavigationViewInfoParcelable();
parcel.setId(this.mId);
parcel.setCurrentDir(this.mCurrentDir);
- parcel.setJailRoom(this.mJailRoom);
+ parcel.setChRooted(this.mChRooted);
parcel.setSelectedFiles(this.mAdapter.getSelectedItems());
parcel.setFiles(this.mFiles);
return parcel;
//Restore the data
this.mId = info.getId();
this.mCurrentDir = info.getCurrentDir();
- this.mJailRoom = info.getJailRoom();
+ this.mChRooted = info.getChRooted();
this.mFiles = info.getFiles();
this.mAdapter.setSelectedItems(info.getSelectedFiles());
//Initialize variables
this.mFiles = new ArrayList<FileSystemObject>();
- // Is in jail room?
+ // Is ChRooted environment?
if (this.mNavigationMode.compareTo(NAVIGATION_MODE.PICKABLE) == 0) {
- // Pick mode is jail room always
- this.mJailRoom = true;
+ // Pick mode is always ChRooted
+ this.mChRooted = true;
} else {
- this.mJailRoom = !ExplorerApplication.isAdvancedMode();
+ this.mChRooted = !ExplorerApplication.isAdvancedMode();
}
// Default long-click action
final boolean reload, final boolean useCurrent,
final SearchInfoParcelable searchInfo, final FileSystemObject scrollTo) {
- // Check navigation security (don't allow to go outside the jail room if one
+ // Check navigation security (don't allow to go outside the ChRooted environment if one
// is created)
- final String fNewDir = checkJailRoomNavigation(newDir);
+ final String fNewDir = checkChRootedNavigation(newDir);
synchronized (this.mSync) {
//Check that it is really necessary change the directory
//Apply user preferences
List<FileSystemObject> sortedFiles =
- FileHelper.applyUserPreferences(files, this.mMimeType, this.mJailRoom);
+ FileHelper.applyUserPreferences(files, this.mMimeType, this.mChRooted);
//Load the data
loadData(sortedFiles);
//Change the breadcrumb
if (NavigationView.this.mBreadcrumb != null) {
- NavigationView.this.mBreadcrumb.changeBreadcrumbPath(newDir, this.mJailRoom);
+ NavigationView.this.mBreadcrumb.changeBreadcrumbPath(newDir, this.mChRooted);
}
//Scroll to object?
}
/**
- * Method that creates a jail room, protecting the user to break anything in the device
+ * Method that creates a ChRooted environment, protecting the user to break anything
+ * in the device
* @hide
*/
- public void createJailRoom() {
- // If we are in a jail room, then do nothing
- if (this.mJailRoom) return;
- this.mJailRoom = true;
+ public void createChRooted() {
+ // If we are in a ChRooted environment, then do nothing
+ if (this.mChRooted) return;
+ this.mChRooted = true;
//Change to first storage volume
StorageVolume[] volumes =
}
/**
- * Method that exits from a jail room
+ * Method that exits from a ChRooted environment
* @hide
*/
- public void exitJailRoom() {
- // If we aren't in a jail room, then do nothing
- if (!this.mJailRoom) return;
- this.mJailRoom = false;
+ public void exitChRooted() {
+ // If we aren't in a ChRooted environment, then do nothing
+ if (!this.mChRooted) return;
+ this.mChRooted = false;
// Refresh
refresh();
}
/**
- * Method that ensures that the user don't go outside the jail room
+ * Method that ensures that the user don't go outside the ChRooted environment
*
* @param newDir The new directory to navigate to
* @return String
*/
- private String checkJailRoomNavigation(String newDir) {
- // If we aren't in jail room, then there is nothing to check
- if (!this.mJailRoom) return newDir;
+ private String checkChRootedNavigation(String newDir) {
+ // If we aren't in ChRooted environment, then there is nothing to check
+ if (!this.mChRooted) return newDir;
// Check if the path is owned by one of the storage volumes
if (!StorageHelper.isPathInStorageVolume(newDir)) {
}
// If console is privileged there is not need to change
- // If we are in a jail room, resolve the error without do anymore
+ // If we are in a ChRooted environment, resolve the error without do anymore
if (relaunchable instanceof InsufficientPermissionsException &&
(isPrivileged || !ExplorerApplication.isAdvancedMode())) {
translateException(
*
* @param files The listed files
* @param mimeType The mime-type to apply. if null returns all.
- * @param jailRoom If app run with no privileges
+ * @param chRooted If app run with no privileges
* @return List<FileSystemObject> The applied mode listed files
*/
public static List<FileSystemObject> applyUserPreferences(
- List<FileSystemObject> files, String mimeType, boolean jailRoom) {
- return applyUserPreferences(files, mimeType, false, jailRoom);
+ List<FileSystemObject> files, String mimeType, boolean chRooted) {
+ return applyUserPreferences(files, mimeType, false, chRooted);
}
/**
* @param files The listed files
* @param mimeType The mime-type to apply. if null returns all.
* @param noSort If sort must be applied
- * @param jailRoom If app run with no privileges
+ * @param chRooted If app run with no privileges
* @return List<FileSystemObject> The applied mode listed files
*/
public static List<FileSystemObject> applyUserPreferences(
- List<FileSystemObject> files, String mimeType, boolean noSort, boolean jailRoom) {
+ List<FileSystemObject> files, String mimeType, boolean noSort, boolean chRooted) {
//Retrieve user preferences
SharedPreferences prefs = Preferences.getSharedPreferences();
ExplorerSettings sortModePref = ExplorerSettings.SETTINGS_SORT_MODE;
//Hidden files
if (!prefs.getBoolean(
showHiddenPref.getId(),
- ((Boolean)showHiddenPref.getDefaultValue()).booleanValue()) || jailRoom) {
+ ((Boolean)showHiddenPref.getDefaultValue()).booleanValue()) || chRooted) {
if (file.isHidden()) {
files.remove(i);
continue;
//System files
if (!prefs.getBoolean(
showSystemPref.getId(),
- ((Boolean)showSystemPref.getDefaultValue()).booleanValue()) || jailRoom) {
+ ((Boolean)showSystemPref.getDefaultValue()).booleanValue()) || chRooted) {
if (file instanceof SystemFile) {
files.remove(i);
continue;
//Symlinks files
if (!prefs.getBoolean(
showSymlinksPref.getId(),
- ((Boolean)showSymlinksPref.getDefaultValue()).booleanValue()) || jailRoom) {
+ ((Boolean)showSymlinksPref.getDefaultValue()).booleanValue()) || chRooted) {
if (file instanceof Symlink) {
files.remove(i);
continue;
}
//Mime/Type
- if (jailRoom && !isDirectory(file)) {
+ if (chRooted && !isDirectory(file)) {
if (mimeType != null && mimeType.compareTo(MimeTypeHelper.ALL_MIME_TYPES) != 0) {
// NOTE: We don't need the context here, because mime-type database should
// be loaded prior to this call