blob: 2e0ee360695620d9a28ac858e06483ad445af1af [file] [log] [blame]
Michael Jurkaab48b682011-09-12 15:39:45 -07001/*
2 * Copyright (C) 2011 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.systemui.recent;
18
19import android.content.Intent;
20import android.content.pm.ResolveInfo;
Michael Jurkaab48b682011-09-12 15:39:45 -070021import android.graphics.drawable.Drawable;
22
23public final class TaskDescription {
24 final ResolveInfo resolveInfo;
25 final int taskId; // application task id for curating apps
26 final int persistentTaskId; // persistent id
27 final Intent intent; // launch intent for application
28 final String packageName; // used to override animations (see onClick())
29 final CharSequence description;
30
Michael Jurka99262722013-09-17 14:18:04 +020031 private Drawable mThumbnail; // generated by Activity.onCreateThumbnail()
Michael Jurkaab48b682011-09-12 15:39:45 -070032 private Drawable mIcon; // application package icon
33 private CharSequence mLabel; // application package label
Michael Jurka99a96552012-01-27 17:23:38 -080034 private boolean mLoaded;
Michael Jurkaab48b682011-09-12 15:39:45 -070035
36 public TaskDescription(int _taskId, int _persistentTaskId,
37 ResolveInfo _resolveInfo, Intent _intent,
38 String _packageName, CharSequence _description) {
39 resolveInfo = _resolveInfo;
40 intent = _intent;
41 taskId = _taskId;
42 persistentTaskId = _persistentTaskId;
43
44 description = _description;
45 packageName = _packageName;
46 }
47
Michael Jurka99a96552012-01-27 17:23:38 -080048 public TaskDescription() {
49 resolveInfo = null;
50 intent = null;
51 taskId = -1;
52 persistentTaskId = -1;
53
54 description = null;
55 packageName = null;
56 }
57
58 public void setLoaded(boolean loaded) {
59 mLoaded = loaded;
60 }
61
62 public boolean isLoaded() {
63 return mLoaded;
64 }
65
66 public boolean isNull() {
67 return resolveInfo == null;
68 }
69
Michael Jurkaab48b682011-09-12 15:39:45 -070070 // mark all these as locked?
71 public CharSequence getLabel() {
72 return mLabel;
73 }
74
75 public void setLabel(CharSequence label) {
76 mLabel = label;
77 }
78
79 public Drawable getIcon() {
80 return mIcon;
81 }
82
83 public void setIcon(Drawable icon) {
84 mIcon = icon;
85 }
86
Michael Jurka99262722013-09-17 14:18:04 +020087 public void setThumbnail(Drawable thumbnail) {
Michael Jurkaab48b682011-09-12 15:39:45 -070088 mThumbnail = thumbnail;
89 }
90
Michael Jurka99262722013-09-17 14:18:04 +020091 public Drawable getThumbnail() {
Michael Jurkaab48b682011-09-12 15:39:45 -070092 return mThumbnail;
93 }
94}