Adding option in global setting to control the display message during user switch
Bug: 145915635
Bug: 145132885
Test: adb shell settings put global android.car.ENABLE_USER_SWITCH_DEVELOPER_MESSAGE true
Merged-In: I70c72d7d74c72a78d919ae34906b6f7b96466ad1
Change-Id: I70c72d7d74c72a78d919ae34906b6f7b96466ad1
(cherry picked from commit e12de0beb4)
This commit is contained in:
@@ -33,6 +33,7 @@ import android.graphics.RectF;
|
|||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@@ -81,8 +82,19 @@ final class CarUserSwitchingDialog extends UserSwitchingDialog {
|
|||||||
.setImageDrawable(drawable);
|
.setImageDrawable(drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
((TextView) view.findViewById(R.id.user_loading))
|
TextView msgView = view.findViewById(R.id.user_loading);
|
||||||
.setText(res.getString(R.string.car_loading_profile));
|
|
||||||
|
// TODO(b/145132885): use constant from CarSettings
|
||||||
|
boolean showInfo = "true".equals(Settings.Global.getString(
|
||||||
|
getContext().getContentResolver(),
|
||||||
|
"android.car.ENABLE_USER_SWITCH_DEVELOPER_MESSAGE"));
|
||||||
|
|
||||||
|
if (showInfo) {
|
||||||
|
msgView.setText(res.getString(R.string.car_loading_profile) + " user\n(from "
|
||||||
|
+ mOldUser.id + " to " + mNewUser.id + ")");
|
||||||
|
} else {
|
||||||
|
msgView.setText(res.getString(R.string.car_loading_profile));
|
||||||
|
}
|
||||||
setView(view);
|
setView(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user