שינויים בהתנהגות: אפליקציות שמטרגטות את Android מגרסה 17 ואילך

בדומה לגרסאות קודמות, Android 17 כולל שינויים בהתנהגות שעשויים להשפיע על האפליקציה שלכם. שינויי ההתנהגות הבאים רלוונטיים רק לאפליקציות שמטרגטות את Android 17 ואילך. אם האפליקציה שלכם מטרגטת את Android מגרסה 17 ואילך, אתם צריכים לשנות את האפליקציה כדי שהיא תתמוך בהתנהגויות האלה, במקרים הרלוונטיים.

חשוב גם לבדוק את רשימת השינויים בהתנהגות שמשפיעים על כל האפליקציות שפועלות ב-Android 17, בלי קשר ל-targetSdkVersion של האפליקציה.

פונקציונליות עיקרית

‫Android 17 כוללת את השינויים הבאים, שמשנים או מרחיבים יכולות ליבה שונות של מערכת Android.

הטמעה חדשה של MessageQueue שלא דורשת נעילה

Beginning with Android 17, apps targeting Android 17 (API level 37) or higher receive a new lock-free implementation of android.os.MessageQueue. The new implementation improves performance and reduces missed frames, but may break clients that reflect on MessageQueue private fields and methods.

For more information, including mitigation strategies, see MessageQueue behavior change guidance.

שדות סופיים סטטיים לא ניתנים לשינוי

Apps running on Android 17 or higher that target Android 17 (API level 37) or higher cannot change static final fields. If an app attempts to change a static final field by using reflection, it will cause an IllegalAccessException. Attempting to modify one of these fields through JNI APIs (such as SetStaticLongField()) will cause the app to crash.

נגישות

ב-Android 17 בוצעו השינויים הבאים כדי לשפר את הנגישות.

תמיכה בנגישות של הקלדה במקלדת פיזית ב-IME מורכב

This feature introduces new AccessibilityEvent and TextAttribute APIs to enhance screen reader spoken feedback for CJKV language input. CJKV IME apps can now signal whether a text conversion candidate has been selected during text composition. Apps with edit fields can specify text change types when sending text changed accessibility events. For example, apps can specify that a text change occurred during text composition, or that a text change resulted from a commit. Doing this enables accessibility services such as screen readers to deliver more precise feedback based on the nature of the text modification.

App adoption

  • IME Apps: When setting composing text in edit fields, IMEs can use TextAttribute.Builder.setTextSuggestionSelected() to indicate whether a specific conversion candidate was selected.

  • Apps with Edit Fields: Apps that maintain a custom InputConnection can retrieve candidate selection data by calling TextAttribute.isTextSuggestionSelected(). These apps should then call AccessibilityEvent.setTextChangeTypes() when dispatching TYPE_VIEW_TEXT_CHANGED events. Apps targeting Android 17 (API level 37) that use the standard TextView will have this feature enabled by default. (That is, TextView will handle retrieving data from the IME and setting text change types when sending events to accessibility services).

  • Accessibility Services: Accessibility services that process TYPE_VIEW_TEXT_CHANGED events can call AccessibilityEvent.getTextChangeTypes() to identify the nature of the modification and adjust their feedback strategies accordingly.

פרטיות

‫Android 17 כוללת את השינויים הבאים לשיפור הפרטיות של המשתמשים.

ההגדרה ECH (הצפנת Client Hello) מופעלת

ב-Android 17 נוספה תמיכה בפלטפורמה בהצפנת ClientHello‏ (ECH), תוסף ל-TLS (אבטחת שכבת התעבורה) שמשפר את פרטיות המשתמשים על ידי הצפנת חיווי שם השרת (SNI) בלחיצת היד של TLS. ההצפנה הזו עוזרת למנוע מצופים ברשת לזהות בקלות את הדומיין הספציפי שאליו האפליקציה מתחברת.

באפליקציות שמטרגטות ל-Android 17 (רמת API 37) ומעלה, נעשה שימוש ב-ECH לחיבורי TLS. ה-ECH פעיל רק אם ספריית הרשת שבה נעשה שימוש באפליקציה (לדוגמה, HttpEngine, ‏ WebView או OkHttp) כוללת תמיכה משולבת ב-ECH, וגם השרת המרוחק תומך בפרוטוקול ECH. אם אי אפשר להגיע להסכמה על ECH, הלקוח שולח תוסף ECH עם תוכן אקראי (מנגנון שנקרא ECH GREASE). מידע נוסף על אופן הפעולה של ECH GREASE זמין ב-RFC 9849.

כדי לאפשר לאפליקציות להתאים אישית את ההתנהגות הזו, ב-Android 17 נוסף רכיב <domainEncryption> חדש לקובץ הגדרות אבטחת הרשת. מפתחים יכולים להשתמש בתג <domainEncryption> בתוך התגים <base-config> או <domain-config> כדי לבחור מצב ECH (לדוגמה, "enabled" או "disabled") באופן גלובלי או לכל דומיין.

מידע נוסף זמין במאמר בנושא הצפנה של Client Hello.

נדרשת הרשאה לגישה לרשת המקומית לאפליקציות שמיועדות ל-Android 17

Android 17 introduces the ACCESS_LOCAL_NETWORK runtime permission to protect users from unauthorized local network access. Because this falls under the existing NEARBY_DEVICES permission group, users who have already granted other NEARBY_DEVICES permissions aren't prompted again. This new requirement prevents malicious apps from exploiting unrestricted local network access for covert user tracking and fingerprinting. By declaring and requesting this permission, your app can discover and connect to devices on the local area network (LAN), such as smart home devices or casting receivers.

Apps targeting Android 17 (API level 37) or higher now have two paths to maintain communication with LAN devices: Adopt system-mediated, privacy-preserving device pickers to skip the permission prompt, or explicitly request this new permission at runtime to maintain local network communication.

For more information, see the Local network permission documentation.

הסתרת סיסמאות ממכשירים פיזיים

If an app targets Android 17 (API level 37) or higher and the user is using a physical input device (for example, an external keyboard), the Android operating system applies the new show_passwords_physical setting to all characters in the password field. By default, that setting hides all password characters.

The Android system shows the last-typed password character to help the user see if they mistyped the password. However, this is much less necessary with larger external keyboards. In addition, devices with external keyboards often have larger displays, which increases the danger of someone seeing the typed password.

If the user is using the device's touchscreen, the system applies the new show_passwords_touch setting.

הגנה על OTP בהודעות SMS רגילות

Beginning with Android 17, Android is extending its SMS OTP protection to apply to standard SMS messages (SMS messages containing an OTP that do not use the WebOTP or SMS Retriever formats). For most apps targeting Android 17 (API level 37) or higher, these SMS messages do not become available until three hours after receipt. This delay is intended to help prevent OTP hijacking. During this three hour delay, the SMS_RECEIVED_ACTION broadcast is withheld and SMS provider database queries are filtered. The SMS message is available to these apps after the delay.

Certain apps such as the default SMS assistant app, connected device companion apps, etc., are exempted from this delay. All apps that rely on reading SMS messages for OTP extraction should transition to using SMS Retriever or SMS User Consent APIs to ensure continued functionality.

אבטחה

ב-Android 17 בוצעו השיפורים הבאים באבטחת המכשירים והאפליקציות.

אבטחת פעילות

ב-Android 17, הפלטפורמה ממשיכה את המעבר לארכיטקטורה של 'אבטחה כברירת מחדל', ומציגה חבילה של שיפורים שנועדו לצמצם את הסיכון לניצול לרעה של פרצות חמורות כמו פישינג, חטיפת אינטראקציות ומתקפות confused deputy. בעקבות העדכון הזה, המפתחים נדרשים להביע הסכמה מפורשת לתקני אבטחה חדשים כדי לשמור על תאימות האפליקציה ועל הגנת המשתמשים.

ההשפעות העיקריות על מפתחים כוללות:

  • הגברת האבטחה של BAL ושיפור ההסכמה להצטרפות: אנחנו משפרים את ההגבלות על הפעלה של פעילות ברקע (BAL) על ידי הרחבת ההגנה ל-IntentSender. המפתחים צריכים להפסיק להשתמש בקבוע MODE_BACKGROUND_ACTIVITY_START_ALLOWED מדור קודם. במקום זאת, מומלץ להשתמש באמצעי בקרה מפורטים כמו MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE, שמגביל את הפעלת הפעילות לתרחישים שבהם האפליקציה המתקשרת גלויה, וכך מצמצם באופן משמעותי את שטח הפנים של המתקפה.
  • כלים להטמעה: מפתחים צריכים להשתמש במצב קפדני ובבדיקות lint מעודכנות כדי לזהות דפוסים מדור קודם ולהבטיח מוכנות לדרישות עתידיות של SDK לטירגוט.

הפעלה של CT כברירת מחדל

If an app targets Android 17 (API level 37) or higher, certificate transparency (CT) is enabled by default. (On Android 16, CT is available but apps had to opt in.)

‫DCL מקורי מאובטח יותר – C

אם האפליקציה מטרגטת ל-Android 17 (רמת API 37) או לגרסה מתקדמת יותר, ההגנה על טעינה דינמית (DCL) של קוד, שהוצגה ב-Android 14 לקובצי DEX ו-JAR, חלה עכשיו גם על ספריות Native.

כל הקבצים המקוריים שנטענו באמצעות System.load() צריכים להיות מסומנים כקריאה בלבד. אחרת, המערכת תציג את השגיאה UnsatisfiedLinkError.

מומלץ להימנע ככל האפשר מטעינה דינמית של קוד באפליקציות, כי פעולה כזו מגדילה מאוד את הסיכון שאפליקציה תיפרץ על ידי הזרקת קוד או שינוי קוד.

הגבלת שדות של פרטים אישיים מזהים בתצוגת הנתונים של CP2

For apps targeting Android 17 (API level Android 17 (API level 37)) and higher, Contacts Provider 2 (CP2) restricts certain columns containing Personally Identifiable Information (PII) from the data view. When this change is enabled, these columns are removed from the data view to enhance user privacy. The restricted columns include:

Apps that are using these columns from ContactsContract.Data can extract them from ContactsContract.RawContacts instead, by joining with RAW_CONTACT_ID.

אכיפה של בדיקות SQL מחמירות ב-CP2

For apps targeting Android 17 (API level Android 17 (API level 37)) and higher, Contacts Provider 2 (CP2) enforces strict SQL query validation when the ContactsContract.Data table is accessed without READ_CONTACTS permission.

With this change, if an app doesn't have READ_CONTACTS permission, StrictColumns and StrictGrammar options are set when querying the ContactsContract.Data table. If a query uses a pattern that isn't compatible with these, it will be rejected and cause an exception to be thrown.

מדיה

‫Android 17 כולל את השינויים הבאים בהתנהגות של מדיה.

חיזוק האבטחה של אודיו ברקע

Beginning with Android 17, the audio framework enforces restrictions on background audio interactions including audio playback, audio focus requests, and volume change APIs to ensure that these changes are started intentionally by the user.

Some audio restrictions apply to all apps. However, the restrictions are more stringent if an app targets Android 17 (API level 37). If one of these apps interacts with audio while it is in the background, it must have a foreground service running. In addition, the app must meet one or both of these requirements:

  • The foreground service must have while-in-use (WIU) capabilities.
  • The app must have the exact alarm permission and be interacting with USAGE_ALARM audio streams.

For more information, including mitigation strategies, see Background audio hardening.

גורמי צורה של מכשירים

‫Android 17 כוללת את השינויים הבאים לשיפור חוויית המשתמש במגוון גדלים וסוגים של מכשירים.

שינויים ב-API של הפלטפורמה שגורמים להתעלמות מהגבלות על כיוון, שינוי גודל ויחס גובה-רוחב במסכים גדולים (sw>=600dp)

We introduced Platform API changes in Android 16 to ignore orientation, aspect ratio, and resizability restrictions on large screens (sw >= 600dp) for apps targeting API level 36 or higher. Developers have the option to opt out of these changes with SDK 36, but this opt-out will no longer be available for apps that target Android 17 (API level 37) or higher.

For more information, see Restrictions on orientation and resizability are ignored.

קישוריות

ב-Android 17 בוצע השינוי הבא כדי לשפר את העקביות ולהתאים להתנהגות הרגילה של Java InputStream עבור שקעי RFCOMM ב-Bluetooth.

התנהגות עקבית של read() ב-BluetoothSocket עבור RFCOMM

For apps targeting Android 17 (API level 37), the read() method of the InputStream obtained from an RFCOMM-based BluetoothSocket now returns -1 when the socket is closed or the connection is dropped.

This change makes RFCOMM socket behavior consistent with LE CoC sockets and aligns with the standard InputStream.read() documentation, which states that -1 is returned when the end of the stream is reached.

Apps that rely solely on catching an IOException to break out of a read loop may be impacted by this change and should update the BluetoothSocket read loops to explicitly check for a return value of -1. This ensures the loop terminates correctly when the remote device disconnects or the socket is closed. For an example of the recommended implementation, see the code snippet in the Transfer Bluetooth data guide.