Merge "Add smartspace complication type." into tm-qpr-dev
This commit is contained in:
@@ -1610,6 +1610,9 @@
|
|||||||
<string name="dream_complication_title_cast_info">Cast Info</string>
|
<string name="dream_complication_title_cast_info">Cast Info</string>
|
||||||
<!-- Screensaver overlay which displays home controls. [CHAR LIMIT=20] -->
|
<!-- Screensaver overlay which displays home controls. [CHAR LIMIT=20] -->
|
||||||
<string name="dream_complication_title_home_controls">Home Controls</string>
|
<string name="dream_complication_title_home_controls">Home Controls</string>
|
||||||
|
<!-- Screensaver overlay which displays smartspace. [CHAR LIMIT=20] -->
|
||||||
|
<string name="dream_complication_title_smartspace">Smartspace</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- Title for a screen allowing the user to choose a profile picture. [CHAR LIMIT=NONE] -->
|
<!-- Title for a screen allowing the user to choose a profile picture. [CHAR LIMIT=NONE] -->
|
||||||
<string name="avatar_picker_title">Choose a profile picture</string>
|
<string name="avatar_picker_title">Choose a profile picture</string>
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ public class DreamBackend {
|
|||||||
COMPLICATION_TYPE_WEATHER,
|
COMPLICATION_TYPE_WEATHER,
|
||||||
COMPLICATION_TYPE_AIR_QUALITY,
|
COMPLICATION_TYPE_AIR_QUALITY,
|
||||||
COMPLICATION_TYPE_CAST_INFO,
|
COMPLICATION_TYPE_CAST_INFO,
|
||||||
COMPLICATION_TYPE_HOME_CONTROLS
|
COMPLICATION_TYPE_HOME_CONTROLS,
|
||||||
|
COMPLICATION_TYPE_SMARTSPACE
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface ComplicationType {}
|
public @interface ComplicationType {}
|
||||||
@@ -103,6 +104,7 @@ public class DreamBackend {
|
|||||||
public static final int COMPLICATION_TYPE_AIR_QUALITY = 4;
|
public static final int COMPLICATION_TYPE_AIR_QUALITY = 4;
|
||||||
public static final int COMPLICATION_TYPE_CAST_INFO = 5;
|
public static final int COMPLICATION_TYPE_CAST_INFO = 5;
|
||||||
public static final int COMPLICATION_TYPE_HOME_CONTROLS = 6;
|
public static final int COMPLICATION_TYPE_HOME_CONTROLS = 6;
|
||||||
|
public static final int COMPLICATION_TYPE_SMARTSPACE = 7;
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final IDreamManager mDreamManager;
|
private final IDreamManager mDreamManager;
|
||||||
@@ -351,6 +353,9 @@ public class DreamBackend {
|
|||||||
case COMPLICATION_TYPE_HOME_CONTROLS:
|
case COMPLICATION_TYPE_HOME_CONTROLS:
|
||||||
res = R.string.dream_complication_title_home_controls;
|
res = R.string.dream_complication_title_home_controls;
|
||||||
break;
|
break;
|
||||||
|
case COMPLICATION_TYPE_SMARTSPACE:
|
||||||
|
res = R.string.dream_complication_title_smartspace;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,8 @@ public interface Complication {
|
|||||||
COMPLICATION_TYPE_WEATHER,
|
COMPLICATION_TYPE_WEATHER,
|
||||||
COMPLICATION_TYPE_AIR_QUALITY,
|
COMPLICATION_TYPE_AIR_QUALITY,
|
||||||
COMPLICATION_TYPE_CAST_INFO,
|
COMPLICATION_TYPE_CAST_INFO,
|
||||||
COMPLICATION_TYPE_HOME_CONTROLS
|
COMPLICATION_TYPE_HOME_CONTROLS,
|
||||||
|
COMPLICATION_TYPE_SMARTSPACE
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@interface ComplicationType {}
|
@interface ComplicationType {}
|
||||||
@@ -175,6 +176,7 @@ public interface Complication {
|
|||||||
int COMPLICATION_TYPE_AIR_QUALITY = 1 << 3;
|
int COMPLICATION_TYPE_AIR_QUALITY = 1 << 3;
|
||||||
int COMPLICATION_TYPE_CAST_INFO = 1 << 4;
|
int COMPLICATION_TYPE_CAST_INFO = 1 << 4;
|
||||||
int COMPLICATION_TYPE_HOME_CONTROLS = 1 << 5;
|
int COMPLICATION_TYPE_HOME_CONTROLS = 1 << 5;
|
||||||
|
int COMPLICATION_TYPE_SMARTSPACE = 1 << 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link Host} interface specifies a way a {@link Complication} to communicate with its
|
* The {@link Host} interface specifies a way a {@link Complication} to communicate with its
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import static com.android.systemui.dreams.complication.Complication.COMPLICATION
|
|||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_DATE;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_DATE;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_HOME_CONTROLS;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_HOME_CONTROLS;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_NONE;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_NONE;
|
||||||
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_SMARTSPACE;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_TIME;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_TIME;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_WEATHER;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_WEATHER;
|
||||||
|
|
||||||
@@ -51,6 +52,8 @@ public class ComplicationUtils {
|
|||||||
return COMPLICATION_TYPE_CAST_INFO;
|
return COMPLICATION_TYPE_CAST_INFO;
|
||||||
case DreamBackend.COMPLICATION_TYPE_HOME_CONTROLS:
|
case DreamBackend.COMPLICATION_TYPE_HOME_CONTROLS:
|
||||||
return COMPLICATION_TYPE_HOME_CONTROLS;
|
return COMPLICATION_TYPE_HOME_CONTROLS;
|
||||||
|
case DreamBackend.COMPLICATION_TYPE_SMARTSPACE:
|
||||||
|
return COMPLICATION_TYPE_SMARTSPACE;
|
||||||
default:
|
default:
|
||||||
return COMPLICATION_TYPE_NONE;
|
return COMPLICATION_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ public class SmartSpaceComplication implements Complication {
|
|||||||
return mViewHolderProvider.get();
|
return mViewHolderProvider.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRequiredTypeAvailability() {
|
||||||
|
return COMPLICATION_TYPE_SMARTSPACE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link CoreStartable} responsbile for registering {@link SmartSpaceComplication} with
|
* {@link CoreStartable} responsbile for registering {@link SmartSpaceComplication} with
|
||||||
* SystemUI.
|
* SystemUI.
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static com.android.systemui.dreams.complication.Complication.COMPLICATION
|
|||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_CAST_INFO;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_CAST_INFO;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_DATE;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_DATE;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_HOME_CONTROLS;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_HOME_CONTROLS;
|
||||||
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_SMARTSPACE;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_TIME;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_TIME;
|
||||||
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_WEATHER;
|
import static com.android.systemui.dreams.complication.Complication.COMPLICATION_TYPE_WEATHER;
|
||||||
import static com.android.systemui.dreams.complication.ComplicationUtils.convertComplicationType;
|
import static com.android.systemui.dreams.complication.ComplicationUtils.convertComplicationType;
|
||||||
@@ -60,6 +61,8 @@ public class ComplicationUtilsTest extends SysuiTestCase {
|
|||||||
.isEqualTo(COMPLICATION_TYPE_CAST_INFO);
|
.isEqualTo(COMPLICATION_TYPE_CAST_INFO);
|
||||||
assertThat(convertComplicationType(DreamBackend.COMPLICATION_TYPE_HOME_CONTROLS))
|
assertThat(convertComplicationType(DreamBackend.COMPLICATION_TYPE_HOME_CONTROLS))
|
||||||
.isEqualTo(COMPLICATION_TYPE_HOME_CONTROLS);
|
.isEqualTo(COMPLICATION_TYPE_HOME_CONTROLS);
|
||||||
|
assertThat(convertComplicationType(DreamBackend.COMPLICATION_TYPE_SMARTSPACE))
|
||||||
|
.isEqualTo(COMPLICATION_TYPE_SMARTSPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user