Prepare settings for METADATA_NAME_CONFIG_ACTIVITY removal.
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
This commit is contained in:
@@ -29,7 +29,6 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.service.dreams.Dream;
|
|
||||||
import android.service.dreams.IDreamManager;
|
import android.service.dreams.IDreamManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -41,6 +40,11 @@ import java.util.List;
|
|||||||
public class DreamBackend {
|
public class DreamBackend {
|
||||||
private static final String TAG = DreamSettings.class.getSimpleName() + ".Backend";
|
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 {
|
public static class DreamInfo {
|
||||||
CharSequence caption;
|
CharSequence caption;
|
||||||
Drawable icon;
|
Drawable icon;
|
||||||
@@ -205,7 +209,7 @@ public class DreamBackend {
|
|||||||
|| resolveInfo.serviceInfo == null
|
|| resolveInfo.serviceInfo == null
|
||||||
|| resolveInfo.serviceInfo.metaData == null)
|
|| resolveInfo.serviceInfo.metaData == null)
|
||||||
return 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);
|
return cn == null ? null : ComponentName.unflattenFromString(cn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user