Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba75a9b6 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Instrumentation targets must have code.

If they don't have code, give the developer a somewhat helpful error
message instead of later falling into a weird classpath failure.

Change-Id: Iebda10173ff99943cbbd71127ae24aa455b709f4
parent 8c04e18c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -805,6 +805,11 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL;
    }

    /** {@hide} */
    public boolean hasCode() {
        return (flags & FLAG_HAS_CODE) != 0;
    }

    public static class DisplayNameComparator
            implements Comparator<ApplicationInfo> {
        public DisplayNameComparator(PackageManager pm) {
+5 −0
Original line number Diff line number Diff line
@@ -17839,6 +17839,11 @@ public final class ActivityManagerService extends ActivityManagerNative
                        "Unable to find instrumentation target package: " + ii.targetPackage);
                return false;
            }
            if (!ai.hasCode()) {
                reportStartInstrumentationFailure(watcher, className,
                        "Instrumentation target has no code: " + ii.targetPackage);
                return false;
            }
            int match = mContext.getPackageManager().checkSignatures(
                    ii.targetPackage, ii.packageName);