Skip to content

Commit

Permalink
Add addListener and removeListeners methods to prevent warning
Browse files Browse the repository at this point in the history
Relates to c19354837#137
  • Loading branch information
GabLeRoux committed Sep 19, 2023
1 parent b0cd6d7 commit e38d3fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SystemSetting.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ interface VolumeData {
}

interface SystemSetting {
addListener: (eventName: string) => void;
removeListeners: (count: number) => void;
getBrightness: () => Promise<number>;
setBrightness: (val: number) => Promise<boolean>;
setBrightnessForce: (val: number) => Promise<boolean>;
Expand Down
19 changes: 19 additions & 0 deletions android/src/main/java/com/ninty/system/setting/SystemSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,25 @@ public String getName() {
return SystemSetting.class.getSimpleName();
}

/**
*
* @see https://stackoverflow.com/questions/69538962/new-nativeeventemitter-was-called-with-a-non-null-argument-without-the-requir
* @param eventName the name of the event
*/
@ReactMethod
public void addListener(String eventName) {

}

/**
* @see https://stackoverflow.com/questions/69538962/new-nativeeventemitter-was-called-with-a-non-null-argument-without-the-requir
* @param count the number of listeners to remove
*/
@ReactMethod
public void removeListeners(Integer count) {

}

@ReactMethod
public void setScreenMode(int mode, Promise promise) {
mode = mode == Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL ? mode : Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
Expand Down

0 comments on commit e38d3fc

Please sign in to comment.