Skip to content

Commit 05f876e

Browse files
Jason SamsAndroid (Google) Code Review
authored andcommitted
Merge "Simplify the way we get the version info. Reduces startup overhead."
2 parents e0f2515 + 85397d8 commit 05f876e

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)