Michael Jurka | ab48b68 | 2011-09-12 15:39:45 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.systemui.recent; |
| 18 | |
| 19 | import android.content.Intent; |
| 20 | import android.content.pm.ResolveInfo; |
| 21 | import android.graphics.Bitmap; |
| 22 | import android.graphics.drawable.Drawable; |
| 23 | |
| 24 | public 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 Jurka | 9926272 | 2013-09-17 14:18:04 +0200 | [diff] [blame] | 32 | private Drawable mThumbnail; // generated by Activity.onCreateThumbnail() |
Michael Jurka | ab48b68 | 2011-09-12 15:39:45 -0700 | [diff] [blame] | 33 | private Drawable mIcon; // application package icon |
| 34 | private CharSequence mLabel; // application package label |
Michael Jurka | 99a9655 | 2012-01-27 17:23:38 -0800 | [diff] [blame] | 35 | private boolean mLoaded; |
Michael Jurka | ab48b68 | 2011-09-12 15:39:45 -0700 | [diff] [blame] | 36 | |
| 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 Jurka | 99a9655 | 2012-01-27 17:23:38 -0800 | [diff] [blame] | 49 | 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 Jurka | ab48b68 | 2011-09-12 15:39:45 -0700 | [diff] [blame] | 71 | // 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 Jurka | 9926272 | 2013-09-17 14:18:04 +0200 | [diff] [blame] | 88 | public void setThumbnail(Drawable thumbnail) { |
Michael Jurka | ab48b68 | 2011-09-12 15:39:45 -0700 | [diff] [blame] | 89 | mThumbnail = thumbnail; |
| 90 | } |
| 91 | |
Michael Jurka | 9926272 | 2013-09-17 14:18:04 +0200 | [diff] [blame] | 92 | public Drawable getThumbnail() { |
Michael Jurka | ab48b68 | 2011-09-12 15:39:45 -0700 | [diff] [blame] | 93 | return mThumbnail; |
| 94 | } |
| 95 | } |