OSDN Git Service

Prepare settings for METADATA_NAME_CONFIG_ACTIVITY removal.
authorJohn Spurlock <jspurlock@google.com>
Wed, 26 Sep 2012 15:16:34 +0000 (11:16 -0400)
committerJohn Spurlock <jspurlock@google.com>
Wed, 26 Sep 2012 15:16:34 +0000 (11:16 -0400)
This is to avoid even a temporary build breakage. Using the new
xml file will be done in a followup commit.

Bug:7172816
Change-Id: If6fedefbee38428eda5b39994c3ad8ff86c8fef9

src/com/android/settings/DreamBackend.java

index 2f0443b..68a31a1 100644 (file)
@@ -29,7 +29,6 @@ import android.graphics.drawable.Drawable;
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.provider.Settings;
-import android.service.dreams.Dream;
 import android.service.dreams.IDreamManager;
 import android.util.Log;
 
@@ -41,6 +40,11 @@ import java.util.List;
 public class DreamBackend {
     private static final String TAG = DreamSettings.class.getSimpleName() + ".Backend";
 
+    // avoid breaking when the api changes.
+    // FIXME: use the new xml file when available
+    private static final String OLD_METADATA_NAME_CONFIG_ACTIVITY =
+            "android.service.dreams.config_activity";
+
     public static class DreamInfo {
         CharSequence caption;
         Drawable icon;
@@ -205,7 +209,7 @@ public class DreamBackend {
                 || resolveInfo.serviceInfo == null
                 || resolveInfo.serviceInfo.metaData == null)
             return null;
-        String cn = resolveInfo.serviceInfo.metaData.getString(Dream.METADATA_NAME_CONFIG_ACTIVITY);
+        String cn = resolveInfo.serviceInfo.metaData.getString(OLD_METADATA_NAME_CONFIG_ACTIVITY);
         return cn == null ? null : ComponentName.unflattenFromString(cn);
     }