Merge "Move verification settings to Settings.Global" into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1275abd013
@@ -4782,17 +4782,24 @@ public final class Settings {
|
||||
/**
|
||||
* Whether the package manager should send package verification broadcasts for verifiers to
|
||||
* review apps prior to installation.
|
||||
*
|
||||
* @deprecated moved to Settings.Global
|
||||
* 1 = request apps to be verified prior to installation, if a verifier exists.
|
||||
* 0 = do not verify apps before installation
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
|
||||
|
||||
/** Timeout for package verification. {@hide} */
|
||||
/** Timeout for package verification.
|
||||
* @deprecated moved to Settings.Global
|
||||
* {@hide} */
|
||||
@Deprecated
|
||||
public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
|
||||
|
||||
/** Default response code for package verification. {@hide} */
|
||||
/** Default response code for package verification.
|
||||
* @deprecated moved to Settings.Global
|
||||
* {@hide} */
|
||||
@Deprecated
|
||||
public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
|
||||
|
||||
/** {@hide} */
|
||||
@@ -5271,6 +5278,23 @@ public final class Settings {
|
||||
/** Timeout in milliseconds to wait for NTP server. {@hide} */
|
||||
public static final String NTP_TIMEOUT = "ntp_timeout";
|
||||
|
||||
/**
|
||||
* Whether the package manager should send package verification broadcasts for verifiers to
|
||||
* review apps prior to installation.
|
||||
* 1 = request apps to be verified prior to installation, if a verifier exists.
|
||||
* 0 = do not verify apps before installation
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
|
||||
|
||||
/** Timeout for package verification.
|
||||
* {@hide} */
|
||||
public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
|
||||
|
||||
/** Default response code for package verification.
|
||||
* {@hide} */
|
||||
public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
|
||||
|
||||
/**
|
||||
* The interval in milliseconds at which to check packet counts on the
|
||||
* mobile data interface when screen is on, to detect possible data
|
||||
|
||||
@@ -67,7 +67,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
|
||||
// is properly propagated through your change. Not doing so will result in a loss of user
|
||||
// settings.
|
||||
private static final int DATABASE_VERSION = 86;
|
||||
private static final int DATABASE_VERSION = 87;
|
||||
|
||||
private Context mContext;
|
||||
private int mUserHandle;
|
||||
@@ -1288,6 +1288,23 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
upgradeVersion = 86;
|
||||
}
|
||||
|
||||
if (upgradeVersion == 86) {
|
||||
db.beginTransaction();
|
||||
try {
|
||||
String[] settingsToMove = {
|
||||
Settings.Secure.PACKAGE_VERIFIER_ENABLE,
|
||||
Settings.Secure.PACKAGE_VERIFIER_TIMEOUT,
|
||||
Settings.Secure.PACKAGE_VERIFIER_DEFAULT_RESPONSE
|
||||
};
|
||||
moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
upgradeVersion = 87;
|
||||
}
|
||||
|
||||
// *** Remember to update DATABASE_VERSION above!
|
||||
|
||||
if (upgradeVersion != currentVersion) {
|
||||
|
||||
@@ -5815,8 +5815,8 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
* @return verification timeout in milliseconds
|
||||
*/
|
||||
private long getVerificationTimeout() {
|
||||
return android.provider.Settings.Secure.getLong(mContext.getContentResolver(),
|
||||
android.provider.Settings.Secure.PACKAGE_VERIFIER_TIMEOUT,
|
||||
return android.provider.Settings.Global.getLong(mContext.getContentResolver(),
|
||||
android.provider.Settings.Global.PACKAGE_VERIFIER_TIMEOUT,
|
||||
DEFAULT_VERIFICATION_TIMEOUT);
|
||||
}
|
||||
|
||||
@@ -5826,8 +5826,8 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
* @return default verification response code
|
||||
*/
|
||||
private int getDefaultVerificationResponse() {
|
||||
return android.provider.Settings.Secure.getInt(mContext.getContentResolver(),
|
||||
android.provider.Settings.Secure.PACKAGE_VERIFIER_DEFAULT_RESPONSE,
|
||||
return android.provider.Settings.Global.getInt(mContext.getContentResolver(),
|
||||
android.provider.Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE,
|
||||
DEFAULT_VERIFICATION_RESPONSE);
|
||||
}
|
||||
|
||||
@@ -5837,8 +5837,8 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
* @return true if verification should be performed
|
||||
*/
|
||||
private boolean isVerificationEnabled() {
|
||||
return android.provider.Settings.Secure.getInt(mContext.getContentResolver(),
|
||||
android.provider.Settings.Secure.PACKAGE_VERIFIER_ENABLE,
|
||||
return android.provider.Settings.Global.getInt(mContext.getContentResolver(),
|
||||
android.provider.Settings.Global.PACKAGE_VERIFIER_ENABLE,
|
||||
DEFAULT_VERIFY_ENABLE ? 1 : 0) == 1 ? true : false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user