blob: eaaeb5458642060cf541bd0d8fd3ecd8b68aea3b [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
Martijn Coenen9052c232019-03-01 09:25:43 +010018import android.annotation.NonNull;
Martijn Coenenfb7caa92019-01-29 11:45:56 +010019import android.content.pm.ApplicationInfo;
20
21/**
22 * This is the interface to be implemented for the class that is specified by the
23 * {@link android.R.styleable#AndroidManifestApplication_zygotePreloadName
24 * android:zygotePreloadName} of the <application> tag.
25 *
26 * It is responsible for preloading application code and data, that will be shared by all
27 * isolated services that have the
28 * {@link android.R.styleable#AndroidManifestService_useAppZygote android:useAppZygote} attribute
29 * of the &lt;service&gt; tag set to <code>true</code>.
30 *
Martijn Coenen9052c232019-03-01 09:25:43 +010031 * Note that implementations of this class must provide a default constructor with no arguments.
Martijn Coenenfb7caa92019-01-29 11:45:56 +010032 */
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 */
Martijn Coenen9052c232019-03-01 09:25:43 +010041 void doPreload(@NonNull ApplicationInfo appInfo);
Martijn Coenenfb7caa92019-01-29 11:45:56 +010042}