Post system_server toasts as system_server

Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testPrintingPolicy
Change-Id: I7ac337dee93bc3843ef2440c2ce7a3b6f7ce094e
Fixes: 119169211
This commit is contained in:
Julia Reynolds
2018-11-26 14:30:40 -05:00
parent 05fa5e1ccf
commit 25c0e878bc

View File

@@ -146,13 +146,14 @@ public final class PrintManagerService extends SystemService {
final long identity = Binder.clearCallingIdentity();
try {
disabledMessage = dpmi.getPrintingDisabledReasonForUser(callingUserId);
if (disabledMessage != null) {
Toast.makeText(mContext, Looper.getMainLooper(), disabledMessage,
Toast.LENGTH_LONG).show();
}
} finally {
Binder.restoreCallingIdentity(identity);
}
if (disabledMessage != null) {
Toast.makeText(mContext, Looper.getMainLooper(), disabledMessage,
Toast.LENGTH_LONG).show();
}
try {
adapter.start();
} catch (RemoteException re) {