blob: a295af352c0aa542db99f33be6b51c361b0c069f [file] [log] [blame]
Martijn Coenenfb7caa92019-01-29 11:45:56 +01001/*
2 * Copyright (C) 2019 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 */
16package android.app;
17
18import android.content.pm.ApplicationInfo;
19
20/**
21 * This is the interface to be implemented for the class that is specified by the
22 * {@link android.R.styleable#AndroidManifestApplication_zygotePreloadName
23 * android:zygotePreloadName} of the <application> tag.
24 *
25 * It is responsible for preloading application code and data, that will be shared by all
26 * isolated services that have the
27 * {@link android.R.styleable#AndroidManifestService_useAppZygote android:useAppZygote} attribute
28 * of the &lt;service&gt; tag set to <code>true</code>.
29 *
30 * Note that this implementations of this class must provide a default constructor with no
31 * arguments.
32 */
33public interface ZygotePreload {
34 /**
35 * This method is called once every time the Application Zygote is started. It is normally
36 * started the first time an isolated service that uses it is started. The Application Zygote
37 * will be stopped when all isolated services that use it are stopped.
38 *
39 * @param appInfo The ApplicationInfo object belonging to the application
40 */
41 void doPreload(ApplicationInfo appInfo);
42}