1 /* 2 * Copyright (C) 2020 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 dalvik.system; 18 19 import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; 20 21 import android.annotation.SystemApi; 22 23 /** 24 * Used by frameworks to specialize libcore in an app process. 25 * 26 * @hide 27 */ 28 @SystemApi(client = MODULE_LIBRARIES) 29 public class AppSpecializationHooks { 30 AppSpecializationHooks()31 private AppSpecializationHooks() {} 32 33 /** 34 * Called in {@link android.app.ActivityThread}, but before binding the application. This method 35 * should be called only after {@link android.compat.Compatibility#setCallbacks} 36 * has been invoked to handle the app compat queries from 37 * {@link android.compat.Compatibility#isChangeEnabled(long)}. 38 * 39 * This is a good place to change system properties / clear cache due to an app compat change 40 * before an app starts. 41 * 42 * @hide 43 */ 44 @SystemApi(client = MODULE_LIBRARIES) handleCompatChangesBeforeBindingApplication()45 public static void handleCompatChangesBeforeBindingApplication() { 46 com.android.i18n.system.AppSpecializationHooks 47 .handleCompatChangesBeforeBindingApplication(); 48 } 49 } 50