1 package com.android.hotspot2; 2 3 /** 4 * Match score for EAP credentials: 5 * None means that there is a distinct mismatch, i.e. realm, method or parameter is defined 6 * and mismatches that of the credential. 7 * Indeterminate means that there is no ANQP information to match against. 8 * Note: The numeric values given to the constants are used for preference comparison and 9 * must be maintained accordingly. 10 */ 11 public abstract class AuthMatch { 12 public static final int None = -1; 13 public static final int Indeterminate = 0; 14 public static final int Realm = 0x04; 15 public static final int Method = 0x02; 16 public static final int Param = 0x01; 17 public static final int MethodParam = Method | Param; 18 public static final int Exact = Realm | Method | Param; 19 20 public static String toString(int match) { 21 if (match < 0) { 22 return "None"; 23 } else if (match == 0) { 24 return "Indeterminate"; 25 } 26 27 StringBuilder sb = new StringBuilder(); 28 if ((match & Realm) != 0) { 29 sb.append("Realm"); 30 } 31 if ((match & Method) != 0) { 32 sb.append("Method"); 33 } 34 if ((match & Param) != 0) { 35 sb.append("Param"); 36 } 37 return sb.toString(); 38 } 39 } 40