Skip to content

Commit e4e231f

Browse files
committed
projectFilePath null check
1 parent 4a92c1d commit e4e231f

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

.idea/gradle.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 29
55
buildToolsVersion '28.0.3'
66
defaultConfig {
77
applicationId "com.samsung.microbit"
88
minSdkVersion 21
9-
targetSdkVersion 28
9+
targetSdkVersion 29
1010
}
1111
buildTypes {
1212
release {

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
-->
1616
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
1717
package="com.samsung.microbit"
18-
android:versionCode="30"
19-
android:versionName="2.8.1">
18+
android:versionCode="33"
19+
android:versionName="2.8.2">
2020

2121
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2222
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

app/src/main/java/com/samsung/microbit/ui/activity/PairingActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,16 +1113,13 @@ public void onClick(final View v) {
11131113
logi("onClick() :: connectBtn");
11141114
Toast.makeText(MBApp.getApp(), getString(R.string.no_longer_required_to_connect), Toast.LENGTH_LONG).show();
11151115

1116-
break;
1117-
/*
11181116
if(!BluetoothChecker.getInstance().isBluetoothON()) {
11191117
setActivityState(PairingActivityState.STATE_ENABLE_BT_FOR_CONNECT);
11201118
enableBluetooth();
11211119
return;
11221120
}
11231121
toggleConnection();
11241122
break;
1125-
*/
11261123

11271124
//TODO: there is no ability to delete paired device on Connect screen, so add or remove the case.
11281125
// Delete Microbit

app/src/main/java/com/samsung/microbit/utils/ProjectsHelper.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,28 @@ public static int findProjectssAndPopulate(HashMap<String, String> prettyFileNam
4646
int totalPrograms = 0;
4747
if(sdcardDownloads.exists()) {
4848
File files[] = sdcardDownloads.listFiles();
49-
for(File file : files) {
50-
String fileName = file.getName();
51-
if(fileName.endsWith(".hex")) {
49+
if (files != null) {
50+
for (File file : files) {
51+
String fileName = file.getName();
52+
if (fileName.endsWith(".hex")) {
5253

53-
//Beautify the filename
54-
String parsedFileName;
55-
int dot = fileName.lastIndexOf(".");
56-
parsedFileName = fileName.substring(0, dot);
57-
parsedFileName = parsedFileName.replace('_', ' ');
54+
//Beautify the filename
55+
String parsedFileName;
56+
int dot = fileName.lastIndexOf(".");
57+
parsedFileName = fileName.substring(0, dot);
58+
parsedFileName = parsedFileName.replace('_', ' ');
5859

59-
if(prettyFileNameMap != null) {
60-
prettyFileNameMap.put(parsedFileName, fileName);
61-
}
60+
if (prettyFileNameMap != null) {
61+
prettyFileNameMap.put(parsedFileName, fileName);
62+
}
6263

63-
if(list != null) {
64-
list.add(new Project(parsedFileName, file.getAbsolutePath(), file.lastModified(),
65-
null, false));
66-
}
64+
if (list != null) {
65+
list.add(new Project(parsedFileName, file.getAbsolutePath(), file.lastModified(),
66+
null, false));
67+
}
6768

68-
++totalPrograms;
69+
++totalPrograms;
70+
}
6971
}
7072
}
7173
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:4.0.0'
8+
classpath 'com.android.tools.build:gradle:4.1.1'
99
classpath 'com.google.gms:google-services:3.0.0'
1010
}
1111
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 commit comments

Comments
 (0)