OSDN Git Service

Fix bug that Google Talk is shown on IM's landing page
authorScott Su <scott.su@myriadgroup.com>
Mon, 24 Aug 2009 03:41:06 +0000 (11:41 +0800)
committerWei Huang <weih@google.com>
Mon, 24 Aug 2009 06:39:37 +0000 (23:39 -0700)
Copy consts defined in framework/base/im to IM app

plugin/com/android/im/plugin/BrandingResourceIDs.java
src/com/android/im/app/ImApp.java
src/com/android/im/app/ImPluginHelper.java
src/com/android/im/app/LandingPage.java
src/com/android/im/app/ProviderListItem.java

index b53c143..70b48c6 100644 (file)
@@ -20,7 +20,37 @@ package com.android.im.plugin;
  * Defines the IDs of branding resources.
  *
  */
-public interface BrandingResourceIDs extends android.im.BrandingResourceIDs {
+public interface BrandingResourceIDs {
+
+    /**
+     * The logo icon of the provider which is displayed in the landing page.
+     */
+    public static final int DRAWABLE_LOGO                = 100;
+    /**
+     * The icon of online presence status.
+     */
+    public static final int DRAWABLE_PRESENCE_ONLINE     = 102;
+    /**
+     * The icon of busy presence status.
+     */
+    public static final int DRAWABLE_PRESENCE_BUSY       = 103;
+    /**
+     * The icon of away presence status.
+     */
+    public static final int DRAWABLE_PRESENCE_AWAY       = 104;
+    /**
+     * The icon of invisible presence status.
+     */
+    public static final int DRAWABLE_PRESENCE_INVISIBLE  = 105;
+    /**
+     * The icon of offline presence status.
+     */
+    public static final int DRAWABLE_PRESENCE_OFFLINE    = 106;
+    /**
+     * The label of the menu to go to the contact list screen.
+     */
+    public static final int STRING_MENU_CONTACT_LIST     = 107;
+
     /**
      * The image displayed on the splash screen while logging in.
      */
index 1f23efd..c02522a 100644 (file)
 
 package com.android.im.app;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import android.app.Activity;
 import android.app.Application;
 import android.content.ComponentName;
@@ -27,21 +33,17 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.ServiceConnection;
 import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.net.ConnectivityManager;
 import android.net.Uri;
 import android.os.Broadcaster;
-import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Message;
 import android.os.RemoteException;
 import android.provider.Im;
-import android.text.TextUtils;
 import android.util.Log;
 
 import com.android.im.IConnectionCreationListener;
@@ -53,16 +55,9 @@ import com.android.im.engine.ImConnection;
 import com.android.im.engine.ImErrorInfo;
 import com.android.im.plugin.BrandingResourceIDs;
 import com.android.im.plugin.ImPlugin;
-import com.android.im.plugin.ImPluginConstants;
 import com.android.im.plugin.ImPluginInfo;
 import com.android.im.service.ImServiceConstants;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 public class ImApp extends Application {
     public static final String LOG_TAG = "ImApp";
 
index f557493..2af7633 100644 (file)
@@ -251,7 +251,6 @@ public class ImPluginHelper {
         return providerId;
     }
 
-    @SuppressWarnings("unchecked")
     private Map<String, String> loadConfiguration(ImPlugin plugin,
             ImPluginInfo info) {
         Map<String, String> config = null;
index cdbea1e..8020cd0 100644 (file)
@@ -102,8 +102,8 @@ public class LandingPage extends ListActivity implements View.OnCreateContextMen
 
         mProviderCursor = managedQuery(Im.Provider.CONTENT_URI_WITH_ACCOUNT,
                 PROVIDER_PROJECTION,
-                null /* selection */,
-                null /* selection args */,
+                Im.Provider.CATEGORY + "=?" /* selection */,
+                new String[]{ ImApp.IMPS_CATEGORY } /* selection args */,
                 Im.Provider.DEFAULT_SORT_ORDER);
         mAdapter = new ProviderAdapter(this, mProviderCursor);
         setListAdapter(mAdapter);
index 882a424..9ddc895 100644 (file)
@@ -18,6 +18,7 @@
 package com.android.im.app;
 
 import com.android.im.R;
+import com.android.im.plugin.BrandingResourceIDs;
 
 import android.graphics.drawable.Drawable;
 import android.widget.LinearLayout;
@@ -27,7 +28,6 @@ import android.content.Context;
 import android.content.ContentResolver;
 import android.content.res.Resources;
 import android.database.Cursor;
-import android.im.BrandingResourceIDs;
 import android.content.res.ColorStateList;
 import android.view.View;
 import android.provider.Im;