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

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

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

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

يعدّل نظام Android 15 أو يوسّع إمكانات نظام Android الأساسية المختلفة.

التغييرات في حالة الحزمة المتوقفة

The intention of the package FLAG_STOPPED state (which users can engage in AOSP builds by long-pressing an app icon and selecting "Force Stop") has always been to keep apps in this state until the user explicitly removes the app from this state by directly launching the app or indirectly interacting with the app (through the sharesheet or a widget, selecting the app as live wallpaper, etc.). In Android 15, we've updated the behavior of the system to be aligned with this intended behavior. Apps should only be removed from the stopped state through direct or indirect user action.

To support the intended behavior, in addition to the existing restrictions, the system also cancels all pending intents when the app enters the stopped state on a device running Android 15. When the user's actions remove the app from the stopped state, the ACTION_BOOT_COMPLETED broadcast is delivered to the app providing an opportunity to re-register any pending intents.

You can call the new ApplicationStartInfo.wasForceStopped() method to confirm whether the app was put into the stopped state.

إتاحة صفحات بحجم 16 كيلوبايت

Historically, Android has only supported 4 KB memory page sizes, which has optimized system memory performance for the average amount of total memory that Android devices have typically had. Beginning with Android 15, AOSP supports devices that are configured to use a page size of 16 KB (16 KB devices). If your app uses any NDK libraries, either directly or indirectly through an SDK, then you will need to rebuild your app for it to work on these 16 KB devices.

As device manufacturers continue to build devices with larger amounts of physical memory (RAM), many of these devices will adopt 16 KB (and eventually greater) page sizes to optimize the device's performance. Adding support for 16 KB page size devices enables your app to run on these devices and helps your app benefit from the associated performance improvements. Without recompiling, apps might not work on 16 KB devices when they are productionized in future Android releases.

To help you add support for your app, we've provided guidance on how to check if your app is impacted, how to rebuild your app (if applicable), and how to test your app in a 16 KB environment using emulators (including Android 15 system images for the Android Emulator).

Benefits and performance gains

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

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

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

Check if your app is impacted

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

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

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

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 (المستوى 33 من واجهة برمجة التطبيقات)، تغيّر ملف خط الرموز التعبيرية المستخدَم من قِبل أداة عرض الرموز التعبيرية في النظام من ملف يستند إلى PNG إلى ملف يستند إلى شكل مسطّح. احتفظ النظام بملف الخط القديم في Android 13 و14 لأسباب تتعلق بالتوافق، حتى تتمكّن التطبيقات التي تستخدم أدوات عرض الخطوط الخاصة بها من مواصلة استخدام ملف الخط القديم إلى أن تتمكّن من الترقية.

للتحقّق مما إذا كان تطبيقك متأثّرًا، ابحث في رمز تطبيقك عن إشارات إلى ملف NotoColorEmojiLegacy.ttf.

يمكنك اختيار تكييف تطبيقك بعدة طرق:

  • استخدام واجهات برمجة تطبيقات النظام الأساسي لعرض النص يمكنك عرض النص على Canvas مستند مستنِد إلى رسومات نقطية، واستخدامه للحصول على صورة أولية إذا لزم الأمر.
  • أضِف ميزة استخدام خطوط COLRv1 إلى تطبيقك. تتيح مكتبة FreeType المفتوحة المصدر استخدام خطوط COLRv1 في الإصدار 2.13.0 والإصدارات الأحدث.
  • كحل أخير، يمكنك تجميع ملف خط الرموز التعبيرية القديم (NotoColorEmoji.ttf) في حزمة APK، ولكن في هذه الحالة سيفتقد تطبيقك أحدث تعديلات الرموز التعبيرية. للحصول على مزيد من المعلومات، يُرجى الاطّلاع على صفحة مشروع Noto Emoji على GitHub.

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

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

تستهدف البرامج الضارة غالبًا مستويات أقل من واجهة برمجة التطبيقات لتجاوز الأمان والخصوصية .أساليب الحماية المُقدمة في الإصدارات الأعلى من Android. على سبيل المثال: تستخدم بعض التطبيقات الضارة القيمة targetSdkVersion من 22 لتجنُّب تعرُّضها نموذج إذن وقت التشغيل الذي تم تقديمه في عام 2015 من خلال نظام التشغيل Android 6.0 Marshmallow (واجهة برمجة التطبيقات) المستوى 23). من خلال هذا التغيير في Android 15، يصعب على البرامج الضارة تجنُّب تحسينات الأمان والخصوصية. تؤدي محاولة تثبيت تطبيق يستهدف مستوى أقل من واجهة برمجة التطبيقات إلى تعذُّر التثبيت، مع ظهور رسالة مثل الرسالة التالية في Logcat:

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

على الأجهزة التي تتم ترقية نظام التشغيل Android 15 إليه، أي تطبيقات تقلّ قيمتها عن targetSdkVersion يظل أكثر من 24 مثبّتًا.

إذا كنت بحاجة إلى اختبار تطبيق يستهدف مستوى قديمًا لواجهة برمجة التطبيقات، استخدِم الأمر التالي في أداة ADB:

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

الأمان والخصوصية

Android 15 introduces robust measures to combat one-time passcode (OTP) fraud and to protect the user's sensitive content, focusing on hardening the Notification Listener Service and screenshare protections. Key enhancements include redacting OTPs from notifications accessible to untrusted apps, hiding notifications during screenshare, and securing app activities when OTPs are posted. These changes aim to keep the user's sensitive content safe from unauthorized actors.

Developers need to be aware of the following to ensure their apps are compatible with the changes in Android 15:

OTP Redaction

Android will stop untrusted apps that implement a NotificationListenerService from reading unredacted content from notifications where an OTP has been detected. Trusted apps such as companion device manager associations are exempt from these restrictions.

Screenshare Protection

  • Notification content is hidden during screen sharing sessions to preserve the user's privacy. If the app implements setPublicVersion(), Android shows the public version of the notification which serves as a replacement notification in insecure contexts. Otherwise, the notification content is redacted without any further context.
  • Sensitive content like password input is hidden from remote viewers to prevent revealing the user's sensitive information.
  • Activities from apps that post notifications during screenshare where an OTP has been detected will be hidden. App content is hidden from the remote viewer when launched.
  • Beyond Android's automatic identification of sensitive fields, developers can manually mark parts of their app as sensitive using setContentSensitivity, which is hidden from remote viewers during screenshare.
  • Developers can choose to toggle the Disable screen share protections option under Developer Options to be exempted from the screenshare protections for demo or testing purposes. The default system screen recorder is exempted from these changes, since the recordings remain on-device.

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

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

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

Before Android 15, if an app requested direct or offload audio playback while another app was playing audio and the resource limits were reached, the app would fail to open a new AudioTrack.

Beginning with Android 15, when an app requests direct or offload playback and the resource limits are reached, the system invalidates any currently open AudioTrack objects which prevent fulfilling the new track request.

(Direct and offload audio tracks are typically opened for playback of compressed audio formats. Common use-cases for playing direct audio include streaming encoded audio over HDMI to a TV. Offload tracks are typically used to play compressed audio on a mobile device with hardware DSP acceleration.)

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

يتضمّن Android 15 بعض التغييرات التي تهدف إلى توفير تجربة مستخدم أكثر اتساقًا وسهولة.

تفعيل الصور المتحركة لإيماءة الرجوع إلى الخلف التنبؤية في التطبيقات التي فعّلت هذه الميزة

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

  • تأكَّد من نقل بيانات تطبيقك بشكلٍ صحيح لاستخدام لفتة التراجع العميق التوقّعية.
  • تأكَّد من أنّ عمليات انتقال الأجزاء تعمل مع ميزة التنقّل التلقائي للخلف.
  • توقَّف عن استخدام الرسوم المتحركة وتأثيرات الانتقال في إطار العمل واستخدِم رسوم متحركة وتأثيرات انتقال androidx بدلاً من ذلك.
  • نقل البيانات بعيدًا عن الحِزم الخلفية التي لا يعرفها FragmentManager استخدِم بدلاً من ذلك حِزم الخلفية التي تديرها FragmentManager أو مكوّن "التنقّل" .

إيقاف التطبيقات المصغّرة عندما يوقف المستخدم أحد التطبيقات بشكلٍ قسري

If a user force-stops an app on a device running Android 15, the system temporarily disables all the app's widgets. The widgets are grayed out, and the user cannot interact with them. This is because beginning with Android 15, the system cancels all an app's pending intents when the app is force-stopped.

The system re-enables those widgets the next time the user launches the app.

For more information, see Changes to package stopped state.

تُنبّه شريحة شريط حالة عرض الوسائط المستخدمين بشأن مشاركة الشاشة وبث المحتوى وتسجيله.

تؤدي إساءة استخدام ميزة "إلقاء الشاشة" إلى تعريض بيانات المستخدمين الخاصة، مثل معلوماتهم المالية، لأنّ المستخدمين لا يدركون أنّه تتم مشاركة شاشة أجهزتهم.

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

شريحة شريط الحالة لمشاركة الشاشة والبث والتسجيل

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

يتضمّن تطبيقك تلقائيًا شريحة شريط الحالة ويوقف تلقائيًا إرسال الشاشة عند تفعيل شاشة القفل.

للاطّلاع على مزيد من المعلومات عن كيفية اختبار تطبيقك لاستخدامات هذه الحالات، يُرجى الاطّلاع على شريحة "شريط الحالة" والإيقاف التلقائي.

قيود الوصول إلى الشبكة في الخلفية

In Android 15, apps that start a network request outside of a valid process lifecycle receive an exception. Typically, an UnknownHostException or other socket-related IOException. Network requests that happen outside of a valid lifecycle are usually due to apps unknowingly continuing a network request even after the app is no longer active.

To mitigate this exception, ensure your network requests are lifecycle aware and cancelled upon leaving a valid process lifecycle by using lifecycle aware components. If it is important that the network request should happen even when the user leaves the application, consider scheduling the network request using WorkManager or continue a user visible task using Foreground Service.

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

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

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