diff options
Diffstat (limited to 'packages')
8 files changed, 32 insertions, 28 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java index 827b378..f8d7fc9 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -20,6 +20,7 @@ import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.os.RemoteException; +import android.os.PowerManager; import android.os.UserHandle; import android.util.AttributeSet; import android.util.Log; @@ -294,6 +295,11 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe if (timeoutMs > 0) { showTimeoutDialog(timeoutMs); } + + if (mLockPatternUtils.isSeparateEncryptionPasswordEnabled() && failedAttempts >= 5) { + final PowerManager powerManager = mContext.getSystemService(PowerManager.class); + powerManager.reboot(null); + } } /** diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index 70a9f5c..33f8da8 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -69,8 +69,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map.Entry; -import cyanogenmod.providers.CMSettings; - import static android.os.BatteryManager.BATTERY_HEALTH_UNKNOWN; import static android.os.BatteryManager.BATTERY_STATUS_FULL; import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; @@ -1132,8 +1130,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } private boolean isDeviceProvisionedInSettingsDb() { - return CMSettings.Secure.getInt(mContext.getContentResolver(), - CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 0) != 0; + return Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, 0) != 0; } private void watchForDeviceProvisioning() { @@ -1150,7 +1148,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { }; mContext.getContentResolver().registerContentObserver( - CMSettings.Secure.getUriFor(CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED), + Settings.Global.getUriFor(Settings.Global.DEVICE_PROVISIONED), false, mDeviceProvisionedObserver); // prevent a race condition between where we check the flag and where we register the diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 7a14241..e9169bf 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -34,6 +34,7 @@ <bool name="def_screen_brightness_automatic_mode">false</bool> <fraction name="def_window_animation_scale">100%</fraction> <fraction name="def_window_transition_scale">100%</fraction> + <fraction name="def_animator_duration_scale">100%</fraction> <bool name="def_haptic_feedback">true</bool> <bool name="def_dozeEnabledByDefault">false</bool> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 42c1aa7..a57ddc1 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -441,7 +441,6 @@ class DatabaseHelper extends SQLiteOpenHelper { + Settings.System.TRANSITION_ANIMATION_SCALE + "'"); stmt = db.compileStatement("INSERT INTO system(name,value)" + " VALUES(?,?);"); - loadDefaultAnimationSettings(stmt); db.setTransactionSuccessful(); } finally { db.endTransaction(); @@ -572,7 +571,6 @@ class DatabaseHelper extends SQLiteOpenHelper { + Settings.System.TRANSITION_ANIMATION_SCALE + "'"); stmt = db.compileStatement("INSERT INTO system(name,value)" + " VALUES(?,?);"); - loadDefaultAnimationSettings(stmt); db.setTransactionSuccessful(); } finally { db.endTransaction(); @@ -978,7 +976,6 @@ class DatabaseHelper extends SQLiteOpenHelper { + Settings.System.TRANSITION_ANIMATION_SCALE + "'"); stmt = db.compileStatement("INSERT INTO system(name,value)" + " VALUES(?,?);"); - loadDefaultAnimationSettings(stmt); db.setTransactionSuccessful(); } finally { db.endTransaction(); @@ -1931,8 +1928,6 @@ class DatabaseHelper extends SQLiteOpenHelper { } if (upgradeVersion < 115) { - moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_SECURE, - new String[] { CMSettings.Secure.STATS_COLLECTION }, true); if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); SQLiteStatement stmt = null; @@ -2588,8 +2583,6 @@ class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE, R.bool.def_screen_brightness_automatic_mode); - loadDefaultAnimationSettings(stmt); - loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION, R.bool.def_accelerometer_rotation); @@ -2641,10 +2634,12 @@ class DatabaseHelper extends SQLiteOpenHelper { } private void loadDefaultAnimationSettings(SQLiteStatement stmt) { - loadFractionSetting(stmt, Settings.System.WINDOW_ANIMATION_SCALE, + loadFractionSetting(stmt, Settings.Global.WINDOW_ANIMATION_SCALE, R.fraction.def_window_animation_scale, 1); - loadFractionSetting(stmt, Settings.System.TRANSITION_ANIMATION_SCALE, + loadFractionSetting(stmt, Settings.Global.TRANSITION_ANIMATION_SCALE, R.fraction.def_window_transition_scale, 1); + loadFractionSetting(stmt, Settings.Global.ANIMATOR_DURATION_SCALE, + R.fraction.def_animator_duration_scale, 1); } private void loadDefaultHapticSettings(SQLiteStatement stmt) { @@ -2834,6 +2829,8 @@ class DatabaseHelper extends SQLiteOpenHelper { loadSetting(stmt, Settings.Global.MODE_RINGER, AudioManager.RINGER_MODE_NORMAL); + loadDefaultAnimationSettings(stmt); + // --- Previously in 'secure' loadBooleanSetting(stmt, Settings.Global.PACKAGE_VERIFIER_ENABLE, R.bool.def_package_verifier_enable); diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index d45b52b..4b49196 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -109,6 +109,7 @@ <uses-permission android:name="android.permission.TRUST_LISTENER" /> <uses-permission android:name="android.permission.USE_FINGERPRINT" /> <uses-permission android:name="android.permission.RESET_FINGERPRINT_LOCKOUT" /> + <uses-permission android:name="android.permission.REBOOT" /> <!-- Needed for WallpaperManager.clear in ImageWallpaper.updateWallpaperLocked --> <uses-permission android:name="android.permission.SET_WALLPAPER"/> diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index 5a6f3c9..b4634ab 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -60,6 +60,7 @@ public class ImageWallpaper extends WallpaperService { private static final String GL_LOG_TAG = "ImageWallpaperGL"; private static final boolean DEBUG = false; private static final String PROPERTY_KERNEL_QEMU = "ro.kernel.qemu"; + private static final String PROPERTY_RENDERING_SOFTWARE = "ro.softwaregl"; static final boolean FIXED_SIZED_SURFACE = true; static final boolean USE_OPENGL = true; @@ -77,7 +78,7 @@ public class ImageWallpaper extends WallpaperService { //noinspection PointlessBooleanExpression,ConstantConditions if (FIXED_SIZED_SURFACE && USE_OPENGL) { - if (!isEmulator()) { + if (!isEmulator() && !needsSoftwareRendering()) { mIsHwAccelerated = ActivityManager.isHighEndGfx(); } } @@ -94,6 +95,10 @@ public class ImageWallpaper extends WallpaperService { return "1".equals(SystemProperties.get(PROPERTY_KERNEL_QEMU, "0")); } + private static boolean needsSoftwareRendering() { + return "1".equals(SystemProperties.get(PROPERTY_RENDERING_SOFTWARE, "0")); + } + @Override public Engine onCreateEngine() { mEngine = new DrawableEngine(); @@ -701,7 +706,7 @@ public class ImageWallpaper extends WallpaperService { mEglConfig = chooseEglConfig(); if (mEglConfig == null) { - throw new RuntimeException("eglConfig not initialized"); + return false; } mEglContext = createContext(mEgl, mEglDisplay, mEglConfig); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index e958ee1..8511107 100755 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -118,8 +118,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import cyanogenmod.providers.CMSettings; - import static com.android.keyguard.KeyguardHostView.OnDismissAction; public abstract class BaseStatusBar extends SystemUI implements @@ -270,8 +268,8 @@ public abstract class BaseStatusBar extends SystemUI implements protected final ContentObserver mSettingsObserver = new ContentObserver(mHandler) { @Override public void onChange(boolean selfChange) { - final boolean provisioned = 0 != CMSettings.Secure.getInt( - mContext.getContentResolver(), CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED, 0); + final boolean provisioned = 0 != Settings.Global.getInt( + mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0); if (provisioned != mDeviceProvisioned) { mDeviceProvisioned = provisioned; updateNotifications(); @@ -582,8 +580,8 @@ public abstract class BaseStatusBar extends SystemUI implements mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mContext.getContentResolver().registerContentObserver( - CMSettings.Secure.getUriFor(CMSettings.Secure.CM_SETUP_WIZARD_COMPLETED), false, - mSettingsObserver, UserHandle.USER_ALL); + Settings.Global.getUriFor(Settings.Global.DEVICE_PROVISIONED), true, + mSettingsObserver); mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(Settings.Global.ZEN_MODE), false, mSettingsObserver); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 7df8346..6b44688 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3600,12 +3600,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } else if (cyanogenmod.content.Intent.ACTION_SCREEN_CAMERA_GESTURE.equals(action)) { boolean userSetupComplete = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0) != 0; - if (!userSetupComplete || !isDeviceProvisioned()) { - if (DEBUG) { - Log.d(TAG, String.format("userSetupComplete = $1%s, " + - "deviceProvisioned = $2%s, ignoring camera launch gesture.", - userSetupComplete, isDeviceProvisioned())); - } + if (!userSetupComplete) { + if (DEBUG) Log.d(TAG, String.format( + "userSetupComplete = %s, ignoring camera launch gesture.", + userSetupComplete)); return; } |