return make_fixnum (1 << nr_planes);
}
+DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
+ doc: /* SKIP: real doc in xfns.c. */)
+ (Lisp_Object terminal)
+{
+#ifdef ANDROID_STUBIFY
+ error ("Android cross-compilation stub called!");
+ return Qnil;
+#else
+ check_android_display_info (terminal);
+ return Vandroid_build_manufacturer;
+#endif
+}
+
+DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
+ doc: /* SKIP: real doc in xfns.c. */)
+ (Lisp_Object terminal)
+{
+#ifdef ANDROID_STUBIFY
+ error ("Android cross-compilation stub called!");
+ return Qnil;
+#else
+ check_android_display_info (terminal);
+ return list3i (android_get_current_api_level (), 0, 0);
+#endif
+}
+
DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens,
0, 1, 0, doc: /* SKIP: real doc in xfns.c. */)
(Lisp_Object terminal)
defsubr (&Sx_hide_tip);
defsubr (&Sandroid_detect_mouse);
defsubr (&Sandroid_toggle_on_screen_keyboard);
+ defsubr (&Sx_server_vendor);
+ defsubr (&Sx_server_version);
#ifndef ANDROID_STUBIFY
defsubr (&Sandroid_query_battery);
\f
-/* Set Vandroid_build_fingerprint to a reasonable value. */
+/* Set Vandroid_build_fingerprint to a reasonable value, and also
+ Vandroid_build_manufacturer. */
static void
android_set_build_fingerprint (void)
Vandroid_build_fingerprint = build_string_from_utf8 (data);
(*android_java_env)->ReleaseStringUTFChars (android_java_env,
string, data);
+
+ /* Now obtain Build.MANUFACTURER. */
+
+ ANDROID_DELETE_LOCAL_REF (string);
+ string = NULL;
+
+ field = (*android_java_env)->GetStaticFieldID (android_java_env,
+ class,
+ "MANUFACTURER",
+ "Ljava/lang/String;");
+ (*android_java_env)->ExceptionClear (android_java_env);
+
+ if (!field)
+ goto fail;
+
+ string
+ = (*android_java_env)->GetStaticObjectField (android_java_env,
+ class, field);
+ (*android_java_env)->ExceptionClear (android_java_env);
+
+ if (!string)
+ goto fail;
+
+ data = (*android_java_env)->GetStringUTFChars (android_java_env,
+ string, NULL);
+ (*android_java_env)->ExceptionClear (android_java_env);
+
+ if (!data)
+ goto fail;
+
+ Vandroid_build_manufacturer = build_string_from_utf8 (data);
+ (*android_java_env)->ReleaseStringUTFChars (android_java_env,
+ string, data);
}
if (string)
ANDROID_DELETE_LOCAL_REF (class);
Vandroid_build_fingerprint = Qnil;
+ Vandroid_build_manufacturer = Qnil;
#endif
}
Emacs is running on. */);
Vandroid_build_fingerprint = Qnil;
+ DEFVAR_LISP ("android-build-manufacturer", Vandroid_build_manufacturer,
+ doc: /* Name of the developer of the running version of Android. */);
+ Vandroid_build_manufacturer = Qnil;
+
/* Only defined so loadup.el loads scroll-bar.el. */
DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
doc: /* SKIP: real doc in xterm.c. */);
The optional argument TERMINAL specifies which display to ask about.
For GNU and Unix systems, this queries the X server software.
+For Android systems, value is the manufacturer who developed the Android
+system that is being used.
For MS Windows and Nextstep the result is hard-coded.
TERMINAL should be a terminal object, a frame or a display name (a string).
release number. For MS Windows, the 3 numbers report the OS major and
minor version and build number. For Nextstep, the first 2 numbers are
hard-coded and the 3rd represents the OS version. For Haiku, all 3
-numbers are hard-coded.
+numbers are hard-coded. For Android, the first number represents the
+Android API level, and the next two numbers are all zero.
See also the function `x-server-vendor'.