0

In Marshmallow this code is not working with GearVR. Activity.onResume() code

IntentFilter intentFilter = new IntentFilter("android.intent.action.proximity_sensor"); 
mReceiver = new BroadcastReceiver() { 
@Override 
public void onReceive(Context context, Intent intent) { 

   if(intent.getType().equals("1")) 
   { 
      Log.v(LOGTAG,"headset mounted"); 
   } 
   else 
   { 
      Log.v(LOGTAG,"headset unmounted"); 
   } 

 } 
}; 

 this.registerReceiver(mReceiver, intentFilter); 
}

this is used to detect GearVR mounted and unmounted. It was working in S6 Lollipop.

Probably this is bug in Marshmallow 6.0.1 link. Any workaround this problem? related links link1 link2

Please share anything that help me in detecting GearVr mount and unmount

Qamar
  • 4,959
  • 1
  • 30
  • 49

1 Answers1

0

Android 6.0 is now using Doze mode to minimize the use of battery. So this Doze mode not allows the system wakups again and again. There should me Minimum of 9 mins gap should be there between two consecutive wakeups. See official documentation for detail.Cleck here

Balvinder Singh
  • 580
  • 6
  • 19