デバイス コントロール
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このガイドでは、デバイス ポリシー コントローラ(DPC)アプリに実装できるデバイス管理機能について説明します。また、Android のエンタープライズ機能のサンプルコードのソースとして TestDPC アプリを使用することもできます。
DPC アプリは、個人所有のデバイスではプロファイル所有者モードで、完全管理対象デバイスではデバイス所有者モードで実行できます。次の表に、DPC がプロファイル所有者モードまたはデバイス所有者モードで実行されている場合に使用できる機能を示します。
カスタムのロック画面 メッセージを作成する
デバイス所有者モードで実行されている DPC は、setDeviceOwnerLockScreenInfo
メソッドを使用して、ユーザーのデバイスにカスタム ロック画面 メッセージを作成できます。このメッセージは、デバイスがロックされているときにデバイスの画面に表示されます。紛失または盗難にあったデバイスに役立ちます。よくあるメッセージは「このスマートフォンは <company name>
のものです。見つかった場合は <phone number>
に電話してください」です。
データ ローミングを無効にする
データローミングを行うと、携帯通信会社の請求額が高額になる可能性があります。これらの費用を削減するために、デバイス所有者モードで実行されている DPC は、DISALLOW_DATA ROAMING
制限を設定してデータ ローミングを無効にできます。DPC によってユーザー制限が設定されると、ユーザーはデバイスの設定を使用してデータ ローミングを変更できなくなります。
設定がブロックされた場合にユーザーにカスタマイズしたメッセージを表示する
ユーザーが IT 部門によってブロックされている設定や機能をクリックすると、その機能にアクセスできない理由がサポート メッセージに簡単に説明されます。
これらのメッセージは、「操作が許可されていません」よりも具体的な内容になります。デバイス オーナー モードまたはプロファイル オーナー モードで実行されている DPC は、DevicePolicyManager
setShortSupportMessage()
メソッドと setLongSupportMessage()
メソッドを使用してこれらのメッセージをカスタマイズできます。
サポート メッセージを作成する
設定が制限されている理由を説明するには、短いメッセージまたは長いメッセージを使用できます。
これらのメッセージのいずれかを翻訳する必要がある場合は、DeviceAdminReceiver
が ACTION_LOCALE_CHANGED
ブロードキャストをリッスンし、それに応じてこの文字列の新しいバージョンを設定する必要があります。
壁紙をロックダウンする
Android デバイスを共有デバイスとして運用している学校や企業などの組織は、ユーザーがデバイスのホーム画面の壁紙を変更できないように設定できます。
壁紙をロックダウンするには、デバイス オーナー モードまたはプロファイル オーナー モードで実行されている DPC で DISALLOW_SET_WALLPAPER
を true
に設定します。この設定のデフォルトは false
です。
お客様のユーザー アイコンをロックダウンする
デバイス所有者モードまたはプロファイル所有者モードで実行されている DPC は、ユーザーを追加してユーザーごとにアイコンを指定できます。このユーザー アイコンはデバイスにのみ表示され、Gmail のメッセージや Google+ のプロフィールなど、他の Google プロパティに表示されるプロフィール アイコンとは異なります。
DPC は DISALLOW_SET_USER_ICON
を true
に構成して、ユーザーがアイコンを変更できないようにできます。この設定のデフォルトは false
です。
デバイスの状態とステータスをリモートでモニタリングする
端末オーナー モードまたはプロファイル オーナー モードで実行されている DPC は、リモートの場所で実行されている無人デバイス(Android デバイスで実行されているデジタル サイネージ ディスプレイやキオスクなど)をモニタリングできます。これを行うには、DPC は HardwarePropertiesManager
インターフェースを使用して、GPU の温度や CPU 使用率などのデバイスの状態に関する情報を取得します。これは、過熱などの問題が原因でデバイスが自動的にオフになる問題を診断する場合に役立ちます。
デバイスのハードウェア プロパティ マネージャー サービスにアクセスするには、文字列 Context.HARDWARE_PROPERTIES_SERVICE
で Context.getSystemService()
を使用します。
Android デバイスをリモートで再起動する
DPC は、デバイス所有者モードで実行されている場合にのみ、Android デバイスをリモートで再起動できます。エンクロージャー内のパブリックな場所にデプロイされているデバイスや、デジタル サイネージ ディスプレイとしてデプロイされているデバイスは、電源ボタンに簡単にアクセスできない場合があります。デバイスを再起動する必要がある場合、DPC は DevicePolicyManager.reboot()
メソッドを使用して再起動できます。
通話中のデバイスは再起動しません。再起動するには、デバイスがアイドル状態である必要があります。これは、管理者が再起動リクエストでユーザーの通話を中断しないようにするためです。デバイスがアクティブな場合、CALL_STATE_IDLE
になるまで IllegalStateException
がスローされます。
ユーザーが Bluetooth 経由でファイルを送信できないようにする
デバイス オーナーとプロファイル オーナーは、DISALLOW_BLUETOOTH_SHARING
を使用して、ユーザーが Bluetooth 経由でファイルを送信できないようにすることができます。ファイルの受信には影響しません。デバイス所有者によって設定された場合、DISALLOW_BLUETOOTH_SHARING
はデバイス上のすべてのユーザーに適用されます。
このオプションを使用すると、IT 管理者はクイック シェアの動作を制御できます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。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,["# Device control\n\nThe features in this guide describe device management capabilities you can\nimplement in your [device policy controller](/work/dpc/build-dpc) (DPC)\napp. You can also use the\n[TestDPC](https://github.com/googlesamples/android-testdpc/) app as\na source of sample code for Android's enterprise features.\n\nA DPC app can run in profile owner mode on personal devices or in device owner\nmode on fully managed devices. This table indicates which features are\navailable when the DPC runs in [profile owner mode or device owner\nmode](https://developers.google.com/android/work/play/emm-api/prov-devices#modes_of_operation):\n\n| **Feature** | **Profile owner** | **Device owner** |\n|---------------------------------------------------------------------------------------------------------------------|-------------------|------------------|\n| [Create a custom lock screen message](#create_a_custom_lock_screen_message) | | ✓ |\n| [Disable data roaming](#disable_data_roaming) | | ✓ |\n| [Give users a customized message if a setting is blocked](#give_users_a_customized_message_if_a_setting_is_blocked) | ✓ | ✓ |\n| [Lock down the wallpaper](#lock_down_the_wallpaper) | ✓ | ✓ |\n| [Lock down a customer user icon](#lock_down_a_customer_user_icon) | ✓ | ✓ |\n| [Remotely monitor device health and status](#remotely_monitor_device_health_and_status) | ✓ | ✓ |\n| [Remotely reboot an Android device](#remotely_reboot_an_android_device) | | ✓ |\n| [Prevent users sending files over Bluetooth](#prevent_users_sending_files_over_bluetooth) | ✓ | ✓ |\n\nCreate a custom lock screen message\n-----------------------------------\n\nRunning in device owner mode, a DPC can create a custom lock screen message on\ntheir users' devices using the [`setDeviceOwnerLockScreenInfo`](/reference/android/app/admin/DevicePolicyManager#setDeviceOwnerLockScreenInfo(android.content.ComponentName,%20java.lang.CharSequence))\nmethod. This message displays on the device screen when locked, and is useful\nfor a lost or stolen device. A common message is \"This phone belongs to\n*`\u003ccompany name\u003e`* , call *`\u003cphone number\u003e`* if found.\"\n\nDisable data roaming\n--------------------\n\nData roaming can cause significant charges on Mobile carrier bills. To help\nstreamline those costs, a DPC running in device owner mode can disable\ndata roaming by setting the [`DISALLOW_DATA ROAMING`](/reference/android/os/UserManager#DISALLOW_DATA_ROAMING) restriction. Once the\nuser restriction is set by the DPC, a user can't change data roaming using\n**Settings** on their device.\n\nGive users a customized message if a setting is blocked\n-------------------------------------------------------\n\nWhen a user clicks a setting or feature blocked by their IT department, the\nsupport message gives a brief explanation of why they can't access the feature.\n\nThese messages can be more descriptive than \"Action not allowed\". A DPC running\nin device owner or profile owner mode can customize these messages\nusing the\n[`DevicePolicyManager`](/reference/android/app/admin/DevicePolicyManager) [`setShortSupportMessage()`](/reference/android/app/admin/DevicePolicyManager#setShortSupportMessage(android.content.ComponentName,%20java.lang.CharSequence))\nand [`setLongSupportMessage()`](/reference/android/app/admin/DevicePolicyManager#setLongSupportMessage(android.content.ComponentName,%20java.lang.CharSequence)) methods.\n\n### Create support messages\n\nTo explain why a setting is restricted, you can use short or long messages:\n\n- **To create a short message** , use the [`setShortSupportMessage()`](/reference/android/app/admin/DevicePolicyManager#setShortSupportMessage(android.content.ComponentName,%20java.lang.CharSequence))\n method.\n\n - The short message is restricted to 200 characters.\n - A common message is \"This setting is disabled by your admin. Contact *'[yourITdepartment@example.com](mailto:yourITdepartment@example.com)'* for support.\"\n- **To create a long message** , use the [`setLongSupportMessage()`](/reference/android/app/admin/DevicePolicyManager#setLongSupportMessage(android.content.ComponentName,%20java.lang.CharSequence)) method.\n The user can view this message on their device under **Settings** \\\u003e\n **Security** \\\u003e **Device admins**, and then select a specific admin.\n\nIf either of these messages needs to be translated, the\n[`DeviceAdminReceiver`](/reference/android/app/admin/DeviceAdminReceiver) needs to listen to the [`ACTION_LOCALE_CHANGED`](/reference/android/content/Intent#ACTION_LOCALE_CHANGED)\nbroadcast and set a new version of this string accordingly.\n\nLock down the wallpaper\n-----------------------\n\nOrganizations such as schools or companies that run Android devices as shared\ndevices can block their users from changing the wallpaper on their device home\nscreen.\n\nTo lock down the wallpaper, a DPC running in device owner or profile owner\nmode can set [`DISALLOW_SET_WALLPAPER`](/reference/android/os/UserManager#DISALLOW_SET_WALLPAPER) to `true`. The default for this\nsetting is `false`.\n\nLock down a customer user icon\n------------------------------\n\nA DPC running in either device owner or profile owner mode can add users and\nspecify an icon for each user. This user icon is only on the device and is\nseparate from the profile icon that appears in other Google properties, such as\na Gmail message or Google Plus profile.\n\nA DPC can configure the [`DISALLOW_SET_USER_ICON`](/reference/android/os/UserManager#DISALLOW_SET_USER_ICON) to `true` to restrict a\nuser from changing their icon. The default for this setting is `false`.\n\nRemotely monitor device health and status\n-----------------------------------------\n\nA DPC running in device owner or profile owner mode can monitor unattended\ndevices running in a remote location, such as digital signage displays or kiosks\nrun off of Android devices. To do this, a DPC uses the\n[`HardwarePropertiesManager`](/reference/android/os/HardwarePropertiesManager) interface to get information about device\nhealth, such as GPU temperatures and CPU usage. This is useful to diagnose\nissues with devices that automatically turn off because of overheating or other\nissues.\n\nTo access the device's Hardware Property Manager service, use\n[`Context.getSystemService()`](/reference/android/content/Context#getSystemService(java.lang.String)) with string\n[`Context.HARDWARE_PROPERTIES_SERVICE`](/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE).\n| **Note:** Not all properties monitored by [`HardwarePropertiesManager`](/reference/android/os/HardwarePropertiesManager) are available to all Android devices.\n\nRemotely reboot an Android device\n---------------------------------\n\nA DPC can remotely reboot Android devices only when it runs in device owner\nmode. In some cases, devices deployed in public places inside enclosures or as\ndigital signage displays can prevent easy access to the power button. If a\ndevice needs to be rebooted, a DPC can do so using the\n[`DevicePolicyManager.reboot()`](/reference/android/app/admin/DevicePolicyManager#reboot(android.content.ComponentName)) method.\n\nA device doesn't reboot if there's an ongoing call. The device needs to be\nin an idle state to reboot. This is to prevent an admin interrupting a user's\nphone call with a reboot request. If the device is active, it throws an\n`IllegalStateException` until [`CALL_STATE_IDLE`](/reference/android/telephony/TelephonyManager#CALL_STATE_IDLE).\n\nPrevent users sending files over Bluetooth\n------------------------------------------\n\nDevice owners and profile owners can prevent users from sending files over\nBluetooth using [`DISALLOW_BLUETOOTH_SHARING`](/reference/android/os/UserManager#DISALLOW_BLUETOOTH_SHARING). Receiving files isn't\naffected. When set by a device owner, `DISALLOW_BLUETOOTH_SHARING` applies to\nall users on the device.\n\nThis option allows the IT admins to control the behavior of [Quick Share](https://support.google.com/android/answer/9286773)."]]