Skip to content
Snippets Groups Projects
Commit 5b7bd1df authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8681172 from 114b33f0 to tm-release

Change-Id: I99278c9fc0b7e43570564fb080f521464563fea9
......@@ -65,7 +65,8 @@ public class CarToastUI extends ToastUI {
@Override
public void showToast(int uid, String packageName, IBinder token, CharSequence text,
IBinder windowToken, int duration, @Nullable ITransientNotificationCallback callback) {
IBinder windowToken, int duration, @Nullable ITransientNotificationCallback callback,
int displayId) {
if (!isAllowListed(packageName) && !isSystemPrivilegedOrPlatformKey(packageName)) {
if (DEBUG) {
Log.w(TAG, packageName
......@@ -80,7 +81,7 @@ public class CarToastUI extends ToastUI {
+ " is a system privileged app or has been signed with platform key.");
}
super.showToast(uid, packageName, token, text, windowToken, duration, callback);
super.showToast(uid, packageName, token, text, windowToken, duration, callback, displayId);
}
private boolean isAllowListed(String packageName) {
......
......@@ -30,6 +30,7 @@ import android.content.pm.PackageManager;
import android.os.IBinder;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
......@@ -110,7 +111,7 @@ public class CarToastUITest extends SysuiTestCase {
false, /* isSignedWithPlatformKey= */ false);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory, never()).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(),
anyInt());
......@@ -123,7 +124,7 @@ public class CarToastUITest extends SysuiTestCase {
false, /* isSignedWithPlatformKey= */ true);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(), anyInt());
}
......@@ -135,7 +136,7 @@ public class CarToastUITest extends SysuiTestCase {
true, /* isSignedWithPlatformKey= */ false);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory, never()).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(),
anyInt());
......@@ -148,7 +149,7 @@ public class CarToastUITest extends SysuiTestCase {
true, /* isSignedWithPlatformKey= */ true);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(), anyInt());
}
......@@ -160,7 +161,7 @@ public class CarToastUITest extends SysuiTestCase {
false, /* isSignedWithPlatformKey= */ false);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory, never()).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(),
anyInt());
......@@ -179,7 +180,7 @@ public class CarToastUITest extends SysuiTestCase {
false, /* isSignedWithPlatformKey= */ false);
carToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(), anyInt());
}
......@@ -191,7 +192,7 @@ public class CarToastUITest extends SysuiTestCase {
false, /* isSignedWithPlatformKey= */ true);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(), anyInt());
}
......@@ -203,7 +204,7 @@ public class CarToastUITest extends SysuiTestCase {
true, /* isSignedWithPlatformKey= */ false);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(), anyInt());
}
......@@ -215,7 +216,7 @@ public class CarToastUITest extends SysuiTestCase {
true, /* isSignedWithPlatformKey= */ true);
mCarToastUI.showToast(UID, PACKAGE_NAME, mIBinder, TEXT, mIBinder, DURATION,
mITransientNotificationCallback);
mITransientNotificationCallback, Display.DEFAULT_DISPLAY);
verify(mToastFactory).createToast(any(), eq(TEXT), eq(PACKAGE_NAME), anyInt(), anyInt());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment