Toast warning message when non-admin user tries to open dev options.
Developer Settings are only accessible for the Admin users. Added a new toast warning message to be displayed when a non-admin user tries to open the Developer options. Bug: 259941142 Test: Manually verfied by tapping on the USB debugging option from a Secondary user. Change-Id: Ibd1b8e19d9130982982ee13ac98cbc1d8f5b8835
This commit is contained in:
@@ -233,7 +233,14 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
||||
return;
|
||||
}
|
||||
Context context = requireContext();
|
||||
if (!DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context)) {
|
||||
UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
|
||||
|
||||
if (!um.isAdminUser()) {
|
||||
Toast.makeText(context, R.string.dev_settings_available_to_admin_only_warning,
|
||||
Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
finish();
|
||||
} else if (!DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context)) {
|
||||
Toast.makeText(context, R.string.dev_settings_disabled_warning, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
finish();
|
||||
|
Reference in New Issue
Block a user