Changed CarUserSwitching UI to show which user is loading.

This option is only available on debuggable builds, and it makes it easier
to debug slow user-switching issues.

Bug: 145027829
Bug: 145915635
Test: manual verification

Change-Id: I10bf6d5fe3cf17480568d29e6407506522bf7679
(cherry picked from commit 81b79b124d3d9a3a0fd92066f9708e05185fe628)
This commit is contained in:
Felipe Leme
2019-12-09 09:08:39 -08:00
committed by Mayank Garg
parent 2b00f7fc54
commit effa2cd793

View File

@@ -32,6 +32,7 @@ import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.UserManager;
import android.view.LayoutInflater;
import android.view.View;
@@ -81,8 +82,15 @@ final class CarUserSwitchingDialog extends UserSwitchingDialog {
.setImageDrawable(drawable);
}
((TextView) view.findViewById(R.id.user_loading))
.setText(res.getString(R.string.car_loading_profile));
TextView msgView = view.findViewById(R.id.user_loading);
// TODO: use developer settings instead
if (Build.IS_DEBUGGABLE) {
// TODO: use specific string
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);
}