| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.textclassifier; |
| 18 |
|
| 19 |
import android.annotation.Nullable; |
| 20 |
|
| 21 |
import com.android.internal.annotations.VisibleForTesting; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public final class SelectionSessionLogger { |
| 29 |
|
| 30 |
private static final String CLASSIFIER_ID = "androidtc"; |
| 31 |
|
| 32 |
static boolean isPlatformLocalTextClassifierSmartSelection(String signature) { |
| 33 |
return SelectionSessionLogger.CLASSIFIER_ID.equals( |
| 34 |
SelectionSessionLogger.SignatureParser.getClassifierId(signature)); |
| 35 |
} |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
@VisibleForTesting |
| 42 |
public static final class SignatureParser { |
| 43 |
|
| 44 |
static String getClassifierId(@Nullable String signature) { |
| 45 |
if (signature == null) { |
| 46 |
return ""; |
| 47 |
} |
| 48 |
final int end = signature.indexOf("|"); |
| 49 |
if (end >= 0) { |
| 50 |
return signature.substring(0, end); |
| 51 |
} |
| 52 |
return ""; |
| 53 |
} |
| 54 |
} |
| 55 |
} |