summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsView.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-12-08 17:02:02 -0800
committerJoe Onorato <joeo@android.com>2009-12-08 17:02:02 -0800
commita276fc59f535a2fb05701e8f49bb7adf4cefb3b2 (patch)
tree4a74bcc15ddf248025ee14d1d4d4374c0057b2c2 /src/com/android/launcher2/AllAppsView.java
parentbf173f11d27719af7a3c480ce84bb5b63e191fba (diff)
downloadandroid_packages_apps_Trebuchet-a276fc59f535a2fb05701e8f49bb7adf4cefb3b2.tar.gz
android_packages_apps_Trebuchet-a276fc59f535a2fb05701e8f49bb7adf4cefb3b2.tar.bz2
android_packages_apps_Trebuchet-a276fc59f535a2fb05701e8f49bb7adf4cefb3b2.zip
Fix 2306862 - Launcher2 crashed: in libs/rs. Uploading texture without a context.
turns off some logging and fixes latent bugs that this uncovered where we were accessing renderscript while there was no context.
Diffstat (limited to 'src/com/android/launcher2/AllAppsView.java')
-rw-r--r--src/com/android/launcher2/AllAppsView.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 6d3ae47b0..9e2223194 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -271,13 +271,13 @@ public class AllAppsView extends RSSurfaceView
}
if (gainFocus) {
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
gainFocus();
} else {
mShouldGainFocus = true;
}
} else {
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
if (mArrowNavigation) {
// Clear selection when we lose focus
mRollo.clearSelectedIcon();
@@ -658,7 +658,11 @@ public class AllAppsView extends RSSurfaceView
public void setApps(ArrayList<ApplicationInfo> list) {
mAllAppsList = list;
if (mRollo != null) {
- mRollo.setApps(list);
+ if (mRollo.mHasSurface) {
+ mRollo.setApps(list);
+ } else {
+ mRollo.mAppsDirty = true;
+ }
}
mLocks &= ~LOCK_ICONS_PENDING;
}
@@ -670,7 +674,7 @@ public class AllAppsView extends RSSurfaceView
}
final int N = list.size();
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
mRollo.reallocAppsList(mRollo.mState.iconCount + N);
}
@@ -682,13 +686,13 @@ public class AllAppsView extends RSSurfaceView
index = -(index+1);
}
mAllAppsList.add(index, item);
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
mRollo.addApp(index, item);
mRollo.mState.iconCount++;
}
}
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
mRollo.saveAppsList();
}
}
@@ -704,10 +708,10 @@ public class AllAppsView extends RSSurfaceView
final ApplicationInfo item = list.get(i);
int index = findAppByComponent(mAllAppsList, item);
if (index >= 0) {
+ int ic = mRollo != null ? mRollo.mState.iconCount : 666;
mAllAppsList.remove(index);
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
mRollo.removeApp(index);
- mRollo.mState.iconCount--;
}
} else {
Log.w(TAG, "couldn't find a match for item \"" + item + "\"");
@@ -715,7 +719,7 @@ public class AllAppsView extends RSSurfaceView
}
}
- if (mRollo != null) {
+ if (mRollo != null && mRollo.mHasSurface) {
mRollo.saveAppsList();
}
}
@@ -1174,7 +1178,7 @@ public class AllAppsView extends RSSurfaceView
System.arraycopy(mLabels, index, mLabels, dest, count);
System.arraycopy(mLabelIds, index, mLabelIds, dest, count);
- if (mHasSurface ) {
+ if (mHasSurface) {
uploadAppIcon(index, item);
} else {
mAppsDirty = true;
@@ -1193,7 +1197,9 @@ public class AllAppsView extends RSSurfaceView
System.arraycopy(mLabels, src, mLabels, index, count);
System.arraycopy(mLabelIds, src, mLabelIds, index, count);
+ mRollo.mState.iconCount--;
final int last = mState.iconCount - 1;
+
mIcons[last] = null;
mIconIds[last] = 0;
mLabels[last] = null;