Lines Matching full:permission
47 * This Activity requests permissions to access the camera ({@link android.Manifest.permission#CAMERA})
49 * Contacts permissions (({@link android.Manifest.permission#READ_CONTACTS} and ({@link
50 * android.Manifest.permission#WRITE_CONTACTS})) are requested when the 'Show and Add Contacts'
76 * Now, if a permission has been disable by the system through the application settings, disabled
89 * Id to identify a camera permission request.
94 * Id to identify a contacts permission request.
101 private static String[] PERMISSIONS_CONTACT = {Manifest.permission.READ_CONTACTS,
102 Manifest.permission.WRITE_CONTACTS};
117 Log.i(TAG, "Show camera button pressed. Checking permission.");
119 // Check if the Camera permission is already available.
120 if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
122 // Camera permission has not been granted.
130 "CAMERA permission has already been granted. Displaying camera preview.");
138 * Requests the Camera permission.
139 * If the permission has been denied previously, a SnackBar will prompt the user to grant the
140 * permission, otherwise it is requested directly.
143 Log.i(TAG, "CAMERA permission has NOT been granted. Requesting permission.");
147 Manifest.permission.CAMERA)) {
148 // Provide an additional rationale to the user if the permission was not granted
149 // and the user would benefit from additional context for the use of the permission.
150 // For example if the user has previously denied the permission.
152 "Displaying camera permission rationale to provide additional context.");
159 new String[]{Manifest.permission.CAMERA},
166 // Camera permission has not been granted yet. Request it directly.
167 ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},
181 if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS)
183 || ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_CONTACTS)
200 * If the permission has been denied previously, a SnackBar will prompt the user to grant the
201 * permission, otherwise it is requested directly.
206 Manifest.permission.READ_CONTACTS)
208 Manifest.permission.WRITE_CONTACTS)) {
210 // Provide an additional rationale to the user if the permission was not granted
211 // and the user would benefit from additional context for the use of the permission.
214 "Displaying contacts permission rationale to provide additional context.");
238 * permission has been granted.
269 // Received permission result for camera permission.
270 Log.i(TAG, "Received response for Camera permission request.");
272 // Check if the only required permission has been granted
274 // Camera permission has been granted, preview can be displayed
275 Log.i(TAG, "CAMERA permission has now been granted. Showing preview.");
279 Log.i(TAG, "CAMERA permission was NOT granted.");