@@ -179,17 +179,19 @@ public void onSelected(final int location) {
179179 break ;
180180 case 3 :
181181 XXPermissions .with (LogcatActivity .this )
182- .permission (Permission .Group . STORAGE )
182+ .permission (Permission .MANAGE_EXTERNAL_STORAGE )
183183 .request (new OnPermission () {
184184 @ Override
185- public void hasPermission (List <String > granted , boolean isAll ) {
186- addFilter (mAdapter .getItem (position ).getTag ());
185+ public void hasPermission (List <String > granted , boolean all ) {
186+ if (all ) {
187+ addFilter (mAdapter .getItem (position ).getTag ());
188+ }
187189 }
188190
189191 @ Override
190- public void noPermission (List <String > denied , boolean quick ) {
191- if (quick ) {
192- XXPermissions .startPermissionActivity (LogcatActivity .this );
192+ public void noPermission (List <String > denied , boolean never ) {
193+ if (never ) {
194+ XXPermissions .startPermissionActivity (LogcatActivity .this , denied );
193195 toast ("请授予存储权限之后再操作" );
194196 }
195197 }
@@ -224,17 +226,19 @@ public boolean onLongClick(View v) {
224226 public void onClick (View v ) {
225227 if (v == mSaveView ) {
226228 XXPermissions .with (this )
227- .permission (Permission .Group . STORAGE )
229+ .permission (Permission .MANAGE_EXTERNAL_STORAGE )
228230 .request (new OnPermission () {
229231 @ Override
230- public void hasPermission (List <String > granted , boolean isAll ) {
231- saveLogToFile ();
232+ public void hasPermission (List <String > granted , boolean all ) {
233+ if (all ) {
234+ saveLogToFile ();
235+ }
232236 }
233237
234238 @ Override
235- public void noPermission (List <String > denied , boolean quick ) {
236- if (quick ) {
237- XXPermissions .startPermissionActivity (LogcatActivity .this );
239+ public void noPermission (List <String > denied , boolean never ) {
240+ if (never ) {
241+ XXPermissions .startPermissionActivity (LogcatActivity .this , denied );
238242 toast ("请授予存储权限之后再操作" );
239243 }
240244 }
@@ -385,7 +389,7 @@ public void run() {
385389 */
386390 private void initFilter () {
387391 File file = new File (LOG_DIRECTORY , LOGCAT_TAG_FILTER_FILE );
388- if (file .exists () && file .isFile () && XXPermissions .hasPermission (this , Permission .Group . STORAGE )) {
392+ if (file .exists () && file .isFile () && XXPermissions .hasPermission (this , Permission .MANAGE_EXTERNAL_STORAGE )) {
389393 BufferedReader reader = null ;
390394 try {
391395 reader = new BufferedReader (new InputStreamReader (new FileInputStream (file ),
@@ -514,19 +518,19 @@ public void onBackPressed() {
514518
515519 @ Override
516520 protected void onResume () {
517- LogcatManager .resume ();
518521 super .onResume ();
522+ LogcatManager .resume ();
519523 }
520524
521525 @ Override
522526 protected void onPause () {
523- LogcatManager .pause ();
524527 super .onPause ();
528+ LogcatManager .pause ();
525529 }
526530
527531 @ Override
528532 protected void onDestroy () {
529- LogcatManager .destroy ();
530533 super .onDestroy ();
534+ LogcatManager .destroy ();
531535 }
532536}
0 commit comments