1ed13187a745866483139e2878037e1f8427ce567Kenny Guy/*
2ed13187a745866483139e2878037e1f8427ce567Kenny Guy * Copyright (C) 2014 The Android Open Source Project
3ed13187a745866483139e2878037e1f8427ce567Kenny Guy *
4ed13187a745866483139e2878037e1f8427ce567Kenny Guy * Licensed under the Apache License, Version 2.0 (the "License");
5ed13187a745866483139e2878037e1f8427ce567Kenny Guy * you may not use this file except in compliance with the License.
6ed13187a745866483139e2878037e1f8427ce567Kenny Guy * You may obtain a copy of the License at
7ed13187a745866483139e2878037e1f8427ce567Kenny Guy *
8ed13187a745866483139e2878037e1f8427ce567Kenny Guy *      http://www.apache.org/licenses/LICENSE-2.0
9ed13187a745866483139e2878037e1f8427ce567Kenny Guy *
10ed13187a745866483139e2878037e1f8427ce567Kenny Guy * Unless required by applicable law or agreed to in writing, software
11ed13187a745866483139e2878037e1f8427ce567Kenny Guy * distributed under the License is distributed on an "AS IS" BASIS,
12ed13187a745866483139e2878037e1f8427ce567Kenny Guy * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13ed13187a745866483139e2878037e1f8427ce567Kenny Guy * See the License for the specific language governing permissions and
14ed13187a745866483139e2878037e1f8427ce567Kenny Guy * limitations under the License.
15ed13187a745866483139e2878037e1f8427ce567Kenny Guy */
16ed13187a745866483139e2878037e1f8427ce567Kenny Guy
17ed13187a745866483139e2878037e1f8427ce567Kenny Guypackage com.android.launcher3.compat;
18ed13187a745866483139e2878037e1f8427ce567Kenny Guy
197066003b2032a49ae5e59dab9b706259bdeb7e6eSunny Goyalimport android.annotation.TargetApi;
20ed13187a745866483139e2878037e1f8427ce567Kenny Guyimport android.content.ComponentName;
21c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guyimport android.content.pm.ApplicationInfo;
22c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guyimport android.content.pm.LauncherActivityInfo;
23ed13187a745866483139e2878037e1f8427ce567Kenny Guyimport android.graphics.drawable.Drawable;
247066003b2032a49ae5e59dab9b706259bdeb7e6eSunny Goyalimport android.os.Build;
25ed13187a745866483139e2878037e1f8427ce567Kenny Guy
267066003b2032a49ae5e59dab9b706259bdeb7e6eSunny Goyal@TargetApi(Build.VERSION_CODES.LOLLIPOP)
27ed13187a745866483139e2878037e1f8427ce567Kenny Guypublic class LauncherActivityInfoCompatVL extends LauncherActivityInfoCompat {
28c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy    private LauncherActivityInfo mLauncherActivityInfo;
29ed13187a745866483139e2878037e1f8427ce567Kenny Guy
30c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy    LauncherActivityInfoCompatVL(LauncherActivityInfo launcherActivityInfo) {
31ed13187a745866483139e2878037e1f8427ce567Kenny Guy        super();
32ed13187a745866483139e2878037e1f8427ce567Kenny Guy        mLauncherActivityInfo = launcherActivityInfo;
33ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
34ed13187a745866483139e2878037e1f8427ce567Kenny Guy
35ed13187a745866483139e2878037e1f8427ce567Kenny Guy    public ComponentName getComponentName() {
36c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy        return mLauncherActivityInfo.getComponentName();
37ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
38ed13187a745866483139e2878037e1f8427ce567Kenny Guy
39ed13187a745866483139e2878037e1f8427ce567Kenny Guy    public UserHandleCompat getUser() {
40c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy        return UserHandleCompat.fromUser(mLauncherActivityInfo.getUser());
41ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
42ed13187a745866483139e2878037e1f8427ce567Kenny Guy
43ed13187a745866483139e2878037e1f8427ce567Kenny Guy    public CharSequence getLabel() {
44c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy        return mLauncherActivityInfo.getLabel();
45ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
46ed13187a745866483139e2878037e1f8427ce567Kenny Guy
47ed13187a745866483139e2878037e1f8427ce567Kenny Guy    public Drawable getIcon(int density) {
48c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy        return mLauncherActivityInfo.getIcon(density);
49ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
50ed13187a745866483139e2878037e1f8427ce567Kenny Guy
51c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy    public ApplicationInfo getApplicationInfo() {
52c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy        return mLauncherActivityInfo.getApplicationInfo();
53ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
54ed13187a745866483139e2878037e1f8427ce567Kenny Guy
55ed13187a745866483139e2878037e1f8427ce567Kenny Guy    public long getFirstInstallTime() {
56c2bd8101b8e26b9ebb2c079ae6867229dad3f196Kenny Guy        return mLauncherActivityInfo.getFirstInstallTime();
57ed13187a745866483139e2878037e1f8427ce567Kenny Guy    }
58ed13187a745866483139e2878037e1f8427ce567Kenny Guy}
59