Skip to content

Commit

Permalink
Delete playTouchSound from UIManagerModule
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdvacca authored and facebook-github-bot committed May 14, 2020
1 parent 0aac4c3 commit d0c4c5e
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2498,10 +2498,6 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json
return static_cast<ObjCTurboModule&>(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<ObjCTurboModule&>(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<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, ObjectKind, "lazilyLoadView", @selector(lazilyLoadView:), args, count);
}
Expand Down Expand Up @@ -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};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,6 @@ namespace JS {

- (NSDictionary *)getConstantsForViewManager:(NSString *)viewManagerName;
- (NSArray<NSString *> *)getDefaultEventTypes;
- (void)playTouchSound;
- (NSDictionary *)lazilyLoadView:(NSString *)name;
- (void)createView:(NSNumber *)reactTag
viewName:(NSString *)viewName
Expand Down
1 change: 0 additions & 1 deletion Libraries/ReactNative/DummyUIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
getConstants: (): {...} => ({}),
getConstantsForViewManager: (viewManagerName: string) => {},
getDefaultEventTypes: (): Array<$FlowFixMe> => [],
playTouchSound: () => {},
lazilyLoadView: (name: string) => {},
createView: (
reactTag: ?number,
Expand Down
1 change: 0 additions & 1 deletion Libraries/ReactNative/NativeUIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface Spec extends TurboModule {
+getConstants: () => Object;
+getConstantsForViewManager: (viewManagerName: string) => Object;
+getDefaultEventTypes: () => Array<string>;
+playTouchSound: () => void;
+lazilyLoadView: (name: string) => Object; // revisit return
+createView: (
reactTag: ?number,
Expand Down
1 change: 0 additions & 1 deletion Libraries/ReactNative/UIManagerProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module.exports = [
'measureInWindow',
'measureLayout',
'measureLayoutRelativeToParent',
'playTouchSound',
'removeRootView',
'removeSubviewsFromContainerWithID',
'replaceExistingNonRootView',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2204,10 +2204,6 @@ namespace facebook {
return static_cast<JavaTurboModule&>(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<JavaTurboModule&>(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<JavaTurboModule&>(turboModule).invokeJavaMethod(rt, ObjectKind, "lazilyLoadView", "(Ljava/lang/String;)Lcom/facebook/react/bridge/WritableMap;", args, count);
}
Expand Down Expand Up @@ -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};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit d0c4c5e

Please sign in to comment.