Android Open Source - android4tv-example4 Parental Callback






From Project

Back to project page android4tv-example4.

License

The source code is released under:

Apache License

If you think the Android project android4tv-example4 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 (C) 2014 iWedia S.A. 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.
 */// w w w.  j  av a 2s  .  c om
package com.iwedia.exampleip.callbacks;

import android.content.Context;
import android.util.Log;

import com.iwedia.dtv.parental.dvb.IParentalCallbackDvb;
import com.iwedia.dtv.parental.dvb.ParentalAgeEvent;
import com.iwedia.exampleip.dtv.DVBManager;

/**
 * Parental control callback.
 */
public class ParentalCallback implements IParentalCallbackDvb {
    private DVBManager mDvbManager = null;
    private static ParentalCallback sInstance;

    public static ParentalCallback getInstance(Context context) {
        if (sInstance == null) {
            sInstance = new ParentalCallback(context);
        }
        return sInstance;
    }

    private ParentalCallback(final Context context) {
        mDvbManager = DVBManager.getInstance();
    }

    @Override
    public void ageLocked(ParentalAgeEvent arg0) {
        Log.d("ParentalCallback", "AGE LOCKED CALLBACK HAPPENED, FOR AGE: "
                + arg0.getAge() + ", IS LOCKED: " + arg0.isLocked());
        mDvbManager.updateAgeLocked(arg0.isLocked());
    }

    @Override
    public void channelLocked(int arg0, boolean arg1) {
        Log.d("ParentalCallback",
                "CHANNEL LOCKED CALLBACK HAPPENED, FOR CHANNEL: " + arg0 + " "
                        + arg1);
        mDvbManager.updateChannelLocked(arg1);
    }
}




Java Source Code List

com.iwedia.custom.EnterPinDialog.java
com.iwedia.custom.SoftwareVersionDialog.java
com.iwedia.exampleip.ChannelListDialog.java
com.iwedia.exampleip.DTVActivity.java
com.iwedia.exampleip.TeletextActivity.java
com.iwedia.exampleip.adapters.ChannelListAdapter.java
com.iwedia.exampleip.callbacks.EPGCallBack.java
com.iwedia.exampleip.callbacks.ParentalCallback.java
com.iwedia.exampleip.dtv.ChannelInfo.java
com.iwedia.exampleip.dtv.DVBManager.java
com.iwedia.exampleip.dtv.IPService.java
com.iwedia.exampleip.dtv.ParentalManager.java
com.iwedia.exampleip.dtv.TeletextSubtitleAudioManager.java