Simplify the way we get the version info.
Reduces startup overhead. Change-Id: Id9556dfe553c23bf3f870a524ca5e687bb9fe777
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user