기기에 Android Device Policy 앱에서 관리하는 직장 프로필이 있는지 확인하려면 다음 메서드를 사용하세요. 이 메서드는 모든 관리 모드에서 호출할 수 있습니다. Android Device Policy 앱에서 관리하는 직장 프로필이 있는 경우 개인 프로필의 앱에서 com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE 인텐트를 쿼리하면 교차 프로필 인텐트로 확인됩니다. 이 메서드는 이러한 직장 프로필이 있는 기기의 개인 프로필에서 호출된 경우에만 true를 반환합니다.
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],["To detect a work profile, utilize the `DevicePolicyManager` to check if the app is the profile owner using `isProfileOwnerApp(\"com.google.android.apps.work.clouddpc\")`. To determine if a device *has* a work profile, query for the intent `com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE`. On Android 11+, check if any activity from `queryIntentActivities` has `isCrossProfileIntentForwarderActivity` set. Prior to Android 11, check if the activity name is `com.android.internal.app.ForwardIntentToManagedProfile`.\n"],null,["# Work profile detection\n\nThis guide illustrates how to detect a work profile on a device. It applies only\nto work profiles managed by the Android Device policy app.\n\nDetect if the app is running inside a work profile\n--------------------------------------------------\n\nThe following method checks if the calling app is running within a work profile\nmanaged by the Android Device Policy app. \n\n### Kotlin\n\n fun isInsideWorkProfile(): Boolean {\n val devicePolicyManager = getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager\n\n return devicePolicyManager.isProfileOwnerApp(\"com.google.android.apps.work.clouddpc\")\n }\n\n### Java\n\n boolean isInsideWorkProfile() {\n DevicePolicyManager devicePolicyManager = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);\n\n return devicePolicyManager.isProfileOwnerApp(\"com.google.android.apps.work.clouddpc\");\n }\n\nDetect if the device has a work profile\n---------------------------------------\n\nTo determine if a device has a work profile managed by the Android Device Policy\napp, use the following method. This can be called from any management mode. From\nan app in the *personal* profile, querying for the intent\n`com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE` should\nresolve as a cross-profile intent if a work profile managed by the Android\nDevice Policy app exists. This method will only return `true` when called from\nthe *personal* profile of a device that has such a work profile.\n| **Note:** To determine if the app itself is running inside a work profile, use the method described in the previous section.\n\n### Android 11 and later:\n\n### Kotlin\n\n fun hasWorkProfile(): Boolean {\n val intent = Intent(\"com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE\")\n val activities = context.packageManager.queryIntentActivities(intent, 0)\n return activities.any { it.isCrossProfileIntentForwarderActivity }\n }\n\n### Java\n\n boolean hasWorkProfile() {\n Intent intent = new Intent(\"com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE\");\n List\u003cResolveInfo\u003e activities = context.getPackageManager().queryIntentActivities(intent, 0);\n return activities.stream()\n .anyMatch(\n (ResolveInfo resolveInfo) -\u003e {\n return resolveInfo.isCrossProfileIntentForwarderActivity();\n });\n }\n\n### Prior to Android 11:\n\n### Kotlin\n\n fun hasWorkProfile(): Boolean {\n val intent = Intent(\"com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE\")\n val activities = context.packageManager.queryIntentActivities(intent, 0)\n return activities.any { it.activityInfo.name == \"com.android.internal.app.ForwardIntentToManagedProfile\" }\n }\n\n### Java\n\n boolean hasWorkProfile() {\n Intent intent = new Intent(\"com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE\");\n List\u003cResolveInfo\u003e activities = context.getPackageManager().queryIntentActivities(intent, 0);\n return activities.stream()\n .anyMatch(\n (ResolveInfo resolveInfo) -\u003e {\n return resolveInfo.activityInfo.name.equals(\"com.android.internal.app.ForwardIntentToManagedProfile\");\n });\n }"]]