Log visibility change for DialogCreatable in Settings.
Bug: 30681529 Test: adb logcat -b events | egrep "(sysui_|notification_)" Test: make RunSettingsRoboTests Change-Id: I51754d258ba1ddfae24323681f21cd02de4dbb4e
This commit is contained in:
@@ -26,6 +26,7 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
|
||||
@@ -133,6 +134,18 @@ public class RestrictedProfileSettings extends AppRestrictionsFragment
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDialogMetricsCategory(int dialogId) {
|
||||
switch (dialogId) {
|
||||
case DIALOG_ID_EDIT_USER_INFO:
|
||||
return MetricsProto.MetricsEvent.DIALOG_USER_EDIT;
|
||||
case DIALOG_CONFIRM_REMOVE:
|
||||
return MetricsProto.MetricsEvent.DIALOG_USER_REMOVE;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void removeUser() {
|
||||
getView().post(new Runnable() {
|
||||
public void run() {
|
||||
|
@@ -26,6 +26,7 @@ import android.os.UserManager;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.android.internal.logging.MetricsProto;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
@@ -192,6 +193,20 @@ public class UserDetailsSettings extends SettingsPreferenceFragment
|
||||
throw new IllegalArgumentException("Unsupported dialogId " + dialogId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDialogMetricsCategory(int dialogId) {
|
||||
switch (dialogId) {
|
||||
case DIALOG_CONFIRM_REMOVE:
|
||||
return MetricsProto.MetricsEvent.DIALOG_USER_REMOVE;
|
||||
case DIALOG_CONFIRM_ENABLE_CALLING:
|
||||
return MetricsProto.MetricsEvent.DIALOG_USER_ENABLE_CALLING;
|
||||
case DIALOG_CONFIRM_ENABLE_CALLING_AND_SMS:
|
||||
return MetricsProto.MetricsEvent.DIALOG_USER_ENABLE_CALLING_AND_SMS;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void removeUser() {
|
||||
mUserManager.removeUser(mUserInfo.id);
|
||||
finishFragment();
|
||||
|
@@ -622,6 +622,32 @@ public class UserSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDialogMetricsCategory(int dialogId) {
|
||||
switch (dialogId) {
|
||||
case DIALOG_CONFIRM_REMOVE:
|
||||
return MetricsEvent.DIALOG_USER_REMOVE;
|
||||
case DIALOG_USER_CANNOT_MANAGE:
|
||||
return MetricsEvent.DIALOG_USER_CANNOT_MANAGE;
|
||||
case DIALOG_ADD_USER:
|
||||
return MetricsEvent.DIALOG_USER_ADD;
|
||||
case DIALOG_SETUP_USER:
|
||||
return MetricsEvent.DIALOG_USER_SETUP;
|
||||
case DIALOG_SETUP_PROFILE:
|
||||
return MetricsEvent.DIALOG_USER_SETUP_PROFILE;
|
||||
case DIALOG_CHOOSE_USER_TYPE:
|
||||
return MetricsEvent.DIALOG_USER_CHOOSE_TYPE;
|
||||
case DIALOG_NEED_LOCKSCREEN:
|
||||
return MetricsEvent.DIALOG_USER_NEED_LOCKSCREEN;
|
||||
case DIALOG_CONFIRM_EXIT_GUEST:
|
||||
return MetricsEvent.DIALOG_USER_CONFIRM_EXIT_GUEST;
|
||||
case DIALOG_USER_PROFILE_EDITOR:
|
||||
return MetricsEvent.DIALOG_USER_EDIT_PROFILE;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean emergencyInfoActivityPresent(Context context) {
|
||||
Intent intent = new Intent(ACTION_EDIT_EMERGENCY_INFO).setPackage("com.android.emergency");
|
||||
List<ResolveInfo> infos = context.getPackageManager().queryIntentActivities(intent, 0);
|
||||
|
Reference in New Issue
Block a user