summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/hardware/usb/IUsbManager.aidl3
-rw-r--r--core/java/android/hardware/usb/UsbManager.java37
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java13
-rw-r--r--services/usb/java/com/android/server/usb/UsbService.java10
4 files changed, 0 insertions, 63 deletions
diff --git a/core/java/android/hardware/usb/IUsbManager.aidl b/core/java/android/hardware/usb/IUsbManager.aidl
index 9bc967f..e4ab3f2 100644
--- a/core/java/android/hardware/usb/IUsbManager.aidl
+++ b/core/java/android/hardware/usb/IUsbManager.aidl
@@ -85,9 +85,6 @@ interface IUsbManager
/* Sets the current USB function. */
void setCurrentFunction(String function, boolean makeDefault);
- /* Sets the file path for USB mass storage backing file. */
- void setMassStorageBackingFile(String path);
-
/* Allow USB debugging from the attached host. If alwaysAllow is true, add the
* the public key to list of host keys that the user has approved.
*/
diff --git a/core/java/android/hardware/usb/UsbManager.java b/core/java/android/hardware/usb/UsbManager.java
index f283051..a45d4ca 100644
--- a/core/java/android/hardware/usb/UsbManager.java
+++ b/core/java/android/hardware/usb/UsbManager.java
@@ -410,28 +410,6 @@ public class UsbManager {
}
}
- private static boolean propertyContainsFunction(String property, String function) {
- String functions = SystemProperties.get(property, "");
- int index = functions.indexOf(function);
- if (index < 0) return false;
- if (index > 0 && functions.charAt(index - 1) != ',') return false;
- int charAfter = index + function.length();
- if (charAfter < functions.length() && functions.charAt(charAfter) != ',') return false;
- return true;
- }
-
- /**
- * Returns true if the specified USB function is currently enabled.
- *
- * @param function name of the USB function
- * @return true if the USB function is enabled.
- *
- * {@hide}
- */
- public boolean isFunctionEnabled(String function) {
- return propertyContainsFunction("sys.usb.config", function);
- }
-
/**
* Returns the current default USB function.
*
@@ -465,19 +443,4 @@ public class UsbManager {
Log.e(TAG, "RemoteException in setCurrentFunction", e);
}
}
-
- /**
- * Sets the file path for USB mass storage backing file.
- *
- * @param path backing file path
- *
- * {@hide}
- */
- public void setMassStorageBackingFile(String path) {
- try {
- mService.setMassStorageBackingFile(path);
- } catch (RemoteException e) {
- Log.e(TAG, "RemoteException in setDefaultFunction", e);
- }
- }
}
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 6adb8be..f84beb6 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -78,8 +78,6 @@ public class UsbDeviceManager {
"/sys/class/android_usb/android0/functions";
private static final String STATE_PATH =
"/sys/class/android_usb/android0/state";
- private static final String MASS_STORAGE_FILE_PATH =
- "/sys/class/android_usb/android0/f_mass_storage/lun/file";
private static final String RNDIS_ETH_ADDR_PATH =
"/sys/class/android_usb/android0/f_rndis/ethaddr";
private static final String AUDIO_SOURCE_PCM_PATH =
@@ -832,8 +830,6 @@ public class UsbDeviceManager {
+ FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim());
pw.println(" Kernel function list: "
+ FileUtils.readTextFile(new File(FUNCTIONS_PATH), 0, null).trim());
- pw.println(" Mass storage backing file: "
- + FileUtils.readTextFile(new File(MASS_STORAGE_FILE_PATH), 0, null).trim());
} catch (IOException e) {
pw.println("IOException: " + e);
}
@@ -866,15 +862,6 @@ public class UsbDeviceManager {
mHandler.sendMessage(MSG_SET_CURRENT_FUNCTIONS, functions, makeDefault);
}
- public void setMassStorageBackingFile(String path) {
- if (path == null) path = "";
- try {
- FileUtils.stringToFile(MASS_STORAGE_FILE_PATH, path);
- } catch (IOException e) {
- Slog.e(TAG, "failed to write to " + MASS_STORAGE_FILE_PATH);
- }
- }
-
private void readOemUsbOverrideConfig() {
String[] configList = mContext.getResources().getStringArray(
com.android.internal.R.array.config_oemUsbModeOverride);
diff --git a/services/usb/java/com/android/server/usb/UsbService.java b/services/usb/java/com/android/server/usb/UsbService.java
index fda8076..e03884f 100644
--- a/services/usb/java/com/android/server/usb/UsbService.java
+++ b/services/usb/java/com/android/server/usb/UsbService.java
@@ -271,16 +271,6 @@ public class UsbService extends IUsbManager.Stub {
}
@Override
- public void setMassStorageBackingFile(String path) {
- mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USB, null);
- if (mDeviceManager != null) {
- mDeviceManager.setMassStorageBackingFile(path);
- } else {
- throw new IllegalStateException("USB device mode not supported");
- }
- }
-
- @Override
public void allowUsbDebugging(boolean alwaysAllow, String publicKey) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USB, null);
mDeviceManager.allowUsbDebugging(alwaysAllow, publicKey);