Updated GCM to be package compliant

This commit is contained in:
Sylvain Berfini 2012-09-26 16:46:43 +02:00
parent f04f596600
commit 1536c53a44
3 changed files with 45 additions and 7 deletions

View file

@ -86,7 +86,7 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".setup.SetupActivity" <activity android:name="org.linphone.setup.SetupActivity"
android:theme="@style/NoTitle" android:theme="@style/NoTitle"
android:screenOrientation="nosensor"> android:screenOrientation="nosensor">
<intent-filter> <intent-filter>
@ -109,7 +109,7 @@
</receiver> </receiver>
<!-- Needed for push notification --> <!-- Needed for push notification -->
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <receiver android:name="org.linphone.gcm.GCMReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter> <intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
@ -117,7 +117,7 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<service android:name=".GCMIntentService" /> <service android:name="org.linphone.gcm.GCMService" />
</application> </application>

View file

@ -0,0 +1,36 @@
package org.linphone.gcm;
/*
GCMReceiver.java
Copyright (C) 2012 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import org.linphone.core.Log;
import android.content.Context;
import com.google.android.gcm.GCMBroadcastReceiver;
/**
* @author Sylvain Berfini
*/
public class GCMReceiver extends GCMBroadcastReceiver {
@Override
protected String getGCMIntentServiceClassName(Context context) {
Log.e("Broadcasting GCM = " + context.getPackageName() + ".gcm.GCMService");
return context.getPackageName() + ".gcm.GCMService";
}
}

View file

@ -1,6 +1,6 @@
package org.linphone; package org.linphone.gcm;
/* /*
GCMIntentService.java GCMService.java
Copyright (C) 2012 Belledonne Communications, Grenoble, France Copyright (C) 2012 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -18,6 +18,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
import org.linphone.LinphoneManager;
import org.linphone.R;
import org.linphone.core.LinphoneCoreException; import org.linphone.core.LinphoneCoreException;
import org.linphone.core.Log; import org.linphone.core.Log;
@ -32,9 +34,9 @@ import com.google.android.gcm.GCMBaseIntentService;
* @author Sylvain Berfini * @author Sylvain Berfini
*/ */
// Warning ! Do not rename the service ! // Warning ! Do not rename the service !
public class GCMIntentService extends GCMBaseIntentService { public class GCMService extends GCMBaseIntentService {
public GCMIntentService() { public GCMService() {
} }