החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
הנחיות בנושא הסחת דעת הנהג (DD)
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כשאפליקציות Android Automotive פועלות בהתאם להנחיות בנושא הסחת דעת של נהגים שמפורטות בהמשך, הן יכולות לפעול במכשיר HU כשהרכב בתנועה. DDG מורכב מהמלצות בסיסיות של Google שנועדו לצמצם את הסחות הדעת של הנהגים.
אפליקציות שעומדות בהנחיות בנושא הסחת דעת של נהגים יכולות להיות מתויגות בתווית עם כמה שפחות הסחות דעת. בדף הזה מוסבר איך צריך לתייג אפליקציות כ'אופטימיזציה להפחתת הסחות דעת' כדי שפלטפורמת Android תוכל לאפשר להן לפעול במצב 'חוויית המשתמש מוגבלת'. מידע נוסף על:
אפליקציות עם כמה שפחות הסחות דעת
אפליקציה יכולה לתייג פעילות מסוימת כפעילות שמותאמת למצב 'ללא הסחות דעת'. כדי שאפשר יהיה להגדיר אפליקציה שלמה כ'אופטימיזציה למניעת הסחות דעת', כל הפעילויות שלה צריכות לעמוד בהנחיות בנושא הסחות דעת לנהגים. כשמצב הנהיגה של רכב משתנה למצב שבו ההגבלות על חוויית המשתמש פעילות:
- הפעילות הנוכחית בחזית יכולה להמשיך לפעול רק אם היא מתויגת כ'אופטימיזציה להסחת דעת' במניפסט.
- כשמפעילים פעילות חדשה, הפעילות החדשה מותרת רק אם היא מסומנת במניפסט בתור 'אופטימיזציה להפחתת הסחות דעת'.
הפלטפורמה אחראית לבדוק את המניפסט ולאפשר רק פעילויות שמותאמות למניעת הסחות דעת לפעול במצב מוגבל.
הערה: הפלטפורמה לא יכולה לזהות או לאכוף את הציות בפועל של האפליקציה להגבלות. היא יכולה רק לבדוק את ההצהרה של האפליקציה במניפסט. תהליך הבדיקה ב-Google Play מחייב עמידה בהנחיות האלה בנושא הסחות דעת לנהגים.
לא כל הפעילויות באפליקציה צריכות לעבור אופטימיזציה להפחתת הסחות הדעת. אפליקציה יכולה לספק חוויית משתמש שונה במצב ללא הגבלות (למשל, כשהרכב חונה) לעומת מצב עם הגבלות חמורות יותר. כתוצאה מכך, אפשר לתייג פעילות ספציפית באפליקציה כדי לבצע אופטימיזציה להפחתת הסחות דעת. לשם כך, מוסיפים את המטא-נתונים הבאים לרכיב <activity>
בקובץ AndroidManifest.xml
של האפליקציה:
<activity android:name=".DistractionOptimizedMainActivity"....>
....
<meta-data android:name="distractionOptimized" android:value="true"/>
</activity>
אפליקציות שמציעות פעילויות שנועדו לפעול במצב מוגבל חייבות להצהיר על המידע הזה במניפסט. הפלטפורמה בוחנת רק את המידע המוצהר לפני שהיא קובעת אם ניתן לאפשר להפעיל את הפעילות (או לא) במצב המוגבל.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון 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-07-27 (שעון UTC)."],[],[],null,["# Driver Distraction Guidelines\n\nWhen Android Automotive apps follow the *Driver Distraction Guidelines* described\nbelow, the apps can run on the HU when a vehicle is moving. DDG consists of baseline\nrecommendations provided by Google and are intended to reduce driver distraction.\n\nApps that meet the Driver Distraction Guidelines can be tagged as\n*Distraction Optimized* . This page details how apps *must* be tagged\nas Distraction Optimized so that the Android platform can enable the apps to run in the User\nExperience Restricted state. To learn more about:\n\n- Car user experience restrictions, see [Car User Experience\n Restrictions](/docs/automotive/driver_distraction/car_uxr).\n- Using car driving state, see [Consuming Car Driving State and\n UX Restrictions](/docs/automotive/driver_distraction/consume).\n\nDistraction Optimized apps\n--------------------------\n\nAn app can tag a specific activity to be Distraction Optimized. For an entire app to\nbe designated as Distraction Optimized, all its activities must adhere to the driver distraction\nguidelines. When the driving state of a vehicle changes to a state in which the UX restrictions are\nactive:\n\n- Current foreground activity can continue to run only when it is tagged as Distraction Optimized in the manifest.\n- When launching a new activity, the new activity is permitted only when it is tagged as Distraction Optimized in the manifest.\n\nThe platform is responsible for checking the manifest and allowing only Distraction Optimized\nactivities to run in a restricted state.\n\n**Note:** The platform can't detect or enforce an app's actual\nadherence to the restrictions; it can only check an app's declaration in the manifest. Adherence to\nthese driver distraction guidelines is enforced during the Google Play review process.\n\nNot all app activities need be Distraction Optimized. An app can provide\ndifferent user experiences for an unrestricted state (for example, when the vehicle is parked)\nversus a more restricted state. As a result, an app can tag a specific activity to be\nDistraction Optimized by adding the following metadata to the `\u003cactivity\u003e` element\nin the `AndroidManifest.xml` file for the app: \n\n```\n\u003cactivity android:name=\".DistractionOptimizedMainActivity\"....\u003e\n....\n\u003cmeta-data android:name=\"distractionOptimized\" android:value=\"true\"/\u003e\n\u003c/activity\u003e\n```\n\nApps that offer activities designed to run in a restricted state must declare that information in\nthe manifest. The platform looks only at the declared information before determining if the activity\ncan be permitted to run (or not) in the restricted state."]]