diff --git a/res/layout/clock_option.xml b/res/layout/clock_option.xml
deleted file mode 100644
index e65cb65..0000000
--- a/res/layout/clock_option.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2019 The Android Open Source Project
-
-     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.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:paddingRight="2dp"
-    android:paddingBottom="@dimen/option_bottom_margin"
-    android:clipChildren="false"
-    android:clipToPadding="false"
-    android:orientation="vertical">
-
-    <TextView
-        android:id="@+id/option_label"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_horizontal"
-        android:layout_marginBottom="@dimen/theme_option_label_margin"
-        android:textAppearance="@style/OptionTitleTextAppearance"/>
-    <FrameLayout
-        android:id="@+id/option_tile"
-        android:layout_width="@dimen/option_tile_width"
-        android:layout_height="@dimen/option_tile_width"
-        android:layout_gravity="center_horizontal"
-        android:paddingHorizontal="@dimen/option_tile_padding_horizontal"
-        android:paddingVertical="@dimen/option_tile_padding_vertical"
-        android:background="@drawable/option_border">
-        <ImageView
-            android:id="@+id/clock_option_thumbnail"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-    </FrameLayout>
-</LinearLayout>
diff --git a/src/com/android/customization/model/clock/BaseClockManager.java b/src/com/android/customization/model/clock/BaseClockManager.java
deleted file mode 100644
index 3434780..0000000
--- a/src/com/android/customization/model/clock/BaseClockManager.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock;
-
-import com.android.customization.model.CustomizationManager;
-
-/**
- * {@link CustomizationManager} for clock faces.
- */
-public abstract class BaseClockManager implements CustomizationManager<Clockface> {
-
-    private final ClockProvider mClockProvider;
-
-    public BaseClockManager(ClockProvider provider) {
-        mClockProvider = provider;
-    }
-
-    @Override
-    public boolean isAvailable() {
-        return mClockProvider.isAvailable();
-    }
-
-    @Override
-    public void apply(Clockface option, Callback callback) {
-        handleApply(option, callback);
-    }
-
-    @Override
-    public void fetchOptions(OptionsFetchedListener<Clockface> callback, boolean reload) {
-        mClockProvider.fetch(callback, false);
-    }
-
-    /** Returns the ID of the current clock face, which may be null for the default clock face. */
-    String getCurrentClock() {
-        return lookUpCurrentClock();
-    }
-
-    /**
-     * Implement to apply the clock picked by the user for {@link BaseClockManager#apply}.
-     *
-     * @param option Clock option, containing ID of the clock, that the user picked.
-     * @param callback Report success and failure.
-     */
-    protected abstract void handleApply(Clockface option, Callback callback);
-
-    /**
-     * Implement to look up the current clock face for {@link BaseClockManager#getCurrentClock()}.
-     *
-     * @return ID of current clock. Can be null for the default clock face.
-     */
-    protected abstract String lookUpCurrentClock();
-}
diff --git a/src/com/android/customization/model/clock/ClockManager.java b/src/com/android/customization/model/clock/ClockManager.java
deleted file mode 100644
index 4e77a49..0000000
--- a/src/com/android/customization/model/clock/ClockManager.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock;
-
-import android.content.ContentResolver;
-import android.provider.Settings.Secure;
-import android.text.TextUtils;
-
-import com.android.customization.module.ThemesUserEventLogger;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * {@link CustomizationManager} for clock faces that implements apply by writing to secure settings.
- */
-public class ClockManager extends BaseClockManager {
-
-    // TODO: use constant from Settings.Secure
-    static final String CLOCK_FACE_SETTING = "lock_screen_custom_clock_face";
-    private static final String CLOCK_FIELD = "clock";
-    private static final String TIMESTAMP_FIELD = "_applied_timestamp";
-    private final ContentResolver mContentResolver;
-    private final ThemesUserEventLogger mEventLogger;
-
-    public ClockManager(ContentResolver resolver, ClockProvider provider,
-            ThemesUserEventLogger logger) {
-        super(provider);
-        mContentResolver = resolver;
-        mEventLogger = logger;
-    }
-
-    @Override
-    protected void handleApply(Clockface option, Callback callback) {
-        boolean stored;
-        try {
-            final JSONObject json = new JSONObject();
-            json.put(CLOCK_FIELD, option.getId());
-            json.put(TIMESTAMP_FIELD, System.currentTimeMillis());
-            stored = Secure.putString(mContentResolver, CLOCK_FACE_SETTING, json.toString());
-        } catch (JSONException ex) {
-            stored = false;
-        }
-        if (stored) {
-            mEventLogger.logClockApplied(option);
-            callback.onSuccess();
-        } else {
-            callback.onError(null);
-        }
-    }
-
-    @Override
-    protected String lookUpCurrentClock() {
-        final String value = Secure.getString(mContentResolver, CLOCK_FACE_SETTING);
-        if (TextUtils.isEmpty(value)) {
-            return value;
-        }
-        try {
-            final JSONObject json = new JSONObject(value);
-            return json.getString(CLOCK_FIELD);
-        } catch (JSONException ex) {
-            return value;
-        }
-    }
-}
diff --git a/src/com/android/customization/model/clock/ClockProvider.java b/src/com/android/customization/model/clock/ClockProvider.java
deleted file mode 100644
index d9a6779..0000000
--- a/src/com/android/customization/model/clock/ClockProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock;
-
-import com.android.customization.model.CustomizationManager.OptionsFetchedListener;
-
-/**
- * Interface for a class that can retrieve Themes from the system.
- */
-public interface ClockProvider {
-    /**
-     * Returns whether clockfaces are available in the current setup.
-     */
-    boolean isAvailable();
-
-    /**
-     * Retrieve the available clockfaces.
-     * @param callback called when the clockfaces have been retrieved (or immediately if cached)
-     * @param reload whether to reload clockfaces if they're cached.
-     */
-    void fetch(OptionsFetchedListener<Clockface> callback, boolean reload);
-}
diff --git a/src/com/android/customization/model/clock/Clockface.java b/src/com/android/customization/model/clock/Clockface.java
deleted file mode 100644
index 9bdcaef..0000000
--- a/src/com/android/customization/model/clock/Clockface.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock;
-
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.ImageView;
-
-import com.android.customization.model.CustomizationManager;
-import com.android.customization.model.CustomizationOption;
-import com.android.wallpaper.R;
-import com.android.wallpaper.asset.Asset;
-
-public class Clockface implements CustomizationOption<Clockface> {
-
-    private final String mTitle;
-    private final String mId;
-    private final Asset mPreview;
-    private final Asset mThumbnail;
-
-    private Clockface(String title, String id, Asset preview, Asset thumbnail) {
-        mTitle = title;
-        mId = id;
-        mPreview = preview;
-        mThumbnail = thumbnail;
-    }
-
-    @Override
-    public String getTitle() {
-        return mTitle;
-    }
-
-    @Override
-    public void bindThumbnailTile(View view) {
-        ImageView thumbView = view.findViewById(R.id.clock_option_thumbnail);
-        mThumbnail.loadDrawableWithTransition(thumbView.getContext(), thumbView, 50, null,
-                thumbView.getResources().getColor(android.R.color.transparent, null));
-    }
-
-    @Override
-    public boolean isActive(CustomizationManager<Clockface> manager) {
-        String currentClock = ((BaseClockManager) manager).getCurrentClock();
-        // Empty clock Id is the default system clock
-        return (TextUtils.isEmpty(currentClock) && TextUtils.isEmpty(mId))
-                || (mId != null && mId.equals(currentClock));
-    }
-
-    @Override
-    public int getLayoutResId() {
-        return R.layout.clock_option;
-    }
-
-    public Asset getPreviewAsset() {
-        return mPreview;
-    }
-
-    public String getId() {
-        return mId;
-    }
-
-    public static class Builder {
-        private String mTitle;
-        private String mId;
-        private Asset mPreview;
-        private Asset mThumbnail;
-
-        public Clockface build() {
-            return new Clockface(mTitle, mId, mPreview, mThumbnail);
-        }
-
-        public Builder setTitle(String title) {
-            mTitle = title;
-            return this;
-        }
-
-        public Builder setId(String id) {
-            mId = id;
-            return this;
-        }
-
-        public Builder setPreview(Asset preview) {
-            mPreview = preview;
-            return this;
-        }
-
-        public Builder setThumbnail(Asset thumbnail) {
-            mThumbnail = thumbnail;
-            return this;
-        }
-    }
-}
diff --git a/src/com/android/customization/model/clock/ContentProviderClockProvider.java b/src/com/android/customization/model/clock/ContentProviderClockProvider.java
deleted file mode 100644
index f0df031..0000000
--- a/src/com/android/customization/model/clock/ContentProviderClockProvider.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package com.android.customization.model.clock;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.ProviderInfo;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Handler;
-import android.os.Looper;
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.android.customization.model.CustomizationManager.OptionsFetchedListener;
-import com.android.customization.model.clock.Clockface.Builder;
-import com.android.wallpaper.R;
-import com.android.wallpaper.asset.ContentUriAsset;
-
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.request.RequestOptions;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public class ContentProviderClockProvider implements ClockProvider {
-
-    private static final String TAG = "ContentProviderClockProvider";
-    private static final ExecutorService sExecutorService = Executors.newSingleThreadExecutor();
-    private static final String LIST_OPTIONS = "list_options";
-    private static final String COL_TITLE = "title";
-    private static final String COL_ID = "id";
-    private static final String COL_THUMBNAIL = "thumbnail";
-    private static final String COL_PREVIEW = "preview";
-
-    private final Context mContext;
-    private final ProviderInfo mProviderInfo;
-    private List<Clockface> mClocks;
-    private boolean mClockContentAvailable;
-
-    public ContentProviderClockProvider(Context context) {
-        mContext = context;
-        String providerAuthority = mContext.getString(R.string.clocks_provider_authority);
-        // TODO: check permissions if needed
-        mProviderInfo = TextUtils.isEmpty(providerAuthority) ? null
-                : mContext.getPackageManager().resolveContentProvider(providerAuthority,
-                        PackageManager.MATCH_SYSTEM_ONLY);
-
-        if (TextUtils.isEmpty(mContext.getString(R.string.clocks_stub_package))) {
-            mClockContentAvailable = false;
-        } else {
-            try {
-                ApplicationInfo applicationInfo = mContext.getPackageManager().getApplicationInfo(
-                        mContext.getString(R.string.clocks_stub_package),
-                        PackageManager.MATCH_SYSTEM_ONLY);
-                mClockContentAvailable = applicationInfo != null;
-            } catch (NameNotFoundException e) {
-                mClockContentAvailable = false;
-            }
-        }
-    }
-
-    @Override
-    public boolean isAvailable() {
-        return mProviderInfo != null && mClockContentAvailable
-                && (mClocks == null || !mClocks.isEmpty());
-    }
-
-    @Override
-    public void fetch(OptionsFetchedListener<Clockface> callback, boolean reload) {
-        if (!isAvailable()) {
-            if (callback != null) {
-                callback.onError(null);
-            }
-            return;
-        }
-        if (mClocks != null && !reload) {
-            if (callback != null) {
-                if (!mClocks.isEmpty()) {
-                    callback.onOptionsLoaded(mClocks);
-                } else {
-                    callback.onError(null);
-                }
-            }
-            return;
-        }
-        sExecutorService.submit(() -> {
-            Uri optionsUri = new Uri.Builder()
-                    .scheme(ContentResolver.SCHEME_CONTENT)
-                    .authority(mProviderInfo.authority)
-                    .appendPath(LIST_OPTIONS)
-                    .build();
-
-            ContentResolver resolver = mContext.getContentResolver();
-
-            List<Clockface> clockfaces = new ArrayList<>();
-            try (Cursor c = resolver.query(optionsUri, null, null, null, null)) {
-                while (c != null && c.moveToNext()) {
-                    String id = c.getString(c.getColumnIndex(COL_ID));
-                    String title = c.getString(c.getColumnIndex(COL_TITLE));
-                    String thumbnailUri = c.getString(c.getColumnIndex(COL_THUMBNAIL));
-                    String previewUri = c.getString(c.getColumnIndex(COL_PREVIEW));
-                    Uri thumbnail = Uri.parse(thumbnailUri);
-                    Uri preview = Uri.parse(previewUri);
-
-                    Clockface.Builder builder = new Builder();
-                    builder.setId(id).setTitle(title)
-                            .setThumbnail(new ContentUriAsset(mContext, thumbnail,
-                                    RequestOptions.fitCenterTransform()))
-                            .setPreview(new ContentUriAsset(mContext, preview,
-                                    RequestOptions.fitCenterTransform()));
-                    clockfaces.add(builder.build());
-                }
-                Glide.get(mContext).clearDiskCache();
-            } catch (Exception e) {
-                clockfaces = null;
-                Log.e(TAG, "Failed to query clock face options.", e);
-            }
-            final List<Clockface> clockfaceList = clockfaces;
-            new Handler(Looper.getMainLooper()).post(() -> {
-                mClocks = clockfaceList;
-                if (callback != null) {
-                    if (!mClocks.isEmpty()) {
-                        callback.onOptionsLoaded(mClocks);
-                    } else {
-                        callback.onError(null);
-                    }
-                }
-            });
-        });
-    }
-}
diff --git a/src/com/android/customization/model/clock/custom/ClockCustomManager.java b/src/com/android/customization/model/clock/custom/ClockCustomManager.java
deleted file mode 100644
index 0815a3e..0000000
--- a/src/com/android/customization/model/clock/custom/ClockCustomManager.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock.custom;
-
-import com.android.customization.model.CustomizationManager;
-
-import com.google.common.collect.Lists;
-
-/**
- * {@link CustomizationManager} for clock faces.
- */
-public class ClockCustomManager implements CustomizationManager<ClockOption> {
-    @Override
-    public boolean isAvailable() {
-        return true;
-    }
-
-    @Override
-    public void apply(ClockOption option, Callback callback) {
-        // TODO(/b241966062) execute applying the clock when user selects a clock
-    }
-
-    @Override
-    public void fetchOptions(OptionsFetchedListener<ClockOption> callback, boolean reload) {
-        // TODO(/b241966062) fetch the real clock metadata from the ClockRegistry
-        callback.onOptionsLoaded(
-                Lists.newArrayList(new ClockOption(), new ClockOption(), new ClockOption(),
-                        new ClockOption(), new ClockOption()));
-    }
-}
diff --git a/src/com/android/customization/model/clock/custom/ClockOption.java b/src/com/android/customization/model/clock/custom/ClockOption.java
deleted file mode 100644
index 5a9f051..0000000
--- a/src/com/android/customization/model/clock/custom/ClockOption.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock.custom;
-
-import android.view.View;
-
-import com.android.customization.model.CustomizationManager;
-import com.android.customization.model.CustomizationOption;
-import com.android.wallpaper.R;
-
-/**
- * {@link CustomizationOption} for a clock face.
- */
-public class ClockOption implements CustomizationOption<ClockOption> {
-
-    @Override
-    public String getTitle() {
-        // TODO(/b241966062) use the title from the clock metadata
-        return "title";
-    }
-
-    @Override
-    public void bindThumbnailTile(View view) {
-        // TODO(/b241966062) bind the thumbnail
-    }
-
-    @Override
-    public boolean isActive(CustomizationManager<ClockOption> manager) {
-        return false;
-    }
-
-
-    @Override
-    public int getLayoutResId() {
-        return R.layout.clock_option;
-    }
-}
diff --git a/src/com/android/customization/module/StatsLogUserEventLogger.java b/src/com/android/customization/module/StatsLogUserEventLogger.java
index 9645454..32e0599 100644
--- a/src/com/android/customization/module/StatsLogUserEventLogger.java
+++ b/src/com/android/customization/module/StatsLogUserEventLogger.java
@@ -44,7 +44,6 @@
 
 import androidx.annotation.Nullable;
 
-import com.android.customization.model.clock.Clockface;
 import com.android.customization.model.color.ColorOption;
 import com.android.customization.model.grid.GridOption;
 import com.android.customization.model.theme.ThemeBundle;
@@ -237,22 +236,6 @@
     }
 
     @Override
-    public void logClockSelected(Clockface clock) {
-        new SysUiStatsLogger()
-                .setAction(StyleEnums.PICKER_SELECT)
-                .setClockPackageHash(Objects.hashCode(clock.getId()))
-                .log();
-    }
-
-    @Override
-    public void logClockApplied(Clockface clock) {
-        new SysUiStatsLogger()
-                .setAction(StyleEnums.PICKER_APPLIED)
-                .setClockPackageHash(Objects.hashCode(clock.getId()))
-                .log();
-    }
-
-    @Override
     public void logGridSelected(GridOption grid) {
         new SysUiStatsLogger()
                 .setAction(StyleEnums.PICKER_SELECT)
diff --git a/src/com/android/customization/module/ThemesUserEventLogger.java b/src/com/android/customization/module/ThemesUserEventLogger.java
index 3e5bb54..b1a87b9 100644
--- a/src/com/android/customization/module/ThemesUserEventLogger.java
+++ b/src/com/android/customization/module/ThemesUserEventLogger.java
@@ -15,7 +15,6 @@
  */
 package com.android.customization.module;
 
-import com.android.customization.model.clock.Clockface;
 import com.android.customization.model.color.ColorOption;
 import com.android.customization.model.grid.GridOption;
 import com.android.customization.model.theme.ThemeBundle;
@@ -38,10 +37,6 @@
      */
     void logColorApplied(int action, ColorOption colorOption);
 
-    void logClockSelected(Clockface clock);
-
-    void logClockApplied(Clockface clock);
-
     void logGridSelected(GridOption grid);
 
     void logGridApplied(GridOption grid);
diff --git a/tests/robotests/src/com/android/customization/model/clock/BaseClockManagerTest.java b/tests/robotests/src/com/android/customization/model/clock/BaseClockManagerTest.java
deleted file mode 100644
index 2b80bde..0000000
--- a/tests/robotests/src/com/android/customization/model/clock/BaseClockManagerTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock;
-
-import static junit.framework.TestCase.assertTrue;
-import static junit.framework.TestCase.fail;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.anyBoolean;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import androidx.annotation.Nullable;
-
-import com.android.customization.model.CustomizationManager.Callback;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-
-@RunWith(RobolectricTestRunner.class)
-public class BaseClockManagerTest {
-
-    private static final String CURRENT_CLOCK = "current_clock";
-
-    @Mock ClockProvider mProvider;
-    private TestClockManager mManager;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mManager = new TestClockManager(mProvider);
-    }
-
-    @Test
-    public void testIsAvailable() {
-        // GIVEN that the ClockProvider is available
-        when(mProvider.isAvailable()).thenReturn(true);
-        // THEN the BaseClockManager is true
-        assertTrue(mManager.isAvailable());
-    }
-
-    @Test
-    public void testApply() {
-        final String id = "id";
-        Clockface clock = new Clockface.Builder().setId(id).build();
-
-        mManager.apply(clock, new Callback() {
-            @Override
-            public void onSuccess() {
-                //Nothing to do here, the test passed
-            }
-            @Override
-            public void onError(@Nullable Throwable throwable) {
-                fail("onError was called when grid had been applied successfully");
-            }
-        });
-
-        assertEquals(id, mManager.getClockId());
-    }
-
-    @Test
-    public void testFetch() {
-        mManager.fetchOptions(null, false);
-        verify(mProvider).fetch(eq(null), anyBoolean());
-    }
-
-    /**
-     * Testable BaseClockManager that provides basic implementations of abstract methods.
-     */
-    private static final class TestClockManager extends BaseClockManager {
-
-        private String mClockId;
-
-        TestClockManager(ClockProvider provider) {
-            super(provider);
-        }
-
-        String getClockId() {
-            return mClockId;
-        }
-
-        @Override
-        protected void handleApply(Clockface option, Callback callback) {
-            mClockId = option.getId();
-            callback.onSuccess();
-        }
-
-        @Override
-        protected String lookUpCurrentClock() {
-            return CURRENT_CLOCK;
-        }
-    }
-}
diff --git a/tests/robotests/src/com/android/customization/model/clock/ClockManagerTest.java b/tests/robotests/src/com/android/customization/model/clock/ClockManagerTest.java
deleted file mode 100644
index 574548a..0000000
--- a/tests/robotests/src/com/android/customization/model/clock/ClockManagerTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * 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.
- */
-package com.android.customization.model.clock;
-
-import static junit.framework.TestCase.fail;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.verify;
-
-import android.content.ContentResolver;
-import android.provider.Settings.Secure;
-
-import androidx.annotation.Nullable;
-
-import com.android.customization.model.CustomizationManager.Callback;
-import com.android.customization.module.ThemesUserEventLogger;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-
-@RunWith(RobolectricTestRunner.class)
-public class ClockManagerTest {
-
-    private static final String CLOCK_ID = "id";
-    private static final String CLOCK_FIELD = "clock";
-    private static final String CLOCK_FACE_SETTING = "fake_clock_face_setting";
-
-    @Mock ClockProvider mProvider;
-    @Mock ThemesUserEventLogger mLogger;
-    private ContentResolver mContentResolver;
-    private ClockManager mManager;
-    @Mock private Clockface mMockClockface;
-    @Mock private Callback mMockCallback;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mContentResolver = RuntimeEnvironment.application.getContentResolver();
-        mManager = new ClockManager(mContentResolver, mProvider, mLogger);
-    }
-
-    @Test
-    public void testApply() throws JSONException {
-        Clockface clock = new Clockface.Builder().setId(CLOCK_ID).build();
-
-        mManager.apply(clock, new Callback() {
-            @Override
-            public void onSuccess() {
-                //Nothing to do here, the test passed
-            }
-
-            @Override
-            public void onError(@Nullable Throwable throwable) {
-                fail("onError was called when grid had been applied successfully");
-            }
-        });
-
-        // THEN the clock id is written to secure settings.
-        JSONObject json =
-                new JSONObject(Secure.getString(mContentResolver, ClockManager.CLOCK_FACE_SETTING));
-        assertEquals(CLOCK_ID, json.getString(CLOCK_FIELD));
-        // AND the event is logged
-        verify(mLogger).logClockApplied(clock);
-    }
-
-    @Test
-    public void testApply_whenJSONExceptionOccurs_callsOnError() {
-        doAnswer((invocation) -> {
-            throw new JSONException("Fake Test Excepton");
-        }).when(mMockClockface).getId();
-
-        mManager.apply(mMockClockface, mMockCallback);
-
-        verify(mMockCallback).onError(null);
-    }
-
-    @Test
-    public void testGetCurrentClock_returnsClockId() throws JSONException {
-        // Secure settings contains a clock id
-        JSONObject json = new JSONObject().put(CLOCK_FIELD, CLOCK_ID);
-        Secure.putString(mContentResolver, ClockManager.CLOCK_FACE_SETTING, json.toString());
-
-        // The current clock is that id
-        assertEquals(CLOCK_ID, mManager.getCurrentClock());
-    }
-
-    @Test
-    public void testGetCurrentClock_whenJSONExceptionOccurs_returnsClockFaceSetting() {
-        // Secure settings contains a clock face setting with invalid format to cause JSONException.
-        Secure.putString(mContentResolver, ClockManager.CLOCK_FACE_SETTING, CLOCK_FACE_SETTING);
-
-        // The current clock is the clock face setting which is saved in secure settings.
-        assertEquals(CLOCK_FACE_SETTING, mManager.getCurrentClock());
-    }
-
-    @Test
-    public void testGetCurrentClock_withNullIdInSecureSettings_returnsNullId() {
-        // Secure settings contains a null clock id
-        Secure.putString(mContentResolver, ClockManager.CLOCK_FACE_SETTING, /* value= */ null);
-
-        // The current clock is null
-        assertEquals(null, mManager.getCurrentClock());
-    }
-
-    @Test
-    public void testGetCurrentClock_withEmptyIdInSecureSettings_returnsEmptyId() {
-        // Secure settings contains an empty clock id
-        Secure.putString(mContentResolver, ClockManager.CLOCK_FACE_SETTING, /* value= */ "");
-
-        // The current clock is empty
-        assertEquals("", mManager.getCurrentClock());
-    }
-}
diff --git a/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java b/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
index 9250a86..2bb2082 100644
--- a/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
+++ b/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
@@ -1,6 +1,5 @@
 package com.android.customization.testing;
 
-import com.android.customization.model.clock.Clockface;
 import com.android.customization.model.color.ColorOption;
 import com.android.customization.model.grid.GridOption;
 import com.android.customization.model.theme.ThemeBundle;
@@ -28,16 +27,6 @@
     }
 
     @Override
-    public void logClockSelected(Clockface clock) {
-        // Do nothing.
-    }
-
-    @Override
-    public void logClockApplied(Clockface clock) {
-        // Do nothing.
-    }
-
-    @Override
     public void logGridSelected(GridOption grid) {
         // Do nothing.
     }
