Skip to content

Commit 1275abd

Browse files
rich canningsAndroid (Google) Code Review
authored andcommitted
Merge "Move verification settings to Settings.Global" into jb-mr1-dev
2 parents cd42ce5 + 4d8fc79 commit 1275abd

File tree

3 files changed

+51
-10
lines changed

3 files changed

+51
-10
lines changed

core/java/android/provider/Settings.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4782,17 +4782,24 @@ public static final String getBluetoothInputDevicePriorityKey(String address) {
47824782
/**
47834783
* Whether the package manager should send package verification broadcasts for verifiers to
47844784
* review apps prior to installation.
4785-
*
4785+
* @deprecated moved to Settings.Global
47864786
* 1 = request apps to be verified prior to installation, if a verifier exists.
47874787
* 0 = do not verify apps before installation
47884788
* {@hide}
47894789
*/
4790+
@Deprecated
47904791
public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
47914792

4792-
/** Timeout for package verification. {@hide} */
4793+
/** Timeout for package verification.
4794+
* @deprecated moved to Settings.Global
4795+
* {@hide} */
4796+
@Deprecated
47934797
public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
47944798

4795-
/** Default response code for package verification. {@hide} */
4799+
/** Default response code for package verification.
4800+
* @deprecated moved to Settings.Global
4801+
* {@hide} */
4802+
@Deprecated
47964803
public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
47974804

47984805
/** {@hide} */
@@ -5271,6 +5278,23 @@ public static final class Global extends NameValueTable {
52715278
/** Timeout in milliseconds to wait for NTP server. {@hide} */
52725279
public static final String NTP_TIMEOUT = "ntp_timeout";
52735280

5281+
/**
5282+
* Whether the package manager should send package verification broadcasts for verifiers to
5283+
* review apps prior to installation.
5284+
* 1 = request apps to be verified prior to installation, if a verifier exists.
5285+
* 0 = do not verify apps before installation
5286+
* {@hide}
5287+
*/
5288+
public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
5289+
5290+
/** Timeout for package verification.
5291+
* {@hide} */
5292+
public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
5293+
5294+
/** Default response code for package verification.
5295+
* {@hide} */
5296+
public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
5297+
52745298
/**
52755299
* The interval in milliseconds at which to check packet counts on the
52765300
* mobile data interface when screen is on, to detect possible data

packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
6767
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
6868
// is properly propagated through your change. Not doing so will result in a loss of user
6969
// settings.
70-
private static final int DATABASE_VERSION = 86;
70+
private static final int DATABASE_VERSION = 87;
7171

7272
private Context mContext;
7373
private int mUserHandle;
@@ -1288,6 +1288,23 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int currentVersion) {
12881288
upgradeVersion = 86;
12891289
}
12901290

1291+
if (upgradeVersion == 86) {
1292+
db.beginTransaction();
1293+
try {
1294+
String[] settingsToMove = {
1295+
Settings.Secure.PACKAGE_VERIFIER_ENABLE,
1296+
Settings.Secure.PACKAGE_VERIFIER_TIMEOUT,
1297+
Settings.Secure.PACKAGE_VERIFIER_DEFAULT_RESPONSE
1298+
};
1299+
moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true);
1300+
1301+
db.setTransactionSuccessful();
1302+
} finally {
1303+
db.endTransaction();
1304+
}
1305+
upgradeVersion = 87;
1306+
}
1307+
12911308
// *** Remember to update DATABASE_VERSION above!
12921309

12931310
if (upgradeVersion != currentVersion) {

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5815,8 +5815,8 @@ public void finishPackageInstall(int token) {
58155815
* @return verification timeout in milliseconds
58165816
*/
58175817
private long getVerificationTimeout() {
5818-
return android.provider.Settings.Secure.getLong(mContext.getContentResolver(),
5819-
android.provider.Settings.Secure.PACKAGE_VERIFIER_TIMEOUT,
5818+
return android.provider.Settings.Global.getLong(mContext.getContentResolver(),
5819+
android.provider.Settings.Global.PACKAGE_VERIFIER_TIMEOUT,
58205820
DEFAULT_VERIFICATION_TIMEOUT);
58215821
}
58225822

@@ -5826,8 +5826,8 @@ private long getVerificationTimeout() {
58265826
* @return default verification response code
58275827
*/
58285828
private int getDefaultVerificationResponse() {
5829-
return android.provider.Settings.Secure.getInt(mContext.getContentResolver(),
5830-
android.provider.Settings.Secure.PACKAGE_VERIFIER_DEFAULT_RESPONSE,
5829+
return android.provider.Settings.Global.getInt(mContext.getContentResolver(),
5830+
android.provider.Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE,
58315831
DEFAULT_VERIFICATION_RESPONSE);
58325832
}
58335833

@@ -5837,8 +5837,8 @@ private int getDefaultVerificationResponse() {
58375837
* @return true if verification should be performed
58385838
*/
58395839
private boolean isVerificationEnabled() {
5840-
return android.provider.Settings.Secure.getInt(mContext.getContentResolver(),
5841-
android.provider.Settings.Secure.PACKAGE_VERIFIER_ENABLE,
5840+
return android.provider.Settings.Global.getInt(mContext.getContentResolver(),
5841+
android.provider.Settings.Global.PACKAGE_VERIFIER_ENABLE,
58425842
DEFAULT_VERIFY_ENABLE ? 1 : 0) == 1 ? true : false;
58435843
}
58445844

0 commit comments

Comments
 (0)