fix: IMEI Permission
This commit is contained in:
parent
fb464b1eec
commit
5cf2a3b4ad
|
|
@ -15,8 +15,6 @@
|
|||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="28" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class SettingsFragment : PreferencesFragment() {
|
|||
}
|
||||
findPreference<Preference>("clear_search_history")!!.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
SearchHistoryTable(attachContext).clearDatabase()
|
||||
if (view != null) Util.createSnackbar(view!!, R.string.toast_clear_success, Snackbar.LENGTH_SHORT).show()
|
||||
if (view != null) Util.createSnackbar(requireView() , R.string.toast_clear_success, Snackbar.LENGTH_SHORT).show()
|
||||
true
|
||||
}
|
||||
findPreference<Preference>("exit_account")!!.isEnabled = AccountUtil.isLoggedIn(attachContext)
|
||||
|
|
@ -132,7 +132,7 @@ class SettingsFragment : PreferencesFragment() {
|
|||
clearCache!!.summary = attachContext.getString(R.string.tip_cache, GlideCacheUtil.getInstance().getCacheSize(attachContext))
|
||||
clearCache.onPreferenceClickListener = Preference.OnPreferenceClickListener { preference: Preference ->
|
||||
GlideCacheUtil.getInstance().clearImageAllCache(attachContext)
|
||||
if (view != null) Util.createSnackbar(view!!, R.string.toast_clear_cache_success, Snackbar.LENGTH_SHORT).show()
|
||||
if (view != null) Util.createSnackbar(requireView() , R.string.toast_clear_cache_success, Snackbar.LENGTH_SHORT).show()
|
||||
preference.summary = attachContext.getString(R.string.tip_cache, "0.0B")
|
||||
true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ public class MobileInfoUtil {
|
|||
try {
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
String imei = null;
|
||||
if (telephonyManager != null) {
|
||||
imei = telephonyManager.getDeviceId();
|
||||
}
|
||||
// if (telephonyManager != null) {
|
||||
// imei = telephonyManager.getDeviceId();
|
||||
// }
|
||||
if (imei == null) {
|
||||
imei = DEFAULT_IMEI;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue