blob: 4b14f867b38196bfd7be90e2de43aede69586af4 [file] [log] [blame]
Jorim Jaggi02886a82016-12-06 09:10:06 -08001/*
2 * Copyright (C) 2016 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
17package com.android.server.wm;
18
19import android.content.res.CompatibilityInfo;
20import android.content.res.Configuration;
21import android.view.WindowManagerPolicy.StartingSurface;
22
23/**
24 * Represents starting data for splash screens, i.e. "traditional" starting windows.
25 */
26class SplashScreenStartingData extends StartingData {
27
28 private final String mPkg;
29 private final int mTheme;
30 private final CompatibilityInfo mCompatInfo;
31 private final CharSequence mNonLocalizedLabel;
32 private final int mLabelRes;
33 private final int mIcon;
34 private final int mLogo;
35 private final int mWindowFlags;
36 private final Configuration mMergedOverrideConfiguration;
37
Jorim Jaggie09fc6b2017-01-19 15:33:36 +010038 SplashScreenStartingData(WindowManagerService service, String pkg, int theme,
39 CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
40 int logo, int windowFlags, Configuration mergedOverrideConfiguration) {
41 super(service);
Jorim Jaggi02886a82016-12-06 09:10:06 -080042 mPkg = pkg;
43 mTheme = theme;
44 mCompatInfo = compatInfo;
45 mNonLocalizedLabel = nonLocalizedLabel;
46 mLabelRes = labelRes;
47 mIcon = icon;
48 mLogo = logo;
49 mWindowFlags = windowFlags;
50 mMergedOverrideConfiguration = mergedOverrideConfiguration;
51 }
52
53 @Override
Jorim Jaggie09fc6b2017-01-19 15:33:36 +010054 StartingSurface createStartingSurface(AppWindowToken atoken) {
55 return mService.mPolicy.addSplashScreen(atoken.token, mPkg, mTheme, mCompatInfo,
Jorim Jaggi02886a82016-12-06 09:10:06 -080056 mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags,
Andrii Kulianfb1bf692017-01-17 11:17:34 -080057 mMergedOverrideConfiguration, atoken.getDisplayContent().getDisplayId());
Jorim Jaggi02886a82016-12-06 09:10:06 -080058 }
59}