Android Open Source - smstimefix Receiver






From Project

Back to project page smstimefix.

License

The source code is released under:

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...

If you think the Android project smstimefix listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright 2012 Matthew Precious/*www.  ja  va 2s  .c o  m*/
 * 
 * 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. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package com.mattprecious.smsfix.library;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;

public class Receiver extends BroadcastReceiver {
    private final static String TAG = "Receiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAG, "Received " + intent.getAction() + " intent");

        String name = context.getPackageName() + "_preferences";

        Log.d(TAG, "Using preferences: " + name);

        SharedPreferences settings = context.getSharedPreferences(name, 0);

        boolean active = settings.getBoolean("active", false);

        Log.d(TAG, "Active preference: " + Boolean.toString(active));

        if (active) {
            Log.d(TAG, "Starting FixService");
            Intent svc = new Intent(context, FixService.class);
            context.startService(svc);
        }
    }
}




Java Source Code List

com.mattprecious.smsfix.library.About.java
com.mattprecious.smsfix.library.FixOld.java
com.mattprecious.smsfix.library.FixService.java
com.mattprecious.smsfix.library.Receiver.java
com.mattprecious.smsfix.library.SMSFix.java
com.mattprecious.smsfix.library.util.SmsMmsDbHelper.java
com.mattprecious.smsfix.library.util.TimeHelper.java