diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-31 08:21:38 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-31 08:21:38 -0400 |
| commit | 02811010cf62f1b21a06780d1e470d04bb24c50f (patch) | |
| tree | 0d933789068aac11c810ed4bb169d14ab16c43c6 /plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java | |
| parent | bca561c1b3989d62a1fba829e0380c6fbf36caf5 (diff) | |
removed unecessary files from git
Diffstat (limited to 'plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java')
| -rw-r--r-- | plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java b/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java deleted file mode 100644 index 57d2be84..00000000 --- a/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.adobe.phonegap.push; - -import android.app.Activity; -import android.app.NotificationManager; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.util.Log; - -public class PushHandlerActivity extends Activity implements PushConstants { - private static String LOG_TAG = "PushPlugin_PushHandlerActivity"; - - /* - * this activity will be started if the user touches a notification that we own. - * We send it's data off to the push plugin for processing. - * If needed, we boot up the main activity to kickstart the application. - * @see android.app.Activity#onCreate(android.os.Bundle) - */ - @Override - public void onCreate(Bundle savedInstanceState) { - GCMIntentService gcm = new GCMIntentService(); - gcm.setNotification(getIntent().getIntExtra(NOT_ID, 0), ""); - super.onCreate(savedInstanceState); - Log.v(LOG_TAG, "onCreate"); - - boolean isPushPluginActive = PushPlugin.isActive(); - processPushBundle(isPushPluginActive); - - finish(); - - if (!isPushPluginActive) { - forceMainActivityReload(); - } - } - - /** - * Takes the pushBundle extras from the intent, - * and sends it through to the PushPlugin for processing. - */ - private void processPushBundle(boolean isPushPluginActive) { - Bundle extras = getIntent().getExtras(); - - if (extras != null) { - Bundle originalExtras = extras.getBundle(PUSH_BUNDLE); - - originalExtras.putBoolean(FOREGROUND, false); - originalExtras.putBoolean(COLDSTART, !isPushPluginActive); - originalExtras.putString(CALLBACK, getIntent().getExtras().getString("callback")); - - PushPlugin.sendExtras(originalExtras); - } - } - - /** - * Forces the main activity to re-launch if it's unloaded. - */ - private void forceMainActivityReload() { - PackageManager pm = getPackageManager(); - Intent launchIntent = pm.getLaunchIntentForPackage(getApplicationContext().getPackageName()); - startActivity(launchIntent); - } - - @Override - protected void onResume() { - super.onResume(); - final NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancelAll(); - } -}
\ No newline at end of file |
