emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android 11c8a2fa87d: Make --with-shared-user-id work


From: Po Lu
Subject: feature/android 11c8a2fa87d: Make --with-shared-user-id work
Date: Fri, 14 Jul 2023 08:53:16 -0400 (EDT)

branch: feature/android
commit 11c8a2fa87df2b6cc505e670a972552750eab71f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 configure.ac                | 9 ++++++++-
 java/AndroidManifest.xml.in | 1 +
 java/res/values/strings.xml | 6 ++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 86abf54911e..5e5c6a88323 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in
index e79fb4e46e7..3aae2032fff 100644
--- a/java/AndroidManifest.xml.in
+++ b/java/AndroidManifest.xml.in
@@ -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"
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 36a47be6c84..8a11cb007ee 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -36,4 +36,10 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>. -->
   <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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]