Show more settings and add restrictions/dialogs for secondary users
Bug: 7213029 crash in About>Status Bug: 7212495 hide System updates for second user Bug: 7212230 nickname editor should select the text Bug: 7160487 TTS settings Bug: 7129411 Settings needs visibility changes for secondary users Change-Id: Ia2d1229c08b392edfa6b671fce4a382410405b14
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
|
||||
package com.android.settings;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -500,4 +504,26 @@ public class Utils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Not global warming, it's global change warning. */
|
||||
public static Dialog buildGlobalChangeWarningDialog(final Context context, int titleResId,
|
||||
final Runnable positiveAction) {
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(titleResId);
|
||||
builder.setMessage(R.string.global_change_warning);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
positiveAction.run();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
public static boolean hasMultipleUsers(Context context) {
|
||||
return ((UserManager) context.getSystemService(Context.USER_SERVICE))
|
||||
.getUsers().size() > 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user