Merge "Fix LaunchAnyWheere via an Evil Card in QuickAccessWallet." into sc-v2-dev am: 34d9f068d1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16564840 Change-Id: Id4c5d58f668b814b0d22c491ec3289e1c49e627d
This commit is contained in:
@@ -223,8 +223,7 @@ public class WalletScreenController implements
|
|||||||
}
|
}
|
||||||
mUiEventLogger.log(WalletUiEvent.QAW_CLICK_CARD);
|
mUiEventLogger.log(WalletUiEvent.QAW_CLICK_CARD);
|
||||||
|
|
||||||
mActivityStarter.startActivity(
|
mActivityStarter.startPendingIntentDismissingKeyguard(cardInfo.getPendingIntent());
|
||||||
((QAWalletCardViewInfo) cardInfo).mWalletCard.getPendingIntent().getIntent(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import static android.view.View.VISIBLE;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
@@ -96,7 +95,7 @@ public class WalletScreenControllerTest extends SysuiTestCase {
|
|||||||
@Mock
|
@Mock
|
||||||
UiEventLogger mUiEventLogger;
|
UiEventLogger mUiEventLogger;
|
||||||
@Captor
|
@Captor
|
||||||
ArgumentCaptor<Intent> mIntentCaptor;
|
ArgumentCaptor<PendingIntent> mIntentCaptor;
|
||||||
@Captor
|
@Captor
|
||||||
ArgumentCaptor<QuickAccessWalletClient.OnWalletCardsRetrievedCallback> mCallbackCaptor;
|
ArgumentCaptor<QuickAccessWalletClient.OnWalletCardsRetrievedCallback> mCallbackCaptor;
|
||||||
private WalletScreenController mController;
|
private WalletScreenController mController;
|
||||||
@@ -374,10 +373,12 @@ public class WalletScreenControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
mController.onCardClicked(walletCardViewInfo);
|
mController.onCardClicked(walletCardViewInfo);
|
||||||
|
|
||||||
verify(mActivityStarter).startActivity(mIntentCaptor.capture(), eq(true));
|
verify(mActivityStarter).startPendingIntentDismissingKeyguard(mIntentCaptor.capture());
|
||||||
|
|
||||||
assertEquals(mWalletIntent.getAction(), mIntentCaptor.getValue().getAction());
|
Intent actualIntent = mIntentCaptor.getValue().getIntent();
|
||||||
assertEquals(mWalletIntent.getComponent(), mIntentCaptor.getValue().getComponent());
|
|
||||||
|
assertEquals(mWalletIntent.getAction(), actualIntent.getAction());
|
||||||
|
assertEquals(mWalletIntent.getComponent(), actualIntent.getComponent());
|
||||||
|
|
||||||
verify(mUiEventLogger, times(1)).log(WalletUiEvent.QAW_CLICK_CARD);
|
verify(mUiEventLogger, times(1)).log(WalletUiEvent.QAW_CLICK_CARD);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user