Merge "Add getAttributionSource function to mocked context" into tm-dev am: fd8fadf0db
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17035951 Change-Id: I6b6a96532adb36bddacf47d1d4d8a7971daf24d2
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
package android.test;
|
package android.test;
|
||||||
|
|
||||||
import android.accounts.AccountManager;
|
import android.accounts.AccountManager;
|
||||||
|
import android.content.AttributionSource;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -26,6 +27,7 @@ import android.content.IntentFilter;
|
|||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Process;
|
||||||
import android.test.mock.MockAccountManager;
|
import android.test.mock.MockAccountManager;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -63,6 +65,15 @@ public class IsolatedContext extends ContextWrapper {
|
|||||||
return intents;
|
return intents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AttributionSource getAttributionSource() {
|
||||||
|
AttributionSource attributionSource = super.getAttributionSource();
|
||||||
|
if (attributionSource == null) {
|
||||||
|
return new AttributionSource.Builder(Process.myUid()).build();
|
||||||
|
}
|
||||||
|
return attributionSource;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ContentResolver getContentResolver() {
|
public ContentResolver getContentResolver() {
|
||||||
// We need to return the real resolver so that MailEngine.makeRight can get to the
|
// We need to return the real resolver so that MailEngine.makeRight can get to the
|
||||||
|
|||||||
Reference in New Issue
Block a user