]> git.eshelyaron.com Git - emacs.git/commitdiff
Make --with-shared-user-id work
authorPo Lu <luangruo@yahoo.com>
Fri, 14 Jul 2023 12:30:30 +0000 (20:30 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 14 Jul 2023 12:30:30 +0000 (20:30 +0800)
* 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
java/AndroidManifest.xml.in
java/res/values/strings.xml

index 86abf54911e33e27207d1ba1d97fc34aefab4fde..5e5c6a88323eec84b6417bb9ec8f76f23df3deff 100644 (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
index e79fb4e46e7c5c12ce957c8d71e1c92d6df9dd6c..3aae2032fffc784839203264723949282bb6d9ee 100644 (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"
index 36a47be6c84d06ec4ad6a2d056f67f8f5f000bb7..8a11cb007ee2806d76ff44e6718aed41e2c96285 100644 (file)
@@ -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>