Remove injecting developer options into Settings itself
- It can improve performance because we use less injected item - Also use RestrictedPreference instead just checking restrictions, so we follow policy transparency. Note: Renamed DevelopmentSettingsDashboardActivity to DevelopmentSettingsActivity, because DevelopmentSettingsDashboardActivity could in disabled state even after Settings upgrades, use a new name to prevent this issue. Bug: 311604902 Test: manual - turn on / off Developer Options Test: unit test Change-Id: I17be117ae59e59410687e6d08fd5edd034d0508f
This commit is contained in:
@@ -47,6 +47,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
@@ -230,6 +231,12 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
getActivity().finish();
|
||||
return;
|
||||
}
|
||||
Context context = requireContext();
|
||||
if (!DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context)) {
|
||||
Toast.makeText(context, R.string.dev_settings_disabled_warning, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user