Browse Source

Disable phone number lookup settings during upgrade

This disables during the upgrade settings that cause private
information leaking through phone number lookup feature.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
replicant-6.0
Joonas Kylmälä 9 months ago
parent
commit
2d8ae47d99
No known key found for this signature in database GPG Key ID: 132DEBCE65522635
1 changed files with 20 additions and 1 deletions
  1. +20
    -1
      packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java

+ 20
- 1
packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java View File

@@ -46,7 +46,7 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{
private static final boolean LOCAL_LOGV = false;

private static final String DATABASE_NAME = "cmsettings.db";
private static final int DATABASE_VERSION = 6;
private static final int DATABASE_VERSION = 7;

public static class CMTableNames {
public static final String TABLE_SYSTEM = "system";
@@ -232,6 +232,25 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{
}
upgradeVersion = 6;
}

if (upgradeVersion < 7) {
if (mUserHandle == UserHandle.USER_OWNER) {
db.beginTransaction();
SQLiteStatement stmt = null;
try {
stmt = db.compileStatement("UPDATE system SET value = 0 WHERE name IN (?,?,?);");
stmt.bindString(1, CMSettings.System.ENABLE_FORWARD_LOOKUP);
stmt.bindString(2, CMSettings.System.ENABLE_PEOPLE_LOOKUP);
stmt.bindString(3, CMSettings.System.ENABLE_REVERSE_LOOKUP);
stmt.execute();
db.setTransactionSuccessful();
} finally {
if (stmt != null) stmt.close();
db.endTransaction();
}
}
upgradeVersion = 7;
}
// *** Remember to update DATABASE_VERSION above!

if (upgradeVersion < newVersion) {


Loading…
Cancel
Save