Home | History | Annotate | Download | only in base
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 package org.chromium.base;
      6 
      7 import org.chromium.base.annotations.MainDex;
      8 
      9 /**
     10  * Helper to get field trial information.
     11  */
     12 @MainDex
     13 public class FieldTrialList {
     14 
     15     private FieldTrialList() {}
     16 
     17     /**
     18      * @param trialName The name of the trial to get the group for.
     19      * @return The group name chosen for the named trial, or the empty string if the trial does
     20      *         not exist.
     21      */
     22     public static String findFullName(String trialName) {
     23         return nativeFindFullName(trialName);
     24     }
     25 
     26     /**
     27      * @param trialName The name of the trial to get the group for.
     28      * @return Whether the trial exists or not.
     29      */
     30     public static boolean trialExists(String trialName) {
     31         return nativeTrialExists(trialName);
     32     }
     33 
     34     private static native String nativeFindFullName(String trialName);
     35     private static native boolean nativeTrialExists(String trialName);
     36 }
     37