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
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 (Encrypted Client Hello) की सुविधा चालू की गई
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 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 client sends an ECH extension with randomized contents (a mechanism called ECH GREASE). See RFC 9849 for more details on how ECH GREASE works.
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,
"enabled" or "disabled") on a global or per-domain basis.
For more information, see the Encrypted Client Hello documentation.
Android 17 को टारगेट करने वाले ऐप्लिकेशन के लिए, लोकल नेटवर्क की अनुमति ज़रूरी है
Android 17 में, ACCESS_LOCAL_NETWORK रनटाइम अनुमति
की सुविधा जोड़ी गई है. इससे, उपयोगकर्ताओं को लोकल नेटवर्क के अनधिकृत ऐक्सेस से बचाया जा सकता है. यह अनुमति, NEARBY_DEVICES अनुमति वाले मौजूदा ग्रुप में शामिल है. इसलिए, जिन उपयोगकर्ताओं ने पहले ही NEARBY_DEVICES की अन्य अनुमतियां दी हैं उन्हें फिर से अनुमति देने के लिए नहीं कहा जाएगा. इस नई ज़रूरत के तहत, नुकसान पहुंचाने वाले ऐप्लिकेशन को लोकल नेटवर्क के अनचाहे ऐक्सेस का गलत इस्तेमाल करके, उपयोगकर्ताओं को ट्रैक करने और उनकी पहचान चुराने से रोका जा सकता है. इस अनुमति के बारे में जानकारी देकर और इसके लिए अनुरोध करके, आपका ऐप्लिकेशन लोकल एरिया नेटवर्क (एलएएन) पर मौजूद डिवाइसों को खोज सकता है और उनसे कनेक्ट हो सकता है. जैसे, स्मार्ट होम डिवाइस या कास्टिंग रिसीवर.
Android 17 (एपीआई लेवल 37) या इसके बाद के वर्शन को टारगेट करने वाले ऐप्लिकेशन के पास, एलएएन डिवाइसों से संपर्क बनाए रखने के दो तरीके हैं: अनुमति के लिए प्रॉम्प्ट को स्किप करने के लिए, सिस्टम-मीडिएटेड और निजता बनाए रखने वाले डिवाइस पिकर का इस्तेमाल करें या लोकल नेटवर्क पर संपर्क बनाए रखने के लिए, रनटाइम में इस नई अनुमति के लिए साफ़ तौर पर अनुरोध करें.
ज़्यादा जानकारी के लिए, लोकल नेटवर्क की अनुमति से जुड़ा दस्तावेज़ देखें.
फ़िज़िकल डिवाइसों से पासवर्ड छिपाना
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.
एसएमएस के सामान्य मैसेज के लिए, ओटीपी से सुरक्षा की सुविधा
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 को डिफ़ॉल्ट रूप से चालू करना
अगर कोई ऐप्लिकेशन, Android 17 (एपीआई लेवल 37) या इसके बाद के वर्शन को टारगेट करता है, तो सर्टिफ़िकेट ट्रांसपैरेंसी (सीटी) डिफ़ॉल्ट रूप से चालू होती है. (Android 16 पर, सीटी उपलब्ध है, लेकिन ऐप्लिकेशन को ऑप्ट इन करना होगा.)
Native DCL—C को ज़्यादा सुरक्षित बनाना
अगर आपका ऐप्लिकेशन, Android 17 (एपीआई लेवल 37) या उसके बाद के वर्शन को टारगेट करता है, तो Android 14 में DEX और JAR फ़ाइलों के लिए, सुरक्षित डाइनैमिक कोड लोडिंग (डीसीएल) की सुविधा अब नेटिव लाइब्रेरी के लिए भी उपलब्ध है.
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.
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 से, ऑडियो फ़्रेमवर्क, बैकग्राउंड में ऑडियो से जुड़े इंटरैक्शन पर पाबंदियां लागू करता है. इनमें ऑडियो चलाने, ऑडियो फ़ोकस के अनुरोध, और वॉल्यूम में बदलाव करने वाले एपीआई शामिल हैं. ऐसा इसलिए किया जाता है, ताकि यह पक्का किया जा सके कि ये बदलाव उपयोगकर्ता ने जान-बूझकर किए हों.
सभी ऐप्लिकेशन पर, ऑडियो से जुड़ी कुछ पाबंदियां लागू होती हैं. हालांकि, अगर कोई ऐप्लिकेशन Android 17 (एपीआई लेवल 37) को टारगेट करता है, तो उस पर ज़्यादा सख्त पाबंदियां लागू होती हैं. अगर इनमें से कोई ऐप्लिकेशन बैकग्राउंड में ऑडियो से इंटरैक्ट करता है, तो उसके लिए फ़ोरग्राउंड सेवा चालू होनी चाहिए. इसके अलावा, ऐप्लिकेशन को इनमें से एक या दोनों शर्तें पूरी करनी होंगी:
- फ़ोरग्राउंड सेवा में, 'इस्तेमाल के समय अनुमति दें' (डब्ल्यूआईयू) की सुविधाएं होनी चाहिए.
- ऐप्लिकेशन के पास अलार्म की सटीक अनुमति होनी चाहिए और वह
USAGE_ALARMऑडियो स्ट्रीम से इंटरैक्ट कर रहा हो.
डिवाइसों के नाप या आकार
Android 17 में, डिवाइसों के अलग-अलग साइज़ और नाप या आकार के हिसाब से, लोगों के अनुभव को बेहतर बनाने के लिए ये बदलाव किए गए हैं.
बड़े स्क्रीन वाले डिवाइसों (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 में, ब्लूटूथ RFCOMM सॉकेट के लिए, स्टैंडर्ड Java InputStream के बर्ताव के मुताबिक, एक जैसा अनुभव देने के लिए यह बदलाव किया गया है.
RFCOMM के लिए, BluetoothSocket read() का एक जैसा बर्ताव
Android 17 (एपीआई लेवल 37) को टारगेट करने वाले ऐप्लिकेशन के लिए, InputStream से मिले
RFCOMM पर आधारित BluetoothSocket का
read() तरीका अब सॉकेट बंद होने या कनेक्शन ड्रॉप होने पर -1 दिखाता है.
इस बदलाव से, RFCOMM सॉकेट का व्यवहार LE CoC सॉकेट के जैसा हो जाता है. साथ ही, यह InputStream.read()
दस्तावेज़ के मुताबिक होता है. इसमें बताया गया है कि स्ट्रीम के खत्म होने पर -1 दिखता है.
जो ऐप्लिकेशन, रीड लूप से बाहर निकलने के लिए सिर्फ़ IOException को पकड़ने पर निर्भर होते हैं उन पर इस बदलाव का असर पड़ सकता है. इसलिए, उन्हें BluetoothSocket के रीड लूप को अपडेट करना चाहिए, ताकि -1 की रिटर्न वैल्यू की साफ़ तौर पर जांच की जा सके. इससे यह पक्का होता है कि रिमोट डिवाइस के डिसकनेक्ट होने या सॉकेट के बंद होने पर, लूप सही तरीके से खत्म हो जाए. सुझाई गई प्रोसेस के उदाहरण के लिए, ब्लूटूथ से डेटा ट्रांसफ़र करने की गाइड में दिया गया कोड स्निपेट देखें.