Loading src/com/android/dialer/about/Licenses.java +25 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public final class Licenses { for (String entry : entries) { int delimiter = entry.indexOf(' '); String[] licenseLocation = entry.substring(0, delimiter).split(":"); Assert.checkState( checkState( delimiter > 0 && licenseLocation.length == 2, "Invalid license meta-data line:\n" + entry); long licenseOffset = Long.parseLong(licenseLocation[0]); Loading @@ -62,6 +62,30 @@ public final class Licenses { return licenses; } /** * Ensures the truth of an expression involving the state of the calling instance, but not * involving any parameters to the calling method. * * @param expression a boolean expression * @param messageTemplate the message to log, possible with format arguments. * @param args optional arguments to be used in the formatted string. * @throws IllegalStateException if {@code expression} is false */ public static void checkState( boolean expression,String messageTemplate, Object... args) { if (!expression) { throw new IllegalStateException(format(messageTemplate, args)); } } private static String format(String messageTemplate, Object... args) { if (messageTemplate == null) { return null; } return String.format(messageTemplate, args); } /** Return the text of a bundled license file. */ public static String getLicenseText(Context context, License license) { long offset = license.getLicenseOffset(); Loading Loading
src/com/android/dialer/about/Licenses.java +25 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public final class Licenses { for (String entry : entries) { int delimiter = entry.indexOf(' '); String[] licenseLocation = entry.substring(0, delimiter).split(":"); Assert.checkState( checkState( delimiter > 0 && licenseLocation.length == 2, "Invalid license meta-data line:\n" + entry); long licenseOffset = Long.parseLong(licenseLocation[0]); Loading @@ -62,6 +62,30 @@ public final class Licenses { return licenses; } /** * Ensures the truth of an expression involving the state of the calling instance, but not * involving any parameters to the calling method. * * @param expression a boolean expression * @param messageTemplate the message to log, possible with format arguments. * @param args optional arguments to be used in the formatted string. * @throws IllegalStateException if {@code expression} is false */ public static void checkState( boolean expression,String messageTemplate, Object... args) { if (!expression) { throw new IllegalStateException(format(messageTemplate, args)); } } private static String format(String messageTemplate, Object... args) { if (messageTemplate == null) { return null; } return String.format(messageTemplate, args); } /** Return the text of a bundled license file. */ public static String getLicenseText(Context context, License license) { long offset = license.getLicenseOffset(); Loading