Loading src/com/android/dialer/settings/DialerSettingsActivity.java +4 −4 Original line number Diff line number Diff line Loading @@ -91,10 +91,10 @@ public class DialerSettingsActivity extends PreferenceActivity { @Override public void onHeaderClick(Header header, int position) { if (header.id == R.id.settings_header_sounds_and_vibration) { // If we don't have the AppOp to write to system settings, go to system sound settings // instead. Otherwise, perform the super implementation (which launches our own // preference fragment. if (!PermissionsUtil.hasAppOp(this, AppOpsManager.OPSTR_WRITE_SETTINGS)) { // If we don't have the permission to write to system settings, go to system sound // settings instead. Otherwise, perform the super implementation (which launches our // own preference fragment. if (!Settings.System.canWrite(this)) { Toast.makeText( this, getResources().getString(R.string.toast_cannot_write_system_settings), Loading src/com/android/dialer/settings/SoundSettingsFragment.java +3 −3 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ public class SoundSettingsFragment extends PreferenceFragment public void onResume() { super.onResume(); if (!PermissionsUtil.hasAppOp(getContext(), AppOpsManager.OPSTR_WRITE_SETTINGS)) { if (!Settings.System.canWrite(getContext())) { // If the user launches this setting fragment, then toggles the WRITE_SYSTEM_SETTINGS // AppOp, then close the fragment since there is nothing useful to do. getActivity().onBackPressed(); Loading @@ -155,7 +155,7 @@ public class SoundSettingsFragment extends PreferenceFragment */ @Override public boolean onPreferenceChange(Preference preference, Object objValue) { if (!PermissionsUtil.hasAppOp(getContext(), AppOpsManager.OPSTR_WRITE_SETTINGS)) { if (!Settings.System.canWrite(getContext())) { // A user shouldn't be able to get here, but this protects against monkey crashes. Toast.makeText( getContext(), Loading @@ -181,7 +181,7 @@ public class SoundSettingsFragment extends PreferenceFragment */ @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (!PermissionsUtil.hasAppOp(getContext(), AppOpsManager.OPSTR_WRITE_SETTINGS)) { if (!Settings.System.canWrite(getContext())) { Toast.makeText( getContext(), getResources().getString(R.string.toast_cannot_write_system_settings), Loading Loading
src/com/android/dialer/settings/DialerSettingsActivity.java +4 −4 Original line number Diff line number Diff line Loading @@ -91,10 +91,10 @@ public class DialerSettingsActivity extends PreferenceActivity { @Override public void onHeaderClick(Header header, int position) { if (header.id == R.id.settings_header_sounds_and_vibration) { // If we don't have the AppOp to write to system settings, go to system sound settings // instead. Otherwise, perform the super implementation (which launches our own // preference fragment. if (!PermissionsUtil.hasAppOp(this, AppOpsManager.OPSTR_WRITE_SETTINGS)) { // If we don't have the permission to write to system settings, go to system sound // settings instead. Otherwise, perform the super implementation (which launches our // own preference fragment. if (!Settings.System.canWrite(this)) { Toast.makeText( this, getResources().getString(R.string.toast_cannot_write_system_settings), Loading
src/com/android/dialer/settings/SoundSettingsFragment.java +3 −3 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ public class SoundSettingsFragment extends PreferenceFragment public void onResume() { super.onResume(); if (!PermissionsUtil.hasAppOp(getContext(), AppOpsManager.OPSTR_WRITE_SETTINGS)) { if (!Settings.System.canWrite(getContext())) { // If the user launches this setting fragment, then toggles the WRITE_SYSTEM_SETTINGS // AppOp, then close the fragment since there is nothing useful to do. getActivity().onBackPressed(); Loading @@ -155,7 +155,7 @@ public class SoundSettingsFragment extends PreferenceFragment */ @Override public boolean onPreferenceChange(Preference preference, Object objValue) { if (!PermissionsUtil.hasAppOp(getContext(), AppOpsManager.OPSTR_WRITE_SETTINGS)) { if (!Settings.System.canWrite(getContext())) { // A user shouldn't be able to get here, but this protects against monkey crashes. Toast.makeText( getContext(), Loading @@ -181,7 +181,7 @@ public class SoundSettingsFragment extends PreferenceFragment */ @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (!PermissionsUtil.hasAppOp(getContext(), AppOpsManager.OPSTR_WRITE_SETTINGS)) { if (!Settings.System.canWrite(getContext())) { Toast.makeText( getContext(), getResources().getString(R.string.toast_cannot_write_system_settings), Loading