@Override public boolean onPreferenceClick(Preference preference) { if (super.onPreferenceClick(preference)) { return true; } if (preference == mActivateEncryption) { if (alertIfMonkey(mActivity, R.string.monkey_encryption)) { return true; } // Check to see if encryption is even supported on this device (it's optional). if (mDPM.getStorageEncryptionStatus() == DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED) { AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); builder.setMessage(R.string.encryption_not_supported); builder.setPositiveButton(R.string.encryption_not_supported_ok, null); builder.show(); return true; } // Launch the activity to activate encryption. May or may not return! Intent intent = new Intent(DevicePolicyManager.ACTION_START_ENCRYPTION); startActivityForResult(intent, REQUEST_CODE_START_ENCRYPTION); return true; } return false; }
@Override public boolean onPreferenceClick(Preference preference) { if (super.onPreferenceClick(preference)) { return true; } if (preference == mActivateEncryption) { if (alertIfMonkey(mActivity, R.string.monkey_encryption)) { return true; } // Check to see if encryption is even supported on this device (it's optional). if (mDPM.getStorageEncryptionStatus() == DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED) { AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); builder.setMessage(R.string.encryption_not_supported); builder.setPositiveButton(R.string.encryption_not_supported_ok, null); builder.show(); return true; } // Launch the activity to activate encryption. May or may not return! Intent intent = new Intent(DevicePolicyManager.ACTION_START_ENCRYPTION); startActivityForResult(intent, REQUEST_CODE_START_ENCRYPTION); return true; } return false; }
@Override public boolean onPreferenceClick(Preference preference) { if (super.onPreferenceClick(preference)) { return true; } if (preference == mLockScreen) { if (alertIfMonkey(mActivity, R.string.monkey_lock_screen)) { return true; } mDPM.lockNow(); return true; } else if (preference == mWipeData || preference == mWipeAppData) { if (alertIfMonkey(mActivity, R.string.monkey_wipe_data)) { return true; } promptForRealDeviceWipe(preference == mWipeAppData); return true; } return false; }
@Override public boolean onPreferenceClick(Preference preference) { if (super.onPreferenceClick(preference)) { return true; } if (preference == mLockScreen) { if (alertIfMonkey(mActivity, R.string.monkey_lock_screen)) { return true; } mDPM.lockNow(); return true; } else if (preference == mWipeData || preference == mWipeAppData) { if (alertIfMonkey(mActivity, R.string.monkey_wipe_data)) { return true; } promptForRealDeviceWipe(preference == mWipeAppData); return true; } return false; }
@Override public boolean onPreferenceClick(Preference preference) { if (super.onPreferenceClick(preference)) { return true; } if (preference == mExpirationStatus) { String expirationStatus = getExpirationStatus(); mExpirationStatus.setSummary(expirationStatus); return true; } return false; }
@Override public boolean onPreferenceClick(Preference preference) { if (super.onPreferenceClick(preference)) { return true; } if (preference == mExpirationStatus) { String expirationStatus = getExpirationStatus(); mExpirationStatus.setSummary(expirationStatus); return true; } return false; }