हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
ड्राइविंग सेशन के बीच हॉटस्पॉट बनाए रखना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस पेज पर, ड्राइविंग सेशन के बीच हॉटस्पॉट बनाए रखने के लिए, उपयोगकर्ताओं को सेट अप करने का तरीका बताया गया है. यह तरीका, AAOS में ड्राइविंग के दौरान वाई-फ़ाई इस्तेमाल करने के अनुभव जैसा ही है.
public class CarSettings {
...
@SystemApi
public static final class Global {
...
/**
* Enables persistent tethering when set to {@code "true"}.
*
* <p>When enabled, tethering is started when the car is started given
* that the hotspot was enabled at shutdown and all tethering sessions
* will remain on even if no devices are connected to it.
*
* <p>When disabled, hotspot will turn off automatically if no devices
* are connected and will no longer persist through drives.
*
* @hide
*/
@SystemApi
public static final String ENABLE_PERSISTENT_TETHERING =
"android.car.ENABLE_PERSISTENT_TETHERING";
}
}
ENABLE_PERSISTENT_TETHERING
को कनेक्ट रखने के लिए, Settings API का इस्तेमाल करें. इस एपीआई का इस्तेमाल क्वेरी करने के लिए भी किया जा सकता है.
अनुमतियां
CarWifiManager API के इस्तेमाल पर पाबंदी है. यह नई अनुमति, ऐक्सेस को सुरक्षित रखने के लिए बनाई गई है.
public boolean canControlPersistApSettings() { ... }
इस अनुमति के लिए सुरक्षा के लेवल ये हैं:
नई अनुमति |
अनुमति |
सुरक्षा का लेवल |
हां |
READ_PERSIST_TETHERING_SETTINGS |
हस्ताक्षर | खास सुविधाएं |
डिफ़ॉल्ट रूप से, डेटा सेव करने का तरीका काम नहीं करता पर सेट होता है. रिसॉर्स ओवरले (config_enablePersistTetheringCapabilities
) को कॉन्फ़िगर किया गया है, ताकि टिथरिंग की सुविधा को बंद किया जा सके. अगर आपको जान-बूझकर टेदरिंग की सुविधा चालू रखनी है, तो वैल्यू को true
पर सेट करें. इससे, उपयोगकर्ता की प्राथमिकता के ऑप्ट-इन के ऊपर, यह सुविधा चालू हो जाएगी. ऐसा इसलिए, क्योंकि WRITE_SECURE_SETTINGS
अनुमति वाले अन्य सिस्टम ऐप्लिकेशन भी इस सेटिंग को कंट्रोल कर सकते हैं.
यहां दिया गया एपीआई यह तय करता है कि यह सुविधा चालू है या नहीं. ENABLE_PERSISTENT_TETHERING
को बदलने से पहले, इस एपीआई को कॉल करें.
/**
* CarWifiManager provides API to allow for applications to perform Wi-Fi specific
* operations.
*
* @hide
*/
@SystemApi
public final class CarWifiManager extends CarManagerBase {
/**
* Returns {@code true} if the persist tethering settings are able to be
* changed.
*
* @hide
*/
@SystemApi
@RequiresPermission(Car.PERMISSION_READ_PERSIST_TETHERING_SETTINGS)
public boolean canControlPersistApSettings() { ... }
}
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-06-26 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-06-26 (UTC) को अपडेट किया गया."],[],[],null,["# Maintain hotspots between driving sessions\n\nThis page describes how you can set up users to maintain hotspots between\ndriving sessions, similar to the Wi-Fi driving experience in AAOS. \n\n public class CarSettings {\n ...\n\n @SystemApi\n public static final class Global {\n ...\n\n /**\n * Enables persistent tethering when set to {@code \"true\"}.\n *\n * \u003cp\u003eWhen enabled, tethering is started when the car is started given\n * that the hotspot was enabled at shutdown and all tethering sessions\n * will remain on even if no devices are connected to it.\n *\n * \u003cp\u003eWhen disabled, hotspot will turn off automatically if no devices\n * are connected and will no longer persist through drives.\n *\n * @hide\n */\n @SystemApi\n public static final String ENABLE_PERSISTENT_TETHERING =\n \"android.car.ENABLE_PERSISTENT_TETHERING\";\n }\n }\n\nTo persist tethering, use `ENABLE_PERSISTENT_TETHERING` through the\n[Settings API](https://developer.android.com/reference/android/provider/Settings.Global#public-methods),\nwhich can also be used to query.\n\n### Permissions\n\nUse of the CarWifiManager API is restricted. This new permission is created to\nguard access. \n\n public boolean canControlPersistApSettings() { ... }\n\nProtection levels for this permission are:\n\n| New permission | Permission | Protection level |\n|----------------|-----------------------------------|-------------------------|\n| Yes | `READ_PERSIST_TETHERING_SETTINGS` | Signature \\| Privileged |\n\nThe persist behavior defaults to *not supported.* A resource overlay\n([`config_enablePersistTetheringCapabilities`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/services/Car/service/res/values/config.xml;l=644)) is configured to block the\nability to persist tethering. To intentionally persist tethering, set the\nvalue to `true` to enable the feature on top of the user preference\nopt-in since other system apps with the `WRITE_SECURE_SETTINGS` permission can\nalso control this setting.\n\nThe following API determines if the behavior is enabled. Call this API before\nyou change `ENABLE_PERSISTENT_TETHERING`. \n\n /**\n * CarWifiManager provides API to allow for applications to perform Wi-Fi specific\n * operations.\n *\n * @hide\n */\n @SystemApi\n public final class CarWifiManager extends CarManagerBase {\n /**\n * Returns {@code true} if the persist tethering settings are able to be\n * changed.\n *\n * @hide\n */\n @SystemApi\n @RequiresPermission(Car.PERMISSION_READ_PERSIST_TETHERING_SETTINGS)\n public boolean canControlPersistApSettings() { ... }\n }"]]