Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.8.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
ganfra committed Aug 9, 2018
2 parents 07b004b + 3a934dc commit 04edbf9
Show file tree
Hide file tree
Showing 167 changed files with 5,669 additions and 3,038 deletions.
3 changes: 3 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ Safa AlFulaij <safa1996alfulaij at gmail.com>

Isa Cichon <isa4 at posteo.net>
* Add spacing to device keys

Nathan van Beelen <nathan at vanbeelen.org>
* PR #1742: Add a media previewer
43 changes: 43 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
Changes in Riot 0.8.13 (2018-08-09)
===================================================

Features:
- Resurrect performance metrics (#2391)
- Telemetry to report incidence of UISIs (#2330)
- Add a previewer for previewing media before sending it into the room (#1742|#2445)
- Implements ReplyTo feature (#2390)
- Add auto completion for slash commands (#2384)
- Support Room Versioning (#2441)

Improvements:
- Update matrix-sdk.aar lib (v0.9.7).
- Piwik: Update the way how stats are reported (#2402)
- Improve BugReport screen: display a preview of the screenshot (#2318)
- In the settings, move theme settings just below "language" (#2439)
- Improve the display of the sources of the message in the dialog (#2348)
- Improve the display of the buttons and the reason in the room preview (#2352)
- In the flair section on settings, notify the user when he has no flair (#2430)
- Improve GDPR consent webview management (#2491)
- Support external keyboard to send messages for recent devices (#220, #1279)
- When user ignores or un-ignores someone, notify that the app will restart (#2437)

Other changes:
- Remove dependency to `android-gif-drawable` lib and use Glide to animate logo on Splashscreen (#2421)
- Keep only Room.getState() method and remove Room.getLiveState() because they are similar (matrix-org/matrix-android-sdk#310)

Bugfix:
- Fix issue on incoming call screen when "Do not disturb mode" is active (#2417)
- Fix issue when selecting sound for notifications in the settings
- Fix issue when changing device name in the settings (#2416)
- Fix issue on verifying device, update the wording of the description message (#1067)
- Messages with code blocks show other HTML as plain text (#2280)
- Message with <p> was sometimes not properly formatted (#2275)
- Fix notification issue when Riot is not started (#2451)
- Fix Unable to add Matrix apps (#2466)
- Riot auto joined a public room (#2472)
- Remove last traces of Firebase analytics (#2481)
- code blocks are escaped and therefore hard readable (#2484)
- Restore the navigation of the back button in the public rooms preview header (#2473)
- Fix issue on preference screen: device lists was not displayed (#2409)
- Ensure notification has a title (#2242)

Changes in Riot 0.8.12 (2018-07-06)
===================================================

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ buildscript {

// global properties used in sub modules
ext {
versionCodeProp = 81200
versionNameProp = "0.8.12"
versionCodeProp = 81300
versionNameProp = "0.8.13"
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
buildNumberProp = "${versionBuild}"
}
Expand Down
3 changes: 1 addition & 2 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ dependencies {
// UI
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.binaryfork:spanny:1.0.4'

// Network
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
Expand All @@ -180,8 +181,6 @@ dependencies {
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
implementation 'com.squareup.okio:okio:1.13.0'

implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'

// Use Glide library to display image (Gif supported)
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
Expand Down
Binary file modified vector/libs/matrix-sdk.aar
Binary file not shown.
21 changes: 4 additions & 17 deletions vector/src/app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,13 @@
android:theme="@style/AppTheme"
tools:replace="allowBackup,label">

<!-- google analytics -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background dispatching on non-Google Play devices -->
<receiver
android:name="com.google.android.gms.analytics.AnalyticsReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
</intent-filter>
</receiver>
<!-- Firebase components -->

<service
android:name="com.google.android.gms.analytics.AnalyticsService"
android:enabled="true"
android:exported="false" />
<meta-data
android:name="firebase_analytics_collection_deactivated"
android:value="true" />

<!-- GCM components -->
<service
android:name="im.vector.gcm.MatrixGcmListenerService"
android:exported="false">
Expand Down
30 changes: 7 additions & 23 deletions vector/src/app/java/im/vector/gcm/GCMHelper.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
/*
* Copyright 2014 OpenMarket Ltd
* Copyright 2017 Vector Creations Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -27,27 +27,11 @@ class GCMHelper {
private static final String LOG_TAG = GCMHelper.class.getSimpleName();

/**
* Retrieves the GCM registration token.
* Retrieves the FCM registration token.
*/
public static String getRegistrationToken() {
String registrationToken = null;

try {
if (null == VectorApp.getInstance()) {
Log.e(LOG_TAG, "## getRegistrationToken() : No active application");
} else {
if (null == FirebaseApp.initializeApp(VectorApp.getInstance())) {
Log.e(LOG_TAG, "## getRegistrationToken() : cannot initialise FirebaseApp");
}
}
// try to get the token anyway
registrationToken = FirebaseInstanceId.getInstance().getToken();
Log.d(LOG_TAG, "## getRegistrationToken(): " + registrationToken);
} catch (Exception e) {
Log.e(LOG_TAG, "## getRegistrationToken() : failed " + e.getMessage());
}


final String registrationToken = FirebaseInstanceId.getInstance().getToken();
Log.d(LOG_TAG, "## getRegistrationToken(): " + registrationToken);
return registrationToken;
}

Expand All @@ -58,7 +42,7 @@ public static void clearRegistrationToken() {
try {
FirebaseInstanceId.getInstance().deleteInstanceId();
} catch (Exception e) {
Log.e(LOG_TAG, "##clearRegistrationToken() failed " + e.getMessage());
Log.e(LOG_TAG, "##clearRegistrationToken() failed " + e.getMessage(), e);
}
}
}
33 changes: 22 additions & 11 deletions vector/src/app/java/im/vector/gcm/MatrixGcmListenerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package im.vector.gcm;

import android.support.annotation.Nullable;

import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.google.gson.JsonParser;
Expand Down Expand Up @@ -54,6 +56,7 @@ public class MatrixGcmListenerService extends FirebaseMessagingService {
* @param data the GCM data
* @return the event
*/
@Nullable
private Event parseEvent(Map<String, String> data) {
// accept only event with room id.
if ((null == data) || !data.containsKey("room_id") || !data.containsKey("event_id")) {
Expand All @@ -73,7 +76,7 @@ private Event parseEvent(Map<String, String> data) {

return event;
} catch (Exception e) {
Log.e(LOG_TAG, "buildEvent fails " + e.getLocalizedMessage());
Log.e(LOG_TAG, "buildEvent fails " + e.getLocalizedMessage(), e);
}

return null;
Expand Down Expand Up @@ -121,13 +124,14 @@ private void onMessageReceivedInternal(final Map<String, String> data) {
Event event = parseEvent(data);

String roomName = data.get("room_name");
if ((null == roomName) && (null != roomId)) {
if (null == roomName && null != roomId) {
// Try to get the room name from our store
MXSession session = Matrix.getInstance(getApplicationContext()).getDefaultSession();

if ((null != session) && session.getDataHandler().getStore().isReady()) {
Room room = session.getDataHandler().getStore().getRoom(roomId);
if (null != room) {
roomName = VectorUtils.getRoomDisplayName(MatrixGcmListenerService.this, session, room);
roomName = VectorUtils.getRoomDisplayName(this, session, room);
}
}
}
Expand All @@ -141,36 +145,36 @@ private void onMessageReceivedInternal(final Map<String, String> data) {
// check if the application has been launched once
// the first GCM event could have been triggered whereas the application is not yet launched.
// so it is required to create the sessions and to start/resume event stream
if (!mCheckLaunched && (null != Matrix.getInstance(getApplicationContext()).getDefaultSession())) {
CommonActivityUtils.startEventStreamService(MatrixGcmListenerService.this);
if (!mCheckLaunched && null != Matrix.getInstance(getApplicationContext()).getDefaultSession()) {
CommonActivityUtils.startEventStreamService(this);
mCheckLaunched = true;
}

// check if the event was not yet received
// a previous catchup might have already retrieved the notified event
if ((null != eventId) && (null != roomId)) {
if (null != eventId && null != roomId) {
try {
Collection<MXSession> sessions = Matrix.getInstance(getApplicationContext()).getSessions();

if ((null != sessions) && (sessions.size() > 0)) {
if (null != sessions && !sessions.isEmpty()) {
for (MXSession session : sessions) {
if (session.getDataHandler().getStore().isReady()) {
if (null != session.getDataHandler().getStore().getEvent(eventId, roomId)) {
Log.e(LOG_TAG, "## onMessageReceivedInternal() : ignore the event " + eventId
+ " in room " + roomId + "because it is already known");
+ " in room " + roomId + " because it is already known");
return;
}
}
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "## onMessageReceivedInternal() : failed to check if the event was already defined " + e.getMessage());
Log.e(LOG_TAG, "## onMessageReceivedInternal() : failed to check if the event was already defined " + e.getMessage(), e);
}
}

CommonActivityUtils.catchupEventStream(MatrixGcmListenerService.this);
CommonActivityUtils.catchupEventStream(this);
} catch (Exception e) {
Log.d(LOG_TAG, "## onMessageReceivedInternal() failed : " + e.getMessage());
Log.d(LOG_TAG, "## onMessageReceivedInternal() failed : " + e.getMessage(), e);
}
}

Expand All @@ -181,6 +185,13 @@ private void onMessageReceivedInternal(final Map<String, String> data) {
*/
@Override
public void onMessageReceived(RemoteMessage message) {
Log.d(LOG_TAG, "## onMessageReceived() from FCM");

// Ensure event stream service is started
if (EventStreamService.getInstance() == null) {
CommonActivityUtils.startEventStreamService(this);
}

final Map<String, String> data = message.getData();

if (null == mUIHandler) {
Expand Down
27 changes: 19 additions & 8 deletions vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" tools:ignore="ProtectedPermissions"/>
<uses-permission
android:name="android.permission.READ_LOGS"
tools:ignore="ProtectedPermissions" />

<!-- universal links management -->
<uses-permission android:name="android.permission.REORDER_TASKS" />
Expand All @@ -22,11 +24,15 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- required on android 6.0.0 devices -->
<uses-permission android:name="android.permission.WRITE_SETTINGS" tools:ignore="ProtectedPermissions"/>
<uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<!-- shared files from external application -->
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" tools:ignore="ProtectedPermissions"/>
<uses-permission
android:name="android.permission.MANAGE_DOCUMENTS"
tools:ignore="ProtectedPermissions" />

<!-- to be able to turn on display when a notification is received-->
<uses-permission android:name="android.permission.WAKE_LOCK" />
Expand All @@ -35,7 +41,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<!-- disable the battery optimisation on some devices to let the background sync works -->
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<!-- videocall feature-->
<!-- android.permission.CAMERA defines android.hardware.camera -->
Expand All @@ -47,7 +53,7 @@
<uses-feature
android:name="android.hardware.camera.any"
android:required="false"
tools:replace="required"/>
tools:replace="required" />

<uses-feature
android:name="android.hardware.camera.autofocus"
Expand Down Expand Up @@ -104,7 +110,7 @@
<!-- No limit for screen ratio: avoid black strips -->
<meta-data
android:name="android.max_aspect"
android:value="9.9"/>
android:value="9.9" />

<!-- activities list starts here -->
<activity
Expand Down Expand Up @@ -306,7 +312,7 @@
android:label="@string/title_activity_group_details"
android:launchMode="singleTop"
android:theme="@style/GroupAppTheme"
android:windowSoftInputMode="adjustResize"/>
android:windowSoftInputMode="adjustResize" />
<activity android:name=".activity.VectorUniversalLinkActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand Down Expand Up @@ -385,7 +391,12 @@
android:label="@string/settings_notification_privacy"
android:theme="@style/CountryPickerTheme" />
<activity
android:name=".activity.SimpleWebViewActivity"
android:name=".activity.VectorWebViewActivity"
android:theme="@style/AppTheme.NoActionBar" />

<activity
android:name="im.vector.activity.MediaPreviewerActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar" />

<!-- broadcast receiver -->
Expand Down
Loading

0 comments on commit 04edbf9

Please sign in to comment.