בדומה לגרסאות קודמות, 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.
שדות סופיים סטטיים לא ניתנים לשינוי
在以 Android 17(API 级别 37)或更高版本为目标平台的 Android 17 或更高版本上运行的应用无法更改 static final 字段。如果应用尝试使用反射更改 static final 字段,则会导致 IllegalAccessException。尝试通过 JNI API(例如 SetStaticLongField())修改其中一个字段会导致应用崩溃。
נגישות
ב-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
InputConnectioncan retrieve candidate selection data by callingTextAttribute.isTextSuggestionSelected(). These apps should then callAccessibilityEvent.setTextChangeTypes()when dispatchingTYPE_VIEW_TEXT_CHANGEDevents. Apps targeting Android 17 (API level 37) that use the standardTextViewwill have this feature enabled by default. (That is,TextViewwill 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_CHANGEDevents can callAccessibilityEvent.getTextChangeTypes()to identify the nature of the modification and adjust their feedback strategies accordingly.
פרטיות
Android 17 כוללת את השינויים הבאים לשיפור הפרטיות של המשתמשים.
ההגדרה ECH (הצפנת Client Hello) מופעלת
Android 17 引入了对加密客户端问候 (ECH) 的平台支持。ECH 是一种 TLS 扩展,可通过加密 TLS 握手中的服务器名称指示 (SNI) 来增强用户隐私保护。这种加密有助于防止网络观察者轻松识别您的应用所连接的特定网域。
对于以 Android 17(API 级别 37)或更高版本为目标平台的应用,ECH 用于 TLS 连接。只有当应用使用的网络库(例如 HttpEngine、WebView 或 OkHttp)已集成 ECH 支持,并且远程服务器也支持 ECH 协议时,ECH 才会处于活跃状态。如果无法协商 ECH,客户端会发送一个包含随机内容的 ECH 扩展(一种称为 ECH GREASE 的机制)。如需详细了解 ECH GREASE 的工作原理,请参阅 RFC 9849。
为了让应用能够自定义此行为,Android 17 向网络安全配置文件添加了一个新的
<domainEncryption> 元素。
开发者可以在 <base-config> 或
<domain-config> 标记中使用 <domainEncryption>,以全局或按网域的方式选择 ECH 模式(例如
"enabled" 或 "disabled")。
如需了解详情,请参阅加密客户端问候文档。
נדרשת הרשאה לגישה לרשת המקומית לאפליקציות שמיועדות ל-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 בוצעו השיפורים הבאים באבטחת המכשירים והאפליקציות.
אבטחת פעילות
In Android 17, the platform continues its shift toward a "secure-by-default" architecture, introducing a suite of enhancements designed to mitigate high-severity exploits such as phishing, interaction hijacking, and confused deputy attacks. This update requires developers to explicitly opt in to new security standards to maintain app compatibility and user protection.
Key impacts for developers include:
- BAL hardening & improved opt-in: We are refining Background Activity
Launch (BAL) restrictions by extending protections to
IntentSender. Developers must migrate away from the legacyMODE_BACKGROUND_ACTIVITY_START_ALLOWEDconstant. Instead, you should adopt granular controls likeMODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE, which restricts activity starts to scenarios where the calling app is visible, significantly reducing the attack surface. - Adoption tools: Developers should utilize strict mode and updated lint checks to identify legacy patterns and ensure readiness for future target SDK requirements.
הפעלה של 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
If your app targets Android 17 (API level 37) or higher, the Safer Dynamic Code Loading (DCL) protection introduced in Android 14 for DEX and JAR files now extends to native libraries.
All native files loaded using System.load() must be marked as read-only.
Otherwise, the system throws UnsatisfiedLinkError.
We recommend that apps avoid dynamically loading code whenever possible, as doing so greatly increases the risk that an app can be compromised by code injection or code tampering.
הגבלת שדות של פרטים אישיים מזהים בתצוגת הנתונים של 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 כולל את השינויים הבאים בהתנהגות של מדיה.
חיזוק האבטחה של אודיו ברקע
החל מ-Android 17, מסגרת האודיו אוכפת הגבלות על אינטראקציות עם אודיו ברקע, כולל הפעלת אודיו, בקשות להרשאת אודיו וממשקי API לשינוי עוצמת הקול, כדי לוודא שהמשתמש יתחיל את השינויים האלה באופן מכוון.
הגבלות מסוימות על אודיו חלות על כל האפליקציות. עם זאת, ההגבלות מחמירות יותר אם האפליקציה מטרגטת ל-Android 17 (רמת API 37). אם אחת מהאפליקציות האלה מבצעת אינטראקציה עם אודיו כשהיא פועלת ברקע, צריך להפעיל שירות בחזית. בנוסף, האפליקציה צריכה לעמוד באחת מהדרישות הבאות (או בשתיהן):
- לשירות שפועל בחזית צריכות להיות יכולות של while-in-use (WIU).
- לאפליקציה צריכה להיות הרשאת התראה מדויקת והיא צריכה להיות באינטראקציה עם זרמי אודיו של
USAGE_ALARM.
מידע נוסף, כולל אסטרטגיות להפחתת הסיכון, זמין במאמר בנושא הקשחה של אודיו ברקע.
גורמי צורה של מכשירים
Android 17 כוללת את השינויים הבאים לשיפור חוויית המשתמש במגוון גדלים וסוגים של מכשירים.
שינויים ב-API של הפלטפורמה שגורמים להתעלמות מהגבלות על כיוון, שינוי גודל ויחס גובה-רוחב במסכים גדולים (sw>=600dp)
我们在 Android 16 中引入了平台 API 变更,以 忽略屏幕方向、 宽高比和尺寸调整能力限制(针对大型屏幕,sw >= 600dp),适用于面向 API 级别 36 或更高级别的应用。开发者可以选择使用 SDK 36 退出这些变更,但对于面向 Android 17(API 级别 37)或更高级别的应用,此退出选项将不再可用。
如需了解详情,请参阅忽略屏幕方向和尺寸调整能力限制。
קישוריות
ב-Android 17 בוצע השינוי הבא כדי לשפר את העקביות ולהתאים להתנהגות הרגילה של Java InputStream עבור שקעי RFCOMM ב-Bluetooth.
התנהגות עקבית של read() ב-BluetoothSocket עבור RFCOMM
对于以 Android 17(API 级别 37)为目标平台的应用,
read() 方法从InputStream 获取的
基于 RFCOMM 的 BluetoothSocket 现在会在
套接字关闭或连接断开时返回 -1。
此更改使 RFCOMM 套接字行为与 LE CoC 套接字保持一致,并与标准 InputStream.read()
文档保持一致,该文档指出,当到达流的末尾时,系统会返回 -1。
仅依赖于捕获 IOException 以跳出读取循环的应用可能会受到此更改的影响,并且应更新 BluetoothSocket 读取循环以明确检查返回值 -1。这可确保在远程设备断开连接或套接字关闭时,循环正确终止。如需查看推荐的实现示例,请参阅传输蓝牙数据指南中的代码段。