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 32 private Bitmap mThumbnail; // generated by Activity.onCreateThumbnail() 33 private Drawable mIcon; // application package icon 34 private CharSequence mLabel; // application package label 35 TaskDescription(int _taskId, int _persistentTaskId, ResolveInfo _resolveInfo, Intent _intent, String _packageName, CharSequence _description)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 48 // mark all these as locked? getLabel()49 public CharSequence getLabel() { 50 return mLabel; 51 } 52 setLabel(CharSequence label)53 public void setLabel(CharSequence label) { 54 mLabel = label; 55 } 56 getIcon()57 public Drawable getIcon() { 58 return mIcon; 59 } 60 setIcon(Drawable icon)61 public void setIcon(Drawable icon) { 62 mIcon = icon; 63 } 64 setThumbnail(Bitmap thumbnail)65 public void setThumbnail(Bitmap thumbnail) { 66 mThumbnail = thumbnail; 67 } 68 getThumbnail()69 public Bitmap getThumbnail() { 70 return mThumbnail; 71 } 72 } 73