@@ -87,6 +87,7 @@ public class VrShellDelegate
87
87
// when used with startActivityForResult...
88
88
public static final int EXIT_VR_RESULT = 7212 ;
89
89
public static final int VR_SERVICES_UPDATE_RESULT = 7213 ;
90
+ public static final int GVR_KEYBOARD_UPDATE_RESULT = 7214 ;
90
91
91
92
private static final int ENTER_VR_NOT_NECESSARY = 0 ;
92
93
private static final int ENTER_VR_CANCELLED = 1 ;
@@ -113,6 +114,9 @@ public class VrShellDelegate
113
114
private static final String VR_CORE_MARKET_URI =
114
115
"market://details?id=" + VrCoreVersionChecker .VR_CORE_PACKAGE_ID ;
115
116
117
+ private static final String GVR_KEYBOARD_MARKET_URI =
118
+ "market://details?id=com.google.android.vr.inputmethod" ;
119
+
116
120
// This value is intentionally probably overkill. This is the time we need to wait from when
117
121
// Chrome is resumed, to when Chrome actually renders a black frame, so that we can cancel the
118
122
// stay_hidden animation and not see a white monoscopic frame in-headset. 150ms is definitely
@@ -322,6 +326,10 @@ public static boolean onActivityResultWithNative(int requestCode, int resultCode
322
326
if (sInstance != null ) sInstance .onVrServicesMaybeUpdated ();
323
327
return true ;
324
328
}
329
+ // Handles the result of requesting to update GVR Keyboard.
330
+ if (requestCode == GVR_KEYBOARD_UPDATE_RESULT ) {
331
+ return true ;
332
+ }
325
333
return false ;
326
334
}
327
335
@@ -1776,6 +1784,12 @@ public boolean onInfoBarButtonClicked(boolean isPrimary) {
1776
1784
buttonText , null , true );
1777
1785
}
1778
1786
1787
+ /* package */ void promptForKeyboardUpdate () {
1788
+ mActivity .startActivityForResult (
1789
+ new Intent (Intent .ACTION_VIEW , Uri .parse (GVR_KEYBOARD_MARKET_URI )),
1790
+ GVR_KEYBOARD_UPDATE_RESULT );
1791
+ }
1792
+
1779
1793
private boolean createVrShell () {
1780
1794
assert mVrShell == null ;
1781
1795
if (mVrClassesWrapper == null ) return false ;
0 commit comments