aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonas Kylmälä <joonas.kylmala@iki.fi>2019-10-09 19:46:52 (GMT)
committerJoonas Kylmälä <joonas.kylmala@iki.fi>2019-10-10 17:25:06 (GMT)
commit2d8ae47d9919f83cdf7244c3eeb34f919d83a33d (patch)
tree2965e3e433dc4bfa1f33376864ed3842131ed058
parentde9e5b00e2a4072d2fd7e89e9abfc512a50d77e3 (diff)
downloadvendor_cmsdk-2d8ae47d9919f83cdf7244c3eeb34f919d83a33d.zip
vendor_cmsdk-2d8ae47d9919f83cdf7244c3eeb34f919d83a33d.tar.gz
vendor_cmsdk-2d8ae47d9919f83cdf7244c3eeb34f919d83a33d.tar.bz2
Disable phone number lookup settings during upgradeHEADreplicant-6.0-0004-rc1replicant-6.0
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>
-rw-r--r--packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java
index d35f449..1242c1a 100644
--- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java
+++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java
@@ -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) {