Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1171)

Side by Side Diff: base/android/java/src/org/chromium/base/BuildInfo.java

Issue 2620843003: Remove bogus format specifier "%s" in logging in BuildInfo.java. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.base; 5 package org.chromium.base;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.pm.ApplicationInfo; 8 import android.content.pm.ApplicationInfo;
9 import android.content.pm.PackageInfo; 9 import android.content.pm.PackageInfo;
10 import android.content.pm.PackageManager; 10 import android.content.pm.PackageManager;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 @CalledByNative 66 @CalledByNative
67 public static String getGMSVersionCode(Context context) { 67 public static String getGMSVersionCode(Context context) {
68 String msg = "gms versionCode not available."; 68 String msg = "gms versionCode not available.";
69 try { 69 try {
70 PackageManager packageManager = context.getPackageManager(); 70 PackageManager packageManager = context.getPackageManager();
71 PackageInfo packageInfo = packageManager.getPackageInfo("com.google. android.gms", 0); 71 PackageInfo packageInfo = packageManager.getPackageInfo("com.google. android.gms", 0);
72 msg = Integer.toString(packageInfo.versionCode); 72 msg = Integer.toString(packageInfo.versionCode);
73 } catch (NameNotFoundException e) { 73 } catch (NameNotFoundException e) {
74 Log.d(TAG, "GMS package is not found: %s", e); 74 Log.d(TAG, "GMS package is not found.", e);
75 } 75 }
76 return msg; 76 return msg;
77 } 77 }
78 78
79 @CalledByNative 79 @CalledByNative
80 public static String getPackageVersionCode(Context context) { 80 public static String getPackageVersionCode(Context context) {
81 String msg = "versionCode not available."; 81 String msg = "versionCode not available.";
82 try { 82 try {
83 PackageManager pm = context.getPackageManager(); 83 PackageManager pm = context.getPackageManager();
84 PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0); 84 PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return Build.VERSION.SDK_INT; 141 return Build.VERSION.SDK_INT;
142 } 142 }
143 143
144 /** 144 /**
145 * @return Whether the current build version is greater than Android N. 145 * @return Whether the current build version is greater than Android N.
146 */ 146 */
147 public static boolean isGreaterThanN() { 147 public static boolean isGreaterThanN() {
148 return Build.VERSION.SDK_INT > 24 || Build.VERSION.CODENAME.equals("NMR1 "); 148 return Build.VERSION.SDK_INT > 24 || Build.VERSION.CODENAME.equals("NMR1 ");
149 } 149 }
150 } 150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698