1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.text; 18 19 import com.android.text.flags.Flags; 20 21 /** 22 * An aconfig feature flags that can be accessible from application process without 23 * ContentProvider IPCs. 24 * 25 * When you add new flags, you have to add flag string to {@link TextFlags#TEXT_ACONFIGS_FLAGS}. 26 * 27 * @hide 28 */ 29 public class ClientFlags { 30 /** 31 * @see Flags#noBreakNoHyphenationSpan() 32 */ noBreakNoHyphenationSpan()33 public static boolean noBreakNoHyphenationSpan() { 34 return TextFlags.isFeatureEnabled(Flags.FLAG_NO_BREAK_NO_HYPHENATION_SPAN); 35 } 36 37 /** 38 * @see Flags#phraseStrictFallback() 39 */ phraseStrictFallback()40 public static boolean phraseStrictFallback() { 41 return TextFlags.isFeatureEnabled(Flags.FLAG_PHRASE_STRICT_FALLBACK); 42 } 43 44 /** 45 * @see Flags#useBoundsForWidth() 46 */ useBoundsForWidth()47 public static boolean useBoundsForWidth() { 48 return TextFlags.isFeatureEnabled(Flags.FLAG_USE_BOUNDS_FOR_WIDTH); 49 } 50 51 /** 52 * @see Flags#fixLineHeightForLocale() 53 */ fixLineHeightForLocale()54 public static boolean fixLineHeightForLocale() { 55 return TextFlags.isFeatureEnabled(Flags.FLAG_FIX_LINE_HEIGHT_FOR_LOCALE); 56 } 57 58 /** 59 * @see Flags#icuBidiMigration() 60 */ icuBidiMigration()61 public static boolean icuBidiMigration() { 62 return TextFlags.isFeatureEnabled(Flags.FLAG_ICU_BIDI_MIGRATION); 63 } 64 65 /** 66 * @see Flags#fixMisalignedContextMenu() 67 */ fixMisalignedContextMenu()68 public static boolean fixMisalignedContextMenu() { 69 return TextFlags.isFeatureEnabled(Flags.FLAG_FIX_MISALIGNED_CONTEXT_MENU); 70 } 71 } 72