Loading app/src/main/AndroidManifest.xml +7 −6 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ tools:ignore="QueryAllPackagesPermission" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="foundation.e.accountmanager.permission.ADD_ACCOUNT" /> <uses-permission android:name="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"/> <application android:name=".EdriveApplication" Loading Loading @@ -104,19 +104,20 @@ </intent-filter> </receiver> <receiver android:name=".account.receivers.AccountRemoveCallbackReceiver" <receiver android:name=".account.receivers.AccountRemoveCallbackReceiver" android:exported="true" android:enabled="true" android:exported="true"> android:permission="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"> <intent-filter> <action android:name="android.accounts.action.ACCOUNT_REMOVED"/> <action android:name="foundation.e.accountmanager.action.ACCOUNT_REMOVED"/> </intent-filter> </receiver> <!-- We can ignore the permission warning since ADD_ACCOUNT permission is signature --> <receiver android:name=".account.receivers.AccountAddedReceiver" android:exported="true" tools:ignore="ExportedReceiver"> android:permission="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"> <intent-filter> <action android:name="foundation.e.accountmanager.action.ACCOUNT_ADDED"/> </intent-filter> Loading app/src/main/java/foundation/e/drive/account/receivers/AccountAddedReceiver.kt +9 −0 Original line number Diff line number Diff line Loading @@ -30,10 +30,19 @@ import timber.log.Timber * @author Vincent Bourgmayer */ class AccountAddedReceiver : BroadcastReceiver() { companion object { const val ACTION_ACCOUNT_ADDED = "foundation.e.accountmanager.action.ACCOUNT_ADDED" } override fun onReceive(context: Context?, intent: Intent?) { Timber.d("\"Account added\" intent received") if (context == null || intent == null || intent.extras == null) return if (intent.action != ACTION_ACCOUNT_ADDED) { Timber.wtf("AccountAddedReceiver.onReceive is called without proper action") return } val extras = intent.extras!! val accountName = extras.getString(AccountManager.KEY_ACCOUNT_NAME, "") Loading app/src/main/java/foundation/e/drive/account/receivers/AccountRemoveCallbackReceiver.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import timber.log.Timber; public class AccountRemoveCallbackReceiver extends BroadcastReceiver { private static final String ACTION_ACCOUNT_REMOVED = "android.accounts.action.ACCOUNT_REMOVED"; private static final String ACTION_ACCOUNT_REMOVED = "foundation.e.accountmanager.action.ACCOUNT_REMOVED"; @SuppressLint("UnsafeProtectedBroadcastReceiver") @Override Loading lint.xml +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ <issue id="Typos" severity="ignore" /> <issue id="StopShip" severity="ignore" /> <issue id="InvalidPackage" severity="ignore" /> <issue id="UnusedQuantity" severity="ignore" /> <!-- WARNINGS --> <issue id="MissingTranslation" severity="warning" /> Loading Loading
app/src/main/AndroidManifest.xml +7 −6 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ tools:ignore="QueryAllPackagesPermission" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="foundation.e.accountmanager.permission.ADD_ACCOUNT" /> <uses-permission android:name="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"/> <application android:name=".EdriveApplication" Loading Loading @@ -104,19 +104,20 @@ </intent-filter> </receiver> <receiver android:name=".account.receivers.AccountRemoveCallbackReceiver" <receiver android:name=".account.receivers.AccountRemoveCallbackReceiver" android:exported="true" android:enabled="true" android:exported="true"> android:permission="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"> <intent-filter> <action android:name="android.accounts.action.ACCOUNT_REMOVED"/> <action android:name="foundation.e.accountmanager.action.ACCOUNT_REMOVED"/> </intent-filter> </receiver> <!-- We can ignore the permission warning since ADD_ACCOUNT permission is signature --> <receiver android:name=".account.receivers.AccountAddedReceiver" android:exported="true" tools:ignore="ExportedReceiver"> android:permission="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"> <intent-filter> <action android:name="foundation.e.accountmanager.action.ACCOUNT_ADDED"/> </intent-filter> Loading
app/src/main/java/foundation/e/drive/account/receivers/AccountAddedReceiver.kt +9 −0 Original line number Diff line number Diff line Loading @@ -30,10 +30,19 @@ import timber.log.Timber * @author Vincent Bourgmayer */ class AccountAddedReceiver : BroadcastReceiver() { companion object { const val ACTION_ACCOUNT_ADDED = "foundation.e.accountmanager.action.ACCOUNT_ADDED" } override fun onReceive(context: Context?, intent: Intent?) { Timber.d("\"Account added\" intent received") if (context == null || intent == null || intent.extras == null) return if (intent.action != ACTION_ACCOUNT_ADDED) { Timber.wtf("AccountAddedReceiver.onReceive is called without proper action") return } val extras = intent.extras!! val accountName = extras.getString(AccountManager.KEY_ACCOUNT_NAME, "") Loading
app/src/main/java/foundation/e/drive/account/receivers/AccountRemoveCallbackReceiver.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import timber.log.Timber; public class AccountRemoveCallbackReceiver extends BroadcastReceiver { private static final String ACTION_ACCOUNT_REMOVED = "android.accounts.action.ACCOUNT_REMOVED"; private static final String ACTION_ACCOUNT_REMOVED = "foundation.e.accountmanager.action.ACCOUNT_REMOVED"; @SuppressLint("UnsafeProtectedBroadcastReceiver") @Override Loading
lint.xml +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ <issue id="Typos" severity="ignore" /> <issue id="StopShip" severity="ignore" /> <issue id="InvalidPackage" severity="ignore" /> <issue id="UnusedQuantity" severity="ignore" /> <!-- WARNINGS --> <issue id="MissingTranslation" severity="warning" /> Loading