summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-02-05 11:35:45 -0800
committerSan Mehat <san@google.com>2010-02-08 16:26:16 -0800
commit1e60c9603e02f95158d21b4a2089dc45dffb41c1 (patch)
treedb40e19878090465ad7c90ca9b68e518bdad73f9 /src
parent07c61c6dbb805ab9aa60ceffd3bd1fb528a3dc65 (diff)
downloadpackages_apps_settings-1e60c9603e02f95158d21b4a2089dc45dffb41c1.zip
packages_apps_settings-1e60c9603e02f95158d21b4a2089dc45dffb41c1.tar.gz
packages_apps_settings-1e60c9603e02f95158d21b4a2089dc45dffb41c1.tar.bz2
Settings: Refactor for new API and remove some unused references / imports
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/DisplaySettings.java1
-rw-r--r--src/com/android/settings/MediaFormat.java2
-rw-r--r--src/com/android/settings/SdCardSettings.java18
-rw-r--r--src/com/android/settings/SoundSettings.java5
-rw-r--r--src/com/android/settings/deviceinfo/Memory.java16
5 files changed, 12 insertions, 30 deletions
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 28a5829..72a0741 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -27,7 +27,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.Bundle;
-import android.os.IMountService;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.preference.CheckBoxPreference;
diff --git a/src/com/android/settings/MediaFormat.java b/src/com/android/settings/MediaFormat.java
index 40ae0d7..71d2766 100644
--- a/src/com/android/settings/MediaFormat.java
+++ b/src/com/android/settings/MediaFormat.java
@@ -23,7 +23,7 @@ import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-import android.os.IMountService;
+import android.os.storage.IMountService;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.Environment;
diff --git a/src/com/android/settings/SdCardSettings.java b/src/com/android/settings/SdCardSettings.java
index 4a83843..2ff5d8a 100644
--- a/src/com/android/settings/SdCardSettings.java
+++ b/src/com/android/settings/SdCardSettings.java
@@ -24,9 +24,10 @@ import android.content.IntentFilter;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.Environment;
-import android.os.IMountService;
import android.os.ServiceManager;
import android.os.StatFs;
+import android.os.storage.StorageManager;
+import android.os.storage.IMountService;
import android.text.format.Formatter;
import android.view.View;
import android.view.View.OnClickListener;
@@ -45,6 +46,7 @@ public class SdCardSettings extends Activity
setContentView(R.layout.sdcard_settings_screen);
+ mStorageManager = (StorageManager) getSystemService(Context.STORAGE_SERVICE);
mMountService = IMountService.Stub.asInterface(ServiceManager.getService("mount"));
mRemovedLayout = findViewById(R.id.removed);
@@ -105,10 +107,7 @@ public class SdCardSettings extends Activity
private void update() {
try {
- String path = Environment.getExternalStorageDirectory().getPath();
- mMassStorage.setChecked(
- mMountService.getVolumeShared(
- Environment.getExternalStorageDirectory().getPath(), "ums"));
+ mMassStorage.setChecked(mStorageManager.isUsbMassStorageEnabled());
} catch (Exception ex) {
}
@@ -158,11 +157,9 @@ public class SdCardSettings extends Activity
public void onClick(View v) {
try {
if (mMassStorage.isChecked()) {
- mMountService.shareVolume(
- Environment.getExternalStorageDirectory().getPath(), "ums");
+ mStorageManager.enableUsbMassStorage();
} else {
- mMountService.unshareVolume(
- Environment.getExternalStorageDirectory().getPath(), "ums");
+ mStorageManager.disableUsbMassStorage();
}
} catch (Exception ex) {
}
@@ -194,7 +191,8 @@ public class SdCardSettings extends Activity
}
};
- private IMountService mMountService;
+ private StorageManager mStorageManager;
+ private IMountService mMountService;
private CheckBox mMassStorage;
diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java
index fb78a80..52947ac 100644
--- a/src/com/android/settings/SoundSettings.java
+++ b/src/com/android/settings/SoundSettings.java
@@ -25,7 +25,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.Bundle;
-import android.os.IMountService;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.preference.CheckBoxPreference;
@@ -59,8 +58,6 @@ public class SoundSettings extends PreferenceActivity implements
private CheckBoxPreference mSilent;
- private IMountService mMountService = null;
-
/*
* If we are currently in one of the silent modes (the ringer mode is set to either
* "silent mode" or "vibrate mode"), then toggling the "Phone vibrate"
@@ -95,8 +92,6 @@ public class SoundSettings extends PreferenceActivity implements
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
- mMountService = IMountService.Stub.asInterface(ServiceManager.getService("mount"));
-
addPreferencesFromResource(R.xml.sound_settings);
if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType) {
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java
index 7e22375..3e26b87 100644
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ b/src/com/android/settings/deviceinfo/Memory.java
@@ -25,11 +25,11 @@ import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.Environment;
-import android.os.IMountService;
+import android.os.storage.IMountService;
import android.os.ServiceManager;
import android.os.StatFs;
-import android.storage.StorageManager;
-import android.storage.StorageEventListener;
+import android.os.storage.StorageManager;
+import android.os.storage.StorageEventListener;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
@@ -95,16 +95,6 @@ public class Memory extends PreferenceActivity {
}
StorageEventListener mStorageListener = new StorageEventListener() {
- public void onShareAvailabilityChanged(String method, boolean available) {
- }
-
- public void onMediaInserted(String label, String path, int major, int minor) {
- updateMemoryStatus();
- }
-
- public void onMediaRemoved(String label, String path, int major, int minor, boolean clean) {
- updateMemoryStatus();
- }
public void onVolumeStateChanged(
String label, String path, String oldState, String newState) {