@@ -245,22 +245,23 @@ public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermiss
245
245
requestPermissions (Collections .singletonList (Manifest .permission .ACCESS_FINE_LOCATION ));
246
246
247
247
} else {
248
- String alertMessage = String .format ("Allow %s to use your location?" , origin );
249
- AlertDialog .Builder builder = new AlertDialog .Builder (this .mWebView .getContext ());
250
- builder .setMessage (alertMessage );
251
- builder .setCancelable (false );
252
- builder .setPositiveButton ("Allow" , (dialog , which ) -> {
253
- callback .invoke (origin , true , false );
254
- });
255
- builder .setNegativeButton ("Don't allow" , (dialog , which ) -> {
256
- callback .invoke (origin , false , false );
257
- });
258
- AlertDialog alertDialog = builder .create ();
259
- alertDialog .show ();
260
- //Delay making `allow` clickable for 500ms to avoid unwanted presses.
261
- Button posButton = alertDialog .getButton (AlertDialog .BUTTON_POSITIVE );
262
- posButton .setEnabled (false );
263
- this .runDelayed (() -> posButton .setEnabled (true ), 500 );
248
+ String alertMessage = String .format ("Allow %s to use your location?" , origin );
249
+ AlertDialog .Builder builder = new AlertDialog .Builder (this .mWebView .getContext ());
250
+ builder .setMessage (alertMessage );
251
+ builder .setCancelable (false );
252
+ builder .setPositiveButton ("Allow" , (dialog , which ) -> {
253
+ callback .invoke (origin , true , false );
254
+ });
255
+ builder .setNegativeButton ("Don't allow" , (dialog , which ) -> {
256
+ callback .invoke (origin , false , false );
257
+ });
258
+ AlertDialog alertDialog = builder .create ();
259
+ alertDialog .show ();
260
+ //Delay making `allow` clickable for 500ms to avoid unwanted presses.
261
+ Button posButton = alertDialog .getButton (AlertDialog .BUTTON_POSITIVE );
262
+ posButton .setEnabled (false );
263
+ this .runDelayed (() -> posButton .setEnabled (true ), 500 );
264
+
264
265
}
265
266
}
266
267
0 commit comments