blob: 2bc28210c57a32edda144e8f52186661ea8f6d6a [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;
21import android.graphics.Bitmap;
22import android.graphics.drawable.Drawable;
23
24public final class TaskDescription {
25 final ResolveInfo resolveInfo;
26 final int taskId; // application task id for curating apps
27 final int persistentTaskId; // persistent id
28 final Intent intent; // launch intent for application
29 final String packageName; // used to override animations (see onClick())
30 final CharSequence description;
31
Michael Jurka99262722013-09-17 14:18:04 +020032 private Drawable mThumbnail; // generated by Activity.onCreateThumbnail()
Michael Jurkaab48b682011-09-12 15:39:45 -070033 private Drawable mIcon; // application package icon
34 private CharSequence mLabel; // application package label
Michael Jurka99a96552012-01-27 17:23:38 -080035 private boolean mLoaded;
Michael Jurkaab48b682011-09-12 15:39:45 -070036
37 public TaskDescription(int _taskId, int _persistentTaskId,
38 ResolveInfo _resolveInfo, Intent _intent,
39 String _packageName, CharSequence _description) {
40 resolveInfo = _resolveInfo;
41 intent = _intent;
42 taskId = _taskId;
43 persistentTaskId = _persistentTaskId;
44
45 description = _description;
46 packageName = _packageName;
47 }
48
Michael Jurka99a96552012-01-27 17:23:38 -080049 public TaskDescription() {
50 resolveInfo = null;
51 intent = null;
52 taskId = -1;
53 persistentTaskId = -1;
54
55 description = null;
56 packageName = null;
57 }
58
59 public void setLoaded(boolean loaded) {
60 mLoaded = loaded;
61 }
62
63 public boolean isLoaded() {
64 return mLoaded;
65 }
66
67 public boolean isNull() {
68 return resolveInfo == null;
69 }
70
Michael Jurkaab48b682011-09-12 15:39:45 -070071 // mark all these as locked?
72 public CharSequence getLabel() {
73 return mLabel;
74 }
75
76 public void setLabel(CharSequence label) {
77 mLabel = label;
78 }
79
80 public Drawable getIcon() {
81 return mIcon;
82 }
83
84 public void setIcon(Drawable icon) {
85 mIcon = icon;
86 }
87
Michael Jurka99262722013-09-17 14:18:04 +020088 public void setThumbnail(Drawable thumbnail) {
Michael Jurkaab48b682011-09-12 15:39:45 -070089 mThumbnail = thumbnail;
90 }
91
Michael Jurka99262722013-09-17 14:18:04 +020092 public Drawable getThumbnail() {
Michael Jurkaab48b682011-09-12 15:39:45 -070093 return mThumbnail;
94 }
95}