Revert "Add FeatureProvider for SyncAcrossDevices Settings integ..."
Revert submission 26930404-syncacrossdevices Reason for revert: Potential culprit for b/336431732- verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reverted changes: /q/submissionid:26930404-syncacrossdevices Change-Id: I9da0de82978fa6984a4636e0c9ccc891d9287fd2
This commit is contained in:
committed by
Android (Google) Code Review
parent
132e7341ea
commit
ea26f2d729
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 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.settings.notification.syncacrossdevices;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
/** Callback to add or remove {@link Preference} in Sync Across Devices feature. */
|
||||
public interface SyncAcrossDevicesFeatureCallback {
|
||||
|
||||
/**
|
||||
* Called when a sync across devices feature is added
|
||||
*
|
||||
* @param preference present the feature
|
||||
*/
|
||||
void onFeatureAdded(@Nullable Preference preference);
|
||||
|
||||
/**
|
||||
* Called when a sync across devices feature is removed
|
||||
*
|
||||
* @param preference present the feature
|
||||
*/
|
||||
void onFeatureRemoved(@Nullable Preference preference);
|
||||
}
|
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 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.settings.notification.syncacrossdevices;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Feature provider for the Sync Across Devices. */
|
||||
public interface SyncAcrossDevicesFeatureProvider {
|
||||
|
||||
/** Returns the SyncAcrossDevicesFeatureUpdater of the Sync Across Devices feature */
|
||||
@Nullable
|
||||
SyncAcrossDevicesFeatureUpdater getSyncAcrossDevicesFeatureUpdater(
|
||||
@NonNull Context context,
|
||||
@NonNull SyncAcrossDevicesFeatureCallback featurePreferenceCallback);
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 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.settings.notification.syncacrossdevices;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Default implementation for {@link SyncAcrossDevicesFeatureProvider} */
|
||||
public class SyncAcrossDevicesFeatureProviderImpl implements SyncAcrossDevicesFeatureProvider {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public SyncAcrossDevicesFeatureUpdater getSyncAcrossDevicesFeatureUpdater(
|
||||
@NonNull Context context,
|
||||
@NonNull SyncAcrossDevicesFeatureCallback featurePreferenceCallback) {
|
||||
return new SyncAcrossDevicesFeatureUpdater() {};
|
||||
}
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 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.settings.notification.syncacrossdevices;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Updates the sync across devices feature state. It notifies the upper level whether to add/remove
|
||||
* the preference through {@link SyncAcrossDevicesFeatureCallback}
|
||||
*/
|
||||
public interface SyncAcrossDevicesFeatureUpdater {
|
||||
|
||||
/** Forces to update the list of the Sync Across Devices feature. */
|
||||
default void forceUpdate() {}
|
||||
|
||||
/** Sets the context to generate the {@link Preference}, so it could get the correct theme. */
|
||||
default void setPreferenceContext(@Nullable Context preferenceContext) {}
|
||||
}
|
@@ -38,7 +38,6 @@ import com.android.settings.fuelgauge.PowerUsageFeatureProvider
|
||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider
|
||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider
|
||||
import com.android.settings.localepicker.LocaleFeatureProvider
|
||||
import com.android.settings.notification.syncacrossdevices.SyncAcrossDevicesFeatureProvider
|
||||
import com.android.settings.onboarding.OnboardingFeatureProvider
|
||||
import com.android.settings.overlay.FeatureFactory.Companion.setFactory
|
||||
import com.android.settings.panel.PanelFeatureProvider
|
||||
@@ -189,11 +188,6 @@ abstract class FeatureFactory {
|
||||
*/
|
||||
abstract val audioSharingFeatureProvider: AudioSharingFeatureProvider
|
||||
|
||||
/**
|
||||
* Gets implementation for sync across devices related feature.
|
||||
*/
|
||||
abstract val syncAcrossDevicesFeatureProvider: SyncAcrossDevicesFeatureProvider
|
||||
|
||||
companion object {
|
||||
private var _factory: FeatureFactory? = null
|
||||
|
||||
|
@@ -55,8 +55,6 @@ import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvid
|
||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider
|
||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProviderImpl
|
||||
import com.android.settings.localepicker.LocaleFeatureProviderImpl
|
||||
import com.android.settings.notification.syncacrossdevices.SyncAcrossDevicesFeatureProvider
|
||||
import com.android.settings.notification.syncacrossdevices.SyncAcrossDevicesFeatureProviderImpl
|
||||
import com.android.settings.panel.PanelFeatureProviderImpl
|
||||
import com.android.settings.search.SearchFeatureProvider
|
||||
import com.android.settings.search.SearchFeatureProviderImpl
|
||||
@@ -199,8 +197,4 @@ open class FeatureFactoryImpl : FeatureFactory() {
|
||||
override val audioSharingFeatureProvider: AudioSharingFeatureProvider by lazy {
|
||||
AudioSharingFeatureProviderImpl()
|
||||
}
|
||||
|
||||
override val syncAcrossDevicesFeatureProvider: SyncAcrossDevicesFeatureProvider by lazy {
|
||||
SyncAcrossDevicesFeatureProviderImpl()
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
|
||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
|
||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider;
|
||||
import com.android.settings.localepicker.LocaleFeatureProvider;
|
||||
import com.android.settings.notification.syncacrossdevices.SyncAcrossDevicesFeatureProvider;
|
||||
import com.android.settings.onboarding.OnboardingFeatureProvider;
|
||||
import com.android.settings.overlay.DockUpdaterFeatureProvider;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
@@ -104,7 +103,6 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public PrivateSpaceLoginFeatureProvider mPrivateSpaceLoginFeatureProvider;
|
||||
public DisplayFeatureProvider mDisplayFeatureProvider;
|
||||
public AudioSharingFeatureProvider mAudioSharingFeatureProvider;
|
||||
public SyncAcrossDevicesFeatureProvider mSyncAcrossDevicesFeatureProvider;
|
||||
|
||||
/**
|
||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||
@@ -152,10 +150,9 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
mStylusFeatureProvider = mock(StylusFeatureProvider.class);
|
||||
mOnboardingFeatureProvider = mock(OnboardingFeatureProvider.class);
|
||||
mFastPairFeatureProvider = mock(FastPairFeatureProvider.class);
|
||||
mPrivateSpaceLoginFeatureProvider = mock(PrivateSpaceLoginFeatureProvider.class);
|
||||
mPrivateSpaceLoginFeatureProvider = mock(PrivateSpaceLoginFeatureProvider.class);
|
||||
mDisplayFeatureProvider = mock(DisplayFeatureProvider.class);
|
||||
mAudioSharingFeatureProvider = mock(AudioSharingFeatureProvider.class);
|
||||
mSyncAcrossDevicesFeatureProvider = mock(SyncAcrossDevicesFeatureProvider.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -343,10 +340,5 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public AudioSharingFeatureProvider getAudioSharingFeatureProvider() {
|
||||
return mAudioSharingFeatureProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SyncAcrossDevicesFeatureProvider getSyncAcrossDevicesFeatureProvider() {
|
||||
return mSyncAcrossDevicesFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,6 @@ import com.android.settings.fuelgauge.PowerUsageFeatureProvider
|
||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider
|
||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider
|
||||
import com.android.settings.localepicker.LocaleFeatureProvider
|
||||
import com.android.settings.notification.syncacrossdevices.SyncAcrossDevicesFeatureProvider
|
||||
import com.android.settings.overlay.DockUpdaterFeatureProvider
|
||||
import com.android.settings.overlay.FeatureFactory
|
||||
import com.android.settings.overlay.SurveyFeatureProvider
|
||||
@@ -153,6 +152,4 @@ class FakeFeatureFactory : FeatureFactory() {
|
||||
get() = TODO("Not yet implemented")
|
||||
override val audioSharingFeatureProvider: AudioSharingFeatureProvider
|
||||
get() = TODO("Not yet implemented")
|
||||
override val syncAcrossDevicesFeatureProvider: SyncAcrossDevicesFeatureProvider
|
||||
get() = TODO("Not yet implemented")
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ import com.android.settings.fuelgauge.PowerUsageFeatureProvider;
|
||||
import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
|
||||
import com.android.settings.inputmethod.KeyboardSettingsFeatureProvider;
|
||||
import com.android.settings.localepicker.LocaleFeatureProvider;
|
||||
import com.android.settings.notification.syncacrossdevices.SyncAcrossDevicesFeatureProvider;
|
||||
import com.android.settings.onboarding.OnboardingFeatureProvider;
|
||||
import com.android.settings.overlay.DockUpdaterFeatureProvider;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
@@ -103,7 +102,6 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public PrivateSpaceLoginFeatureProvider mPrivateSpaceLoginFeatureProvider;
|
||||
public DisplayFeatureProvider mDisplayFeatureProvider;
|
||||
public AudioSharingFeatureProvider mAudioSharingFeatureProvider;
|
||||
public SyncAcrossDevicesFeatureProvider mSyncAcrossDevicesFeatureProvider;
|
||||
|
||||
/** Call this in {@code @Before} method of the test class to use fake factory. */
|
||||
public static FakeFeatureFactory setupForTest() {
|
||||
@@ -156,7 +154,6 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
mPrivateSpaceLoginFeatureProvider = mock(PrivateSpaceLoginFeatureProvider.class);
|
||||
mDisplayFeatureProvider = mock(DisplayFeatureProvider.class);
|
||||
mAudioSharingFeatureProvider = mock(AudioSharingFeatureProvider.class);
|
||||
mSyncAcrossDevicesFeatureProvider = mock(SyncAcrossDevicesFeatureProvider.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -344,9 +341,4 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public AudioSharingFeatureProvider getAudioSharingFeatureProvider() {
|
||||
return mAudioSharingFeatureProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SyncAcrossDevicesFeatureProvider getSyncAcrossDevicesFeatureProvider() {
|
||||
return mSyncAcrossDevicesFeatureProvider;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user