nickmao1985 / apndroid

Automatically exported from code.google.com/p/apndroid
0 stars 0 forks source link

Request for APN switch API ignores default notification config #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. configure APNDroid to disable state notifications
2. third party app sends intent 
com.google.code.apndroid.intent.action.CHANGE_REQUEST with only 
TARGET_APN_STATE parameter

What is the expected output? What do you see instead?

APN state changed without notification bar status icon displayed.
However I see that notification icon is still displayed when state is 
changed through API, nevertheless it does not displayed upon manual change 
through widget

What version of the product are you using? On what operating system?
Version 10 on Nexus One 2.1-update1

Please provide any additional information below.

Original issue reported on code.google.com by sergey.p...@gmail.com on 17 Apr 2010 at 9:47

GoogleCodeExporter commented 9 years ago

Original comment by zeldigas on 18 Apr 2010 at 9:38

GoogleCodeExporter commented 9 years ago
Please check a new build (r17) and report if the problem still can be 
reproduced. If
it is, send a log please.

Original comment by zeldigas on 18 Apr 2010 at 10:14

GoogleCodeExporter commented 9 years ago
if you'll find this bug again, comment and i'll reopen it for further fixing

Original comment by zeldigas on 19 Apr 2010 at 1:42

GoogleCodeExporter commented 9 years ago
Just installed r17. No luck. Here is what logcat says
D/        ( 1313): unable to unlink 
'/data/data/com.google.code.apndroid/shared_prefs/com.google.code.apndroid.widge
t.SET
TINGS.xml.bak': No such file or directory (errno=2)
I/apndroid.log( 1313): switching apn state [target=0, modifyMms=1, 
showNotification=true]
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=1, modifyMms=1, 
showNotification=true]
D/apndroid.log( 1313): Current Preferred APN=93, stored preferred APN=93
D/apndroid.log( 1313): trying to fix connection
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=0, modifyMms=1, 
showNotification=true]
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=1, modifyMms=1, 
showNotification=true]
D/apndroid.log( 1313): Current Preferred APN=93, stored preferred APN=93
D/apndroid.log( 1313): trying to fix connection
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=0, modifyMms=1, 
showNotification=true]
I/apndroid.log( 1313): switch success=true
I/ActivityManager(   78): Starting activity: Intent { 
act=android.intent.action.MAIN 
cat=[android.intent.category.LAUNCHER] flg=0x10200000 
cmp=com.google.code.apndroid/.MainActivity }
I/apndroid.log( 1313): switching apn state [target=1, modifyMms=1, 
showNotification=true]
D/apndroid.log( 1313): Current Preferred APN=93, stored preferred APN=93
D/apndroid.log( 1313): trying to fix connection
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=0, modifyMms=1, 
showNotification=true]
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=1, modifyMms=1, 
showNotification=true]
D/apndroid.log( 1313): Current Preferred APN=93, stored preferred APN=93
D/apndroid.log( 1313): trying to fix connection
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=0, modifyMms=1, 
showNotification=true]
I/apndroid.log( 1313): switch success=true
I/apndroid.log( 1313): switching apn state [target=1, modifyMms=1, 
showNotification=true]
D/apndroid.log( 1313): Current Preferred APN=93, stored preferred APN=93
D/apndroid.log( 1313): trying to fix connection
I/apndroid.log( 1313): switch success=true

In app notifications are set to false and don't show up if I change state 
manually 
through the widget

Original comment by sergey.p...@gmail.com on 19 Apr 2010 at 2:23

GoogleCodeExporter commented 9 years ago
Strange that there were no logs entries from API activity (ActionActivity). 
I'll use
api-example application (can be found in APNdroid repo) for check it again.

Original comment by zeldigas on 20 Apr 2010 at 10:04

GoogleCodeExporter commented 9 years ago
If it helps I'm using equivalent of this code:

Intent intent = new 
Intent("com.google.code.apndroid.intent.action.CHANGE_REQUEST");
intent.putExtra("com.google.code.apndroid.intent.extra.TARGET_STATE", 1);
context.sendBroadcast(intent);

So this will show notification regardless of app default settings. If I 
explicitly 
add:
intent.putExtra("com.google.code.apndroid.intent.extra.SHOW_NOTIFICATION", 
false);
to the code above, than it does not show notification. 

Not a life critical, since I ended up providing explicit 'no notification' 
option to 
the user.. Just wanted to let you know

Original comment by sergey.p...@gmail.com on 20 Apr 2010 at 10:26

GoogleCodeExporter commented 9 years ago
There is a probability that r17 was build without fix of this bug. Next build
(oficcial and published on market) will contain correct fix.
Here is a log with a fixed code:
04-20 11:23:41.554: INFO/ActivityManager(52): Starting activity: Intent {
act=com.google.code.apndroid.intent.action.CHANGE_REQUEST
cmp=com.google.code.apndroid/.ActionActivity (has extras) }
04-20 11:23:41.598: INFO/apndroid.log(334): MMS target state is unspecified
04-20 11:23:41.605: INFO/apndroid.log(334): Show notification icon setting is 
unspecified
04-20 11:23:41.696: INFO/apndroid.log(334): switching apn state [target=0,
modifyMms=1, showNotification=false]
04-20 11:23:41.821: INFO/apndroid.log(334): switch success=true

It was tested with api example app with commented lines 44, 46.

After release test it again please and if it is still wrong result, report 
about it.

Original comment by zeldigas on 20 Apr 2010 at 11:31