Home | History | Annotate | Download | only in runtimepermissions

Lines Matching refs:CAMERA

27 import com.example.android.system.runtimepermissions.camera.CameraPreviewFragment
42 * This Activity requests permissions to access the camera ([android.Manifest.permission.CAMERA])
43 * when the 'Show Camera' button is clicked to display the camera preview.
73 * For example the camera cannot be opened or an empty list of contacts is returned. No special
92 * Called when the 'show camera' button is clicked.
96 Log.i(TAG, "Show camera button pressed. Checking permission.")
97 // Check if the Camera permission is already available.
98 if (!isPermissionGranted(Manifest.permission.CAMERA)) {
99 // Camera permission has not been granted.
102 // Camera permissions is already available, show the camera preview.
104 "CAMERA permission has already been granted. Displaying camera preview.")
110 * Requests the Camera permission.
115 Log.i(TAG, "CAMERA permission has NOT been granted. Requesting permission.")
116 if (shouldShowPermissionRationale(Manifest.permission.CAMERA)) {
120 Log.i(TAG, "Displaying camera permission rationale to provide additional context.")
124 requestPermission(Manifest.permission.CAMERA, REQUEST_CAMERA)
129 // Camera permission has not been granted yet. Request it directly.
130 requestPermission(Manifest.permission.CAMERA, REQUEST_CAMERA)
135 * Called when the 'show camera' button is clicked.
183 * Display the [CameraPreviewFragment] in the content area if the required Camera
211 // Received permission result for camera permission.
212 Log.i(TAG, "Received response for Camera permission request.")
216 // Camera permission has been granted, preview can be displayed
217 Log.i(TAG, "CAMERA permission has now been granted. Showing preview.")
221 Log.i(TAG, "CAMERA permission was NOT granted.")
256 * Id to identify a camera permission request.