package com.gs.apidemo;

import android.content.Intent;
import android.os.Bundle;
import android.os.HandlerThread;
import android.util.Log;
import android.view.View;

import com.gs.device.api.DeviceApi;
import com.gs.device.entity.SystemInfo;

public class MainActivity extends BaseActivity {
    private static final String TAG = MainActivity.class.getSimpleName();
    //private NvramCallback mNvramCallback;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        HandlerThread handlerThread = new HandlerThread("my_thread");
        /*mNvramCallback = new NvramCallback(handlerThread.getLooper()) {
            @Override
            public void onCallback(String name) { // run on the thread named "my_thread".
                Log.i(TAG, "onCallback: " + name);
            }
        };
        NvramApi.addCallback(mNvramCallback.callback, "phonebook.emergencyCallNumber");*/

        SystemInfo systemInfo = DeviceApi.getSystemInfo();
        String productBaseName = systemInfo.getProductBase();
        String systemVersion = systemInfo.getSystemVersion();

        Log.i(TAG, "onCreate: " + productBaseName + ", " + systemVersion);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        /*NvramApi.removeCallback(mNvramCallback.callback);*/
    }

    public void gotoLedActivity(View view) {
        Intent intent = new Intent(this, LedActivity.class);
        startActivity(intent);
    }

    public void gotoDialerActivity(View view) {
        Intent intent = new Intent(this, DialerActivity.class);
        startActivity(intent);
    }

    public void gotoAccountsActivity(View view) {
        Intent intent = new Intent(this,AccountsActivity.class);
        startActivity(intent);
    }

    public void gotoContactsActivity(View view) {
        Intent intent = new Intent(this,ContactsActivity.class);
        startActivity(intent);
    }
    public void gotoCallLogsActivity(View view) {
        Intent intent = new Intent(this,CallLogsActivity.class);
        startActivity(intent);
    }
    public void gotoSmsActivity(View view) {
        Intent intent = new Intent(this,SmsActivity.class);
        startActivity(intent);
    }
    public void gotoAudioRouteActivity(View view) {
        Intent intent = new Intent(this,AudioRouteActivity.class);
        startActivity(intent);
    }
}
