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

Commit 3bf048a2 authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

CMFM: Do not use cd and pwd commands



Remove cd and pwd commands and use / as working directory for shell process (this commands
are not used). This prevents that storage volumes from get busy on unmount file systems.
Signed-off-by: default avatarjruesga <jorge@ruesga.com>

Change-Id: I772866c00233351f505b61f53d43bac5de02a5e4
parent 1530ad9a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -39,10 +39,6 @@
  <command commandId="bash" commandPath="/system/bin/sh" commandArgs="" />
  <command commandId="su" commandPath="/system/xbin/su" commandArgs="" />

  <!-- Directory -->
  <command commandId="cd" commandPath="cd" commandArgs="%1$s" />
  <command commandId="pwd" commandPath="/system/xbin/pwd" commandArgs="-P" />

  <!-- Console info -->
  <command commandId="groups" commandPath="/system/xbin/groups" commandArgs="" />
  <command commandId="id" commandPath="/system/bin/id" commandArgs="-Gn" />
+6 −7
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import com.cyanogenmod.filemanager.preferences.Preferences;
import com.cyanogenmod.filemanager.ui.ThemeManager;
import com.cyanogenmod.filemanager.ui.ThemeManager.Theme;
import com.cyanogenmod.filemanager.util.AIDHelper;
import com.cyanogenmod.filemanager.util.FileHelper;
import com.cyanogenmod.filemanager.util.MimeTypeHelper;

import java.io.File;
@@ -354,13 +353,11 @@ public final class FileManagerApplication extends Application {
            if (ConsoleBuilder.isPrivileged()) {
                sBackgroundConsole =
                        new ConsoleHolder(
                                ConsoleBuilder.createPrivilegedConsole(
                                        ctx, FileHelper.ROOT_DIRECTORY));
                                ConsoleBuilder.createPrivilegedConsole(ctx));
            } else {
                sBackgroundConsole =
                        new ConsoleHolder(
                                ConsoleBuilder.createNonPrivilegedConsole(
                                        ctx, FileHelper.ROOT_DIRECTORY));
                                ConsoleBuilder.createNonPrivilegedConsole(ctx));
            }
        } catch (Exception e) {
            Log.e(TAG,
@@ -389,8 +386,7 @@ public final class FileManagerApplication extends Application {
                sBackgroundConsole =
                        new ConsoleHolder(
                                ConsoleBuilder.createPrivilegedConsole(
                                        getInstance().getApplicationContext(),
                                        FileHelper.ROOT_DIRECTORY));
                                        getInstance().getApplicationContext()));
            } catch (Exception e) {
                try {
                    if (sBackgroundConsole != null) {
@@ -410,6 +406,9 @@ public final class FileManagerApplication extends Application {
     * @return boolean If the access mode of the application
     */
    public static AccessMode getAccessMode() {
        if (!sIsDeviceRooted) {
            return AccessMode.SAFE;
        }
        String defaultValue =
                ((ObjectStringIdentifier)FileManagerSettings.
                            SETTINGS_ACCESS_MODE.getDefaultValue()).getId();
+7 −0
Original line number Diff line number Diff line
@@ -612,6 +612,13 @@ public class NavigationActivity extends Activity
                                StorageHelper.getStorageVolumes(NavigationActivity.this);
                        if (volumes != null && volumes.length > 0) {
                            initialDir = volumes[0].getPath();
                        } else {
                            // Show exception and exists
                            DialogHelper.showToast(
                                    NavigationActivity.this,
                                    R.string.msgs_cant_create_console, Toast.LENGTH_LONG);
                            exit();
                            return;
                        }
                    }

+0 −29
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cyanogenmod.filemanager.commands;

/**
 * An interface that represents an executable for retrieve the current directory.
 */
public interface ChangeCurrentDirExecutable extends SyncResultExecutable {

    /**
     * {@inheritDoc}
     */
    @Override
    Boolean getResult();
}
+0 −29
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cyanogenmod.filemanager.commands;

/**
 * An interface that represents an executable for retrieve the current directory.
 */
public interface CurrentDirExecutable extends SyncResultExecutable {

    /**
     * {@inheritDoc}
     */
    @Override
    String getResult();
}
Loading