Example usage for android.media.tv TvInputInfo toString

List of usage examples for android.media.tv TvInputInfo toString

Introduction

In this page you can find the example usage for android.media.tv TvInputInfo toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.android.tv.dvr.DvrSessionManager.java

@Override
public void onInputAdded(String inputId) {
    super.onInputAdded(inputId);
    TvInputInfo info = mTvInputManager.getTvInputInfo(inputId);
    if (DEBUG) {/*from w w w .  ja va 2  s . c om*/
        Log.d(TAG, "onInputAdded " + info.toString() + " canRecord=" + info.canRecord() + " tunerCount="
                + info.getTunerCount());
    }
    if (info.canRecord()) {
        mRecordingTvInputs.put(inputId, info);
    }
}

From source file:com.android.tv.dvr.DvrSessionManager.java

@Override
public void onInputUpdated(String inputId) {
    super.onInputUpdated(inputId);
    TvInputInfo info = mTvInputManager.getTvInputInfo(inputId);
    if (DEBUG) {/* w w w  .jav  a 2 s  . c om*/
        Log.d(TAG, "onInputUpdated " + info.toString() + " canRecord=" + info.canRecord() + " tunerCount="
                + info.getTunerCount());
    }
    if (info.canRecord()) {
        mRecordingTvInputs.put(inputId, info);
    } else {
        mRecordingTvInputs.remove(inputId);
    }
}

From source file:com.android.usbtuner.UsbInputController.java

/**
 * Enable/disable the component {@link UsbTunerTvInputService}.
 *
 * @param context {@link Context} instance
 * @param enabled {@code true} to enable the service; otherwise {@code false}
 *//*from   w w  w.j av  a 2 s  . c o m*/
private void enableUsbTunerTvInputService(Context context, boolean enabled) {
    PackageManager pm = context.getPackageManager();
    ComponentName USBTUNER = new ComponentName(context, UsbTunerTvInputService.class);

    // Don't kill app by enabling/disabling TvActivity. If LC is killed by enabling/disabling
    // TvActivity, the following pm.setComponentEnabledSetting doesn't work.
    ((TvApplication) context.getApplicationContext()).handleInputCountChanged(true, enabled, true);
    // Since PackageManager.DONT_KILL_APP delays the operation by 10 seconds
    // (PackageManagerService.BROADCAST_DELAY), we'd better avoid using it. It is used only
    // when the LiveChannels app is active since we don't want to kill the running app.
    int flags = TvApplication.getSingletons(context).getMainActivityWrapper().isCreated()
            ? PackageManager.DONT_KILL_APP
            : 0;
    int newState = enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
            : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
    if (newState != pm.getComponentEnabledSetting(USBTUNER)) {
        // Send/cancel the USB tuner TV input setup recommendation card.
        TunerSetupActivity.onTvInputEnabled(context, enabled);
        // Enable/disable the USB tuner TV input.
        pm.setComponentEnabledSetting(USBTUNER, newState, flags);
        if (DEBUG)
            Log.d(TAG, "Status updated:" + enabled);
    }
    if (enabled && BuildCompat.isAtLeastN()) {
        TvInputInfo info = mDvbDeviceAccessor.buildTvInputInfo(context);
        if (info != null) {
            Log.i(TAG, "TvInputInfo updated: " + info.toString());
            ((TvInputManager) context.getSystemService(Context.TV_INPUT_SERVICE)).updateTvInputInfo(info);
        }
    }
}