diff options
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index e0091e1..5fafc92 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -24,6 +24,7 @@ import android.app.admin.DevicePolicyManager; import android.app.backup.IBackupManager; import android.bluetooth.BluetoothAdapter; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; @@ -751,6 +752,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment } private void updateBugreportOptions() { + final ComponentName bugreportStorageProviderComponentName = + new ComponentName("com.android.shell", + "com.android.shell.BugreportStorageProvider"); if ("user".equals(Build.TYPE)) { final ContentResolver resolver = getActivity().getContentResolver(); final boolean adbEnabled = Settings.Global.getInt( @@ -758,14 +762,23 @@ public class DevelopmentSettings extends SettingsPreferenceFragment if (adbEnabled) { mBugreport.setEnabled(true); mBugreportInPower.setEnabled(true); + getPackageManager().setComponentEnabledSetting( + bugreportStorageProviderComponentName, + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0); } else { mBugreport.setEnabled(false); mBugreportInPower.setEnabled(false); mBugreportInPower.setChecked(false); Settings.Secure.putInt(resolver, Settings.Secure.BUGREPORT_IN_POWER_MENU, 0); + getPackageManager().setComponentEnabledSetting( + bugreportStorageProviderComponentName, + PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, 0); } } else { mBugreportInPower.setEnabled(true); + getPackageManager().setComponentEnabledSetting( + bugreportStorageProviderComponentName, + PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0); } } |