This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
-
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.
v0.3.0; migrate to target android Q; support scoped storage; change f…
…ile path;
- Loading branch information
Jerry Chen
committed
Jul 17, 2019
1 parent
ac14654
commit 78b5a48
Showing
8 changed files
with
113 additions
and
51 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 |
---|---|---|
|
@@ -19,3 +19,4 @@ | |
/app/release | ||
/app/debug | ||
*.lnk | ||
/.idea/codeStyles |
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
14 changes: 0 additions & 14 deletions
14
app/src/androidTest/java/jerryc05/unlockme/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
app/src/androidTest/java/jerryc05/unlockme/InstrumentedTest.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,71 @@ | ||
package jerryc05.unlockme; | ||
|
||
import android.content.Context; | ||
import android.os.Environment; | ||
import android.provider.MediaStore; | ||
import android.util.Log; | ||
|
||
import androidx.test.core.app.ApplicationProvider; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public final class InstrumentedTest { | ||
|
||
private static Context context = ApplicationProvider.getApplicationContext(); | ||
|
||
@SuppressWarnings("ConstantConditions") | ||
@Test | ||
public void testURI() { | ||
Log.e("INTERNAL_CONTENT_URI", MediaStore.Images.Media. | ||
INTERNAL_CONTENT_URI.getPath()); | ||
Log.e("EXTERNAL_CONTENT_URI", MediaStore.Images.Media. | ||
EXTERNAL_CONTENT_URI.getPath()); | ||
Log.e("VOLUME_INTERNAL", MediaStore.Images.Media. | ||
getContentUri(MediaStore.VOLUME_INTERNAL).getPath()); | ||
Log.e("VOLUME_EXTERNAL", MediaStore.Images.Media. | ||
getContentUri(MediaStore.VOLUME_EXTERNAL).getPath()); | ||
Log.e("VOLUME_EXTERNAL_PRIMARY", MediaStore.Images.Media. | ||
getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY).getPath()); | ||
|
||
/* | ||
E/INTERNAL_CONTENT_URI: /internal/images/media | ||
E/EXTERNAL_CONTENT_URI: /external/images/media | ||
E/VOLUME_INTERNAL: /internal/images/media | ||
E/VOLUME_EXTERNAL: /external/images/media | ||
E/VOLUME_EXTERNAL_PRIMARY: /external_primary/images/media | ||
*/ | ||
} | ||
|
||
@SuppressWarnings("ConstantConditions") | ||
@Test | ||
public void testDir() { | ||
for (File file : context.getExternalFilesDirs(Environment.DIRECTORY_PICTURES)) | ||
Log.e("getExternalFilesDirs", file.getAbsolutePath()); | ||
Log.e("getExternalFilesDir", context.getExternalFilesDir( | ||
Environment.DIRECTORY_PICTURES).getAbsolutePath()); | ||
for (File file : context.getExternalMediaDirs()) | ||
Log.e("getExternalMediaDirs", file.getAbsolutePath()); | ||
|
||
/* | ||
E/getExternalFilesDirs: /storage/emulated/0/Android/data/jerryc05.unlockme/files/Pictures | ||
E/getExternalFilesDirs: /storage/0670-0B16/Android/data/jerryc05.unlockme/files/Pictures | ||
E/getExternalFilesDir: /storage/emulated/0/Android/data/jerryc05.unlockme/files/Pictures | ||
E/getExternalMediaDirs: /storage/emulated/0/Android/media/jerryc05.unlockme | ||
E/getExternalMediaDirs: /storage/0670-0B16/Android/media/jerryc05.unlockme | ||
*/ | ||
} | ||
} |
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
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
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
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