Commit dd86631b authored by sync_forks@e's avatar sync_forks@e

Merge branch 'cm-14.1' into eelo-0.1

parents 055690b4 b98c5a95
......@@ -94,13 +94,9 @@ public class ContentProviderOperation implements Parcelable {
}
/** @hide */
public ContentProviderOperation(ContentProviderOperation cpo, boolean removeUserIdFromUri) {
public ContentProviderOperation(ContentProviderOperation cpo, Uri withUri) {
mType = cpo.mType;
if (removeUserIdFromUri) {
mUri = ContentProvider.getUriWithoutUserId(cpo.mUri);
} else {
mUri = cpo.mUri;
}
mUri = withUri;
mValues = cpo.mValues;
mSelection = cpo.mSelection;
mSelectionArgs = cpo.mSelectionArgs;
......@@ -110,14 +106,6 @@ public class ContentProviderOperation implements Parcelable {
mYieldAllowed = cpo.mYieldAllowed;
}
/** @hide */
public ContentProviderOperation getWithoutUserIdInUri() {
if (ContentProvider.uriHasUserId(mUri)) {
return new ContentProviderOperation(this, true);
}
return this;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mType);
Uri.writeToParcel(dest, mUri);
......
......@@ -50,7 +50,7 @@
<item>ERR_ESTIMATE=0</item>
<item>INTERMEDIATE_POS=0</item>
<item>GPS_LOCK=0</item>
<item>SUPL_ES=0</item>
<item>SUPL_ES=1</item>
</string-array>
</resources>
......@@ -48,7 +48,7 @@
<item>ERR_ESTIMATE=0</item>
<item>INTERMEDIATE_POS=0</item>
<item>GPS_LOCK=0</item>
<item>SUPL_ES=0</item>
<item>SUPL_ES=1</item>
</string-array>
</resources>
......@@ -59,7 +59,7 @@
<item>ERR_ESTIMATE=0</item>
<item>INTERMEDIATE_POS=0</item>
<item>GPS_LOCK=0</item>
<item>SUPL_ES=0</item>
<item>SUPL_ES=1</item>
</string-array>
</resources>
......@@ -43,6 +43,6 @@
<item>ERR_ESTIMATE=0</item>
<item>INTERMEDIATE_POS=0</item>
<item>GPS_LOCK=0</item>
<item>SUPL_ES=0</item>
<item>SUPL_ES=1</item>
</string-array>
</resources>
......@@ -39,6 +39,6 @@
<item>ERR_ESTIMATE=0</item>
<item>INTERMEDIATE_POS=0</item>
<item>GPS_LOCK=0</item>
<item>SUPL_ES=0</item>
<item>SUPL_ES=1</item>
</string-array>
</resources>
......@@ -61,7 +61,7 @@
<item>ERR_ESTIMATE=0</item>
<item>INTERMEDIATE_POS=0</item>
<item>GPS_LOCK=0</item>
<item>SUPL_ES=0</item>
<item>SUPL_ES=1</item>
</string-array>
</resources>
......@@ -2448,6 +2448,7 @@
<item>NTP_SERVER=north-america.pool.ntp.org</item>
<item>SUPL_VER=0x20000</item>
<item>SUPL_MODE=1</item>
<item>SUPL_ES=1</item>
</string-array>
<!-- If there is no preload VM number in the sim card, carriers such as
......
......@@ -516,6 +516,13 @@ public class SettingsProvider extends ContentProvider {
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
final int userId = getUserIdFromUri(uri, UserHandle.getCallingUserId());
if (userId != UserHandle.getCallingUserId()) {
getContext().enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS,
"Access files from the settings of another user");
}
uri = ContentProvider.getUriWithoutUserId(uri);
final String cacheName;
if (Settings.System.RINGTONE_CACHE_URI.equals(uri)) {
cacheName = Settings.System.RINGTONE_CACHE;
......@@ -528,8 +535,7 @@ public class SettingsProvider extends ContentProvider {
+ "ringtone playback is available through android.media.Ringtone");
}
final File cacheFile = new File(
getRingtoneCacheDir(UserHandle.getCallingUserId()), cacheName);
final File cacheFile = new File(getRingtoneCacheDir(userId), cacheName);
return ParcelFileDescriptor.open(cacheFile, ParcelFileDescriptor.parseMode(mode));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment