Make --with-shared-user-id work

* configure.ac (ANDROID_SHARED_USER_NAME): New variable.
Substitute it.
* java/AndroidManifest.xml.in: Set `sharedUserLabel' if a shared
user ID is enabled.
* java/res/values/strings.xml (shared_user_name): New string
resource.
This commit is contained in:
Po Lu 2023-07-14 20:30:30 +08:00
parent cb4ea3e7fb
commit 11c8a2fa87
3 changed files with 15 additions and 1 deletions

View file

@ -844,6 +844,7 @@ ANDROID_JAR=
ANDROID_ABI=
WARN_JAVAFLAGS=
ANDROID_SHARED_USER_ID=
ANDROID_SHARED_USER_NAME=
# This is a list of Makefiles that have alternative versions for
# Android.
@ -2656,7 +2657,12 @@ for Android, but all API calls need to be stubbed out])
emacs_val=`AS_ECHO(["$with_shared_user_id"]) \
| sed -e 's/"/\\"/'`
emacs_val="\"$emacs_val\""
ANDROID_SHARED_USER_ID="android:sharedUserId=$emacs_val"])],[
ANDROID_SHARED_USER_ID="android:sharedUserId=$emacs_val"
# `android:sharedUserName' is required for sharedUserID to work
# on recent Android releases. It does not otherwise affect the
# behavior of any code.
emacs_val="\"@string/shared_user_name\""
ANDROID_SHARED_USER_NAME="android:sharedUserLabel=$emacs_val"])],[
# Emacs will be built as a shared library, and a wrapper around it
# will also be built for the benefit of applications. This
# requires Emacs be built as a position independent executable.
@ -2698,6 +2704,7 @@ AC_SUBST([ANDROID_LIBS])
AC_SUBST([ANDROID_LDFLAGS])
AC_SUBST([ANDROID_BUILD_CFLAGS])
AC_SUBST([ANDROID_SHARED_USER_ID])
AC_SUBST([ANDROID_SHARED_USER_NAME])
if test "${with_pgtk}" = "yes"; then
window_system=pgtk

View file

@ -75,6 +75,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
android:theme="@style/EmacsStyle"
android:debuggable="@ANDROID_DEBUGGABLE@"
@ANDROID_SHARED_USER_ID@
@ANDROID_SHARED_USER_NAME@
android:extractNativeLibs="true">
<activity android:name="org.gnu.emacs.EmacsActivity"

View file

@ -36,4 +36,10 @@
<string name="erase_dump_caption">
Remove the dumped state created when Emacs was installed.
</string>
<!-- This resource describes the purpose of any `sharedUserId'
specified at configure-time. -->
<string name="shared_user_name">
Emacs shared user
</string>
</resources>