Remove unused osName argument from DcAccounts constructor

This commit is contained in:
link2xt
2023-07-31 17:19:04 +00:00
committed by bjoern
parent 1a13224ad2
commit 87d69c9a86
3 changed files with 5 additions and 7 deletions
+1 -3
View File
@@ -223,14 +223,12 @@ static dc_accounts_t* get_dc_accounts(JNIEnv *env, jobject obj)
}
JNIEXPORT jlong Java_com_b44t_messenger_DcAccounts_createAccountsCPtr(JNIEnv *env, jobject obj, jstring osname, jstring dir)
JNIEXPORT jlong Java_com_b44t_messenger_DcAccounts_createAccountsCPtr(JNIEnv *env, jobject obj, jstring dir)
{
CHAR_REF(osname);
CHAR_REF(dir);
int writable = 1;
jlong accountsCPtr = (jlong)dc_accounts_new(dirPtr, writable);
CHAR_UNREF(dir);
CHAR_UNREF(osname);
return accountsCPtr;
}
+3 -3
View File
@@ -2,8 +2,8 @@ package com.b44t.messenger;
public class DcAccounts {
public DcAccounts(String osName, String dir) {
accountsCPtr = createAccountsCPtr(osName, dir);
public DcAccounts(String dir) {
accountsCPtr = createAccountsCPtr(dir);
}
@Override
@@ -36,7 +36,7 @@ public class DcAccounts {
// working with raw c-data
private long accountsCPtr; // CAVE: the name is referenced in the JNI
private native long createAccountsCPtr (String osName, String dir);
private native long createAccountsCPtr (String dir);
private native void unrefAccountsCPtr ();
private native long getEventEmitterCPtr ();
private native long getJsonrpcInstanceCPtr ();
@@ -90,7 +90,7 @@ public class ApplicationContext extends MultiDexApplication {
System.loadLibrary("native-utils");
dcAccounts = new DcAccounts("Android "+BuildConfig.VERSION_NAME, new File(getFilesDir(), "accounts").getAbsolutePath());
dcAccounts = new DcAccounts(new File(getFilesDir(), "accounts").getAbsolutePath());
rpc = new Rpc(dcAccounts.getJsonrpcInstance());
AccountManager.getInstance().migrateToDcAccounts(this);
int[] allAccounts = dcAccounts.getAll();