Loading core/java/android/server/search/Searchables.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.Bundle; import android.util.Log; import java.util.ArrayList; import java.util.ArrayList; import java.util.HashMap; import java.util.HashMap; Loading @@ -34,6 +35,8 @@ import java.util.List; */ */ public class Searchables { public class Searchables { private static final String LOG_TAG = "Searchables"; // static strings used for XML lookups, etc. // static strings used for XML lookups, etc. // TODO how should these be documented for the developer, in a more structured way than // TODO how should these be documented for the developer, in a more structured way than // the current long wordy javadoc in SearchManager.java ? // the current long wordy javadoc in SearchManager.java ? Loading Loading @@ -184,7 +187,6 @@ public class Searchables { * TODO: sort the list somehow? UI choice. * TODO: sort the list somehow? UI choice. */ */ public void buildSearchableList() { public void buildSearchableList() { // These will become the new values at the end of the method // These will become the new values at the end of the method HashMap<ComponentName, SearchableInfo> newSearchablesMap HashMap<ComponentName, SearchableInfo> newSearchablesMap = new HashMap<ComponentName, SearchableInfo>(); = new HashMap<ComponentName, SearchableInfo>(); Loading Loading @@ -223,6 +225,11 @@ public class Searchables { ComponentName globalSearchActivity = globalSearchIntent.resolveActivity(pm); ComponentName globalSearchActivity = globalSearchIntent.resolveActivity(pm); SearchableInfo newDefaultSearchable = newSearchablesMap.get(globalSearchActivity); SearchableInfo newDefaultSearchable = newSearchablesMap.get(globalSearchActivity); if (newDefaultSearchable == null) { Log.w(LOG_TAG, "No searchable info found for new default searchable activity " + globalSearchActivity); } // Store a consistent set of new values // Store a consistent set of new values synchronized (this) { synchronized (this) { mSearchablesMap = newSearchablesMap; mSearchablesMap = newSearchablesMap; Loading Loading
core/java/android/server/search/Searchables.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.Bundle; import android.util.Log; import java.util.ArrayList; import java.util.ArrayList; import java.util.HashMap; import java.util.HashMap; Loading @@ -34,6 +35,8 @@ import java.util.List; */ */ public class Searchables { public class Searchables { private static final String LOG_TAG = "Searchables"; // static strings used for XML lookups, etc. // static strings used for XML lookups, etc. // TODO how should these be documented for the developer, in a more structured way than // TODO how should these be documented for the developer, in a more structured way than // the current long wordy javadoc in SearchManager.java ? // the current long wordy javadoc in SearchManager.java ? Loading Loading @@ -184,7 +187,6 @@ public class Searchables { * TODO: sort the list somehow? UI choice. * TODO: sort the list somehow? UI choice. */ */ public void buildSearchableList() { public void buildSearchableList() { // These will become the new values at the end of the method // These will become the new values at the end of the method HashMap<ComponentName, SearchableInfo> newSearchablesMap HashMap<ComponentName, SearchableInfo> newSearchablesMap = new HashMap<ComponentName, SearchableInfo>(); = new HashMap<ComponentName, SearchableInfo>(); Loading Loading @@ -223,6 +225,11 @@ public class Searchables { ComponentName globalSearchActivity = globalSearchIntent.resolveActivity(pm); ComponentName globalSearchActivity = globalSearchIntent.resolveActivity(pm); SearchableInfo newDefaultSearchable = newSearchablesMap.get(globalSearchActivity); SearchableInfo newDefaultSearchable = newSearchablesMap.get(globalSearchActivity); if (newDefaultSearchable == null) { Log.w(LOG_TAG, "No searchable info found for new default searchable activity " + globalSearchActivity); } // Store a consistent set of new values // Store a consistent set of new values synchronized (this) { synchronized (this) { mSearchablesMap = newSearchablesMap; mSearchablesMap = newSearchablesMap; Loading