diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 13 | ||||
| -rw-r--r-- | src/android.h | 1 | ||||
| -rw-r--r-- | src/sfntfont-android.c | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/android.c b/src/android.c index 598d002fb1c..57a95bcd4f9 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -5006,6 +5006,19 @@ android_restart_emacs (void) | |||
| 5006 | exit (0); | 5006 | exit (0); |
| 5007 | } | 5007 | } |
| 5008 | 5008 | ||
| 5009 | /* Return a number from 1 to 33 describing the version of Android | ||
| 5010 | Emacs is running on. | ||
| 5011 | |||
| 5012 | This is different from __ANDROID_API__, as that describes the | ||
| 5013 | minimum version of Android this build of Emacs will run on, and in | ||
| 5014 | turn which APIs Emacs can safely use. */ | ||
| 5015 | |||
| 5016 | int | ||
| 5017 | android_get_current_api_level (void) | ||
| 5018 | { | ||
| 5019 | return android_api_level; | ||
| 5020 | } | ||
| 5021 | |||
| 5009 | 5022 | ||
| 5010 | 5023 | ||
| 5011 | #else /* ANDROID_STUBIFY */ | 5024 | #else /* ANDROID_STUBIFY */ |
diff --git a/src/android.h b/src/android.h index 9b2eca807cb..da5c4379800 100644 --- a/src/android.h +++ b/src/android.h | |||
| @@ -90,6 +90,7 @@ extern void android_wait_event (void); | |||
| 90 | extern void android_toggle_on_screen_keyboard (android_window, bool); | 90 | extern void android_toggle_on_screen_keyboard (android_window, bool); |
| 91 | extern void android_window_updated (android_window, unsigned long); | 91 | extern void android_window_updated (android_window, unsigned long); |
| 92 | extern _Noreturn void android_restart_emacs (void); | 92 | extern _Noreturn void android_restart_emacs (void); |
| 93 | extern int android_get_current_api_level (void); | ||
| 93 | 94 | ||
| 94 | 95 | ||
| 95 | 96 | ||
diff --git a/src/sfntfont-android.c b/src/sfntfont-android.c index ab90a2e4ecd..d8f598fd330 100644 --- a/src/sfntfont-android.c +++ b/src/sfntfont-android.c | |||
| @@ -734,8 +734,7 @@ init_sfntfont_android (void) | |||
| 734 | 734 | ||
| 735 | /* Make sure to pick the right Sans Serif font depending on what | 735 | /* Make sure to pick the right Sans Serif font depending on what |
| 736 | version of Android the device is running. */ | 736 | version of Android the device is running. */ |
| 737 | #if HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL | 737 | if (android_get_current_api_level () >= 15) |
| 738 | if (android_get_device_api_level () >= 15) | ||
| 739 | Vsfnt_default_family_alist | 738 | Vsfnt_default_family_alist |
| 740 | = list3 (Fcons (build_string ("Monospace"), | 739 | = list3 (Fcons (build_string ("Monospace"), |
| 741 | build_string ("Droid Sans Mono")), | 740 | build_string ("Droid Sans Mono")), |
| @@ -746,7 +745,6 @@ init_sfntfont_android (void) | |||
| 746 | Fcons (build_string ("Sans Serif"), | 745 | Fcons (build_string ("Sans Serif"), |
| 747 | build_string ("Roboto"))); | 746 | build_string ("Roboto"))); |
| 748 | else | 747 | else |
| 749 | #endif | ||
| 750 | Vsfnt_default_family_alist | 748 | Vsfnt_default_family_alist |
| 751 | = list3 (Fcons (build_string ("Monospace"), | 749 | = list3 (Fcons (build_string ("Monospace"), |
| 752 | build_string ("Droid Sans Mono")), | 750 | build_string ("Droid Sans Mono")), |