Bug 842395 - Remove areClientsAvailable() from TabsAccessor. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 21 Feb 2013 11:56:19 -0800
changeset 122569 b7863019511c53d92ee7d74cbe0dfcfeb6c57eaf
parent 122568 57b4ba1a0018b0af0fc346004197ae26b0526300
child 122570 e698845ff3ac819f67e548ff02877055c4dcc617
push id24346
push userryanvm@gmail.com
push dateFri, 22 Feb 2013 11:09:18 +0000
treeherdermozilla-central@67f2a2816651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs842395
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 842395 - Remove areClientsAvailable() from TabsAccessor. r=mfinkle
mobile/android/base/TabsAccessor.java
--- a/mobile/android/base/TabsAccessor.java
+++ b/mobile/android/base/TabsAccessor.java
@@ -55,56 +55,16 @@ public final class TabsAccessor {
         public String guid;
         public String name;
     }
 
     public interface OnQueryTabsCompleteListener {
         public void onQueryTabsComplete(List<RemoteTab> tabs);
     }
 
-    public interface OnClientsAvailableListener {
-        public void areAvailable(boolean available);
-    }
-
-    // Helper method to check if there are any clients available
-    public static void areClientsAvailable(final Context context, final OnClientsAvailableListener listener) {
-        if (listener == null)
-            return;
-
-        (new GeckoAsyncTask<Void, Void, Boolean>(GeckoApp.mAppContext, GeckoAppShell.getHandler()) {
-            @Override
-            protected Boolean doInBackground(Void... unused) {
-                Uri uri = BrowserContract.Tabs.CONTENT_URI;
-                uri = uri.buildUpon()
-                         .appendQueryParameter(BrowserContract.PARAM_LIMIT, "1")
-                         .build();
-
-                Cursor cursor = context.getContentResolver().query(uri,
-                                                                   CLIENTS_AVAILABILITY_PROJECTION,
-                                                                   CLIENTS_SELECTION,
-                                                                   null,
-                                                                   null);
-                
-                if (cursor == null)
-                    return false;
-                
-                try {
-                    return cursor.moveToNext();
-                } finally {
-                    cursor.close();
-                }
-            }
-
-            @Override
-            protected void onPostExecute(Boolean availability) {
-                listener.areAvailable(availability);
-            }
-        }).setPriority(GeckoAsyncTask.Priority.HIGH).execute();
-    }
-
     // This method returns all tabs from all remote clients, 
     // ordered by most recent client first, most recent tab first 
     public static void getTabs(final Context context, final OnQueryTabsCompleteListener listener) {
         getTabs(context, 0, listener);
     }
 
     // This method returns limited number of tabs from all remote clients, 
     // ordered by most recent client first, most recent tab first