summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@google.com>2015-07-29 01:19:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-07-29 01:19:43 +0000
commitb8040265dd0d5a2a96e0850623647dad2f528db1 (patch)
treeccde4fc8d2f3247f326cec3f57af31cacad5b344 /services
parent02022b70bef7d6964bc8043385531d1aa97fb15b (diff)
parent4634987668eb7e1fa1434bddbde969ef43de6b40 (diff)
downloadframeworks_base-b8040265dd0d5a2a96e0850623647dad2f528db1.zip
frameworks_base-b8040265dd0d5a2a96e0850623647dad2f528db1.tar.gz
frameworks_base-b8040265dd0d5a2a96e0850623647dad2f528db1.tar.bz2
Merge "Give secondary users read-only physical cards." into mnc-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/MountService.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 857394f..6ab2fd7 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -69,7 +69,6 @@ import android.os.storage.IMountServiceListener;
import android.os.storage.IMountShutdownObserver;
import android.os.storage.IObbActionListener;
import android.os.storage.MountServiceInternal;
-import android.os.storage.MountServiceInternal.ExternalStorageMountPolicy;
import android.os.storage.OnObbStateChangeListener;
import android.os.storage.StorageManager;
import android.os.storage.StorageResultCode;
@@ -809,7 +808,7 @@ class MountService extends IMountService.Stub
synchronized (mVolumes) {
for (int i = 0; i < mVolumes.size(); i++) {
final VolumeInfo vol = mVolumes.valueAt(i);
- if (vol.isVisibleToUser(userId) && vol.isMountedReadable()) {
+ if (vol.isVisibleForRead(userId) && vol.isMountedReadable()) {
final StorageVolume userVol = vol.buildStorageVolume(mContext, userId, false);
mHandler.obtainMessage(H_VOLUME_BROADCAST, userVol).sendToTarget();
@@ -1252,7 +1251,7 @@ class MountService extends IMountService.Stub
// started after this point will trigger additional
// user-specific broadcasts.
for (int userId : mStartedUsers) {
- if (vol.isVisibleToUser(userId)) {
+ if (vol.isVisibleForRead(userId)) {
final StorageVolume userVol = vol.buildStorageVolume(mContext, userId, false);
mHandler.obtainMessage(H_VOLUME_BROADCAST, userVol).sendToTarget();
@@ -2610,13 +2609,14 @@ class MountService extends IMountService.Stub
}
@Override
- public StorageVolume[] getVolumeList(int uid, String packageName) {
+ public StorageVolume[] getVolumeList(int uid, String packageName, int flags) {
+ final boolean forWrite = (flags & StorageManager.FLAG_FOR_WRITE) != 0;
+
final ArrayList<StorageVolume> res = new ArrayList<>();
boolean foundPrimary = false;
final int userId = UserHandle.getUserId(uid);
final boolean reportUnmounted;
-
final long identity = Binder.clearCallingIdentity();
try {
reportUnmounted = !mMountServiceInternal.hasExternalStorage(
@@ -2628,7 +2628,7 @@ class MountService extends IMountService.Stub
synchronized (mLock) {
for (int i = 0; i < mVolumes.size(); i++) {
final VolumeInfo vol = mVolumes.valueAt(i);
- if (vol.isVisibleToUser(userId)) {
+ if (forWrite ? vol.isVisibleForWrite(userId) : vol.isVisibleForRead(userId)) {
final StorageVolume userVol = vol.buildStorageVolume(mContext, userId,
reportUnmounted);
if (vol.isPrimary()) {