Jorim Jaggi | 02886a8 | 2016-12-06 09:10:06 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.server.wm; |
| 18 | |
| 19 | import android.content.res.CompatibilityInfo; |
| 20 | import android.content.res.Configuration; |
| 21 | import android.view.WindowManagerPolicy.StartingSurface; |
| 22 | |
| 23 | /** |
| 24 | * Represents starting data for splash screens, i.e. "traditional" starting windows. |
| 25 | */ |
| 26 | class 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 Jaggi | e09fc6b | 2017-01-19 15:33:36 +0100 | [diff] [blame] | 38 | 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 Jaggi | 02886a8 | 2016-12-06 09:10:06 -0800 | [diff] [blame] | 42 | 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 Jaggi | e09fc6b | 2017-01-19 15:33:36 +0100 | [diff] [blame] | 54 | StartingSurface createStartingSurface(AppWindowToken atoken) { |
| 55 | return mService.mPolicy.addSplashScreen(atoken.token, mPkg, mTheme, mCompatInfo, |
Jorim Jaggi | 02886a8 | 2016-12-06 09:10:06 -0800 | [diff] [blame] | 56 | mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags, |
Andrii Kulian | fb1bf69 | 2017-01-17 11:17:34 -0800 | [diff] [blame] | 57 | mMergedOverrideConfiguration, atoken.getDisplayContent().getDisplayId()); |
Jorim Jaggi | 02886a8 | 2016-12-06 09:10:06 -0800 | [diff] [blame] | 58 | } |
| 59 | } |