// Path: wear/src/main/java/ooo/oxo/apps/earth/provider/EarthsContract.java
// public class EarthsContract {
// 
//     public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final Uri CONTENT_URI = new Uri.Builder()
//             .scheme(ContentResolver.SCHEME_CONTENT)
//             .authority(AUTHORITY)
//             .path("earths")
//             .build();
// 
//     public static final Uri LATEST_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, "latest");
// 
//     public static final String CONTENT_TYPE_DIR
//             = "vnd.android.cursor.dir/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final String CONTENT_TYPE_ITEM
//             = "vnd.android.cursor.item/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     static final String TABLE = "earths";
// 
//     public static class Columns implements BaseColumns {
//         public static final String FILE = "file";
//         public static final String FETCHED_AT = "fetched_at";
//     }
// 
// }


import android.view.SurfaceHolder;
import android.view.WindowInsets;
import androidx.annotation.Nullable;
import java.io.FileNotFoundException;
import ooo.oxo.apps.earth.provider.EarthsContract;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.wearable.watchface.CanvasWatchFaceService;
import android.support.wearable.watchface.WatchFaceStyle;
import android.util.Log;
import android.view.Gravity;
            }
        }

        @Override
        public void onDraw(Canvas canvas, Rect bounds) {
            Bitmap earth = loadLatestEarth();

            if (earth == null) {
                Log.d(TAG, "earth not ready, fallback to preview");
                earth = loadPreview();
            }

            if (earth == null) {
                Log.e(TAG, "earth preview not ready, impossible!");
                return;
            }

            region.set(bounds);
            region.bottom = region.width();
            region.inset(inset, inset);

            canvas.drawBitmap(earth, null, region, paint);

            earth.recycle();
        }

        @Nullable
        private Bitmap loadLatestEarth() {
            try {
                return BitmapFactory.decodeStream(getContentResolver()
// Path: wear/src/main/java/ooo/oxo/apps/earth/provider/EarthsContract.java
// public class EarthsContract {
// 
//     public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final Uri CONTENT_URI = new Uri.Builder()
//             .scheme(ContentResolver.SCHEME_CONTENT)
//             .authority(AUTHORITY)
//             .path("earths")
//             .build();
// 
//     public static final Uri LATEST_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, "latest");
// 
//     public static final String CONTENT_TYPE_DIR
//             = "vnd.android.cursor.dir/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final String CONTENT_TYPE_ITEM
//             = "vnd.android.cursor.item/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     static final String TABLE = "earths";
// 
//     public static class Columns implements BaseColumns {
//         public static final String FILE = "file";
//         public static final String FETCHED_AT = "fetched_at";
//     }
// 
// }


// Path: wear/src/main/java/ooo/oxo/apps/earth/EarthWatchFaceService.java
import android.view.SurfaceHolder;
import android.view.WindowInsets;
import androidx.annotation.Nullable;
import java.io.FileNotFoundException;
import ooo.oxo.apps.earth.provider.EarthsContract;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.wearable.watchface.CanvasWatchFaceService;
import android.support.wearable.watchface.WatchFaceStyle;
import android.util.Log;
import android.view.Gravity;

            }
        }

        @Override
        public void onDraw(Canvas canvas, Rect bounds) {
            Bitmap earth = loadLatestEarth();

            if (earth == null) {
                Log.d(TAG, "earth not ready, fallback to preview");
                earth = loadPreview();
            }

            if (earth == null) {
                Log.e(TAG, "earth preview not ready, impossible!");
                return;
            }

            region.set(bounds);
            region.bottom = region.width();
            region.inset(inset, inset);

            canvas.drawBitmap(earth, null, region, paint);

            earth.recycle();
        }

        @Nullable
        private Bitmap loadLatestEarth() {
            try {
                return BitmapFactory.decodeStream(getContentResolver()
                        .openInputStream(EarthsContract.LATEST_CONTENT_URI));