mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	remove unnecessary video flag check
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
		
							parent
							
								
									95e0a0d143
								
							
						
					
					
						commit
						8ff380ac8a
					
				
					 3 changed files with 0 additions and 30 deletions
				
			
		|  | @ -16,7 +16,6 @@ public interface Constants { | |||
|         int PICK_PICTURE_FROM_DOCUMENTS = FILE_PICKER_IMAGE_IDENTIFICATOR + (1 << 11); | ||||
|         int PICK_PICTURE_FROM_GALLERY = FILE_PICKER_IMAGE_IDENTIFICATOR + (1 << 12); | ||||
|         int TAKE_PICTURE = FILE_PICKER_IMAGE_IDENTIFICATOR + (1 << 13); | ||||
|         int CAPTURE_VIDEO = FILE_PICKER_IMAGE_IDENTIFICATOR + (1 << 14); | ||||
| 
 | ||||
|         int RECEIVE_DATA_FROM_FULL_SCREEN_MODE = 1 << 9; | ||||
|     } | ||||
|  |  | |||
|  | @ -157,7 +157,6 @@ public class FilePicker implements Constants { | |||
|             requestCode &= ~RequestCodes.SOURCE_CHOOSER; | ||||
|             if (requestCode == RequestCodes.PICK_PICTURE_FROM_GALLERY || | ||||
|                     requestCode == RequestCodes.TAKE_PICTURE || | ||||
|                     requestCode == RequestCodes.CAPTURE_VIDEO || | ||||
|                     requestCode == RequestCodes.PICK_PICTURE_FROM_DOCUMENTS || | ||||
|                     requestCode == RequestCodes.PICK_PICTURE_FROM_CUSTOM_SELECTOR) { | ||||
|                 if (resultCode == Activity.RESULT_OK) { | ||||
|  | @ -169,8 +168,6 @@ public class FilePicker implements Constants { | |||
|                         onPictureReturnedFromCustomSelector(data, activity, callbacks); | ||||
|                     } else if (requestCode == RequestCodes.TAKE_PICTURE) { | ||||
|                         onPictureReturnedFromCamera(activity, callbacks); | ||||
|                     } else if (requestCode == RequestCodes.CAPTURE_VIDEO) { | ||||
|                         onVideoReturnedFromCamera(activity, callbacks); | ||||
|                     } else if (isPhoto(data)) { | ||||
|                         onPictureReturnedFromCamera(activity, callbacks); | ||||
|                     } else { | ||||
|  |  | |||
|  | @ -165,32 +165,6 @@ class FilePickerTest { | |||
|         method.invoke(mockFilePicker, activity) | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
|     fun testTakenCameraVideo() { | ||||
|         val mockFilePicker = mock(FilePicker::class.java) | ||||
|         val method: Method = | ||||
|             FilePicker::class.java.getDeclaredMethod( | ||||
|                 "takenCameraVideo", | ||||
|                 Context::class.java, | ||||
|             ) | ||||
|         method.isAccessible = true | ||||
|         method.invoke(mockFilePicker, context) | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
|     fun testTakenCameraVideoCaseTrue() { | ||||
|         val mockFilePicker = mock(FilePicker::class.java) | ||||
|         `when`(PreferenceManager.getDefaultSharedPreferences(activity)).thenReturn(sharedPref) | ||||
|         `when`(sharedPref.getString("last_video", null)).thenReturn("") | ||||
|         val method: Method = | ||||
|             FilePicker::class.java.getDeclaredMethod( | ||||
|                 "takenCameraVideo", | ||||
|                 Context::class.java, | ||||
|             ) | ||||
|         method.isAccessible = true | ||||
|         method.invoke(mockFilePicker, activity) | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
|     fun testIsPhoto() { | ||||
|         val mockFilePicker = mock(FilePicker::class.java) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 parneet-guraya
						parneet-guraya