title: Unable to get location with HTML5 Geolocation and Android with different user
body: <p>I'm developing an app for Android which will be runned on a single type of device, which is - Samsung Galaxy Tab 3 8.0 - running on Android KitKat 4.4.2.</p>
  
  <p>We have multiple users on our devices, the Owner and a Restricted Profile account, which is used by workers in our company.</p>
  
  <p>My app has a <code>WebView</code> in which it loads our Web Application from a Web server which is responsive in it's layout and on login request we require the visitor to Share his/hers Location with HTML5 Geolocation.</p>
  
  <p>Sharing one's location works like a charm on Web (using either a Browser on a computer or on a mobile devices), works fine on the App when the Owner account initiates it, etc.</p>
  
  <p>However, if I run this application as the Restricted Profile account, I only reach the timeout I've set in my JavaScript, message appears and nothing else happends.</p>
  
  <p>This is my JavaScript for invoking the Share Location thing:</p>
  
  <pre><code>if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(getPositionForMobileApp, getLocationErrorHandler, {frequency: 5000, maximumAge: 0, timeout: 60000, enableHighAccuracy: true});
  } else {
      $('.panel-body').first().html('&lt;small&gt;Your browser doesn\'t support &lt;strong&gt;HTML5 Geolocation&lt;/strong&gt;.&lt;br /&gt; Please install a newer version of your Internet Browser.&lt;/small&gt;');
  }
  </code></pre>
  
  <p>JavaScript callbacks for HTML5 Geolocation API are:</p>
  
  <pre><code>function getPositionForMobileApp(position) {
      $('input#position').val(position.coords.latitude + ';' + position.coords.longitude);
  
      $.post('/user/login?usingMobileApp=true', {position: (position.coords.latitude + ';' + position.coords.longitude)}, function (data) {
          if (data.success) {
              $('.panel-body').first().html(data.html);
  
              // this is for testing/debugging purposes
              $('.col-md-12.text-center small').html(position.coords.latitude + ' ----------- ' + position.coords.longitude);
  
              $('input#login').focus();
          } else {
              $('.panel-body').first().html('&lt;small&gt;&lt;strong&gt;Request is not valid!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We've blocked your IP Address: &lt;kbd&gt;' + data.ip + '&lt;/kbd&gt; for next 24 hours.&lt;/small&gt;');
          }
      }, 'json');
  }
  }
  </code></pre>
  
  <p>As mentioned before, this works well on other Browser on computers and Browsers on mobile devices, except when I run my URL from a Chrome Browser on a mobile device, using the Restricted Profile account - it doesn't even prompt me on Chrome whether to Share location or block it.</p>
  
  <p>When I run it this way using the Built in Internet Browser app, it prompts me, if I accept, I get my position regulary.</p>
  
  <p>So I belive this has to do something with user restrictions built by Samsung/Android, I don't know who any more.</p>
  
  <p>These are my permissions in my <code>AndroidManifest.xml</code>:</p>
  
  <p>
      </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_SETTINGS" /&gt;
  &lt;uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_APN_SETTINGS" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /&gt;
  
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /&gt;
  
  &lt;uses-permission android:name="android.permission.INSTALL_PACKAGES" /&gt;
  &lt;uses-permission android:name="android.permission.DELETE_PACKAGES" /&gt;
  </code></pre>
  
  <p>I'm using all those for different purposes; I don't know if some maybe colliding with others or something, but I need all of those.</p>
  
  <p>This is my <code>onGeolocationPermissionsShowPrompt</code> method override:</p>
  
  <pre><code>mWebView.setWebChromeClient(new WebChromeClient() {
      @Override
      public void onGeolocationPermissionsShowPrompt(String origin, final GeolocationPermissions.Callback callback) {
          // I doubt that this is needed at all, but I've added it anyway
          GeolocationPermissions.getInstance().allow(origin);
  
          // as said, works well on other places...
          callback.invoke(origin, true, false);
  
          // after so much frustration, I've added the parent method.
          super.onGeolocationPermissionsShowPrompt(origin, callback);
      }
  });
  </code></pre>
  
  <p>I don't know anything anymore; can't figure it out.</p>