Loading packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1429,7 +1429,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi void makeOverlayToast(int stringId) { final Resources res = mContext.getResources(); final SystemUIToast systemUIToast = mToastFactory.createToast(mContext, final SystemUIToast systemUIToast = mToastFactory.createToast(mContext, mContext, res.getString(stringId), mContext.getPackageName(), UserHandle.myUserId(), res.getConfiguration().orientation); if (systemUIToast == null) { Loading packages/SystemUI/src/com/android/systemui/settings/brightness/ui/BrightnessWarningToast.kt +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ constructor( // Show the brightness warning toast with passing the toast inflation required context, // userId and resId from SystemUI package. val systemUIToast = toastFactory.createToast( viewContext, viewContext, viewContext, res.getString(resId), viewContext.packageName, viewContext.getUserId(), res.configuration.orientation ) Loading packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java +11 −9 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import com.android.systemui.plugins.ToastPlugin; public class SystemUIToast implements ToastPlugin.Toast { static final String TAG = "SystemUIToast"; final Context mContext; final Context mDisplayContext; final CharSequence mText; final ToastPlugin.Toast mPluginToast; Loading @@ -68,17 +69,18 @@ public class SystemUIToast implements ToastPlugin.Toast { @Nullable private final Animator mInAnimator; @Nullable private final Animator mOutAnimator; SystemUIToast(LayoutInflater layoutInflater, Context context, CharSequence text, String packageName, int userId, int orientation) { this(layoutInflater, context, text, null, packageName, userId, SystemUIToast(LayoutInflater layoutInflater, Context applicationContext, Context displayContext, CharSequence text, String packageName, int userId, int orientation) { this(layoutInflater, applicationContext, displayContext, text, null, packageName, userId, orientation); } SystemUIToast(LayoutInflater layoutInflater, Context context, CharSequence text, ToastPlugin.Toast pluginToast, String packageName, @UserIdInt int userId, int orientation) { SystemUIToast(LayoutInflater layoutInflater, Context applicationContext, Context displayContext, CharSequence text, ToastPlugin.Toast pluginToast, String packageName, @UserIdInt int userId, int orientation) { mLayoutInflater = layoutInflater; mContext = context; mContext = applicationContext; mDisplayContext = displayContext; mText = text; mPluginToast = pluginToast; mPackageName = packageName; Loading Loading @@ -221,9 +223,9 @@ public class SystemUIToast implements ToastPlugin.Toast { mPluginToast.onOrientationChange(orientation); } mDefaultY = mContext.getResources().getDimensionPixelSize(R.dimen.toast_y_offset); mDefaultY = mDisplayContext.getResources().getDimensionPixelSize(R.dimen.toast_y_offset); mDefaultGravity = mContext.getResources().getInteger(R.integer.config_toastDefaultGravity); mDisplayContext.getResources().getInteger(R.integer.config_toastDefaultGravity); } private Animator createInAnimator() { Loading packages/SystemUI/src/com/android/systemui/toast/ToastFactory.java +8 −7 Original line number Diff line number Diff line Loading @@ -65,16 +65,17 @@ public class ToastFactory implements Dumpable { /** * Create a toast to be shown by ToastUI. */ public SystemUIToast createToast(Context context, CharSequence text, String packageName, int userId, int orientation) { LayoutInflater layoutInflater = LayoutInflater.from(context); public SystemUIToast createToast(Context applicationContext, Context displayContext, CharSequence text, String packageName, int userId, int orientation) { LayoutInflater layoutInflater = LayoutInflater.from(displayContext); if (isPluginAvailable()) { return new SystemUIToast(layoutInflater, context, text, mPlugin.createToast(text, packageName, userId), packageName, userId, orientation); } return new SystemUIToast(layoutInflater, context, text, packageName, userId, return new SystemUIToast(layoutInflater, applicationContext, displayContext, text, mPlugin.createToast(text, packageName, userId), packageName, userId, orientation); } return new SystemUIToast(layoutInflater, applicationContext, displayContext, text, packageName, userId, orientation); } private boolean isPluginAvailable() { return mPlugin != null; Loading packages/SystemUI/src/com/android/systemui/toast/ToastUI.java +2 −2 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ public class ToastUI implements return; } Context displayContext = context.createDisplayContext(display); mToast = mToastFactory.createToast(displayContext /* sysuiContext */, text, packageName, userHandle.getIdentifier(), mOrientation); mToast = mToastFactory.createToast(mContext, displayContext /* sysuiContext */, text, packageName, userHandle.getIdentifier(), mOrientation); if (mToast.getInAnimation() != null) { mToast.getInAnimation().start(); Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1429,7 +1429,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi void makeOverlayToast(int stringId) { final Resources res = mContext.getResources(); final SystemUIToast systemUIToast = mToastFactory.createToast(mContext, final SystemUIToast systemUIToast = mToastFactory.createToast(mContext, mContext, res.getString(stringId), mContext.getPackageName(), UserHandle.myUserId(), res.getConfiguration().orientation); if (systemUIToast == null) { Loading
packages/SystemUI/src/com/android/systemui/settings/brightness/ui/BrightnessWarningToast.kt +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ constructor( // Show the brightness warning toast with passing the toast inflation required context, // userId and resId from SystemUI package. val systemUIToast = toastFactory.createToast( viewContext, viewContext, viewContext, res.getString(resId), viewContext.packageName, viewContext.getUserId(), res.configuration.orientation ) Loading
packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java +11 −9 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import com.android.systemui.plugins.ToastPlugin; public class SystemUIToast implements ToastPlugin.Toast { static final String TAG = "SystemUIToast"; final Context mContext; final Context mDisplayContext; final CharSequence mText; final ToastPlugin.Toast mPluginToast; Loading @@ -68,17 +69,18 @@ public class SystemUIToast implements ToastPlugin.Toast { @Nullable private final Animator mInAnimator; @Nullable private final Animator mOutAnimator; SystemUIToast(LayoutInflater layoutInflater, Context context, CharSequence text, String packageName, int userId, int orientation) { this(layoutInflater, context, text, null, packageName, userId, SystemUIToast(LayoutInflater layoutInflater, Context applicationContext, Context displayContext, CharSequence text, String packageName, int userId, int orientation) { this(layoutInflater, applicationContext, displayContext, text, null, packageName, userId, orientation); } SystemUIToast(LayoutInflater layoutInflater, Context context, CharSequence text, ToastPlugin.Toast pluginToast, String packageName, @UserIdInt int userId, int orientation) { SystemUIToast(LayoutInflater layoutInflater, Context applicationContext, Context displayContext, CharSequence text, ToastPlugin.Toast pluginToast, String packageName, @UserIdInt int userId, int orientation) { mLayoutInflater = layoutInflater; mContext = context; mContext = applicationContext; mDisplayContext = displayContext; mText = text; mPluginToast = pluginToast; mPackageName = packageName; Loading Loading @@ -221,9 +223,9 @@ public class SystemUIToast implements ToastPlugin.Toast { mPluginToast.onOrientationChange(orientation); } mDefaultY = mContext.getResources().getDimensionPixelSize(R.dimen.toast_y_offset); mDefaultY = mDisplayContext.getResources().getDimensionPixelSize(R.dimen.toast_y_offset); mDefaultGravity = mContext.getResources().getInteger(R.integer.config_toastDefaultGravity); mDisplayContext.getResources().getInteger(R.integer.config_toastDefaultGravity); } private Animator createInAnimator() { Loading
packages/SystemUI/src/com/android/systemui/toast/ToastFactory.java +8 −7 Original line number Diff line number Diff line Loading @@ -65,16 +65,17 @@ public class ToastFactory implements Dumpable { /** * Create a toast to be shown by ToastUI. */ public SystemUIToast createToast(Context context, CharSequence text, String packageName, int userId, int orientation) { LayoutInflater layoutInflater = LayoutInflater.from(context); public SystemUIToast createToast(Context applicationContext, Context displayContext, CharSequence text, String packageName, int userId, int orientation) { LayoutInflater layoutInflater = LayoutInflater.from(displayContext); if (isPluginAvailable()) { return new SystemUIToast(layoutInflater, context, text, mPlugin.createToast(text, packageName, userId), packageName, userId, orientation); } return new SystemUIToast(layoutInflater, context, text, packageName, userId, return new SystemUIToast(layoutInflater, applicationContext, displayContext, text, mPlugin.createToast(text, packageName, userId), packageName, userId, orientation); } return new SystemUIToast(layoutInflater, applicationContext, displayContext, text, packageName, userId, orientation); } private boolean isPluginAvailable() { return mPlugin != null; Loading
packages/SystemUI/src/com/android/systemui/toast/ToastUI.java +2 −2 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ public class ToastUI implements return; } Context displayContext = context.createDisplayContext(display); mToast = mToastFactory.createToast(displayContext /* sysuiContext */, text, packageName, userHandle.getIdentifier(), mOrientation); mToast = mToastFactory.createToast(mContext, displayContext /* sysuiContext */, text, packageName, userHandle.getIdentifier(), mOrientation); if (mToast.getInAnimation() != null) { mToast.getInAnimation().start(); Loading