27 মার্চ, 2025 থেকে, আমরা AOSP তৈরি করতে এবং অবদান রাখতে aosp-main
এর পরিবর্তে android-latest-release
ব্যবহার করার পরামর্শ দিচ্ছি। আরও তথ্যের জন্য, AOSP-তে পরিবর্তনগুলি দেখুন।
টর্চ শক্তি নিয়ন্ত্রণ
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Android 13 বা উচ্চতর সংস্করণে চলমান ডিভাইসগুলির জন্য, Android ফ্রেমওয়ার্ক টর্চ শক্তির জন্য একটি বহুস্তরীয় নিয়ন্ত্রণ প্রদান করে। অ্যান্ড্রয়েড 12 এবং তার চেয়ে কম সময়ে, ফ্রেমওয়ার্ক শুধুমাত্র টর্চ মোড চালু বা বন্ধ করার অনুমতি দেয়। মাল্টিলেভেল টর্চ শক্তি নিয়ন্ত্রণ সমর্থন করে, ডিভাইসগুলি আলোর অবস্থার উপর ভিত্তি করে ফ্ল্যাশলাইটের উজ্জ্বলতা নিয়ন্ত্রণ করা এবং একটি সারিতে আলোর দ্রুত স্পন্দন প্রেরণ করে একটি স্ট্রোব প্রভাব ব্যবহার করে সহায়তার জন্য সংকেত পাঠানোর মতো ক্ষেত্রেগুলিকে সক্ষম করতে পারে। এই বৈশিষ্ট্যটির আরেকটি সুবিধা হল এটি ব্যাটারি লাইফ এবং কর্মক্ষমতা উন্নত করতে পারে কারণ টর্চ মোডকে সর্বদা সর্বোচ্চ শক্তিতে চালু করার প্রয়োজন হয় না, যা তাপীয় থ্রটলিং অবস্থার দিকে নিয়ে যেতে পারে।
পাবলিক API
অ্যাপগুলি নিম্নলিখিত পাবলিক API এবং ক্যামেরা বৈশিষ্ট্য কীগুলির মাধ্যমে টর্চ শক্তি নিয়ন্ত্রণ বৈশিষ্ট্য ব্যবহার করতে পারে। এই APIগুলির জন্য কোনও ক্যামেরা অনুমতির প্রয়োজন নেই কারণ ক্যামেরা অ্যাক্সেস করা হয়নি৷
ক্যামেরা ম্যানেজার এপিআই
ক্যামেরার বৈশিষ্ট্য কী
বাস্তবায়ন
আপনার ডিভাইসে টর্চ শক্তি নিয়ন্ত্রণ বৈশিষ্ট্য সমর্থন করতে, নিম্নলিখিত ক্যামেরা AIDL HAL ইন্টারফেস ব্যবহার করুন:
অবস্থান: /camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
টর্চ উজ্জ্বলতা নিয়ন্ত্রণ বৈশিষ্ট্য সমর্থন করার জন্য আপনার HAL বাস্তবায়ন নিম্নলিখিত ক্যামেরা বৈশিষ্ট্য কীগুলির বিজ্ঞাপন দেয় তা নিশ্চিত করুন:
টর্চ শক্তি নিয়ন্ত্রণ সমর্থনকারী ক্যামেরা HAL বাস্তবায়নের রেফারেন্সের জন্য, EmulatedCameraDeviceHWLImpl.cpp
দেখুন।
বৈধতা
টর্চ শক্তি নিয়ন্ত্রণ বৈশিষ্ট্য আপনার বাস্তবায়ন যাচাই করতে, নিম্নলিখিত VTS এবং CTS পরীক্ষা চালান:
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি 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,["# Torch strength control\n\nFor devices running Android 13 or higher, the Android\nframework provides a multilevel control for torch strength. In\nAndroid 12 and lower, the framework allows only for\nturning the torch mode on or off. By supporting multilevel torch strength\ncontrol, devices can enable use cases such as controlling the brightness of the\nflashlight based on lighting conditions and sending signals for assistance\nusing a strobe effect by sending quick pulses of light in a row. Another\nbenefit of this feature is that it can improve battery life and performance as\nthe torch mode doesn't always need to be turned on at the maximum strength,\nwhich can lead to thermal throttling conditions.\n\nPublic APIs\n-----------\n\nApps can use the torch strength control feature through the following public\nAPIs and camera characteristics keys. No camera permissions are required for\nthese APIs because the camera isn't accessed.\n\n#### CameraManager APIs\n\n- [`public void turnOnTorchWithStrengthLevel (String cameraId, int torchStrength)`](https://developer.android.com/reference/android/hardware/camera2/CameraManager#turnOnTorchWithStrengthLevel(java.lang.String,%20int)): Sets the brightness level of the flashlight associated with the given `cameraId` value in torch mode. If torch mode is off and `torchStrength` is greater than or equal to `1`, the torch turns on with the strength level specified in `torchStrength`.\n- [`public int getTorchStrengthLevel (String cameraId)`](https://developer.android.com/reference/android/hardware/camera2/CameraManager#getTorchStrengthLevel(java.lang.String)): Returns the brightness level of the flash unit associated with `cameraId`.\n\n#### CameraCharacteristics keys\n\n- [`FLASH_INFO_STRENGTH_MAXIMUM_LEVEL`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#FLASH_INFO_STRENGTH_MAXIMUM_LEVEL): Maximum brightness level. The camera HAL advertises this feature by setting a value greater than `1`.\n- [`FLASH_INFO_STRENGTH_DEFAULT_LEVEL`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#FLASH_INFO_STRENGTH_DEFAULT_LEVEL): Default flashlight brightness level.\n\nImplementation\n--------------\n\nTo support the torch strength control feature on your device, use the following\ncamera AIDL HAL interfaces:\n\nLocation: `/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl`\n\n- [`void turnOnTorchWithStrengthLevel(int torchStrength)`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl?q=turnOnTorchWithStrengthLevel)\n- [`int getTorchStrengthLevel()`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl?q=getTorchStrengthLevel)\n\nEnsure your HAL implementation advertises the following camera characteristics\nkeys to support the torch brightness control feature:\n\n- [`FLASH_INFO_STRENGTH_MAXIMUM_LEVEL`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#FLASH_INFO_STRENGTH_MAXIMUM_LEVEL)\n- [`FLASH_INFO_STRENGTH_DEFAULT_LEVEL`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#FLASH_INFO_STRENGTH_DEFAULT_LEVEL)\n\nFor a reference Camera HAL implementation supporting torch strength control,\nsee\n[`EmulatedCameraDeviceHWLImpl.cpp`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedCameraDeviceHWLImpl.cpp).\n\nValidation\n----------\n\nTo validate your implementation of the torch strength control feature, run the\nfollowing VTS and CTS tests:\n\n- VTS: [`/camera/provider/aidl/vts/VtsAidlHalCameraProvider\\_TargetTest.cpp`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp)\n- CTS: [`/platform/cts/tests/camera/src/android/hardware/camera2/cts/FlashlightTest.java`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/tests/camera/src/android/hardware/camera2/cts/FlashlightTest.java)"]]