Skip to content

Commit 85397d8

Browse files
author
Jason Sams
committed
Simplify the way we get the version info.
Reduces startup overhead. Change-Id: Id9556dfe553c23bf3f870a524ca5e687bb9fe777
1 parent 94d2f36 commit 85397d8

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

graphics/java/android/renderscript/RenderScript.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -865,13 +865,7 @@ public final Context getApplicationContext() {
865865
}
866866

867867
static int getTargetSdkVersion(Context ctx) {
868-
try {
869-
PackageManager pm = ctx.getPackageManager();
870-
ApplicationInfo app = pm.getApplicationInfo(ctx.getPackageName(), 0);
871-
return app.targetSdkVersion;
872-
} catch (Exception e) {
873-
throw new RSDriverException("Error calculating target SDK version for RS.");
874-
}
868+
return ctx.getApplicationInfo().targetSdkVersion;
875869
}
876870

877871
/**

0 commit comments

Comments
 (0)