Skip to content

Commit 7039de8

Browse files
author
Ted Schmidt
committed
Merge pull request #186 from senseobservationsystems/hotfix/multi_language_reset_password
Hotfix/multi language reset password
2 parents b63036a + 52dd0e3 commit 7039de8

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v3.5.1 (2016-01-11)
2+
3+
### Added
4+
* New parameter language in reset password request
5+
16
## v3.4.2 (2015-05-13)
27

38
### Fixed

sense-android-library/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
55
package="nl.sense_os.service"
6-
android:versionName="3.5.0">
6+
android:versionName="3.5.1">
77
<!-- <uses-sdk -->
88
<uses-sdk android:minSdkVersion="9" tools:overrideLibrary="com.google.android.gms"/>
99

sense-android-library/src/nl/sense_os/service/commonsense/SenseApi.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,26 @@ public static boolean resetPassword(Context context, String email) throws IOExce
12771277
*/
12781278
public static boolean resetPasswordRequest(Context context, String username) throws IOException,
12791279
JSONException {
1280+
return resetPasswordRequest(context, username, Locale.US);
1281+
}
1282+
1283+
/**
1284+
* Request a password reset for the given username.
1285+
*
1286+
* @param context
1287+
* Application context, used for getting preferences.
1288+
* @param email
1289+
* Email address for the account that you want to regain access to.
1290+
* @param language
1291+
* Language the reset password email will be send as
1292+
* @return <code>true</code> if the request wasw accepted
1293+
* @throws IOException
1294+
* In case of communication failure to CommonSense
1295+
* @throws JSONException
1296+
* In case of unparseable response from CommonSense
1297+
*/
1298+
public static boolean resetPasswordRequest(Context context, String username, Locale language) throws IOException,
1299+
JSONException {
12801300

12811301
if (null == sMainPrefs) {
12821302
sMainPrefs = context.getSharedPreferences(SensePrefs.MAIN_PREFS, Context.MODE_PRIVATE);
@@ -1287,6 +1307,7 @@ public static boolean resetPasswordRequest(Context context, String username) thr
12871307
String url = devMode ? SenseUrls.RESET_PASSWORD_REQUEST_DEV : SenseUrls.RESET_PASSWORD_REQUEST;
12881308
JSONObject content = new JSONObject();
12891309
content.put("username", username);
1310+
content.put("language", language.toString());
12901311

12911312
// TODO disable compressed
12921313
Boolean useCompressed = sMainPrefs.getBoolean(SensePrefs.Main.Advanced.COMPRESS, false);

sense-android-library/src/nl/sense_os/service/phonestate/AppInfoVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public abstract class AppInfoVersion {
44

5-
public final static String SENSE_LIBRARY_VERSION = "v3.4.2";
5+
public final static String SENSE_LIBRARY_VERSION = "v3.5.1";
66
public final static String CORTEX_VERSION = "";
77
}

0 commit comments

Comments
 (0)