Merge "Remove USE_LOCATION_FOR_SERVICES from Settings"
diff --git a/res/drawable-mdpi/ic_launcher_settings.png b/res/drawable-mdpi/ic_launcher_settings.png
old mode 100755
new mode 100644
index 16db056..a8cddf3
--- a/res/drawable-mdpi/ic_launcher_settings.png
+++ b/res/drawable-mdpi/ic_launcher_settings.png
Binary files differ
diff --git a/res/drawable-mdpi/icon.png b/res/drawable-mdpi/icon.png
old mode 100755
new mode 100644
index 16db056..a8cddf3
--- a/res/drawable-mdpi/icon.png
+++ b/res/drawable-mdpi/icon.png
Binary files differ
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.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/ManageApplications.java b/src/com/android/settings/ManageApplications.java
index 0525dab..6de6c9c 100644
--- a/src/com/android/settings/ManageApplications.java
+++ b/src/com/android/settings/ManageApplications.java
@@ -1559,8 +1559,8 @@
ManageApplications.this.registerReceiver(this, filter);
// Register for events related to sdcard installation.
IntentFilter sdFilter = new IntentFilter();
- sdFilter.addAction(Intent.ACTION_MEDIA_RESOURCES_AVAILABLE);
- sdFilter.addAction(Intent.ACTION_MEDIA_RESOURCES_UNAVAILABLE);
+ sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
+ sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
ManageApplications.this.registerReceiver(this, sdFilter);
}
@Override
@@ -1573,9 +1573,9 @@
Uri data = intent.getData();
String pkgName = data.getEncodedSchemeSpecificPart();
updatePackageList(actionStr, pkgName);
- } else if (Intent.ACTION_MEDIA_RESOURCES_AVAILABLE.equals(actionStr) ||
- Intent.ACTION_MEDIA_RESOURCES_UNAVAILABLE.equals(actionStr)) {
- boolean available = Intent.ACTION_MEDIA_RESOURCES_AVAILABLE.equals(actionStr);
+ } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(actionStr) ||
+ Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(actionStr)) {
+ boolean available = Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(actionStr);
String pkgList[] = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
if (pkgList == null || pkgList.length == 0) {
// Ignore
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.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.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 @@
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 @@
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 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 @@
}
};
- 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.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 @@
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 @@
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..04eebb1 100644
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ b/src/com/android/settings/deviceinfo/Memory.java
@@ -25,11 +25,11 @@
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,19 +95,9 @@
}
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) {
+ @Override
+ public void onStorageStateChanged(String path, String oldState, String newState) {
updateMemoryStatus();
}
};
@@ -166,9 +156,8 @@
Log.e(TAG, "Mount service is null, can't unmount");
}
} catch (RemoteException ex) {
- // Failed for some reason, try to update UI to actual state
- updateMemoryStatus();
}
+ updateMemoryStatus();
}
private void mount() {
@@ -180,9 +169,8 @@
Log.e(TAG, "Mount service is null, can't mount");
}
} catch (RemoteException ex) {
- // Failed for some reason, try to update UI to actual state
- updateMemoryStatus();
}
+ updateMemoryStatus();
}
private void updateMemoryStatus() {