signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.62k stars 6.15k forks source link

It is not possible to set a group avatar #641

Closed Deccoy closed 10 years ago

Deccoy commented 10 years ago

Hello,

thanks for your great work.

On my CM11 phone it is not possible to set a group avatar. Clicking on the empty group avatar wil open the "image selecting form", but whatever i choose, the group avatar stays empty after selection.

Bedt regards, Deccoy

mcginty commented 10 years ago

Hi @Deccoy, thanks for the issue. We've actually seen this before but have been unable to identify a root cause. To help identify what's happening, can you tell me what device you're running this on, and paste a logcat of you trying to set the group avatar?

Deccoy commented 10 years ago

Hi,

I have checked the issue on my second phone, there it works. Maybe it has to do something with my custom ROM. I will provide the logcat tomorrow, because it is after midnight here in europe :-)

mcginty commented 10 years ago

Unfortunately I think it's more complex than that. I run CM11 and it works fine for me, but then it didn't work on a phone running stock. Thanks in advance!

Deccoy commented 10 years ago

s, expected. msg: No permission to write APN settings: Neither user 10079 nor current process has android.permission.WRITE_APN_SETTINGS. 02-25 09:14:27.392 W/MmsSmsDatabase( 6435): Executing query: SELECT _id, body, read, type, address, address_device_id, subject, thread_id, status, date_sent, date_received, m_type, msg_box, part_count, ct_l, tr_id, m_size, exp, st, transport_type FROM (SELECT DISTINCT date_sent * 1 AS date_sent, date * 1 AS date_received, _id, body, read, thread_id, type, address, address_device_id, subject, NULL AS m_type, NULL AS msg_box, status, NULL AS part_count, NULL AS ct_l, NULL AS tr_id, NULL AS m_size, NULL AS exp, NULL AS st, 'sms' AS transport_type FROM sms WHERE (read = 0) UNION ALL SELECT DISTINCT date * 1000 AS date_sent, date_received * 1000 AS date_received, _id, body, read, thread_id, NULL AS type, address, address_device_id, NULL AS subject, m_type, msg_box, NULL AS status, part_count, ct_l, tr_id, m_size, exp, st, 'mms' AS transport_type FROM mms WHERE (read = 0) ORDER BY date_received ASC) 02-25 09:14:27.472 W/KeyCachingService( 6435): Incrementing activity count... 02-25 09:14:27.642 I/ActivityManager( 6435): Timeline: Activity_idle id: android.os.BinderProxy@418c3ae8 time:6230958 02-25 09:14:27.972 I/ActivityManager( 1884): Timeline: Activity_windows_visible id: ActivityRecord{41f19d38 u0 org.thoughtcrime.securesms/.ConversationActivity t53} time:6231280 02-25 09:14:30.865 I/ActivityManager( 6435): Timeline: Activity_launch_request id:org.thoughtcrime.securesms time:6234178 02-25 09:14:30.885 I/ActivityManager( 1884): START u0 {cmp=org.thoughtcrime.securesms/.GroupCreateActivity (has extras)} from pid 6435 02-25 09:14:30.975 W/KeyCachingService( 6435): Decrementing activity count... 02-25 09:14:30.975 W/KeyCachingService( 6435): Starting timeout: 21600000 02-25 09:14:31.405 W/KeyCachingService( 6435): Incrementing activity count... 02-25 09:14:31.566 I/ActivityManager( 1884): Displayed org.thoughtcrime.securesms/.GroupCreateActivity: +614ms 02-25 09:14:31.816 I/LatinIME:LogUtils( 2101): Dictionary info: dictionary = contacts.de_DE.dict ; version = ? ; date = ? 02-25 09:14:31.876 I/ActivityManager( 6435): Timeline: Activity_idle id: android.os.BinderProxy@41a46538 time:6235187 02-25 09:14:31.926 I/ActivityManager( 1884): Timeline: Activity_windows_visible id: ActivityRecord{41d063e8 u0 org.thoughtcrime.securesms/.GroupCreateActivity t53} time:6235232 02-25 09:14:33.347 I/ActivityManager( 1884): START u0 {act=android.intent.action.GET_CONTENT typ=image/* cmp=com.android.documentsui/.DocumentsActivity (has extras)} from pid 6435 02-25 09:14:33.407 W/KeyCachingService( 6435): Decrementing activity count... 02-25 09:14:33.407 W/KeyCachingService( 6435): Starting timeout: 21600000 02-25 09:14:33.618 I/Adreno200-EGL( 6834): : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_VANILLA.04.02.02.60.051_msm8960_JB_VANILLA_CL2997615_release_AU (CL2997615) 02-25 09:14:33.618 I/Adreno200-EGL( 6834): Build Date: 04/11/13 Thu 02-25 09:14:33.618 I/Adreno200-EGL( 6834): Local Branch: 02-25 09:14:33.618 I/Adreno200-EGL( 6834): Remote Branch: quic/mako_jb_mr1 02-25 09:14:33.618 I/Adreno200-EGL( 6834): Local Patches: NONE 02-25 09:14:33.618 I/Adreno200-EGL( 6834): Reconstruct Branch: AU_LINUX_ANDROID_JB_VANILLA.04.02.02.60.051 + NOTHING 02-25 09:14:34.158 I/ActivityManager( 1884): Displayed com.android.documentsui/.DocumentsActivity: +771ms 02-25 09:14:34.198 W/IInputConnectionWrapper( 6435): showStatusIcon on inactive InputConnection 02-25 09:14:34.228 D/Documents( 6834): Current stack: 02-25 09:14:34.228 D/Documents( 6834): * Root{authority=com.android.providers.media.documents, rootId=images_root, title=Bilder} 02-25 09:14:34.228 D/Documents( 6834): +-- Document{docId=images_bucket:372605949, name=WallPaper} 02-25 09:14:34.228 D/Documents( 6834): +-- Document{docId=images_root, name=Bilder} 02-25 09:14:34.488 I/ActivityManager( 1884): Timeline: Activity_windows_visible id: ActivityRecord{41dae2f0 u0 com.android.documentsui/.DocumentsActivity t53} time:6237795 02-25 09:14:34.538 D/Documents( 6834): userMode=0, userSortOrder=0 --> mode=2, sortOrder=2 02-25 09:14:34.569 I/ActivityManager( 6834): Timeline: Activity_idle id: android.os.BinderProxy@41aac148 time:6237875 02-25 09:14:35.900 D/Documents( 6834): onFinished() [content://com.android.providers.media.documents/document/image%3A20057] 02-25 09:14:35.970 W/KeyCachingService( 6435): Incrementing activity count... 02-25 09:14:36.040 I/ActivityManager( 6435): Timeline: Activity_idle id: android.os.BinderProxy@41a46538 time:6239346 02-25 09:14:36.090 D/skia ( 6435): --- SkImageDecoder::Factory returned null 02-25 09:14:36.370 I/ActivityManager( 1884): Timeline: Activity_windows_visible id: ActivityRecord{41d063e8 u0 org.thoughtcrime.securesms/.GroupCreateActivity t53} time:6239685 02-25 09:14:38.352 I/ActivityManager( 1884): START u0 {act=com.android.systemui.recent.action.TOGGLE_RECENTS flg=0x10800000 cmp=com.android.systemui/.recent.RecentsActivity (has extras)} from pid 2013 02-25 09:14:38.592 W/KeyCachingService( 6435): Decrementing activity count... 02-25 09:14:38.592 W/KeyCachingService( 6435): Starting timeout: 21600000 02-25 09:14:38.663 W/InputMethodManagerService( 1884): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41da11f8 (uid=10079 pid=6435) 02-25 09:14:38.663 W/IInputConnectionWrapper( 6435): showStatusIcon on inactive InputConnection 02-25 09:14:38.743 I/ActivityManager( 2013): Timeline: Activity_idle id: android.os.BinderProxy@419948c0 time:6242051 02-25 09:14:39.013 I/ActivityManager( 1884): Timeline: Activity_windows_visible id: ActivityRecord{41d47db0 u0 com.android.systemui/.recent.RecentsActivity t20} time:6242324 02-25 09:14:39.243 D/SizeAdaptiveLayout( 2013): com.android.internal.widget.SizeAdaptiveLayout{419eb580 V.E..... ......I. 0,0-0,0 #7f070062 app:id/adaptive}child view android.widget.FrameLayout{419bda28 G.E..... ......ID 0,0-0,0 #10202d6 android:id/status_bar_latest_event_content} measured out of bounds at 95px clamped to 96px 02-25 09:14:39.243 I/InputDispatcher( 1884): Dropped event because of pending overdue app switch. 02-25 09:14:39.283 D/SizeAdaptiveLayout( 2013): com.android.internal.widget.SizeAdaptiveLayout{419eb580 V.E..... ......I. 0,0-0,0 #7f070062 app:id/adaptive}child view android.widget.FrameLayout{419bda28 G.E..... ......ID 0,0-0,0 #10202d6 android:id/status_bar_latest_event_content} measured out of bounds at 95px clamped to 96px 02-25 09:14:39.353 V/PanelView( 2013): animationTick called with dtms=0; nothing to do (h=1.3639104 v=0.0) 02-25 09:14:39.363 V/PanelView( 2013): animationTick called with dtms=0; nothing to do (h=1.3639104 v=-3000.0) 02-25 09:14:39.483 W/InputMethodManagerService( 1884): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41e11a18 attribute=null, token = android.os.BinderProxy@41e43180 02-25 09:14:41.305 V/PhoneStatusBar( 2013): setLightsOn(true) 02-25 09:14:41.575 I/ActivityManager( 7090): Timeline: Activity_idle id: android.os.BinderProxy@4187b220 time:6244883 02-25 09:14:41.926 I/ActivityManager( 1884): Timeline: Activity_windows_visible id: ActivityRecord{41dafad8 u0 com.nolanlawson.logcat/.LogcatActivity t59} time:6245230 02-25 09:14:44.068 D/su ( 7270): su invoked. 02-25 09:14:44.068 D/su ( 7270): starting daemon client 10107 10107 02-25 09:14:44.078 D/su ( 7272): remote pid: 7270 02-25 09:14:44.078 D/su ( 7272): remote pts_slave: 02-25 09:14:44.078 D/su ( 7272): waiting for child exit 02-25 09:14:44.088 D/su ( 7274): su invoked. 02-25 09:14:44.098 D/su ( 7274): db allowed 02-25 09:14:44.098 D/su ( 7274): 10107 /system/xbin/su executing 0 /system/bin/sh using binary /system/bin/sh : sh 02-25 09:14:44.168 D/su ( 7272): sending code 02-25 09:14:44.168 D/su ( 7272): child exited 02-25 09:14:44.168 D/su ( 7270): client exited 0 02-25 09:14:44.278 D/su ( 7278): su invoked. 02-25 09:14:44.278 D/su ( 7278): starting daemon client 10107 10107 02-25 09:14:44.308 D/su ( 7280): remote pid: 7278 02-25 09:14:44.308 D/su ( 7280): remote pts_slave: 02-25 09:14:44.308 D/su ( 7280): waiting for child exit 02-25 09:14:44.308 D/su ( 7282): su invoked. 02-25 09:14:44.308 D/su ( 7282): db allowed 02-25 09:14:44.318 D/su ( 7282): 10107 /system/xbin/su executing 0 /system/bin/sh using binary /system/bin/sh : sh 02-25 09:14:44.318 D/su ( 7280): sending code 02-25 09:14:44.318 D/su ( 7280): child exited 02-25 09:14:44.338 D/su ( 7278): client exited 0 02-25 09:14:44.498 D/su ( 7285): su invoked. 02-25 09:14:44.508 D/su ( 7285): starting daemon client 10107 10107 02-25 09:14:44.508 D/su ( 7287): remote pid: 7285 02-25 09:14:44.508 D/su ( 7287): remote pts_slave: 02-25 09:14:44.508 D/su ( 7287): waiting for child exit 02-25 09:14:44.518 D/su ( 7289): su invoked. 02-25 09:14:44.538 D/su ( 7289): db allowed 02-25 09:14:44.538 D/su ( 7289): 10107 /system/xbin/su executing 0 /system/bin/sh using binary /system/bin/sh : sh 02-25 09:14:44.558 D/su ( 7287): sending code 02-25 09:14:44.558 D/su ( 7287): child exited

Deccoy commented 10 years ago

lt still doesn't working on my phone. On my table it works.

n00b42 commented 10 years ago

Not working on my i9100, rooted, CM11-20140205-Nightly-i9100 using TextSecure from AppStore

phime42 commented 10 years ago

Not working.

makubi commented 10 years ago

I tried to trace down the problem and - at least for me - BitmapFactory.decodeFile(pendingFile.getAbsolutePath()) in GroupCreateActivity.java:503 returns null: https://github.com/WhisperSystems/TextSecure/blob/d5f04159074544d715628b870aa048993ee69b7d/src/org/thoughtcrime/securesms/GroupCreateActivity.java#L503

I think that the call to android.graphics.BitmapFactory.nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) in BitmapFactory.java:613 returns null.

Using CM-11-20140210-SNAPSHOT-M3-crespo

ghost commented 10 years ago

Doesn't work for me either. Using Moto G running 4.4.2. I will sent a logcat when Google told me how to do that ;)

DorianScholz commented 10 years ago

I made pull request #946 to fix this. Please test if this solves the issue for you too.

It removes the non standard use of cropping and replaces it with a simple circle crop from the center. (see comments on http://stackoverflow.com/questions/11375131/android-crop-image) If we want a user selectable crop, we might need to use something like this; https://github.com/biokys/cropimage

mcginty commented 10 years ago

@Deccoy could you try @DorianScholz's PR and see if it solves the issue for you?

Deccoy commented 10 years ago

It works for me, thank you.

cramu commented 10 years ago

Setting the group avatar works for me (N4) only with stock gallery. GPhotos, QuickPic and Total Commander result in an empty avatar.

DorianScholz commented 10 years ago

@cramu; I just tried using other image providers and they all worked for me: Gallery, ES File Explorer, Total Commander, GPhotos. This is on an HTC One with 4.4.2 What is you configuration? (I assume on N4 you also have 4.4.2?) And could you post a debug log (Settings->Submit Debug Log), thanks.

ghost commented 10 years ago

In my Moto G (4.4.2) I have the following behavior:

When clicking in the group icon the standard Gallery APP comes up. Choosing a picture from there does not work. But when I take the path from the upper left icon from where you can choose different Apps, the standard Gallery App does works for setting up an Icon

DorianScholz commented 10 years ago

@volkerpfosten is that with our without my patch? (this patch is not in the app yet, unless you have compiled it yourself)

ghost commented 10 years ago

Sry if I've read sth. over...

This happens here in Stock Android running 2.0.4 from the Play Store - so nothing compiled by myself or patched!

cramu commented 10 years ago

I'm running KOT49H with Xposed and some modules. Debug log submitted. I use official version from PlayStore also, so I can't tell if your patch works. Just thought it would help to share a workaround.