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 @libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE)
30 public class AppSpecializationHooks {
31 
AppSpecializationHooks()32     private AppSpecializationHooks() {}
33 
34     /**
35      * Called in {@link android.app.ActivityThread}, but before binding the application. This method
36      * should be called only after {@link android.compat.Compatibility#setCallbacks}
37      * has been invoked to handle the app compat queries from
38      * {@link android.compat.Compatibility#isChangeEnabled(long)}.
39      *
40      * This is a good place to change system properties / clear cache due to an app compat change
41      * before an app starts.
42      *
43      * @hide
44      */
45     @SystemApi(client = MODULE_LIBRARIES)
46     @libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE)
handleCompatChangesBeforeBindingApplication()47     public static void handleCompatChangesBeforeBindingApplication() {
48         com.android.i18n.system.AppSpecializationHooks
49                 .handleCompatChangesBeforeBindingApplication();
50     }
51 }
52