diff options
| author | 2020-01-08 15:24:53 -0800 | |
|---|---|---|
| committer | 2020-01-23 11:29:21 -0800 | |
| commit | 0c8cdf54db7811d78d2ccedcf05f71ba245b4fe7 (patch) | |
| tree | 38914a7bb932650746a738a2e13a18486e69eb5b | |
| parent | 38812f345c6067300cd878ae67b970de997b5cee (diff) | |
Use preview_sdk_int for version code checks
Don't use Build.VERSION.CODENAME to check for R.
Use Build.VERSION.SDK_INT > Q || (Build.VERSION.SDK_INT == Q &&
Build.VERSION.PREVIEW_SDK_INT > 0)
Bug: 146235828
Test: m DocumentsUIGoogle
Change-Id: I59e327d4e92d41a93b6bea145b8497fd4f85108c
Merged-In: I59e327d4e92d41a93b6bea145b8497fd4f85108c
(cherry picked from commit b6f32d9fe2e220bce8395390862dbf1b935881d6)
| -rw-r--r-- | tools/stats_log_api_gen/java_writer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/stats_log_api_gen/java_writer.cpp b/tools/stats_log_api_gen/java_writer.cpp index fef490c7e5f9..c6cca600dc0d 100644 --- a/tools/stats_log_api_gen/java_writer.cpp +++ b/tools/stats_log_api_gen/java_writer.cpp @@ -85,8 +85,9 @@ static int write_java_methods( string indent(""); if (supportQ) { // TODO(b/146235828): Use just SDK_INT check once it is incremented from Q. - fprintf(out, " if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q ||\n"); - fprintf(out, " Build.VERSION.CODENAME.equals(\"R\")) {\n"); + fprintf(out, " if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q\n"); + fprintf(out, " || (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q\n"); + fprintf(out, " && Build.VERSION.PREVIEW_SDK_INT > 0)) {\n"); indent = " "; } |