I have a service, in particular an Android Daydream DreamService, that I have declared in my AndroidManifest.xml file. When my app is loaded, Android detects this declaration and adds my app as an option to the list of Daydreams the user can choose from in their Settings. I am declaring this Service as follows...
<service android:name=".daydream.DaydreamService" android:exported="true"
android:icon="@drawable/icon" android:label="@string/app_name" >
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.service.dream"
android:resource="@xml/daydream" />
</service>
I'm trying to see if there is a way I can conditionally load this Service declaration programmatically. In other words, I want to only declare this DreamService based on some programmatic logic. I don't want Android to list or even be aware of my app's Daydream feature unless I programmatically enable it.
Is something like this possible?