/soc/2012/michael/android: 0317d49d12a2: Implemented account nat...

Michael Zangl michael at soc.pidgin.im
Sat Jul 7 03:34:14 EDT 2012


Changeset: 0317d49d12a23de9004a15f83c02aa6e6f495d24
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2012-06-17 19:31 +0200
Branch:	 soc.2012.android
URL: http://hg.pidgin.im/soc/2012/michael/android/rev/0317d49d12a2

Description:

Implemented account native functions.

diffstat:

 android/workspace/im.pidgin.libpurple/native/helpers.h                                   |   5 +
 android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java |  32 +++++----
 2 files changed, 23 insertions(+), 14 deletions(-)

diffs (64 lines):

diff --git a/android/workspace/im.pidgin.libpurple/native/helpers.h b/android/workspace/im.pidgin.libpurple/native/helpers.h
--- a/android/workspace/im.pidgin.libpurple/native/helpers.h
+++ b/android/workspace/im.pidgin.libpurple/native/helpers.h
@@ -11,6 +11,11 @@
 #include <jni.h>
 
 /**
+ * This is a placeholder until proper UI name support is integrated.
+ */
+#define ANDROID_UI "android"
+
+/**
  * Converts a pointer to a java long
  */
 #define pToLong(arg) ((jlong) ((intptr_t) (arg)))
diff --git a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java
--- a/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java
+++ b/android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java
@@ -146,19 +146,19 @@
 
 	private native void setRememberPassword_native(boolean remember);
 
-	/**
-	 * Registers the account on the server.
-	 */
-	public void register() {
-		getManager().getThread().schedule(new AbstractWaitableRunnable() {
-			@Override
-			protected void execute() {
-				register_native();
-			}
-		});
-	}
-
-	private native void register_native();
+//	/**
+//	 * Registers the account on the server.
+//	 */
+//	public void register() {
+//		getManager().getThread().schedule(new AbstractWaitableRunnable() {
+//			@Override
+//			protected void execute() {
+//				register_native();
+//			}
+//		});
+//	}
+//
+//	private native void register_native();
 
 	/**
 	 * Gets the enabled status of the account
@@ -202,7 +202,11 @@
 	 */
 	protected static PurpleAccount newAccount(CoreManager manager, String name,
 			PurpleProtocolPlugin protocol) {
-		return new PurpleAccount(newAccount_native(name, protocol.getId()),
+		long account_native = newAccount_native(name, protocol.getId());
+		if (account_native == 0) {
+			throw new NullPointerException("Native account was null.");
+		}
+		return new PurpleAccount(account_native,
 				manager);
 	}
 



More information about the Commits mailing list