เช่นเดียวกับรุ่นก่อนๆ Android 17 มีการเปลี่ยนแปลงลักษณะการทำงานที่อาจส่งผลต่อแอปของคุณ การเปลี่ยนแปลงลักษณะการทำงานต่อไปนี้จะมีผลกับแอปที่กำหนดเป้าหมายเป็น Android 17 ขึ้นไปเท่านั้น หากแอปกำหนดเป้าหมายเป็น Android 17 ขึ้นไป คุณควรแก้ไขแอปให้รองรับลักษณะการทำงานเหล่านี้ในกรณีที่เกี่ยวข้อง
นอกจากนี้ โปรดตรวจสอบรายการการเปลี่ยนแปลงลักษณะการทำงานที่ส่งผลต่อแอปทั้งหมด
ที่ทำงานบน Android 17 ไม่ว่า targetSdkVersion ของแอปจะเป็นอย่างไร
ฟังก์ชันหลัก
Android 17 มีการเปลี่ยนแปลงต่อไปนี้ซึ่งแก้ไขหรือขยายความสามารถหลักต่างๆ ของระบบ Android
การใช้งาน MessageQueue แบบใหม่ที่ไม่มีการล็อก
ตั้งแต่ Android 17 เป็นต้นไป แอปที่กำหนดเป้าหมายเป็น Android 17 (ระดับ API 37)
ขึ้นไปจะได้รับการติดตั้งใช้งานแบบใหม่ที่ไม่ต้องล็อกของ
android.os.MessageQueue การติดตั้งใช้งานใหม่นี้ช่วยปรับปรุงประสิทธิภาพและ
ลดเฟรมที่พลาดไป แต่ก็อาจทำให้ไคลเอ็นต์ที่ใช้ฟิลด์และเมธอดส่วนตัวMessageQueue
ใช้งานไม่ได้
ดูข้อมูลเพิ่มเติม รวมถึงกลยุทธ์การลดผลกระทบได้ที่คำแนะนำเกี่ยวกับการเปลี่ยนแปลงลักษณะการทำงานของ MessageQueue
ตอนนี้ฟิลด์สุดท้ายแบบคงที่แก้ไขไม่ได้แล้ว
แอปที่ทำงานบน Android 17 ขึ้นไปซึ่งกำหนดเป้าหมายเป็น
Android 17 (ระดับ API 37) ขึ้นไปจะเปลี่ยนฟิลด์ static final ไม่ได้ หาก
แอปพยายามเปลี่ยนฟิลด์ static final โดยใช้การสะท้อน จะทำให้เกิด IllegalAccessException การพยายามแก้ไขฟิลด์ใดฟิลด์หนึ่งเหล่านี้
ผ่าน JNI API (เช่น SetStaticLongField()) จะทําให้แอปขัดข้อง
การช่วยเหลือพิเศษ
Android 17 มีการเปลี่ยนแปลงต่อไปนี้เพื่อปรับปรุงการช่วยเหลือพิเศษ
การรองรับการช่วยเหลือพิเศษสำหรับการพิมพ์ด้วยแป้นพิมพ์จริงของ IME ที่ซับซ้อน
ฟีเจอร์นี้จะเปิดตัว API AccessibilityEvent และ TextAttribute ใหม่เพื่อปรับปรุงการอธิบายและอ่านออกเสียงของโปรแกรมอ่านหน้าจอสำหรับการป้อนข้อมูลภาษา CJKV ตอนนี้แอป CJKV IME สามารถส่งสัญญาณได้ว่ามีการเลือกข้อความที่แนะนำให้แปลงหรือไม่ในระหว่างการเขียนข้อความ แอปที่มีช่องแก้ไขสามารถระบุประเภทการเปลี่ยนแปลงข้อความเมื่อ
ส่งเหตุการณ์การช่วยเหลือพิเศษที่ข้อความมีการเปลี่ยนแปลง
เช่น แอปสามารถระบุว่าการเปลี่ยนแปลงข้อความเกิดขึ้นระหว่างการเขียนข้อความ หรือการเปลี่ยนแปลงข้อความเกิดจากการคอมมิต
การดำเนินการนี้จะช่วยให้บริการการช่วยเหลือพิเศษ เช่น โปรแกรมอ่านหน้าจอ ให้ความคิดเห็นที่แม่นยำยิ่งขึ้นตามลักษณะของการแก้ไขข้อความ
การรับแอปไปใช้งาน
แอป IME: เมื่อตั้งค่าการเขียนข้อความในช่องแก้ไข IME จะใช้
TextAttribute.Builder.setTextSuggestionSelected()เพื่อระบุว่ามีการเลือก ตัวเลือก Conversion ที่เฉพาะเจาะจงหรือไม่แอปที่มีช่องแก้ไข: แอปที่ดูแลรักษา
InputConnectionที่กำหนดเองจะ เรียกข้อมูลการเลือกผู้สมัครได้โดยการเรียกใช้TextAttribute.isTextSuggestionSelected()จากนั้นแอปเหล่านี้ควรเรียกใช้AccessibilityEvent.setTextChangeTypes()เมื่อส่งTYPE_VIEW_TEXT_CHANGEDเหตุการณ์ แอปที่กำหนดเป้าหมายเป็น Android 17 (API ระดับ 37) ซึ่งใช้TextViewมาตรฐานจะเปิดใช้ฟีเจอร์นี้โดยค่าเริ่มต้น (กล่าวคือTextViewจะจัดการการดึงข้อมูลจาก IME และการตั้งค่าประเภทการเปลี่ยนแปลงข้อความเมื่อส่งเหตุการณ์ไปยังบริการการช่วยเหลือพิเศษ)บริการช่วยเหลือพิเศษ: บริการช่วยเหลือพิเศษที่ประมวลผลเหตุการณ์
TYPE_VIEW_TEXT_CHANGEDสามารถเรียกใช้AccessibilityEvent.getTextChangeTypes()เพื่อระบุลักษณะของการแก้ไขและปรับกลยุทธ์ความคิดเห็นตามนั้น
ความเป็นส่วนตัว
Android 17 มีการเปลี่ยนแปลงต่อไปนี้เพื่อปรับปรุงความเป็นส่วนตัวของผู้ใช้
เปิดใช้ ECH (ClientHello ที่เข้ารหัส) โดยขึ้นอยู่กับโอกาส
Android 17 introduces platform support for Encrypted Client Hello (ECH), a TLS extension that enhances user privacy by encrypting the Server Name Indication (SNI) in the TLS handshake. This encryption helps prevent network observers from easily identifying the specific domain your app is connecting to.
For apps targeting Android 17 (API level 37) or higher, ECH is opportunistically used for TLS connections. ECH is active only if the networking library used by the app (for example, HttpEngine, WebView, or OkHttp) has integrated ECH support and the remote server also supports the ECH protocol. If ECH cannot be negotiated, the connection automatically falls back to a standard TLS handshake without SNI encryption.
To allow apps to customize this behavior, Android 17 adds a new
<domainEncryption> element to the Network Security Configuration file.
Developers can use <domainEncryption> within <base-config> or
<domain-config> tags to select an ECH mode (for example,
"opportunistic", "enabled", or "disabled") on a global or per-domain
basis.
For more information, see the Encrypted Client Hello documentation.
ต้องมีสิทธิ์เข้าถึงเครือข่ายภายในสำหรับแอปที่กำหนดเป้าหมายเป็น 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.
ซ่อนรหัสผ่านจากอุปกรณ์จริง
หากแอปกำหนดเป้าหมายเป็น Android 17 (ระดับ API 37) ขึ้นไปและผู้ใช้ใช้อุปกรณ์ป้อนข้อมูลจริง (เช่น แป้นพิมพ์ภายนอก) ระบบปฏิบัติการ Android จะใช้การตั้งค่า show_passwords_physical ใหม่กับอักขระทั้งหมดในช่องรหัสผ่าน โดยค่าเริ่มต้น การตั้งค่าดังกล่าวจะซ่อนอักขระรหัสผ่านทั้งหมด
ระบบ Android จะแสดงอักขระรหัสผ่านที่พิมพ์ล่าสุดเพื่อช่วยให้ผู้ใช้เห็นว่าพิมพ์รหัสผ่านผิดหรือไม่ อย่างไรก็ตาม ฟีเจอร์นี้มีความจำเป็นน้อยลงมากเมื่อใช้แป้นพิมพ์ภายนอกขนาดใหญ่ นอกจากนี้ อุปกรณ์ที่มีแป้นพิมพ์ภายนอกมักจะมีจอแสดงผลขนาดใหญ่ ซึ่งเพิ่มความเสี่ยงที่ผู้อื่นจะเห็นรหัสผ่านที่พิมพ์
หากผู้ใช้ใช้หน้าจอสัมผัสของอุปกรณ์ ระบบจะใช้การตั้งค่า show_passwords_touch ใหม่
ความปลอดภัย
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 โดยค่าเริ่มต้น
หากแอปกำหนดเป้าหมายเป็น Android 17 (API ระดับ 37) ขึ้นไป ระบบจะเปิดใช้ ความโปร่งใสของใบรับรอง (CT) โดยค่าเริ่มต้น (ใน Android 16 CT จะพร้อมใช้งาน แต่แอปต้องเลือกใช้)
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.
รูปแบบของอุปกรณ์
Android 17 มีการเปลี่ยนแปลงต่อไปนี้เพื่อปรับปรุงประสบการณ์ของผู้ใช้ ในอุปกรณ์ขนาดและรูปแบบต่างๆ
การเปลี่ยนแปลง API ของแพลตฟอร์มเพื่อไม่สนใจข้อจำกัดด้านการวางแนว ความสามารถในการปรับขนาด และสัดส่วนภาพบนหน้าจอขนาดใหญ่ (sw>=600dp)
เราได้เปิดตัวการเปลี่ยนแปลง Platform API ใน Android 16 เพื่อไม่สนใจข้อจำกัดด้านการวางแนว สัดส่วนภาพ และความสามารถในการปรับขนาดบนหน้าจอขนาดใหญ่ (sw >= 600dp) สำหรับแอปที่กำหนดเป้าหมายเป็น API ระดับ 36 ขึ้นไป นักพัฒนาแอปมีตัวเลือกในการเลือกไม่ใช้การเปลี่ยนแปลงเหล่านี้ ด้วย SDK 36 แต่ตัวเลือกการเลือกไม่ใช้นี้จะไม่มีให้บริการอีกต่อไป สำหรับแอปที่กำหนดเป้าหมายเป็น Android 17 (ระดับ API 37) ขึ้นไป
ดูข้อมูลเพิ่มเติมได้ที่ระบบจะเพิกเฉยต่อข้อจำกัดเกี่ยวกับ การวางแนวและการปรับขนาด