Bug 24478 - Unable to dim screen on google glass
Summary: Unable to dim screen on google glass
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.0
Hardware: PC All
: High blocker
Target Milestone: 5.1
Assignee: Bugzilla
Depends on:
Reported: 2014-11-12 18:34 UTC by Michael
Modified: 2015-04-10 15:40 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Test App to reproduce problem (27.75 KB, application/zip)
2014-11-12 18:36 UTC, Michael
GoogleGlass working app (276.49 KB, application/zip)
2014-11-12 18:37 UTC, Michael

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Michael 2014-11-12 18:34:42 UTC
Unable to dim the screen of google glass. Only workaround is to leave the screen on at full brightness at all times and this causes battery issues. 

Behavior Description:
Adding the android:immersive=”true” flag to the android manifest file for a glass app created with Xamarin does not work.  After 5 seconds of the screen being auto turned off by glass this flag should allow the last activity to be resumed on waking glass, however, all that is displayed is the google glass home screen.  To test I created a blank Xamarin android app using visual studio 2013 and added the android:immersive=”true” flag to the manifest for the MainActivity.  I also loaded up the glass api demo app from https://github.com/googleglass/gdk-apidemo-sample.git in Android Studio and added the same flag to the activities.  The android studio app will resume when glass is wakened with a finger press, however the xamarin app will not.
Comment 1 Michael 2014-11-12 18:36:37 UTC
Created attachment 8708 [details]
Test App to reproduce problem
Comment 2 Michael 2014-11-12 18:37:33 UTC
Created attachment 8709 [details]
GoogleGlass working app
Comment 3 Sean Pearl 2014-11-12 23:32:05 UTC
Confirmed in 4.18.1. Setting android:immersive="true" in an activity in the manifest does not cause it to resume after waking the glass from several seconds of device standby, it acts the same as the default or android:immersive="false" and returns to the home screen instead.  

Client is looking for a workaround other than forcing the device's screen to maximum brightness, which greatly impacts battery life.
Comment 4 Atsushi Eno 2014-11-13 13:01:39 UTC
We figured out that this android:immersive does not exist on http://developer.android.com/guide/topics/manifest/activity-element.html but it does on https://developers.google.com/glass/develop/gdk/immersions .

We added another property on Android.App.ActivityAttribute class.

[master 864f08d]
Comment 5 Chris Hardy [MSFT] 2014-11-13 19:13:10 UTC
Just to go on from Atsushi's comment, the correct way (when the issue above is live) will be to add the Immersive property to your Activity attribute, so it would look like this:

	[Activity (Label = "Hello Xamarin", Icon = "@drawable/Icon", Immersive = true, MainLauncher = true, Enabled = true)]

for now, to work around the issue, you can do a build of the project and look at the generated AndroidManifest.xml file in the obj folder and extract the Activity and manually add the immersive property like in the example from Google on https://developers.google.com/glass/develop/gdk/immersions

<activity android:enabled="true" android:icon="@drawable/icon" android:immersive="true" android:label="Hello Xamarin" android:name="helloglassworld.MainActivity">
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      <meta-data android:name="com.google.android.glass.VoiceTrigger" android:resource="@xml/voicetriggerstart" />
        <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />

I hope this helps!
Comment 6 Chris Hardy [MSFT] 2014-11-13 19:14:14 UTC
... forgot to say and manually add this into the AndroidManifest.xml file in your main project.
Comment 7 PJ 2014-12-04 16:14:18 UTC
Fixed by Atsushi in comment 4.
Comment 8 Sean Pearl 2014-12-04 18:04:30 UTC
Confirming that this is resolved in Master.
Comment 9 Peter Collins 2015-04-10 15:40:19 UTC
Verifying based on Comment #8