From c33d0bf3c7a32ab0792f4560d4633662db74a59e Mon Sep 17 00:00:00 2001 From: Ztiany Date: Thu, 19 Dec 2019 23:55:21 +0800 Subject: [PATCH] fix permission --- .../com/android/base/permission/AutoPermissionFragment.java | 3 ++- .../com/android/base/permission/AutoPermissionRequester.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java b/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java index e2115ad..6be72c2 100644 --- a/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java +++ b/lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java @@ -41,7 +41,6 @@ public class AutoPermissionFragment extends Fragment { @Override public void onPause() { super.onPause(); - mHandler.removeCallbacks(mRunnable); mIsActivityReady = false; } @@ -67,6 +66,7 @@ public class AutoPermissionFragment extends Fragment { } void startRequest() { + Timber.d("startRequest() called "); mHandler.removeCallbacks(mRunnable); startChecked(); } @@ -78,6 +78,7 @@ public class AutoPermissionFragment extends Fragment { if (callback != null) { callback.onReady(); } + mCallback = null; mHandler.removeCallbacks(mRunnable); } else { mHandler.postDelayed(mRunnable, 300); diff --git a/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java b/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java index 4d5661f..a9a7d96 100644 --- a/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java +++ b/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java @@ -140,6 +140,7 @@ public class AutoPermissionRequester { @Override public void onResume(@NonNull LifecycleOwner owner) { mActivity.getLifecycle().removeObserver(this); + Timber.d("startRequest 2"); startRequestInternal(supportFragmentManager, fragment); } };