Home | History | Annotate | Download | only in wm
      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 
     22 import com.android.server.policy.WindowManagerPolicy.StartingSurface;
     23 
     24 /**
     25  * Represents starting data for splash screens, i.e. "traditional" starting windows.
     26  */
     27 class SplashScreenStartingData extends StartingData {
     28 
     29     private final String mPkg;
     30     private final int mTheme;
     31     private final CompatibilityInfo mCompatInfo;
     32     private final CharSequence mNonLocalizedLabel;
     33     private final int mLabelRes;
     34     private final int mIcon;
     35     private final int mLogo;
     36     private final int mWindowFlags;
     37     private final Configuration mMergedOverrideConfiguration;
     38 
     39     SplashScreenStartingData(WindowManagerService service, String pkg, int theme,
     40             CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
     41             int logo, int windowFlags, Configuration mergedOverrideConfiguration) {
     42         super(service);
     43         mPkg = pkg;
     44         mTheme = theme;
     45         mCompatInfo = compatInfo;
     46         mNonLocalizedLabel = nonLocalizedLabel;
     47         mLabelRes = labelRes;
     48         mIcon = icon;
     49         mLogo = logo;
     50         mWindowFlags = windowFlags;
     51         mMergedOverrideConfiguration = mergedOverrideConfiguration;
     52     }
     53 
     54     @Override
     55     StartingSurface createStartingSurface(AppWindowToken atoken) {
     56         return mService.mPolicy.addSplashScreen(atoken.token, mPkg, mTheme, mCompatInfo,
     57                 mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags,
     58                 mMergedOverrideConfiguration, atoken.getDisplayContent().getDisplayId());
     59     }
     60 }
     61