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