Merge "Remove FLAG_SHOW_FOR_ALL_USERS to avoid crash"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7de784c1eb
@@ -19,7 +19,6 @@ import static android.widget.Toast.Duration;
|
||||
|
||||
import android.annotation.StringRes;
|
||||
import android.content.Context;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class SysUIToast {
|
||||
@@ -29,10 +28,7 @@ public class SysUIToast {
|
||||
}
|
||||
|
||||
public static Toast makeText(Context context, CharSequence text, @Duration int duration) {
|
||||
Toast toast = Toast.makeText(context, text, duration);
|
||||
toast.getWindowParams().privateFlags |=
|
||||
WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
|
||||
return toast;
|
||||
return Toast.makeText(context, text, duration);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user