Settings: Minimal refactor to support new dreams api.

Fix breaking changes to the dreams api.  Master toggle
and multiple dreams support in Settings will be done in
a subsequent change.

Bug:7028665
Change-Id: Ia56dd00ec50323fbba06473b1747e5015a3f1898
This commit is contained in:
John Spurlock
2012-08-22 09:59:44 -04:00
parent 395f5f7007
commit e5a84b2ea1
3 changed files with 21 additions and 7 deletions

View File

@@ -36,7 +36,10 @@ public class DreamTesterPreference extends Preference {
protected void onClick() {
IDreamManager dm = IDreamManager.Stub.asInterface(ServiceManager.getService("dreams"));
try {
ComponentName cn = dm.getDreamComponent();
ComponentName[] dreams = dm.getDreamComponents();
if (dreams == null || dreams.length == 0)
return;
ComponentName cn = dreams[0];
Log.v(TAG, "DreamComponent cn=" + cn);
dm.testDream(cn);
} catch (RemoteException ex) {