Utils.getPackageUri() for creating Uris from packageNames

Since this is done a lot, might as well have a reusable method.
This commit is contained in:
Hans-Christoph Steiner committed 2016-06-02 08:36:30 +02:00
1 parent ae3ea85355
commit 677db72bb3
3 files changed
+11 -4

No files matched your search

@@ -158,7 +158,7 @@ public class TestUtils {
context.setPackageManager(pm);
pm.install(appId, versionCode, versionName);
Intent installIntent = new Intent(Intent.ACTION_PACKAGE_ADDED);
installIntent.setData(Uri.parse("package:" + appId));
installIntent.setData(Utils.getPackageUri(appId));
new PackageAddedReceiver().onReceive(context, installIntent);
}
@@ -176,7 +176,7 @@ public class TestUtils {
context.setPackageManager(pm);
pm.install(appId, versionCode, versionName);
Intent installIntent = new Intent(Intent.ACTION_PACKAGE_CHANGED);
installIntent.setData(Uri.parse("package:" + appId));
installIntent.setData(Utils.getPackageUri(appId));
new PackageUpgradedReceiver().onReceive(context, installIntent);
}
@@ -189,7 +189,7 @@ public class TestUtils {
context.setPackageManager(pm);
pm.remove(appId);
Intent installIntent = new Intent(Intent.ACTION_PACKAGE_REMOVED);
installIntent.setData(Uri.parse("package:" + appId));
installIntent.setData(Utils.getPackageUri(appId));
new PackageRemovedReceiver().onReceive(context, installIntent);
}