From 790c2d9fc5931bca04e6d28a6ccec16e4aea2024 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Fri, 11 Jun 2010 00:14:11 -0700 Subject: This variable can be checked outside the lock because it's only set from the ui thread. This will help the ANR in LauncherModel.onReceive because if we're under contention, there's a good chance that we haven't loaded yet. It won't completely fix it, but that will take a large refactoring. Bug 2672967 Change-Id: I2c97a416767b4bb6aac0252f02e2aa2055ae8a4e --- src/com/android/launcher2/LauncherModel.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 17cd15101..17f75732a 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -304,13 +304,13 @@ public class LauncherModel extends BroadcastReceiver { ArrayList removed = null; ArrayList modified = null; - synchronized (mAllAppsListLock) { - if (mBeforeFirstLoad) { - // If we haven't even loaded yet, don't bother, since we'll just pick - // up the changes. - return; - } + if (mBeforeFirstLoad) { + // If we haven't even loaded yet, don't bother, since we'll just pick + // up the changes. + return; + } + synchronized (mAllAppsListLock) { final String action = intent.getAction(); if (Intent.ACTION_PACKAGE_CHANGED.equals(action) -- cgit v1.2.3