Skip to content

Commit 7fb0c19

Browse files
committed
Initial implementation of handling CredentialProviderService:OnBeginGetCredentialRequest
1 parent 62bf70e commit 7fb0c19

File tree

5 files changed

+448
-59
lines changed

5 files changed

+448
-59
lines changed

src/Kp2aBusinessLogic/IKp2aApp.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,11 @@ int WebDavChunkedUploadSize
167167
/// Registers an action that should be executed when the context instance with the given id has been resumed.
168168
/// </summary>
169169
void RegisterPendingActionForContextInstance(int contextInstanceId, ActionOnOperationFinished actionToPerformWhenContextIsResumed);
170+
171+
/// <summary>
172+
/// Use an App level (singletone) AtomicInteger
173+
/// for the request code of pending intent in the credential provider service.
174+
/// </summary>
175+
int RequestCodeForCredentialProvider { get; }
170176
}
171177
}

src/keepass2android-app/Resources/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,5 +1353,7 @@
13531353

13541354
<string name="credential_provider_service_subtitle">Password credential provider</string>
13551355
<string name="credential_provider_password_creation_description">Save Password in new entry</string>
1356+
<string name="open_app_name">Open %1$s</string>
1357+
<string name="manage_credentials">Manage Credentials</string>
13561358

13571359
</resources>

src/keepass2android-app/app/App.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You should have received a copy of the GNU General Public License
6666
using Java.Interop;
6767
using AndroidX.Lifecycle;
6868
using keepass2android.services;
69+
using Java.Util.Concurrent.Atomic;
6970

7071

7172
namespace keepass2android
@@ -1628,6 +1629,13 @@ public void PerformPendingActions(int instanceId)
16281629
}
16291630
}
16301631
}
1632+
1633+
private readonly AtomicInteger requestCodeForCredentialProvider = new();
1634+
public int RequestCodeForCredentialProvider
1635+
{
1636+
get => requestCodeForCredentialProvider.IncrementAndGet();
1637+
}
1638+
16311639
}
16321640

16331641

0 commit comments

Comments
 (0)