تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تمنح الأذونات المتعلقة بالموقع الجغرافي والميكروفون والكاميرا تطبيقك إذن الوصول إلى معلومات حساسة بشكل خاص عن المستخدمين. تتضمّن المنصة آليات متعدّدة، موضّحة في هذه الصفحة، لمساعدة المستخدمين على البقاء على اطّلاع والتحكّم في التطبيقات التي يمكنها الوصول إلى الموقع الجغرافي والميكروفون والكاميرا.
يجب ألا تؤثّر ميزات النظام التي تحافظ على الخصوصية في طريقة تعامل تطبيقك مع الأذونات المتعلقة بالموقع الجغرافي والميكروفون والكاميرا، وذلك طالما أنّك تتّبع أفضل ممارسات الخصوصية.
على وجه الخصوص، احرِص على تنفيذ ما يلي في تطبيقك:
انتظِر إلى أن يمنح المستخدم إذن CAMERA لتطبيقك قبل الوصول إلى كاميرا الجهاز.
يجب الانتظار إلى أن يمنح المستخدم إذن RECORD_AUDIO لتطبيقك قبل الوصول إلى ميكروفون الجهاز.
انتظِر إلى أن يمنح المستخدم تطبيقك إذن ACCESS_COARSE_LOCATION أو إذن ACCESS_FINE_LOCATION قبل طلب إذن ACCESS_BACKGROUND_LOCATION.
لوحة بيانات الخصوصية
الشكل 1. شاشة استخدام الموقع الجغرافي، وهي جزء من "لوحة بيانات الخصوصية"
على الأجهزة المتوافقة التي تعمل بالإصدار 12 من نظام التشغيل Android أو الإصدارات الأحدث، تظهر شاشة "لوحة بيانات الخصوصية" في إعدادات النظام. في هذه الشاشة، يمكن للمستخدمين الوصول إلى شاشات منفصلة تعرض أوقات وصول التطبيقات إلى معلومات الموقع الجغرافي والكاميرا والميكروفون. تعرض كل شاشة مخططًا زمنيًا يوضّح وقت وصول التطبيقات المختلفة إلى نوع معيّن من البيانات. يوضّح الشكل 1 المخطط الزمني للوصول إلى بيانات الموقع الجغرافي.
عرض الأساس المنطقي للوصول إلى البيانات
يمكن لتطبيقك تقديم شرح للمستخدمين لمساعدتهم في فهم سبب وصول تطبيقك إلى معلومات الموقع الجغرافي أو الكاميرا أو الميكروفون. يمكن أن يظهر سبب الاستخدام هذا في شاشة "لوحة بيانات الخصوصية" الجديدة أو شاشة أذونات تطبيقك أو كليهما.
لتوضيح سبب وصول تطبيقك إلى معلومات الموقع الجغرافي والكاميرا والميكروفون،
يُرجى إكمال الخطوات التالية:
أضِف نشاطًا يقدّم، عند بدء تشغيله، بعض الأسباب التي توضّح سبب تنفيذ تطبيقك لنوع معيّن من إجراءات الوصول إلى البيانات. في هذا النشاط، اضبط السمة
android:permission على START_VIEW_PERMISSION_USAGE.
حدِّد ما يجب أن يعرضه نشاط "سبب الوصول إلى البيانات". على سبيل المثال، يمكنك عرض الموقع الإلكتروني لتطبيقك أو مقالة من مركز المساعدة. لتقديم شرح أكثر تفصيلاً حول أنواع البيانات التي يصل إليها تطبيقك، بالإضافة إلى وقت الوصول إليها، عليك التعامل مع البيانات الإضافية التي يتضمّنها النظام عند استدعاء الغرض من استخدام الإذن:
استنادًا إلى فلاتر الأهداف التي تضيفها، يظهر للمستخدمين رمز معلومات
بجانب اسم تطبيقك على شاشات معيّنة:
في حال إضافة فلتر الأهداف الذي يحتوي على VIEW_PERMISSION_USAGE
action، سيظهر للمستخدمين الرمز على صفحة أذونات تطبيقك في إعدادات النظام. يمكنك تطبيق هذا الإجراء على جميع أذونات وقت التشغيل.
في حال إضافة فلتر الأهداف الذي يتضمّن الإجراء VIEW_PERMISSION_USAGE_FOR_PERIOD، سيظهر للمستخدمين الرمز بجانب اسم تطبيقك كلما ظهر تطبيقك في شاشة "لوحة بيانات الخصوصية".
عندما ينقر المستخدمون على هذا الرمز، يبدأ نشاط شرح السبب في تطبيقك.
الشكل 2. مؤشرات استخدام الميكروفون والكاميرا، والتي تعرض
عمليات الوصول الأخيرة إلى البيانات
المؤشرات
على الأجهزة التي تعمل بنظام التشغيل Android 12 أو إصدار أحدث، عندما يصل تطبيق إلى الميكروفون أو الكاميرا، يظهر رمز في شريط الحالة. إذا كان التطبيق في
وضع ملء الشاشة، سيظهر الرمز في
أعلى يسار الشاشة. يمكن للمستخدمين فتح "الإعدادات السريعة" والنقر على الرمز للاطّلاع على التطبيقات التي تستخدم الميكروفون أو الكاميرا حاليًا.
تعرض "الشكل 2" لقطة شاشة مثال تحتوي على الرموز.
تحديد موضع المؤشرات على الشاشة
إذا كان تطبيقك يتيح استخدام وضع العرض الغامر أو واجهة مستخدم بملء الشاشة، قد تتداخل المؤشرات مع واجهة مستخدم تطبيقك لفترة وجيزة. للمساعدة في تعديل واجهة المستخدم لتتلاءم مع هذه المؤشرات، يقدّم النظام الطريقة getPrivacyIndicatorBounds()، كما يوضّح مقتطف الرمز التالي. باستخدام واجهة برمجة التطبيقات هذه، يمكنك تحديد الحدود التي قد تظهر فيها المؤشرات. يمكنك بعد ذلك اختيار تنظيم واجهة المستخدم على شاشتك بشكل مختلف.
Kotlin
view.setOnApplyWindowInsetsListener{view,windowInsets->
valindicatorBounds=windowInsets.getPrivacyIndicatorBounds()// change your UI to avoid overlappingwindowInsets}
مفاتيح التبديل
الشكل 3. أزرار إيقاف الميكروفون والكاميرا وتفعيلهما في
"الإعدادات السريعة"
على الأجهزة المتوافقة التي تعمل بنظام التشغيل Android 12 أو إصدار أحدث، يمكن للمستخدمين تفعيل إذن الوصول إلى الكاميرا والميكروفون أو إيقافهما لجميع التطبيقات على الجهاز من خلال النقر على خيار تبديل واحد. يمكن للمستخدمين الوصول إلى الخيارات التي يمكن تفعيلها أو إيقافها من الإعدادات السريعة، كما هو موضّح في الشكل 3، أو من شاشة "الخصوصية" في إعدادات النظام.
تؤثّر أزرار إيقاف الكاميرا والميكروفون في جميع التطبيقات على الجهاز:
عندما يوقف المستخدم إذن الوصول إلى الكاميرا، يتلقّى تطبيقك خلاصة كاميرا فارغة.
عندما يوقف المستخدم إذن الوصول إلى الكاميرا أو الميكروفون، ثم يشغّل تطبيقًا يحتاج إلى الوصول إلى معلومات الكاميرا أو الميكروفون، يذكّر النظام المستخدم بأنّ خيار الإيقاف على مستوى الجهاز مفعّل.
التحقّق من توافق الجهاز
للتحقّق ممّا إذا كان الجهاز يتيح استخدام مفتاحَي تحكّم في الميكروفون والكاميرا، أضِف المنطق الذي يظهر في مقتطف الرمز التالي:
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-21 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-08-21 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["The permissions related to location, microphone, and camera grant your app\naccess to particularly sensitive information about users. The platform includes\nseveral mechanisms, described on this page, to help users stay informed and in\ncontrol over which apps can access location, microphone, and camera.\n\nThese privacy-preserving system features shouldn't affect how your app handles\nthe permissions related to location, microphone, and camera, as long as you\n[follow privacy best practices](/privacy/best-practices).\n\nIn particular, make sure you do the following in your app:\n\n- Wait to access the device's camera until the user has granted the [`CAMERA`](/reference/android/Manifest.permission#CAMERA) permission to your app.\n- Wait to access the device's microphone until the user has granted the [`RECORD_AUDIO`](/reference/android/Manifest.permission#RECORD_AUDIO) permission to your app.\n- Wait until the user interacts with a feature in your app that requires location before you request the [`ACCESS_COARSE_LOCATION`](/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION) permission or the [`ACCESS_FINE_LOCATION`](/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) permission, as described in the guide on how to [request location\n permissions](/training/location/permissions#request-location-access-runtime).\n- Wait until the user grants your app either the `ACCESS_COARSE_LOCATION` permission or the `ACCESS_FINE_LOCATION` permission before you request the [`ACCESS_BACKGROUND_LOCATION`](/reference/android/Manifest.permission#ACCESS_BACKGROUND_LOCATION) permission.\n\nPrivacy Dashboard \n**Figure 1.** Location usage screen, part of the Privacy Dashboard.\n\nOn supported devices that run Android 12 or higher, a Privacy\nDashboard screen appears in system settings. On this screen, users can access\nseparate screens that show when apps access location, camera, and microphone\ninformation. Each screen shows a timeline of when different apps have accessed a\nparticular type of data. Figure 1 shows the data access timeline for location\ninformation.\n\nShow rationale for data access\n\nYour app can provide a rationale for users to help them understand why your app\naccesses location, camera, or microphone information. This rationale can appear\non the new Privacy Dashboard screen, your app's permissions screen, or both.\n\nTo explain why your app accesses location, camera, and microphone information,\ncomplete the following steps:\n\n1. Add an activity that, when started, provides some rationale for why your app\n performs a particular type of data access action. Within this activity, set the\n [`android:permission`](/guide/topics/manifest/activity-element#prmsn) attribute\n to [`START_VIEW_PERMISSION_USAGE`](/reference/android/Manifest.permission#START_VIEW_PERMISSION_USAGE).\n\n If your app targets Android 12 or higher, you must explicitly\n [define a value for the `android:exported`\n attribute](/about/versions/12/behavior-changes-12#exported).\n2. Add the following intent filter to the newly-added activity:\n\n ```xml\n \u003c!-- android:exported required if you target Android 12. --\u003e\n \u003cactivity android:name=\".DataAccessRationaleActivity\"\n android:permission=\"android.permission.START_VIEW_PERMISSION_USAGE\"\n android:exported=\"true\"\u003e\n \u003c!-- VIEW_PERMISSION_USAGE shows a selectable information icon on\n your app permission's page in system settings.\n VIEW_PERMISSION_USAGE_FOR_PERIOD shows a selectable information\n icon on the Privacy Dashboard screen. --\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.VIEW_PERMISSION_USAGE\" /\u003e\n \u003caction android:name=\"android.intent.action.VIEW_PERMISSION_USAGE_FOR_PERIOD\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n ...\n \u003c/intent-filter\u003e\n \u003c/activity\u003e\n ```\n3. Decide what your data access rationale activity should show. For example, you\n might show your app's website or a help center article. To provide a more\n detailed explanation about the types of data that your app accesses, as well as\n when the access occurred, handle the extras that the system includes when it\n invokes the permission usage intent:\n\n - If the system invokes `ACTION_VIEW_PERMISSION_USAGE`, your app can retrieve a value for [`EXTRA_PERMISSION_GROUP_NAME`](/reference/android/content/Intent#EXTRA_PERMISSION_GROUP_NAME).\n - If the system invokes `ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD`, your app can retrieve values for `EXTRA_PERMISSION_GROUP_NAME`, [`EXTRA_ATTRIBUTION_TAGS`](/reference/android/content/Intent#EXTRA_ATTRIBUTION_TAGS), [`EXTRA_START_TIME`](/reference/android/content/Intent#EXTRA_START_TIME), and [`EXTRA_END_TIME`](/reference/android/content/Intent#EXTRA_END_TIME).\n\nDepending on which intent filters you add, users see an information icon\nnext to your app's name on certain screens:\n\n- If you add the intent filter that contains the `VIEW_PERMISSION_USAGE` action, users see the icon on your app's permissions page in system settings. You can apply this action to all runtime permissions.\n- If you add the intent filter that contains the `VIEW_PERMISSION_USAGE_FOR_PERIOD` action, users see the icon next to your app's name whenever your app appears in the Privacy Dashboard screen.\n\nWhen users select that icon, your app's rationale activity is started. \n**Figure 2.** Microphone and camera indicators, which show recent data access.\n\nIndicators **Note:** The icon mentioned in this section shouldn't require changes to your app's logic, as long as you [follow privacy best\n| practices](/privacy/best-practices).\n\nOn devices that run Android 12 or higher, when an app accesses\nthe microphone or camera, an icon appears in the status bar. If the app is in\n[immersive mode](/training/system-ui/immersive#immersive), the icon appears in\nthe upper-right corner of the screen. Users can open Quick Settings and select\nthe icon to view which apps are currently using the microphone or camera.\nFigure 2 shows an example screenshot that contains the icons.\n\nIdentify the screen location of indicators\n\nIf your app supports immersive mode or a full-screen UI, the indicators might\nmomentarily overlap your app's UI. To help adapt your UI to these indicators,\nthe system introduces the\n[`getPrivacyIndicatorBounds()`](/reference/android/view/WindowInsets.Builder#setPrivacyIndicatorBounds(android.graphics.Rect))\nmethod, which the following code snippet demonstrates. Using this API, you can\nidentify the bounds where the indicators might appear. You might then decide to\norganize your screen's UI differently. \n\nKotlin \n\n```kotlin\nview.setOnApplyWindowInsetsListener { view, windowInsets -\u003e\n val indicatorBounds = windowInsets.getPrivacyIndicatorBounds()\n // change your UI to avoid overlapping\n windowInsets\n}\n```\n\nToggles **Note:** The toggles mentioned in this section shouldn't require changes to your app's logic, as long as you [follow privacy best\npractices](/privacy/best-practices). \n**Figure 3.** Microphone and camera toggles in Quick Settings.\n\nOn [supported devices](#toggles-check-device-support) that run\nAndroid 12 or higher, users can enable and disable camera and\nmicrophone access for all apps on the device by pressing a single toggle\noption. Users can access the toggleable options from [Quick\nSettings](https://support.google.com/android/answer/9083864), as shown in\nfigure 3, or from the Privacy screen in system settings.\n\nThe camera and microphone toggles affect all apps on the device:\n\n- When the user turns off camera access, your app receives a blank camera feed.\n- When the user turns off microphone access, your app receives silent audio.\n Additionally, [motion sensors are\n rate-limited](/guide/topics/sensors/sensors_overview#sensors-rate-limiting),\n regardless of whether you declare the\n [`HIGH_SAMPLING_RATE_SENSORS`](/reference/android/Manifest.permission#HIGH_SAMPLING_RATE_SENSORS)\n permission.\n\n | **Note:** When the user places a call to emergency services, such as 911, the system turns on microphone access. This behavior preserves user safety.\n\nWhen the user turns off access to camera or microphone, then\nlaunches an app that needs access to camera or microphone information, the\nsystem reminds the user that the device-wide toggle is turned off.\n\nCheck device support\n\nTo check whether a device supports microphone and camera toggles, add the logic\nthat appears in the following code snippet: \n\nKotlin \n\n```kotlin\nval sensorPrivacyManager = applicationContext\n .getSystemService(SensorPrivacyManager::class.java)\n as SensorPrivacyManager\nval supportsMicrophoneToggle = sensorPrivacyManager\n .supportsSensorToggle(Sensors.MICROPHONE)\nval supportsCameraToggle = sensorPrivacyManager\n .supportsSensorToggle(Sensors.CAMERA)\n```\n\nJava \n\n```java\nSensorPrivacyManager sensorPrivacyManager = getApplicationContext()\n .getSystemService(SensorPrivacyManager.class);\nboolean supportsMicrophoneToggle = sensorPrivacyManager\n .supportsSensorToggle(Sensors.MICROPHONE);\nboolean supportsCameraToggle = sensorPrivacyManager\n .supportsSensorToggle(Sensors.CAMERA);\n```"]]