Merge tag 'android-15.0.0_r6' of https://android.googlesource.com/platform/packages/inputmethods/LatinIME into HEAD
Android 15.0.0 Release 6 (AP4A.241205.013)
Change-Id: I640527e5a6d68b9fc7e72c714c7eaec28693c73e
# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZ1IssgAKCRDorT+BmrEO
# eM80AKCQkF3gcDZYHY0rpm3J4cQnkdEl3ACePQg3fh/m6daGIsN3l7sAAmDQRQA=
# =qN3k
# -----END PGP SIGNATURE-----
# gpg: Signature faite le jeu 05 déc 2024 17:44:02 EST
# gpg: avec la clef DSA 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Impossible de vérifier la signature : Pas de clef publique
diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
index fe988ac..5ab55bc 100644
--- a/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
+++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
@@ -229,8 +229,14 @@
final long now = System.currentTimeMillis();
final long alarmTime = now + new Random().nextInt(MAX_ALARM_DELAY_MILLIS);
final Intent updateIntent = new Intent(DictionaryPackConstants.UPDATE_NOW_INTENT_ACTION);
+ // Set the package name to ensure the PendingIntent is only delivered to trusted components
+ updateIntent.setPackage(context.getPackageName());
+ int pendingIntentFlags = PendingIntent.FLAG_CANCEL_CURRENT;
+ if (android.os.Build.VERSION.SDK_INT >= 23) {
+ pendingIntentFlags |= PendingIntent.FLAG_IMMUTABLE;
+ }
final PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,
- updateIntent, PendingIntent.FLAG_CANCEL_CURRENT);
+ updateIntent, pendingIntentFlags);
// We set the alarm in the type that doesn't forcefully wake the device
// from sleep, but fires the next time the device actually wakes for any
diff --git a/native/dicttoolkit/Android.bp b/native/dicttoolkit/Android.bp
index 6560d65..4ae250f 100644
--- a/native/dicttoolkit/Android.bp
+++ b/native/dicttoolkit/Android.bp
@@ -24,7 +24,6 @@
cc_defaults {
name: "dicttoolkit_defaults",
- cpp_std: "gnu++17",
cflags: [
"-Werror",
"-Wall",
diff --git a/native/dicttoolkit/tests/utils/utf8_utils_test.cpp b/native/dicttoolkit/tests/utils/utf8_utils_test.cpp
index 9c59a8b..18fa2f4 100644
--- a/native/dicttoolkit/tests/utils/utf8_utils_test.cpp
+++ b/native/dicttoolkit/tests/utils/utf8_utils_test.cpp
@@ -40,7 +40,7 @@
EXPECT_EQ('t', codePoints[3]);
}
{
- const std::vector<int> codePoints = Utf8Utils::getCodePoints(u8"\u3042a\u03C2\u0410");
+ const std::vector<int> codePoints = Utf8Utils::getCodePoints("\u3042a\u03C2\u0410");
EXPECT_EQ(4u, codePoints.size());
EXPECT_EQ(0x3042, codePoints[0]); // HIRAGANA LETTER A
EXPECT_EQ('a', codePoints[1]);
@@ -48,7 +48,7 @@
EXPECT_EQ(0x0410, codePoints[3]); // GREEK SMALL LETTER FINAL SIGMA
}
{
- const std::vector<int> codePoints = Utf8Utils::getCodePoints(u8"\U0001F36A?\U0001F752");
+ const std::vector<int> codePoints = Utf8Utils::getCodePoints("\U0001F36A?\U0001F752");
EXPECT_EQ(3u, codePoints.size());
EXPECT_EQ(0x1F36A, codePoints[0]); // COOKIE
EXPECT_EQ('?', codePoints[1]);
@@ -75,7 +75,7 @@
0x1F36A /* COOKIE */,
0x1F752 /* ALCHEMICAL SYMBOL FOR STARRED TRIDENT */
};
- EXPECT_EQ(u8"\u00E0\u03C2\u0430\u3042\U0001F36A\U0001F752",
+ EXPECT_EQ("\u00E0\u03C2\u0430\u3042\U0001F36A\U0001F752",
Utf8Utils::getUtf8String(CodePointArrayView(codePoints)));
}
}