// Signature format: 2.0
package android.test.mock {

  public class MockContext extends android.content.Context {
    method public int getDisplayId();
  }

  @Deprecated public class MockPackageManager extends android.content.pm.PackageManager {
    method @Deprecated public void addCrossProfileIntentFilter(android.content.IntentFilter, int, int, int);
    method @Deprecated public void clearCrossProfileIntentFilters(int);
    method @Deprecated public int getInstallReason(String, android.os.UserHandle);
    method @Deprecated public java.util.List<android.content.pm.ApplicationInfo> getInstalledApplicationsAsUser(int, int);
    method @Deprecated public String[] getNamesForUids(int[]);
    method @Deprecated @NonNull public String getServicesSystemSharedLibraryPackageName();
    method @Deprecated @NonNull public String getSharedSystemSharedLibraryPackageName();
  }

}

