Adapt FakeContext to API 23

This commit is contained in:
Romain Vimont 2023-03-31 00:24:01 +02:00
parent e4c152b1a3
commit cfc9882897

View File

@ -26,15 +26,13 @@ public final class FakeContext extends ContextWrapper {
return PACKAGE_NAME; return PACKAGE_NAME;
} }
@Override
public String getOpPackageName() { public String getOpPackageName() {
return PACKAGE_NAME; return PACKAGE_NAME;
} }
@TargetApi(31) @TargetApi(31)
@Override
public AttributionSource getAttributionSource() { public AttributionSource getAttributionSource() {
AttributionSource.Builder builder = new AttributionSource.Builder(Process.SHELL_UID); AttributionSource.Builder builder = new AttributionSource.Builder(0);
builder.setPackageName(PACKAGE_NAME); builder.setPackageName(PACKAGE_NAME);
return builder.build(); return builder.build();
} }