27 মার্চ, 2025 থেকে, আমরা AOSP তৈরি করতে এবং অবদান রাখতে aosp-main এর পরিবর্তে android-latest-release ব্যবহার করার পরামর্শ দিচ্ছি। আরও তথ্যের জন্য, AOSP-তে পরিবর্তনগুলি দেখুন।
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
অ্যান্ড্রয়েড 11-এ, অমনোযোগী ঘুম একটি পাওয়ার-সেভিং বৈশিষ্ট্য যা ব্যবহারকারীর নিষ্ক্রিয়তার সময়সীমা সেট করার অনুমতি দেয় যার পরে স্ক্রিনটি বন্ধ হয়ে যায়, এমনকি যদি FLAG_KEEP_SCREEN_ON সহ উইন্ডোগুলি দৃশ্যমান হয় বা FULL_WAKE_LOCK , SCREEN_BRIGHT_WAKE_LOCK বা ধরে রাখা হয় SCREEN_DIM_WAKE_LOCKPARTIAL_WAKE_LOCK স্তরের ওয়েকলকগুলি এই বৈশিষ্ট্য দ্বারা প্রভাবিত হয় না৷ টাইমআউটের মেয়াদ শেষ হওয়ার কিছুক্ষণ আগে, একটি বার্তা দেখানো হতে পারে যা ব্যবহারকারীকে সতর্ক করে যে ডিভাইসটি ঘুমাতে যাবে যদি তারা ডিভাইসের সাথে ইন্টারঅ্যাক্ট না করে।
এই প্রেক্ষাপটে, ব্যবহারকারীর কার্যকলাপ বলতে এমন যেকোন কিছুকে বোঝায় যা PowerManager#userActivity ( USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS পতাকা ব্যতীত) এ কল ট্রিগার করে, যার মধ্যে কিন্তু সীমাবদ্ধ নয়:
টাচস্ক্রিনের সাথে মিথস্ক্রিয়া করা
একটি শারীরিক বোতাম টিপুন
একটি বহিরাগত আনুষঙ্গিক থেকে ইভেন্ট ইনপুট করুন (উদাহরণস্বরূপ, সংযুক্ত কীবোর্ড, ব্লুটুথ রিমোট, আইআর রিমোট)
ভয়েস মিথস্ক্রিয়া
নির্দিষ্ট HDMI CEC বার্তা গ্রহণ করা, যেমন One Touch Play
একটি নতুন কাস্ট সেশন শুরু হচ্ছে৷
কাস্টমাইজেশন
বৈশিষ্ট্যটি সক্ষম থাকলে, ব্যবহারকারীর নিষ্ক্রিয়তার একটি নির্দিষ্ট সময়ের পরে ডিভাইসটি একটি অনস্ক্রিন সতর্কতা দেখায়। যদি কোন ব্যবস্থা নেওয়া না হয়, স্ক্রীনটি বন্ধ হয়ে যায়। আপনি এই কনফিগারেশন বিকল্পগুলি ব্যবহার করে বৈশিষ্ট্যটি কাস্টমাইজ করতে পারেন।
টাইমআউট কনফিগার করুন
টাইমআউট কনফিগার করতে, frameworks/base/core/res/res/values/config.xml এ নিম্নলিখিত উপাদানটি আপডেট করুন:
config_attentiveTimeout
ব্যবহারকারীর নিষ্ক্রিয়তার মিলিসেকেন্ডে ডিফল্ট সময় নির্দিষ্ট করে যার পরে স্ক্রীনটি বন্ধ হয়ে যায় (এমনকি যদি স্ক্রীন ওয়েকলকগুলি থাকে)।
নির্মাণের সময় সেট করুন।
যদি মানটি 0 এবং config_minimumScreenOffTimeout মধ্যে হয়, তাহলে ঘুম থেকে ওঠার পরপরই ডিভাইসটিকে তার স্ক্রীন বন্ধ করা থেকে বিরত রাখতে টাইমআউটটি config_minimumScreenOffTimeout এ সেট করা হয়।
ডিফল্ট: -1 , যা এই বৈশিষ্ট্যটি নিষ্ক্রিয় করে।
ডিফল্ট টাইমআউট ওভাররাইড করুন
ডিফল্ট টাইমআউট সেটিং ওভাররাইড করতে, নিম্নলিখিত উপাদান আপডেট করুন।
Settings.Secure.ATTENTIVE_TIMEOUT
সেট করা থাকলে, config_attentiveTimeout দ্বারা সেট করা ডিফল্ট অমনোযোগী ঘুমের সময়সীমাকে ওভাররাইড করে।
রানটাইম সেট করা যাবে.
সতর্কতা উপস্থিত হওয়ার আগে সময়কাল কনফিগার করুন
সময়কাল কনফিগার করতে, frameworks/base/core/res/res/values/config.xml এ নিম্নলিখিত উপাদানটি আপডেট করুন:
config_attentiveWarningDuration
দীর্ঘ সময় ধরে ব্যবহারকারীর নিষ্ক্রিয়তার পরে স্ক্রিনটি বন্ধ হওয়ার আগে ব্যবহারকারীকে কতক্ষণ সতর্কতা বার্তা দেখাতে হবে।
মানটি সেট অমনোযোগী ঘুমের সময়সীমার নীচে হওয়া উচিত, অন্যথায় সতর্কতা ডায়ালগটি ক্রমাগত দেখায় এবং বাতিল করা যাবে না।
ডিফল্ট: 30000 (30s)।
TvSettings-এ টাইমআউট পছন্দগুলি দেখান
টাইমআউট পছন্দগুলি দেখানোর জন্য, packages/apps/TvSettings/Settings/res/values/config.xml এ নিম্নলিখিত উপাদানটি আপডেট করুন:
config_show_standby_timeout
মিডিয়া প্লেব্যাকের সময় স্ক্রীন বন্ধ করার অনুমতি দেওয়ার জন্য একটি পছন্দের আইটেম দেখাবে কিনা।
ডিফল্ট: false ।
সতর্কতা UI এর জন্য সম্পদ
সতর্কীকরণ ডায়ালগের বিন্যাস frameworks/base/packages/SystemUI/res/layout/inattentive_sleep_warning.xml এ সংজ্ঞায়িত করা হয়েছে।
ডায়ালগের জন্য নিম্নোক্ত স্ট্রিংগুলি frameworks/base/packages/SystemUI/res/values/strings.xml এবং frameworks/base/packages/SystemUI/res-product/values/strings.xml এ সংজ্ঞায়িত করা হয়েছে।
inattentive_sleep_warning_title
inattentive_sleep_warning_message
বিল্ড টাইম কনফিগারেশন এবং সংস্থান সম্পদ ওভারলে দ্বারা পরিবর্তন করা যেতে পারে।
বাস্তবায়ন
নিম্নলিখিত ব্যবহার করে বৈশিষ্ট্য সক্রিয় করুন.
ডিফল্ট config_attentiveTimeout ওভাররাইড করুন।
AOSP TvSettings ব্যবহার করলে:
config_show_standby_timeout ওভাররাইড করে সেটিংসে বৈশিষ্ট্যটি নিষ্ক্রিয় করুন।
আপনার নিজস্ব সেটিংস প্রয়োগ করুন যা Settings.Secure.ATTENTIVE_TIMEOUT সেট করে।
বৈধতা
বৈশিষ্ট্যটির জন্য CTS পরীক্ষাগুলি cts/hostsidetests/os/src/android/os/cts/InattentiveSleepTests.java এ রয়েছে।
উদাহরণ এবং উৎস
frameworks/base/packages/SystemUI/src/com/android/systemui/power/InattentiveSleepWarningView.java ডিফল্ট সতর্কতা UI বাস্তবায়ন রয়েছে।
packages/apps/TvSettings সেটিংসে বৈশিষ্ট্যটি কীভাবে প্রকাশ করতে হয় তার একটি উদাহরণ প্রদান করে।
ম্যানুয়াল টেস্ট কেস উদাহরণ
নিশ্চিত করুন যে stay_on_while_plugged_in ডেভেলপার সেটিং বন্ধ আছে যদি ডিভাইসের স্বাস্থ্য HAL রিপোর্ট করে যে ডিভাইসটিতে একটি ব্যাটারি আছে ( battery_presenttrue ) কারণ এটি স্ক্রীন বন্ধ করা থেকে বৈশিষ্ট্যটিকে আটকাতে পারে। adb shell settings put global stay_on_while_plugged_in 0
সতর্কতা ডায়ালগ সময়কাল থেকে কয়েক সেকেন্ড বেশি হতে একটি অমনোযোগী ঘুমের সময়সীমা সেট করুন। adb shell settings put secure attentive_timeout 32000
একটি ভিডিও আবার প্লে করা শুরু করুন (একটি স্ক্রীন ওয়েকলক অর্জন করতে)।
যাচাই করুন যে ঘুমের সতর্কতা ডায়ালগ কয়েক সেকেন্ড পরে উপস্থিত হয়।
যাচাই করুন যে সেট টাইমআউটের মেয়াদ শেষ হওয়ার পরে স্ক্রীনটি বন্ধ হয়ে যায়।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 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-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# TV standby\n\nIn Android 11, inattentive sleep is a power-saving feature\nthat allows a user inactivity timeout to be set after which the screen turns off, even\nif windows with [FLAG_KEEP_SCREEN_ON](https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_KEEP_SCREEN_ON)\nare visible or wakelocks of level\n[FULL_WAKE_LOCK](https://developer.android.com/reference/android/os/PowerManager#FULL_WAKE_LOCK),\n[SCREEN_BRIGHT_WAKE_LOCK](https://developer.android.com/reference/android/os/PowerManager#SCREEN_BRIGHT_WAKE_LOCK) or\n[SCREEN_DIM_WAKE_LOCK](https://developer.android.com/reference/android/os/PowerManager#SCREEN_DIM_WAKE_LOCK)\nare held.\nWakelocks with level [PARTIAL_WAKE_LOCK](https://developer.android.com/reference/android/os/PowerManager#PARTIAL_WAKE_LOCK) aren't affected by this feature.\nShortly before the timeout expires, a message can be shown that warns\nthe user that the device will go to sleep if they don't interact with the device.\n\nIn this context, user activity refers to anything that triggers a call to\n`PowerManager#userActivity` (without the `USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS`\nflag), including but not limited to:\n\n- Interacting with the touchscreen\n- Pressing a physical button\n- Input events from an external accessory (for example, connected keyboard, bluetooth remote, IR remote)\n- Voice interaction\n- Receiving certain HDMI CEC messages, such as One Touch Play\n- Starting a new cast session\n\nCustomization\n-------------\n\nIf the feature is enabled, the device shows an onscreen warning after a specified time of\nuser inactivity. If no action is taken, the screen turns off. You can customize the feature\nusing these configuration options.\n| **Caution:** If a similar power-saving feature is already implemented, enabling this feature might lead to unintended consequences, such as duplicate warning UI.\n\n### Configure the timeout\n\nTo configure the timeout, update the following element in\n`frameworks/base/core/res/res/values/config.xml`:\n\n- `config_attentiveTimeout`\n - Specifies the default time in milliseconds of user inactivity after which the screen turns off (even if screen wakelocks are in place).\n - Set at build time.\n - If the value is between `0` and `config_minimumScreenOffTimeout`, the timeout is set to `config_minimumScreenOffTimeout` to prevent the device from turning off its screen shortly after waking up.\n - Default: `-1`, which disables this feature.\n\n### Override the default timeout\n\nTo override the default timeout setting, update the following element.\n\n- `Settings.Secure.ATTENTIVE_TIMEOUT`\n - If set, overrides the default inattentive sleep timeout set by `config_attentiveTimeout`.\n - Can be set at runtime.\n\n### Configure the duration before warning appears\n\nTo configure the duration, update the following element in\n`frameworks/base/core/res/res/values/config.xml`:\n\n- `config_attentiveWarningDuration`\n - How long to show a warning message to the user before the screen turns off after prolonged user inactivity.\n - The value should be well below the set inattentive sleep timeout, otherwise the warning dialog shows constantly and can't be dismissed.\n - Default: `30000` (30s).\n\n### Show the timeout preferences in TvSettings\n\nTo show the timeout preferences, update the following element in\n`packages/apps/TvSettings/Settings/res/values/config.xml`:\n\n- `config_show_standby_timeout`\n - Whether to show a preference item for allowing turning the screen off during media playback.\n - Default: `false`.\n\n### Resources for the warning UI\n\n- The layout of the warning dialog is defined in `frameworks/base/packages/SystemUI/res/layout/inattentive_sleep_warning.xml`.\n- The following strings for the dialog are defined in `frameworks/base/packages/SystemUI/res/values/strings.xml` and `frameworks/base/packages/SystemUI/res-product/values/strings.xml`.\n - `inattentive_sleep_warning_title`\n - `inattentive_sleep_warning_message`\n\nThe build time configurations and resources can be changed by resource overlays.\n\nImplementation\n--------------\n\nEnable the feature using the following.\n\n1. Override the default `config_attentiveTimeout`.\n2. If using the AOSP `TvSettings`:\n - Disable the feature in settings by overriding `config_show_standby_timeout`.\n - Implement your own settings that set `Settings.Secure.ATTENTIVE_TIMEOUT`.\n\nValidation\n----------\n\nThe CTS tests for the feature are at\n`cts/hostsidetests/os/src/android/os/cts/InattentiveSleepTests.java`.\n\nExamples and source\n-------------------\n\n- `frameworks/base/packages/SystemUI/src/com/android/systemui/power/InattentiveSleepWarningView.java` contains the default warning UI implementation.\n- `packages/apps/TvSettings` provides an example of how to expose the feature in settings.\n\nManual test case example\n------------------------\n\n1. Make sure the `stay_on_while_plugged_in`\n developer setting is off if the device's health HAL reports that the device has a\n battery (`battery_present` is `true`) as this might prevent the\n feature from turning off the screen. \n\n `adb shell settings put global stay_on_while_plugged_in 0`\n\n2. Set an inattentive sleep timeout to be a few seconds more than the warning dialog duration. \n `adb shell settings put secure attentive_timeout 32000`\n3. Start playing back a video (to acquire a screen wakelock).\n4. Verify that the sleep warning dialog appears after a few seconds.\n5. Verify that the screen turns off after the set timeout expires."]]