Example usage for android.util Log wtf

List of usage examples for android.util Log wtf

Introduction

In this page you can find the example usage for android.util Log wtf.

Prototype

public static int wtf(String tag, Throwable tr) 

Source Link

Document

What a Terrible Failure: Report an exception that should never happen.

Usage

From source file:org.botlibre.sdk.activity.ChatActivity.java

public MediaPlayer playAudio(String audio, boolean loop, boolean cache, boolean start) {
    try {/*ww  w  .j  a va  2 s.  co m*/
        Uri audioUri = null;
        if (cache) {
            audioUri = HttpGetVideoAction.fetchVideo(this, audio);
        }
        if (audioUri == null) {
            audioUri = Uri.parse(MainActivity.connection.fetchImage(audio).toURI().toString());
        }
        final MediaPlayer audioPlayer = new MediaPlayer();
        audioPlayer.setDataSource(getApplicationContext(), audioUri);
        audioPlayer.setOnErrorListener(new OnErrorListener() {

            @Override
            public boolean onError(MediaPlayer mp, int what, int extra) {
                Log.wtf("Audio error", "what:" + what + " extra:" + extra);
                audioPlayer.stop();
                audioPlayer.release();
                return true;
            }
        });
        audioPlayer.setOnCompletionListener(new OnCompletionListener() {
            @Override
            public void onCompletion(MediaPlayer mp) {
                audioPlayer.release();
                runOnUiThread(new Runnable() {
                    public void run() {
                        try {
                            beginListening();
                        } catch (Exception e) {
                            Log.e("ChatActivity", "MediaPlayer: " + e.getMessage());
                        }
                    }
                });
            }
        });
        audioPlayer.prepare();
        audioPlayer.setLooping(loop);
        if (start) {
            audioPlayer.start();
        }
        return audioPlayer;
    } catch (Exception exception) {
        Log.wtf(exception.toString(), exception);
        return null;
    }
}

From source file:org.botlibre.sdk.activity.ChatActivity.java

@Override
public void onUtteranceCompleted(String utteranceId) {
    debug("onUtteranceCompleted");
    runOnUiThread(new Runnable() {
        public void run() {
            try {
                beginListening();/*from  w  w w.  j a va2  s  . co m*/
            } catch (Exception ignore) {
            }
        }
    });
    try {
        if (!MainActivity.disableVideo && !videoError && this.response.isVideo()) {
            this.videoView.post(new Runnable() {
                public void run() {
                    cycleVideo(response);
                }
            });
        }
    } catch (Exception exception) {
        Log.wtf(exception.toString(), exception);
    }
}

From source file:com.google.android.gms.common.GooglePlayServicesUtil.java

public static int isGooglePlayServicesAvailable(Context context) {
    PackageManager packageManager = context.getPackageManager();
    try {/*from w w w.j a  v  a 2 s.  c  o  m*/
        context.getResources().getString(C0192R.string.common_google_play_services_unknown_issue);
    } catch (Throwable th) {
        Log.e("GooglePlayServicesUtil",
                "The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.");
    }
    if (System.currentTimeMillis() < 1227312000288L) {
        return 12;
    }
    m118t(context);
    try {
        PackageInfo packageInfo = packageManager.getPackageInfo(GOOGLE_PLAY_SERVICES_PACKAGE, 64);
        if (!gk.m1034y(context)) {
            try {
                if (m107a(packageManager.getPackageInfo(GOOGLE_PLAY_STORE_PACKAGE, 64), Aj) == null) {
                    Log.w("GooglePlayServicesUtil", "Google Play Store signature invalid.");
                    return 9;
                }
                if (m107a(packageInfo,
                        m107a(packageManager.getPackageInfo(GOOGLE_PLAY_STORE_PACKAGE, 64), Aj)) == null) {
                    Log.w("GooglePlayServicesUtil", "Google Play services signature invalid.");
                    return 9;
                }
            } catch (NameNotFoundException e) {
                Log.w("GooglePlayServicesUtil", "Google Play Store is missing.");
                return 9;
            }
        } else if (m107a(packageInfo, Aj) == null) {
            Log.w("GooglePlayServicesUtil", "Google Play services signature invalid.");
            return 9;
        }
        if (packageInfo.versionCode < GOOGLE_PLAY_SERVICES_VERSION_CODE) {
            Log.w("GooglePlayServicesUtil",
                    "Google Play services out of date.  Requires 4452000 but found " + packageInfo.versionCode);
            return 2;
        }
        try {
            return !packageManager.getApplicationInfo(GOOGLE_PLAY_SERVICES_PACKAGE, 0).enabled ? 3 : 0;
        } catch (NameNotFoundException e2) {
            Log.wtf("GooglePlayServicesUtil", "Google Play services missing when getting application info.");
            e2.printStackTrace();
            return 1;
        }
    } catch (NameNotFoundException e3) {
        Log.w("GooglePlayServicesUtil", "Google Play services is missing.");
        return 1;
    }
}