Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
4577cf7
Set app settings directory to internal storage
PhilZ-cwm6 Jun 24, 2022
7e2aab5
Fix messages lost after app reinstall
PhilZ-cwm6 Jun 24, 2022
16b3ca7
Fix context labels help on long click on bottom buttons
PhilZ-cwm6 Jun 24, 2022
21e6d3c
Update jcifsng to 2.1.7 and sync to upstream jcifsng releases
PhilZ-cwm6 Jun 24, 2022
a322027
Fix SMB sync unable to connect when setting a custom port in target
PhilZ-cwm6 Jun 24, 2022
4156069
Fix Edit SMB Server user/password not saved in Edit Sync Task view
PhilZ-cwm6 Jun 27, 2022
69d432b
code formatting
PhilZ-cwm6 Jun 24, 2022
a61bc30
Allow copy/paste password when importing encrypted settings
PhilZ-cwm6 Jun 27, 2022
da3b149
Allow password confirmation toggle/copy/paste in export encrypted set…
PhilZ-cwm6 Jun 27, 2022
be56224
Fix Zip password could not be set
PhilZ-cwm6 Jun 27, 2022
4320b2a
Allow copy/paste on unmasked SMB password
PhilZ-cwm6 Jun 27, 2022
c05b894
Code formatting
PhilZ-cwm6 Jun 27, 2022
6e3138b
Toggle SMB password Layout view on use password check/uncheck
PhilZ-cwm6 Jun 27, 2022
4b204c9
Mask SMB password when edit SMB parameters option is unchecked
PhilZ-cwm6 Jun 27, 2022
acabaad
Preserve SMB password masked/unmasked state on screen rotation
PhilZ-cwm6 Jun 27, 2022
2e8ff6d
Code optimize
PhilZ-cwm6 Jun 29, 2022
7ca44f4
Update description comments
PhilZ-cwm6 Jun 29, 2022
d47f5e2
Comments and remove unused variables
PhilZ-cwm6 Jun 29, 2022
cd64d55
Update comments
PhilZ-cwm6 Jun 29, 2022
bbde400
Deprecate passwordToggleEnabled
PhilZ-cwm6 Jun 29, 2022
682f77c
Add logging code to TaskEditor class
PhilZ-cwm6 Jun 29, 2022
651a4bb
Enable CommonUtilities debug code in SyncFolderEditValue.isSame
PhilZ-cwm6 Jun 29, 2022
94ff158
Properly set Save/Ok button after screen rotation in ZIP/SMB view
PhilZ-cwm6 Jun 29, 2022
4dab507
Fix some spinners are disabled after screen rotation
PhilZ-cwm6 Jun 30, 2022
edb93b2
Remove unused code
PhilZ-cwm6 Jun 30, 2022
69de8a3
Fix Sync Tasks main view not updated after editing a task
PhilZ-cwm6 Jun 30, 2022
8417b2e
Do not discard SMB password on screen rotation until folder view is s…
PhilZ-cwm6 Jun 30, 2022
122f766
Do not discard SMB port on screen rotation until folder view is saved
PhilZ-cwm6 Jun 30, 2022
5986a4e
Fix "Use SMB account/pass" option is not properly set
PhilZ-cwm6 Jun 30, 2022
54d05fe
Code clean-up
PhilZ-cwm6 Jul 1, 2022
559e599
Preserve Zip password on screen rotation until folder view is saved
PhilZ-cwm6 Jul 1, 2022
fbe5b29
Add option to change application settings directory
PhilZ-cwm6 Jul 1, 2022
4d6d21e
Update gradle plugin
PhilZ-cwm6 Jul 1, 2022
d001cf1
Update and use original zip4j lib v2.11.1
PhilZ-cwm6 Jul 1, 2022
64351b4
SMB1: Update jcifs lib from 1.3.17 to 1.3.19
PhilZ-cwm6 Jul 1, 2022
635941f
Update README.MD
PhilZ-cwm6 Jul 1, 2022
04b946d
Fix SyncTak, History and Messages broken after screen rotation
PhilZ-cwm6 Jul 2, 2022
01f7857
Fix Ok button disabled on file selection even if a file name was set
PhilZ-cwm6 Jul 3, 2022
f7da8d2
Preserve zip file name set by user when browsing files/location
PhilZ-cwm6 Jul 3, 2022
861ef2a
Fix SMB list shares selection not preserved after screen rotation
PhilZ-cwm6 Jul 5, 2022
d10c24e
Preserve selected server options in scanner after screen rotation
PhilZ-cwm6 Jul 6, 2022
110964e
List SMB shares code clean-up
PhilZ-cwm6 Jul 6, 2022
18cbb77
Use a global constant for min/max SMB properties
PhilZ-cwm6 Jul 6, 2022
37cefde
SMB scanner fix view (initialization commit)
PhilZ-cwm6 Jul 8, 2022
fd11590
SMB Scanner: Fix scroll bar not always shown when needed
PhilZ-cwm6 Jul 8, 2022
c438c02
SMB Scanner: code formatting and clean up
PhilZ-cwm6 Jul 8, 2022
96a7c57
SMB Scanner optimization and fixes
PhilZ-cwm6 Jul 8, 2022
d85d4b7
SMB scanner results view fixes
PhilZ-cwm6 Jul 8, 2022
fa25564
Fix SMB Scanner thread could run in the background
PhilZ-cwm6 Jul 10, 2022
6cf071d
SMB scanner selected server UI fix error messages
PhilZ-cwm6 Jul 10, 2022
e1f3ee6
SMB Scanner: support custom port on listing shares 1/2
PhilZ-cwm6 Jul 12, 2022
8c2769f
Properly close JcifsFile after listing shares list
PhilZ-cwm6 Jul 13, 2022
825757e
SMB Scanner: preserve found scan port in server info results
PhilZ-cwm6 Jul 13, 2022
788e927
SMB scanner: properly use selected port to display shares
PhilZ-cwm6 Jul 13, 2022
7eed4cd
Set proper error message if connection fails when refreshing shares
PhilZ-cwm6 Jul 14, 2022
3305a5a
SMB Scanner: on refresh shares, properly handle connection thread
PhilZ-cwm6 Jul 15, 2022
73384f6
Set default SMB level variable
PhilZ-cwm6 Jul 15, 2022
bcbeac6
SMB Scanner: scan for selected SMB level servers
PhilZ-cwm6 Jul 15, 2022
21cf3de
SMB Scanner: disable server selection if scan protocol is unavailable
PhilZ-cwm6 Jul 15, 2022
05c6635
SMB Scaner: preserve shares list if password is toggled
PhilZ-cwm6 Jul 16, 2022
91b5342
Get SMB level from JcifsAuth
PhilZ-cwm6 Jul 16, 2022
d670743
SMB Scanner: Notify negative response on Cancel button
PhilZ-cwm6 Jul 16, 2022
573279b
Adjust SMB Scanner protocol spinner for small screens
PhilZ-cwm6 Jul 16, 2022
aa553ab
SMB Scanner fix view on small layouts
PhilZ-cwm6 Jul 19, 2022
4111754
Fix SMB scanner invalid results could be selected
PhilZ-cwm6 Jul 19, 2022
2f0501f
Fix SMB Scanner crash from upstream
PhilZ-cwm6 Jul 19, 2022
a7121d8
Fix scan results added after scan was cancelled
PhilZ-cwm6 Jul 19, 2022
eb961cc
SMB Scanner server selection view for smaller screens
PhilZ-cwm6 Jul 19, 2022
047549b
Fix NPE app/system crash from SafManager3
PhilZ-cwm6 Jul 20, 2022
7aa2c05
Implement fix more potential NPE
PhilZ-cwm6 Jul 20, 2022
e56ccea
Do not use hard coded references to storage paths
PhilZ-cwm6 Jul 20, 2022
87a6e0f
Implement Remove hard-coded storage paths
PhilZ-cwm6 Jul 20, 2022
cc74b61
Fix String format to digits
PhilZ-cwm6 Jul 20, 2022
7673f84
Fix compiler errors and warnings + fix potential memory leaks
PhilZ-cwm6 Jul 21, 2022
32e1206
Fix compiler errors and warnings
PhilZ-cwm6 Jul 21, 2022
9adee7c
Fix compiler errors and warnings 2
PhilZ-cwm6 Jul 21, 2022
1fb1540
SMB Scanner: proper multithreading scan
PhilZ-cwm6 Jul 22, 2022
1fb7c19
SMB Scanner: fix compiler warnings
PhilZ-cwm6 Jul 22, 2022
d3c9188
SMB Scanner results: limit server port to 5 digits only
PhilZ-cwm6 Jul 23, 2022
8e6ffa0
SMB Scanner result selected: optimize error message visibility
PhilZ-cwm6 Jul 23, 2022
577f2ad
SMB Scanner: show scanned IP range during progress
PhilZ-cwm6 Jul 23, 2022
750cf82
SMB Scanner: fix changing password did not reset shares list
PhilZ-cwm6 Jul 23, 2022
126ce66
SMB Scanner: optimize error message visibility
PhilZ-cwm6 Jul 23, 2022
88bccd3
Fix compiler error and warnings
PhilZ-cwm6 Jul 23, 2022
fdf3374
Font size: Deprecate use of updateConfiguration()
PhilZ-cwm6 Jul 24, 2022
93b038b
Cleanup code to apply language, theme and font size
PhilZ-cwm6 Jul 24, 2022
ffb56e7
Cleanup code to restart app on some settings change
PhilZ-cwm6 Jul 24, 2022
55600d9
Fix SMB v1 logging and fix compiler warnings
PhilZ-cwm6 Jul 24, 2022
48d481b
Add help comments
PhilZ-cwm6 Jul 24, 2022
4ce2d42
Fix deprecated onAttach(Activity activity)
PhilZ-cwm6 Jul 25, 2022
2e9735d
Fix resource format
PhilZ-cwm6 Jul 25, 2022
8870ddd
Fix Date deprecated format in WeekDay button Edit
PhilZ-cwm6 Jul 25, 2022
83df6a5
Fix various compiler warnings
PhilZ-cwm6 Jul 25, 2022
6a6a08f
Replace deprecated Activity.getResources().getDrawable
PhilZ-cwm6 Jul 25, 2022
30548ba
Code clean up
PhilZ-cwm6 Jul 25, 2022
e914344
Fix deprecated Date format for archive destination filename preview
PhilZ-cwm6 Jul 25, 2022
494bfed
Fix compiler warnings
PhilZ-cwm6 Jul 25, 2022
46d0b3d
Properly implement Clone() using Serializable in Edit Sync Task
PhilZ-cwm6 Jul 25, 2022
35b7715
Implement both Cloneable (not used) and Serializable clone() methods
PhilZ-cwm6 Jul 25, 2022
ad1a365
rename clone Serializable method
PhilZ-cwm6 Jul 25, 2022
d468363
Proper Cloneable class with Serialized clone in SyncTaskItem
PhilZ-cwm6 Jul 25, 2022
3a69e4c
Compiler warning fixes
PhilZ-cwm6 Jul 25, 2022
ad7280a
Replace deprecated Context.getDrawable()
PhilZ-cwm6 Jul 25, 2022
85a1e5f
Replace deprecated shouldOverrideUrlLoading in Webview
PhilZ-cwm6 Jul 25, 2022
36ac44f
Fix compiler warnings
PhilZ-cwm6 Jul 25, 2022
9935b34
Save Messages: synchronize on a final object
PhilZ-cwm6 Jul 25, 2022
1344f21
Fix compiler warnings
PhilZ-cwm6 Jul 25, 2022
f7443bc
SaveHistory synchronize on a final object
PhilZ-cwm6 Jul 25, 2022
3cc00f2
Code clean up and fix log.debug output
PhilZ-cwm6 Jul 25, 2022
e7f78b4
Preserve file/directory time/date template after screen rotation
PhilZ-cwm6 Jul 26, 2022
5decb11
Fix NPE crash on app start for some rare devices
PhilZ-cwm6 Aug 31, 2022
1e58ba8
Deprecate startActivityForResult() and requestPermissions()
PhilZ-cwm6 Aug 31, 2022
590f4de
Enable Storage access permission in app menu
PhilZ-cwm6 Aug 31, 2022
ddd9d58
Move requestLocalStoragePermission() code to main activity
PhilZ-cwm6 Aug 31, 2022
b493575
Deprecate startActivityForResult()
PhilZ-cwm6 Aug 31, 2022
b62eeee
Deprecate setRetainInstance() and getRetainInstance()
PhilZ-cwm6 Aug 31, 2022
3350f05
Deprecate onActivityCreated
PhilZ-cwm6 Aug 31, 2022
d682498
Deprecate getFragmentManager()
PhilZ-cwm6 Aug 31, 2022
120b3f7
Fix potential memory leak
PhilZ-cwm6 Aug 31, 2022
75e907b
Formatting
PhilZ-cwm6 Sep 2, 2022
740e034
Fix crash on russian resources
PhilZ-cwm6 Sep 2, 2022
fd6e85a
Gradle upgrade 7.2.2
PhilZ-cwm6 Sep 2, 2022
e542fe0
Always reload config when returning from Settings
PhilZ-cwm6 Sep 5, 2022
2773c16
New prefs: Deprecate PreferenceActivity for PreferenceFragmentCompat
PhilZ-cwm6 Sep 5, 2022
70c75b6
Preferences: disable force dual pane in landscape orientation
PhilZ-cwm6 Sep 10, 2022
c7608eb
Fix orientation to portrait mode was not applied properly
PhilZ-cwm6 Sep 10, 2022
7ccaf86
Preferences: add open app system permissions option
PhilZ-cwm6 Sep 10, 2022
cf2879b
Code formatting and adjust onCreate() methods order
PhilZ-cwm6 Sep 12, 2022
5e59c50
Use Bundle savedInstanceState from onCreate() to check app start state
PhilZ-cwm6 Sep 12, 2022
9f53981
Fix NPE crash when changing system app permissions while in Preferences
PhilZ-cwm6 Sep 12, 2022
1ea1e8a
Define a default theme variable in code
PhilZ-cwm6 Sep 12, 2022
a2180aa
Clarify code to restart app + notify message when app is killed in ba…
PhilZ-cwm6 Sep 12, 2022
26511a5
Set result of Settings Activity to OK on back pressed
PhilZ-cwm6 Sep 12, 2022
0fee1fc
Add settings option to revoke storage permission
PhilZ-cwm6 Sep 13, 2022
f6e8e5b
Disable All file access context menu
PhilZ-cwm6 Sep 13, 2022
83ae1fa
Preferences: Restore the Custom List Pref for compressed file types
PhilZ-cwm6 Sep 16, 2022
2f43f0f
Custom List Preference: Deprecate getFragmentManager()
PhilZ-cwm6 Sep 17, 2022
11b1ad2
Custom List Preference: support custom dialog title
PhilZ-cwm6 Sep 17, 2022
7ea7f00
Custom List Preference: support undo and properly enable Ok button
PhilZ-cwm6 Sep 21, 2022
9423964
Upgrade gradle, plugins and buildToolsVersion to target latest SDK 33
PhilZ-cwm6 Sep 21, 2022
6e68366
Deprecate getParcelableArrayList(String key)
PhilZ-cwm6 Sep 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ Improved version of [SMBSync2](https://github.com/Sentaroh/SMBSync2)

### License information
- This software includes the work that is distributed in the Apache License 2.0.
- [Zip4J 2.2.3](https://github.com/srikanth-lingala/zip4j)
- [Zip4J 2.11.1](https://github.com/srikanth-lingala/zip4j)
- [Metadata-extractor](https://github.com/drewnoakes/metadata-extractor)
- This software includes the work that is distributed in the GNU Lesser General Public License v2.1.
- [jcifs-ng](https://github.com/AgNO3/jcifs-ng)
- [jcifs-1.3.17](https://jcifs.samba.org/)
- [jcifsng-2.1.17](https://github.com/AgNO3/jcifs-ng)
- [jcifs-1.3.19](https://jcifs.samba.org/)
- This software includes the work that is distributed in the MOZILLA PUBLIC LICENSE 1.1.
- [juniversalchardet-1.0.3](https://code.google.com/archive/p/juniversalchardet/)
- This software includes the work that is distributed in the Bouncy Castle LICENSE.
- [Bouncy Castle Provider](https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on/1.66)
- [Bouncy Castle Provider](https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on/1.69)
- This software includes the work that is distributed in the BSD 3-Clause "New" or "Revised" License
- [markdownj](https://github.com/myabc/markdownj)
- This software includes the work that is distributed in the MIT LICENSE.
Expand Down
59 changes: 40 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"//"29.0.3"
compileSdk 33
buildToolsVersion '33.0.0' //"29.0.3"
defaultConfig {
applicationId "com.sentaroh.android.SMBSync3"
minSdkVersion 26
targetSdkVersion 30
targetSdkVersion 33
versionCode 2
versionName "1.0.1"
}

lintOptions {
disable 'MissingTranslation'
abortOnError false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -42,7 +38,8 @@ android {
}

task copyDebugApkRelease(type: Copy) {
from 'build/outputs/apk/debug'
// from 'build/outputs/apk/debug'
from 'build/intermediates/apk/debug'
into '../release/' // Into the project root, one level above the app folder
include '*debug.apk'
}
Expand All @@ -51,10 +48,10 @@ android {
// options.compilerArgs << '-Xlint:unchecked,deprecation'
// }

afterEvaluate {
// afterEvaluate {
packageDebug.finalizedBy(copyDebugApkRelease)
// copyDebugApkRelease.finalizedBy(copyDebugApk)
}
// }

}
}
Expand All @@ -81,27 +78,46 @@ android {

}
}
lint {
abortOnError false
disable 'MissingTranslation'
}
namespace 'com.sentaroh.android.SMBSync3'

}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
// implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.5.1' //bug with duplicate lifecycle-viewmodel-2.5.0-runtime as it needs both java and ktx implementations
// implementation 'androidx.appcompat:appcompat:1.6.0-rc01' //compileSdkVersion 33

// Both lifecycle-viewmodel java/ktx implementations are needed for appcompat 1.5.1
// The implementations can be removed in appcompat 1.6.0
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'


// implementation 'com.google.android.material:material:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.material:material:1.6.1'
// implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'

implementation files('libs/jcifs-ng-2.1.6-20201207-01.jar')
implementation files('libs/jcifs-1.3.17_patch.jar')
implementation files('libs/JcifsFile2-1.0.8.jar')
implementation files('libs/bcprov-jdk15to18-1.66.jar')
// implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.constraintlayout:constraintlayout:2.1.4"

implementation files('libs/jcifsng-latest.jar')
implementation files('libs/jcifs13-1.3.19.jar')
implementation files('libs/JcifsFile2-1.0.9.jar')
// implementation files('libs/bcprov-jdk15to18-1.66.jar')
// implementation files('libs/bcprov-jdk15to18-169.jar')
implementation 'org.bouncycastle:bcprov-jdk15to18:1.69'
// implementation 'org.bouncycastle:bcprov-jdk15to18:1.71'

implementation files('libs/Utilities3-1.0.3.aar')

implementation files('libs/metadata-extractor-2.11.0.jar')

implementation "androidx.work:work-runtime:2.5.0"
// implementation "androidx.work:work-runtime:2.5.0"
implementation "androidx.work:work-runtime:2.7.1"

implementation files('libs/MarkDownJ_0.4.jar')

Expand All @@ -112,5 +128,10 @@ dependencies {
// implementation 'androidx.activity:activity:1.2.0-rc01'
// implementation "androidx.fragment:fragment-ktx:1.3.0-rc01"
// implementation "androidx.core:core-ktx:+"
// implementation "androidx.activity:activity:1.3.1"
// implementation "androidx.activity:activity-ktx:1.3.1"
// implementation "androidx.fragment:fragment:1.5.2"

implementation 'androidx.preference:preference:1.2.0'

}
Binary file removed app/libs/JcifsFile2-1.0.8.jar
Binary file not shown.
Binary file added app/libs/JcifsFile2-1.0.9.jar
Binary file not shown.
Binary file modified app/libs/Utilities3-1.0.3.aar
Binary file not shown.
Binary file removed app/libs/jcifs-1.3.17_patch.jar
Binary file not shown.
Binary file removed app/libs/jcifs-ng-2.1.6-20201207-01.jar
Binary file not shown.
Binary file added app/libs/jcifs13-1.3.19.jar
Binary file not shown.
Binary file added app/libs/jcifsng-latest.jar
Binary file not shown.
18 changes: 10 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sentaroh.android.SMBSync3">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
Expand Down Expand Up @@ -59,12 +58,12 @@
</receiver>

<activity
android:label="@string/app_name"
android:name=".ActivityMain"
android:launchMode="standard"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|layoutDirection|fontScale"
android:screenOrientation="unspecified"
android:alwaysRetainTaskState="true">
android:alwaysRetainTaskState="true"
android:exported="true">

<intent-filter >
<action android:name="android.intent.action.MAIN" />
Expand All @@ -79,28 +78,31 @@

<activity
android:name=".ActivitySettings"
android:label="@string/app_name"
android:screenOrientation="unspecified"
android:icon="@drawable/smbsync">

<!-- Return to main app when pressing Top action bar back button -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ActivityMain"/>
</activity>

<activity
android:name=".ActivityPasswordSettings"
android:label="@string/app_name"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|layoutDirection|fontScale"
android:screenOrientation="unspecified"
android:icon="@drawable/smbsync"
android:excludeFromRecents="true">
</activity>

<activity
android:label="@string/app_name"
android:name=".ActivityIntentHandler"
android:theme="@android:style/Theme.Translucent"
android:launchMode="singleTop"
android:taskAffinity=".ActivityIntentHandler"
android:screenOrientation="unspecified"
android:excludeFromRecents="true">
android:excludeFromRecents="true"
android:exported="true">

<intent-filter >
<action android:name="${applicationId}.ACTION_START_SYNC"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ActivityIntentHandler extends Activity {

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(GlobalParameters.setNewLocale(base));
super.attachBaseContext(GlobalParameters.setLocaleAndMetrics(base));
}

@Override
Expand All @@ -64,15 +64,14 @@ protected void onCreate(Bundle savedInstanceState) {
if (mGp == null) {
mGp =GlobalWorkArea.getGlobalParameter(c);
}
if (mUtil == null) mUtil = mUtil = new CommonUtilities(c, "IntentHandler", mGp, null);
if (mUtil == null) mUtil = new CommonUtilities(c, "IntentHandler", mGp, null);

mGp.loadConfigList(c, mUtil);

final Intent received_intent=getIntent();
if (received_intent.getAction()!=null && !received_intent.getAction().equals("")) {
if (received_intent.getAction().equals(QUERY_SYNC_TASK_INTENT)) {
querySyncTask(c, received_intent);
finish();
} else {
String action=received_intent.getAction();
String task_list=received_intent.getStringExtra(START_SYNC_EXTRA_PARM_SYNC_TASK);
Expand All @@ -81,8 +80,8 @@ protected void onCreate(Bundle savedInstanceState) {
} else {
SyncWorker.startSyncWorkerByAction(c, mGp, mUtil, action, "", task_list);
}
finish();
}
finish();
}
}

Expand All @@ -98,7 +97,8 @@ public void onDestroy() {
}

private void querySyncTask(Context c, Intent in) {
String reply_list = "", sep = "";
StringBuilder reply_list = new StringBuilder();
String sep = "";
String task_type = QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE_AUTO;
if (in.getStringExtra(QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE) != null)
task_type = in.getStringExtra(QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE);
Expand All @@ -109,32 +109,32 @@ private void querySyncTask(Context c, Intent in) {
SyncTaskItem sti = mGp.syncTaskList.get(i);
if (task_type.toLowerCase().equals(QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE_TEST.toLowerCase())) {
if (sti.isSyncTestMode()) {
reply_list += sep + sti.getSyncTaskName();
reply_list.append(sep).append(sti.getSyncTaskName());
sep = NAME_LIST_SEPARATOR;
reply_count++;
}
} else if (task_type.toLowerCase().equals(QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE_AUTO.toLowerCase())) {
if (sti.isSyncTaskAuto()) {
reply_list += sep + sti.getSyncTaskName();
reply_list.append(sep).append(sti.getSyncTaskName());
sep = NAME_LIST_SEPARATOR;
reply_count++;
}
} else if (task_type.toLowerCase().equals(QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE_MANUAL.toLowerCase())) {
if (!sti.isSyncTaskAuto()) {
reply_list += sep + sti.getSyncTaskName();
reply_list.append(sep).append(sti.getSyncTaskName());
sep = NAME_LIST_SEPARATOR;
reply_count++;
}
} else if (task_type.toLowerCase().equals(QUERY_SYNC_TASK_EXTRA_PARM_TASK_TYPE_ALL.toLowerCase())) {
reply_list += sep + sti.getSyncTaskName();
reply_list.append(sep).append(sti.getSyncTaskName());
sep = NAME_LIST_SEPARATOR;
reply_count++;
}
}
}
Intent reply = new Intent(REPLY_SYNC_TASK_INTENT);
reply.putExtra(REPLY_SYNC_TASK_EXTRA_PARM_SYNC_COUNT, reply_count);
reply.putExtra(REPLY_SYNC_TASK_EXTRA_PARM_SYNC_ARRAY, reply_list);
reply.putExtra(REPLY_SYNC_TASK_EXTRA_PARM_SYNC_ARRAY, reply_list.toString());
mUtil.addDebugMsg(1, "I", "query result, count="+reply_count+", list=["+reply_list+"]");
c.sendBroadcast(reply);
}
Expand Down
Loading