android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION is not needed for Android screen recording
Many posts and chatbots claim android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION is needed to for implementing screen recording on Android. Some claim it is needed in the screen recording service tag in AndroidManifest.xml, some in uses-permission for the app. some both.
As of 2025-02-13 for targeting Android 14, FOREGROUND_SERVICE_MEDIA_PROJECTION is no longer needed anywhere in the code. the OS will prompt the user to get the permission to start the foreground service for screen recoding.
When the intent created by MediaProjectionManager.createScreenCaptureIntent is launched, the OS prompts the user to give the permission to record screen, and then the app handles the results. If (result.getResultCode() == RESULT_OK), the app has got the permission, and go ahead with the screen recording.