forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[path_provider] Clean up Java code (flutter#8240)
Minor cleanup in the native implementation code: - Removes a utility to map from index integers to directories, which hasn't been used since the Pigeon conversion but was accidentally left. - Inlines all the implementations of path getters; many methods were pointlessly delegating their implementation to another private method, which is a relic of the pre-Pigeon structure. All of the method implementations were moved without any changes.
- Loading branch information
1 parent
ebe5367
commit 9f6d599
Showing
6 changed files
with
52 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 2.2.15 | ||
|
||
* Removes unnecessary native code. | ||
|
||
## 2.2.14 | ||
|
||
* Updates annotations lib to 1.9.1. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
...android/android/src/main/java/io/flutter/plugins/pathprovider/StorageDirectoryMapper.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...android/android/src/test/java/io/flutter/plugins/pathprovider/PathProviderPluginTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package io.flutter.plugins.pathprovider; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNull; | ||
|
||
public class PathProviderPluginTest { | ||
@org.junit.Test | ||
public void testStorageDirectoryTypeTranslation() { | ||
final PathProviderPlugin plugin = new PathProviderPlugin(); | ||
assertNull(plugin.getStorageDirectoryString(Messages.StorageDirectory.ROOT)); | ||
assertEquals("music", plugin.getStorageDirectoryString(Messages.StorageDirectory.MUSIC)); | ||
assertEquals("podcasts", plugin.getStorageDirectoryString(Messages.StorageDirectory.PODCASTS)); | ||
assertEquals( | ||
"ringtones", plugin.getStorageDirectoryString(Messages.StorageDirectory.RINGTONES)); | ||
assertEquals("alarms", plugin.getStorageDirectoryString(Messages.StorageDirectory.ALARMS)); | ||
assertEquals( | ||
"notifications", plugin.getStorageDirectoryString(Messages.StorageDirectory.NOTIFICATIONS)); | ||
assertEquals("pictures", plugin.getStorageDirectoryString(Messages.StorageDirectory.PICTURES)); | ||
assertEquals("movies", plugin.getStorageDirectoryString(Messages.StorageDirectory.MOVIES)); | ||
assertEquals( | ||
"downloads", plugin.getStorageDirectoryString(Messages.StorageDirectory.DOWNLOADS)); | ||
assertEquals("dcim", plugin.getStorageDirectoryString(Messages.StorageDirectory.DCIM)); | ||
} | ||
} |
42 changes: 0 additions & 42 deletions
42
...oid/android/src/test/java/io/flutter/plugins/pathprovider/StorageDirectoryMapperTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters