WindowManager: Toast message is not visible in some scenarios
Issue: Toast does not get displayed if it is displayed from an
Activity which runs in a process different from the process of the
package to which the activity belongs.
Fix: While adding a window a check is done to ensure that the uid
of the activity matches the uid of the package to which the activity
belongs. This change will bypass the above check for Toast message.
CRs-Fixed: 720701
Change-Id: I29c5d30a8f11c2d132066c77bd038abc444cedb4
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 6dfb4e0..91e6133 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1412,7 +1412,10 @@
// XXX right now the app process has complete control over
// this... should introduce a token to let the system
// monitor/control what they are doing.
- outAppOp[0] = AppOpsManager.OP_TOAST_WINDOW;
+
+ // Bypass this to allow any activity to show toast even if
+ // it runs in a different process than its package.
+ //outAppOp[0] = AppOpsManager.OP_TOAST_WINDOW;
break;
case TYPE_DREAM:
case TYPE_INPUT_METHOD: