اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
شاشة التأمين
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
لا تظهر شاشة القفل التي يوفّرها إطار عمل AOSP تلقائيًا مع عناصر التحكم لفتح القفل (شاشة القفل) إلا على الشاشة الأساسية. في الإصدار 9 من نظام التشغيل Android (والإصدارات الأقدم)، كانت الشاشات الثانوية تتيح استخدام نافذة قفل واحدة على شاشة خارجية واحدة. في Android 10، يتم توسيع نطاق شاشة القفل ليشمل جميع الشاشات الثانوية
العلنية. تظل شاشة القفل بسيطة ولا تتيح فتح القفل من الشاشات
الثانوية.

الشكل 1: شاشة القفل على الشاشة الثانوية
يمكن لمصنعي الأجهزة تنفيذ ميزة "قفل الشاشة" على الشاشات الثانوية،
بشرط استيفاء متطلبات الأمان الأساسية. عندما يكون الجهاز
مقفَلاً، يجب إخفاء المعلومات بأمان على جميع الشاشات. لا تتوفّر سياسة مدمجة أو إمكانية التحكّم في المحتوى الذي يجب عرضه أو إخفاؤه عندما يكون الجهاز
مقفلاً. وبالتالي، فإنّ الطريقة الآمنة الوحيدة لتنفيذ الوصول المحدود هي
إخفاء كل المحتوى خلف شاشة القفل ونوافذ القفل. الاستثناءات الوحيدة هي التطبيقات التي وافقت صراحةً على عرضها أعلى شاشة القفل باستخدام الطريقتَين
R.attr.showWhenLocked
أو
Activity.setShowWhenLocked()
.
في حال عدم اتّباع هذه الخطوات، من المحتمل جدًا تسرُّب المعلومات من الشاشات العامة والخاصة.
على الرغم من أنّه يمكن وضع الشاشات في حالات مختلفة (ON
/OFF
)،
تكون الحالة "مقفَلة" عالمية لجميع الشاشات. كما هو الحال مع أي عملية تنفيذ على الجهاز، يجب أن يكون واضحًا للمستخدم ما إذا كان الجهاز مقفلاً (أو مفتوحًا). على سبيل المثال، يؤدي الضغط على زر التشغيل عادةً إلى قفل جهاز جوّال. يجب أن يؤدي زر التشغيل أيضًا إلى قفل كل
الشاشات الداخلية والخارجية.
وبما أنّ نافذة القفل مملوكة لخدمة SystemUI، لن يتم وضعها على
الشاشات الخاصة. يتحمّل مالكو الشاشات الخاصة مسؤولية إخفاء
النوافذ وحماية المحتوى عندما يكون الجهاز مقفلاً. لا يؤدي تنفيذ النظام التلقائي فقط إلى إخفاء الأنشطة على الشاشات الخاصة من خلال تغيير
مستوى الرؤية.
التنفيذ
يتم تنفيذ نافذة القفل على الشاشات الثانوية كنافذة عرض
في KeyguardDisplayManager
. غيّر نظام التشغيل Android 10
KeyguardDisplayManager#mPresentations
إلى صفيف يحتوي على كل
نوافذ القفل لجميع الشاشات الثانوية. يحتوي KeyguardDisplayManager
أيضًا على مراقب لتغييرات الشاشة للردّ على التغييرات في الشاشات المتاحة
وتأمين جميع الشاشات. من المهم قفل جميع الشاشات المتصلة على الفور في
أي وقت حتى لا يتمكّن المهاجمون من استخراج بيانات المستخدمين حتى في حال الوصول المادي
إلى الجهاز.
يتم عرض نافذة القفل على جميع الشاشات الثانوية العامة (راجِع
KeyguardDisplayManager#isKeyguardShowable()
). ويتحمل مالكو الشاشات
الخاصة مسؤولية تأمين المحتوى عندما يكون الجهاز
مُقفَلاً.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Lock screen\n\nAOSP's default implementation of the Lock screen with affordances to unlock\nit (keyguard) appears only on the primary display. In Android 9 (and lower),\nsecondary screens supported a single *locking window* on a single external\ndisplay. In Android 10, the Lock screen is expanded to all public secondary\ndisplays. The Lock screen remains simple and doesn't support unlocking from secondary\nscreens.\n\n**Figure 1.** Lock screen on secondary display\n\nDevice manufacturers can implement their Lock screen for secondary displays,\nprovided the fundamental security requirement is fulfilled. When the device is\nlocked, information should be securely concealed on all displays. There's no\nbuilt-in policy or control over what content should be shown or hidden when device\nis locked. Therefore, the only secure way of implementing restricted access is to\nhide all content behind the Lock screen and locking windows. The only exceptions\nare apps that have explicitly opted in to be displayed on top of the Lock screen\nusing the\n[R.attr.showWhenLocked](https://developer.android.com/reference/android/R.attr.html#showWhenLocked) or\n[Activity.setShowWhenLocked()](https://developer.android.com/reference/android/app/Activity.html#setShowWhenLocked(boolean)) methods.\nOtherwise, there is strong potential to leak information from public and private\ndisplays.\n\nWhile displays can be placed in to different states (`ON`/`OFF`),\nthe locked state is global for all displays. As with any device implementation, it should\nbe obvious to a user when a device is locked (or unlocked). For example, pressing\na power button typically locks a mobile device. A power button should also lock all\ninternal and external screens.\n\nBecause the locking window is owned by SystemUI, it won't be placed on\nprivate displays. Owners of the private displays are responsible for hiding\nthe windows and protecting content when a device is locked. The default system\nimplementation *only* hides activities on private displays by changing\nvisibility.\n\nImplementation\n--------------\n\nThe locking window on secondary displays is implemented as a [Presentation](https://developer.android.com/reference/android/app/Presentation)\nwindow in `KeyguardDisplayManager`. Android 10 changed\n`KeyguardDisplayManager#mPresentations` to an array that holds all\nlocking windows for all secondary screens. `KeyguardDisplayManager` also\nhas a display-change listener to respond to changes to the available displays and\nsecure all screens. It's important to immediately lock all connected displays at\nany given time so that attackers can't extract user data even with physical access\nto the device.\n\nThe locking window is displayed on all public secondary displays (see\n`KeyguardDisplayManager#isKeyguardShowable()`). Owners of private\ndisplays are responsible for securing the content when a device is\nlocked."]]