Simplify the way we get the version info.

Reduces startup overhead.

Change-Id: Id9556dfe553c23bf3f870a524ca5e687bb9fe777
This commit is contained in:
Jason Sams
2011-10-06 17:54:45 -07:00
parent 94d2f366f9
commit 85397d8dcb

View File

@ -865,13 +865,7 @@ public class RenderScript {
}
static int getTargetSdkVersion(Context ctx) {
try {
PackageManager pm = ctx.getPackageManager();
ApplicationInfo app = pm.getApplicationInfo(ctx.getPackageName(), 0);
return app.targetSdkVersion;
} catch (Exception e) {
throw new RSDriverException("Error calculating target SDK version for RS.");
}
return ctx.getApplicationInfo().targetSdkVersion;
}
/**