From d0c4c5eaf90430c7004621d1596c5f2a55ad03e0 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 13 May 2020 18:15:58 -0700 Subject: [PATCH] Delete playTouchSound from UIManagerModule Summary: This diff deletes the deprecated PlayTouchSound method from UIManagerModules. I verified there are no callsites of this method in Facebook sourcecode changelog: [BREAKING][Android] Deletes the method PlayTouchSound method from UIManagerModule, this method was moved to the SoundManagerModule class. Motivation: I'm cleaning up my fabric backlog before lockdown Reviewed By: JoshuaGross, TheSavior Differential Revision: D21487612 fbshipit-source-id: f630e2b7f927e0b607a30b9f4904feb63a561ab9 --- .../FBReactNativeSpec-generated.mm | 7 ------- .../FBReactNativeSpec/FBReactNativeSpec.h | 1 - Libraries/ReactNative/DummyUIManager.js | 1 - Libraries/ReactNative/NativeUIManager.js | 1 - Libraries/ReactNative/UIManagerProperties.js | 1 - .../facebook/fbreact/specs/NativeUIManagerSpec.java | 3 --- .../specs/jni/FBReactNativeSpec-generated.cpp | 7 ------- .../facebook/react/uimanager/UIManagerModule.java | 13 ------------- 8 files changed, 34 deletions(-) diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm index 1eb1960df40305..bf5093af987ba0 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm @@ -2498,10 +2498,6 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json return static_cast(turboModule).invokeObjCMethod(rt, ArrayKind, "getDefaultEventTypes", @selector(getDefaultEventTypes), args, count); } - static facebook::jsi::Value __hostFunction_NativeUIManagerSpecJSI_playTouchSound(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, VoidKind, "playTouchSound", @selector(playTouchSound), args, count); - } - static facebook::jsi::Value __hostFunction_NativeUIManagerSpecJSI_lazilyLoadView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { return static_cast(turboModule).invokeObjCMethod(rt, ObjectKind, "lazilyLoadView", @selector(lazilyLoadView:), args, count); } @@ -2608,9 +2604,6 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json methodMap_["getDefaultEventTypes"] = MethodMetadata {0, __hostFunction_NativeUIManagerSpecJSI_getDefaultEventTypes}; - methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeUIManagerSpecJSI_playTouchSound}; - - methodMap_["lazilyLoadView"] = MethodMetadata {1, __hostFunction_NativeUIManagerSpecJSI_lazilyLoadView}; diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h index 072e730b0aa638..8cd831f027231c 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h @@ -2697,7 +2697,6 @@ namespace JS { - (NSDictionary *)getConstantsForViewManager:(NSString *)viewManagerName; - (NSArray *)getDefaultEventTypes; -- (void)playTouchSound; - (NSDictionary *)lazilyLoadView:(NSString *)name; - (void)createView:(NSNumber *)reactTag viewName:(NSString *)viewName diff --git a/Libraries/ReactNative/DummyUIManager.js b/Libraries/ReactNative/DummyUIManager.js index dd887bc12b42e3..1947640e0a8d54 100644 --- a/Libraries/ReactNative/DummyUIManager.js +++ b/Libraries/ReactNative/DummyUIManager.js @@ -23,7 +23,6 @@ module.exports = { getConstants: (): {...} => ({}), getConstantsForViewManager: (viewManagerName: string) => {}, getDefaultEventTypes: (): Array<$FlowFixMe> => [], - playTouchSound: () => {}, lazilyLoadView: (name: string) => {}, createView: ( reactTag: ?number, diff --git a/Libraries/ReactNative/NativeUIManager.js b/Libraries/ReactNative/NativeUIManager.js index 717e63dbc12282..30e2d1f2c7d0df 100644 --- a/Libraries/ReactNative/NativeUIManager.js +++ b/Libraries/ReactNative/NativeUIManager.js @@ -17,7 +17,6 @@ export interface Spec extends TurboModule { +getConstants: () => Object; +getConstantsForViewManager: (viewManagerName: string) => Object; +getDefaultEventTypes: () => Array; - +playTouchSound: () => void; +lazilyLoadView: (name: string) => Object; // revisit return +createView: ( reactTag: ?number, diff --git a/Libraries/ReactNative/UIManagerProperties.js b/Libraries/ReactNative/UIManagerProperties.js index 3205d7ea252e2e..938e42eef9d4ad 100644 --- a/Libraries/ReactNative/UIManagerProperties.js +++ b/Libraries/ReactNative/UIManagerProperties.js @@ -40,7 +40,6 @@ module.exports = [ 'measureInWindow', 'measureLayout', 'measureLayoutRelativeToParent', - 'playTouchSound', 'removeRootView', 'removeSubviewsFromContainerWithID', 'replaceExistingNonRootView', diff --git a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeUIManagerSpec.java b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeUIManagerSpec.java index 1f9cdce0522832..03e3fe9bb0ce48 100644 --- a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeUIManagerSpec.java +++ b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/NativeUIManagerSpec.java @@ -42,9 +42,6 @@ public NativeUIManagerSpec(ReactApplicationContext reactContext) { public abstract void configureNextLayoutAnimation(ReadableMap config, Callback callback, Callback errorCallback); - @ReactMethod - public abstract void playTouchSound(); - @ReactMethod public abstract void blur(Double reactTag); diff --git a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp index 243de2d8bd6d78..c262ffe6b2f77f 100644 --- a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp +++ b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp @@ -2204,10 +2204,6 @@ namespace facebook { return static_cast(turboModule).invokeJavaMethod(rt, ArrayKind, "getDefaultEventTypes", "()Lcom/facebook/react/bridge/WritableArray;", args, count); } - static facebook::jsi::Value __hostFunction_NativeUIManagerSpecJSI_playTouchSound(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeJavaMethod(rt, VoidKind, "playTouchSound", "()V", args, count); - } - static facebook::jsi::Value __hostFunction_NativeUIManagerSpecJSI_lazilyLoadView(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { return static_cast(turboModule).invokeJavaMethod(rt, ObjectKind, "lazilyLoadView", "(Ljava/lang/String;)Lcom/facebook/react/bridge/WritableMap;", args, count); } @@ -2314,9 +2310,6 @@ namespace facebook { methodMap_["getDefaultEventTypes"] = MethodMetadata {0, __hostFunction_NativeUIManagerSpecJSI_getDefaultEventTypes}; - methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeUIManagerSpecJSI_playTouchSound}; - - methodMap_["lazilyLoadView"] = MethodMetadata {1, __hostFunction_NativeUIManagerSpecJSI_lazilyLoadView}; diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index d753e252a567c4..38ec86679cc7a5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -13,9 +13,7 @@ import static com.facebook.react.uimanager.common.UIManagerType.FABRIC; import android.content.ComponentCallbacks2; -import android.content.Context; import android.content.res.Configuration; -import android.media.AudioManager; import android.view.View; import androidx.annotation.Nullable; import androidx.collection.ArrayMap; @@ -717,17 +715,6 @@ public void dispatchCommand(int reactTag, String commandId, @Nullable ReadableAr mUIImplementation.dispatchViewManagerCommand(reactTag, commandId, commandArgs); } - /** @deprecated use {@link SoundManager#playTouchSound()} instead. */ - @ReactMethod - @Deprecated - public void playTouchSound() { - AudioManager audioManager = - (AudioManager) getReactApplicationContext().getSystemService(Context.AUDIO_SERVICE); - if (audioManager != null) { - audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK); - } - } - /** * Show a PopupMenu. *