Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Require permissions to read APN DB.

Since the DB may contain corp passwords, we should secure it.
Using the same permission as writing to the DB as the read is
potentially as damaging as a write.

bug:6922610
Change-Id: If0c7382b0809d254410274588fab7a0e89594c71
  • Loading branch information...
commit 410a1228ec7aef66826f4aebf21cd26dc75ae82b 1 parent fddd809
Robert Greenwalt authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/com/android/providers/telephony/TelephonyProvider.java
View
4 src/com/android/providers/telephony/TelephonyProvider.java
@@ -425,6 +425,9 @@ private void setAPNConfigCheckSum(long id) {
@Override
public Cursor query(Uri url, String[] projectionIn, String selection,
String[] selectionArgs, String sort) {
+
+ checkPermission();
+
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables("carriers");
@@ -717,7 +720,6 @@ public int update(Uri url, ContentValues values, String where, String[] whereArg
}
private void checkPermission() {
- // Check the permissions
getContext().enforceCallingOrSelfPermission("android.permission.WRITE_APN_SETTINGS",
"No permission to write APN settings");
}
Please sign in to comment.
Something went wrong with that request. Please try again.