تغييرات السلوك: جميع التطبيقات

يتضمّن نظام Android 15 الأساسي تغييرات في السلوك قد تؤثر في تطبيقك. تنطبق التغييرات التالية في السلوك على جميع التطبيقات التي تعمل بنظام التشغيل Android 15: بغض النظر عن targetSdkVersion. يجب اختبار تطبيقك ثم تعديله حسب الحاجة لدعمها بشكل صحيح، حيثما ينطبق ذلك.

تأكد أيضًا من مراجعة قائمة تغييرات السلوك التي تؤثر في التطبيقات فقط التي تستهدف الإصدار 15 من نظام التشغيل Android

الوظيفة الأساسية

يعمل Android 15 على تعديل الإمكانات الأساسية المتنوعة لنظام Android أو توسيعها.

التغييرات على حالة توقُّف الطرد

软件包 FLAG_STOPPED 状态(用户可以通过长按应用图标并选择“强行停止”来参与 AOSP build)一直是为了让应用保持此状态,直到用户通过直接启动应用或间接与应用互动(通过 Sharesheet 或 widget、选择应用作为动态壁纸等)将应用从此状态明确移除。在 Android 15 中,我们将更新系统的行为,以符合这一预期行为。只能通过用户直接或间接操作将应用从停止状态中移除。

为了支持预期行为,除了现有限制之外,当应用在搭载 Android 15 的设备上进入停止状态时,系统还会取消所有待处理 intent。当用户的操作将应用从停止状态中移除时,系统会向应用传递 ACTION_BOOT_COMPLETED 广播,让用户有机会重新注册任何待处理的 intent。

您可以调用新的 ApplicationStartInfo.wasForceStopped() 方法来确认应用是否已置于停止状态。

دعم أحجام الصفحات التي تبلغ 16 كيلوبايت

سابقًا، كان نظام Android لا يدعم سوى أحجام صفحات الذاكرة التي تبلغ 4 كيلوبايت، والتي تحتوي على لتحسين أداء ذاكرة النظام للحصول على متوسط إجمالي الذاكرة التي كان لديهم عادةً أجهزة Android. بدءًا من نظام التشغيل Android 15، يتوافق "بروتوكول AOSP" مع الأجهزة التي تم إعدادها لاستخدام حجم صفحة يبلغ 16 كيلوبايت (16 كيلوبايت) الأجهزة). إذا كان تطبيقك يستخدم أي مكتبات NDK، سواء بشكل مباشر أو بشكل غير مباشر من خلال إحدى حِزم SDK، ستحتاج إلى إعادة إنشاء التطبيق يعمل على هذه الأجهزة التي يبلغ حجمها 16 كيلوبايت.

مع استمرار الشركات المصنّعة للأجهزة في تصميم أجهزة تحتوي على كميات أكبر من ذاكرة فعلية (RAM)، ستعتمد العديد من هذه الأجهزة على سعة 16 كيلوبايت ( أكبر في النهاية) لتحسين أداء الجهاز. جارٍ الإضافة بالنسبة إلى الأجهزة التي حجمها 16 كيلوبايت، يمكن تشغيل تطبيقك على هذه الأجهزة وتساعد تطبيقك على الاستفادة من الأداء المرتبط التحسينات. قد لا تعمل التطبيقات على الأجهزة التي يبلغ حجمها 16 كيلوبايت بدون إعادة التجميع. عند إنتاجها في إصدارات Android المستقبلية.

ولمساعدتك على توفير الدعم لتطبيقك، قدّمنا إرشادات حول كيفية التحقق من إذا تأثّر تطبيقك إعادة إنشاء تطبيقك (إن أمكن)، وكيفية اختبار تطبيقك في بيئة بحجم 16 كيلوبايت باستخدام أدوات المحاكاة (بما في ذلك Android 15) صور النظام لمحاكي Android).

الفوائد والمكاسب في الأداء

إنّ الأجهزة التي تم ضبطها بأحجام صفحات تبلغ 16 كيلوبايت تستخدِم ذاكرة أكبر قليلاً في المتوسط، ولكنّها تحصل أيضًا على تحسينات أداء متنوعة لكل من النظام والتطبيقات:

  • أوقات أقل لتشغيل التطبيقات أثناء تعرّض النظام لضغط الذاكرة: انخفاض بنسبة 3.16% في المتوسط، مع تحسينات أكثر أهمية (تصل إلى 30%) لبعض التطبيقات التي اختبرناها
  • استهلاك مخفض للطاقة أثناء تشغيل التطبيق: خفض بنسبة 4.56% في المتوسط
  • تشغيل أسرع للكاميرا: عند بدء تشغيل الجهاز باستخدام درجة حرارة أعلى بنسبة 4.48% في المتوسط، والتشغيل على البارد بسرعة أكبر بنسبة 6.60% في المتوسط
  • وقت تشغيل النظام المحسَّن: محسَّن بنسبة 1.5% (حوالي 0.8 ثانية) في المتوسط

تستند هذه التحسينات إلى اختبارنا الأولي، ومن المحتمل أن تختلف النتائج على الأجهزة الفعلية. سنقدم تحليلاً إضافيًا للمكاسب المحتملة للتطبيقات بينما نواصل اختبارنا.

التحقّق ممّا إذا كان تطبيقك متأثرًا بهذا التغيير

إذا كان تطبيقك يستخدم أي رموز برمجية أصلية، يجب عليك إعادة إنشاء تطبيقك مع دعم الأجهزة التي بحجم 16 كيلوبايت. إذا لم تكن متأكدًا مما إذا كان تطبيقك يستخدم رمزًا برمجيًا أصليًا، يمكنك استخدام أداة تحليل APK لتحديد ما إذا كان هناك أي رمز أصلي أم لا.

إذا كان تطبيقك لا يستخدم إلا رمزًا برمجيًا مكتوبًا بلغة برمجة Java أو بلغة Kotlin، بما في ذلك جميع المكتبات أو حِزم SDK، يعني ذلك أنّ تطبيقك سيكون متوافقًا مع الأجهزة التي يبلغ حجمها 16 كيلوبايت. ومع ذلك، ننصحك باختبار تطبيقك في بيئة بحجم 16 كيلوبايت للتأكّد من عدم حدوث تراجعات غير متوقّعة في سلوك التطبيق.

تغييرات مطلوبة في بعض التطبيقات لإتاحة المساحة الخاصة

Private space is a new feature in Android 15 that lets users create a separate space on their device where they can keep sensitive apps away from prying eyes, under an additional layer of authentication. Because apps in the private space have restricted visibility, some types of apps need to take additional steps to be able to see and interact with apps in a user's private space.

All apps

Because apps in the private space are kept in a separate user profile, similar to work profiles, apps shouldn't assume that any installed copies of their app that aren't in the main profile are in the work profile. If your app has logic related to work profile apps that make this assumption, you'll need to adjust this logic.

Medical apps

When a user locks the private space, all apps in the private space are stopped, and those apps can't perform foreground or background activities, including showing notifications. This behavior might critically impact the use and function of medical apps installed in the private space.

The private space setup experience warns users that the private space is not suitable for apps that need to perform critical foreground or background activities, such as showing notifications from medical apps. However, apps can't determine whether or not they're being used in the private space, so they can't show a warning to the user for this case.

For these reasons, if you develop a medical app, review how this feature might impact your app and take appropriate actions—such as informing your users not to install your app in the private space—to avoid disrupting critical app capabilities.

Launcher apps

If you develop a launcher app, you must do the following before apps in the private space will be visible:

  1. Your app must be assigned as the default launcher app for the device—that is, possessing the ROLE_HOME role.
  2. Your app must declare the ACCESS_HIDDEN_PROFILES normal permission in your app's manifest file.

Launcher apps that declare the ACCESS_HIDDEN_PROFILES permission must handle the following private space use cases:

  1. Your app must have a separate launcher container for apps installed in the private space. Use the getLauncherUserInfo() method to determine which type of user profile is being handled.
  2. The user must be able to hide and show the private space container.
  3. The user must be able to lock and unlock the private space container. Use the requestQuietModeEnabled() method to lock (by passing true) or unlock (by passing false) the private space.
  4. While locked, no apps in the private space container should be visible or discoverable through mechanisms such as search. Your app should register a receiver for the ACTION_PROFILE_AVAILABLE and ACTION_PROFILE_UNAVAILABLE broadcasts and update the UI in your app when the locked or unlocked state of the private space container changes. Both of these broadcasts include EXTRA_USER, which your app can use to refer to the private profile user.

    You can also use the isQuietModeEnabled() method to check whether the private space profile is locked or not.

App store apps

The private space includes an "Install Apps" button that launches an implicit intent to install apps into the user's private space. In order for your app to receive this implicit intent, declare an <intent-filter> in your app's manifest file with a <category> of CATEGORY_APP_MARKET.

تمت إزالة خط الرمز التعبيري المستند إلى PNG

基于 PNG 的旧版表情符号字体文件 (NotoColorEmojiLegacy.ttf) 已 只留下基于矢量的文件从 Android 13 (API) 开始 级别 33),系统表情符号渲染程序使用的表情符号字体文件已从 PNG 文件转换为矢量文件。系统保留了 Android 13 和 14 中的旧版字体文件。 具有自己的字体渲染程序的应用可以继续使用旧版字体文件 直到能够升级为止

要查看您的应用是否会受到影响,请在应用的代码中搜索对 NotoColorEmojiLegacy.ttf 文件。

您可以选择以多种方式调整您的应用:

  • 使用平台 API 进行文本渲染。您可以将文本渲染为基于位图的 Canvas,并在必要时使用它获取原始图像。
  • 向您的应用添加 COLRv1 字体支持。FreeType 开源库 在版本 2.13.0 中支持 COLRv1,并且 。
  • 万不得已时,可以将旧版表情符号字体文件打包 (NotoColorEmoji.ttf) 复制到您的 APK 中, 但在这种情况下,您的应用将缺少最新的表情符号更新。对于 请参阅 Noto 表情符号 GitHub 项目 页面

تمت زيادة الحد الأدنى لإصدار حزمة تطوير البرامج (SDK) المستهدَف من 23 إلى 24

Android 15 builds on the the changes that were made in Android 14 and extends this security further. In Android 15, apps with a targetSdkVersion lower than 24 can't be installed. Requiring apps to meet modern API levels helps to ensure better security and privacy.

Malware often targets lower API levels in order to bypass security and privacy protections that have been introduced in higher Android versions. For example, some malware apps use a targetSdkVersion of 22 to avoid being subjected to the runtime permission model introduced in 2015 by Android 6.0 Marshmallow (API level 23). This Android 15 change makes it harder for malware to avoid security and privacy improvements. Attempting to install an app targeting a lower API level results in an installation failure, with a message like the following one appearing in Logcat:

INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 24, but found 7

On devices upgrading to Android 15, any apps with a targetSdkVersion lower than 24 remain installed.

If you need to test an app targeting an older API level, use the following ADB command:

adb install --bypass-low-target-sdk-block FILENAME.apk

الكاميرا والوسائط

يجري نظام Android 15 التغييرات التالية على سلوك الكاميرا والوسائط لجميع المستخدمين. التطبيقات.

يؤدي الآن تشغيل الصوت المباشر أو غير القابل للتنزيل إلى إلغاء صلاحية المقاطع الصوتية التي سبق فتحها بشكل مباشر أو غير معدَّل عند بلوغ الحدّ الأقصى لاستخدام الموارد.

قبل استخدام نظام التشغيل Android 15، إذا طلب أحد التطبيقات تشغيل الصوت مباشرةً أو إلغاء التحميل أثناء تشغيل الصوت في تطبيق آخر وتم بلوغ الحدّ الأقصى المسموح به للموارد، سيتعذّر على التطبيق فتح AudioTrack جديد.

بدءًا من نظام التشغيل Android 15، عندما يطلب أحد التطبيقات التشغيل المباشر أو الإزالة وبلغ الحد الأقصى للموارد، يلغي النظام صلاحية أي عناصر AudioTrack مفتوحة حاليًا، ما يمنع تنفيذ طلب قناة الإصدار الجديد.

(عادةً ما يتم فتح المقاطع الصوتية المباشرة وتلك غير المستخدمة لتشغيل تنسيقات الصوت المضغوطة. تشمل حالات الاستخدام الشائعة لتشغيل الصوت المباشر بث الصوت المشفر عبر HDMI إلى التلفزيون. تُستخدم مسارات التفريغ عادةً لتشغيل صوت مضغوط على جهاز جوّال مزوَّد بتسريع نظام معالجة البيانات (DSP) للأجهزة).

تجربة المستخدم وواجهة مستخدم النظام

يتضمن Android 15 بعض التغييرات التي تهدف إلى إنشاء صورة تجربة المستخدم السهلة.

ميزة "الصور المتحركة القائمة على التوقّعات" مفعَّلة للتطبيقات التي تم تفعيلها

从 Android 15 开始,移除了预测性返回动画的开发者选项。现在,对于已完全或在 activity 级别选择启用预测性返回手势的应用,系统现在会显示“返回主屏幕”“跨任务”和“跨 activity”等系统动画。如果您的应用受到影响,请执行以下操作:

  • 确保您的应用已正确迁移,以使用预测性返回手势。
  • 确保您的 fragment 转换支持预测性返回导航。
  • 停止使用动画和框架转换,并改用 Animator 和 AndroidX 转换。
  • FragmentManager 不知道的返回堆栈中迁出。请改用由 FragmentManager 或 Navigation 组件管理的返回堆栈。

يتم إيقاف التطبيقات المصغّرة عندما يفرض المستخدم إيقافًا لأحد التطبيقات

如果用户在搭载 Android 15 的设备上强行停止某个应用,系统会暂时停用该应用的所有 widget。这些 widget 会灰显,用户无法与它们互动。这是因为,从 Android 15 开始,当应用被强行停止时,系统会取消应用的所有待处理 intent。

系统会在用户下次启动应用时重新启用这些 widget。

如需了解详情,请参阅对软件包停止状态的更改

عمليات الإيقاف نهائيًا

مع كل إصدار، قد تصبح واجهات برمجة تطبيقات Android معيَّنة قديمة أو يجب أن تكون إعادة تصميمه لتوفير تجربة أفضل للمطوّرين أو دعم نظام أساسي جديد والإمكانات. في هذه الحالات، سنوقف نهائيًا واجهات برمجة التطبيقات القديمة توجيه المطورين إلى واجهات برمجة تطبيقات بديلة لاستخدامها بدلاً من ذلك.

يعني الإيقاف أننا أنهينا الدعم الرسمي لواجهات برمجة التطبيقات، ولكن سيتم ستظل متاحة للمطورين. لمعرفة المزيد عن الجوانب البارزة في هذا الإصدار من نظام التشغيل Android، يمكنك الاطّلاع على صفحة عمليات الإيقاف النهائي.