Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Data Recovery White
Commits
958a7451
Commit
958a7451
authored
Jul 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
4c996e93
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
15 deletions
+11
-15
MessagingService.java
...main/java/com/base/datarecovery/fcm/MessagingService.java
+1
-1
NotificationUtil.kt
...c/main/java/com/base/datarecovery/fcm/NotificationUtil.kt
+8
-7
RecoveryTimerManager.java
.../java/com/base/datarecovery/fcm/RecoveryTimerManager.java
+1
-1
ScreenStatusReceiver.java
.../java/com/base/datarecovery/fcm/ScreenStatusReceiver.java
+1
-1
HomeFragment.kt
.../main/java/com/base/datarecovery/fragment/HomeFragment.kt
+0
-5
No files found.
app/src/main/java/com/base/datarecovery/fcm/MessagingService.java
View file @
958a7451
...
...
@@ -58,7 +58,7 @@ public class MessagingService extends FirebaseMessagingService {
// Consider implementing this method if local notifications are needed
private
void
sendLocalNotification
()
{
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
"MessagingService"
);
}
}
\ No newline at end of file
app/src/main/java/com/base/datarecovery/fcm/NotificationUtil.kt
View file @
958a7451
...
...
@@ -213,19 +213,20 @@ object NotificationUtil {
AppPreferences
.
getInstance
().
put
(
key
,
s
)
}
fun
sendNotification
(
context
:
Context
)
{
val
currentNum
=
AppPreferences
.
getInstance
().
getInt
(
"showNotificationCount_"
+
AdDisplayUtils
.
getInstance
().
getCurrentDate
(),
0
)
val
maxNum
=
AppPreferences
.
getInstance
().
getString
(
"maxShowNotificationCount"
,
"156"
).
toIntOrNull
()
?:
156
fun
sendNotification
(
context
:
Context
,
where
:
String
=
""
)
{
val
currentNum
=
AppPreferences
.
getInstance
().
getInt
(
"showNotificationCount_"
+
AdDisplayUtils
.
getInstance
().
getCurrentDate
(),
0
)
val
maxNum
=
AppPreferences
.
getInstance
().
getString
(
"maxShowNotificationCount"
,
"156"
).
toIntOrNull
()
?:
156
if
(
currentNum
>=
maxNum
)
{
LogEx
.
logDebug
(
"glc"
,
"currentNum >= maxNum"
)
LogEx
.
logDebug
(
"glc"
,
"currentNum >= maxNum"
)
return
}
val
actionId
:
Int
=
getNextNotificationId
()
EventUtils
.
event
(
"showNotification"
,
null
,
null
,
false
)
EventUtils
.
event
(
"showNotification"
,
where
,
null
,
false
)
if
(
MyApplication
.
PAUSED_VALUE
==
1
)
{
LogEx
.
logDebug
(
"glc"
,
"MyApplication.PAUSED_VALUE == 1)"
)
LogEx
.
logDebug
(
"glc"
,
"MyApplication.PAUSED_VALUE == 1)"
)
return
}
...
...
@@ -235,7 +236,7 @@ object NotificationUtil {
val
nowTime
=
System
.
currentTimeMillis
()
val
x
=
nowTime
-
lastTime
if
(
x
<
(
interval
*
1000
))
{
LogEx
.
logDebug
(
"glc"
,
"sendNotification x < (interval * 1000)"
)
LogEx
.
logDebug
(
"glc"
,
"sendNotification x < (interval * 1000)"
)
return
}
...
...
app/src/main/java/com/base/datarecovery/fcm/RecoveryTimerManager.java
View file @
958a7451
...
...
@@ -34,7 +34,7 @@ public class RecoveryTimerManager {
!
ScreenStatusReceiver
.
isSecureLockActive
()
&&
MyApplication
.
PAUSED_VALUE
!=
1
)
{
Log
.
d
(
"glc"
,
"Scheduled task conditions are met"
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
"scheduleTask"
);
}
}
};
...
...
app/src/main/java/com/base/datarecovery/fcm/ScreenStatusReceiver.java
View file @
958a7451
...
...
@@ -49,7 +49,7 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
Log
.
d
(
"glc"
,
"isDeviceInteractive() && !isSecureLockActive()"
);
int
secureSetting
=
Integer
.
valueOf
(
AppPreferences
.
getInstance
().
getString
(
"lockS"
,
"1"
));
if
(
secureSetting
==
1
)
{
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
"ScreenStatusReceiver"
);
}
}
break
;
...
...
app/src/main/java/com/base/datarecovery/fragment/HomeFragment.kt
View file @
958a7451
...
...
@@ -14,18 +14,13 @@ import com.base.datarecovery.activity.privacyspace.PrivacySpaceActivity
import
com.base.datarecovery.activity.recovery.FileScanResultActivity
import
com.base.datarecovery.activity.repeat.RepeatAnimationActivity
import
com.base.datarecovery.activity.screenshot.ScreenShotAnimationActivity
import
com.base.datarecovery.ads.AdmobMaxHelper
import
com.base.datarecovery.ads.admob.AdmobBannerUtils
import
com.base.datarecovery.bean.ConstObject
import
com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.datarecovery.bean.ConstObject.SCAN_PHOTOS
import
com.base.datarecovery.bean.ConstObject.SCAN_VIDEOS
import
com.base.datarecovery.bean.ConstObject.privacyPinPassword
import
com.base.datarecovery.databinding.FragmentHomeBinding
import
com.base.datarecovery.fcm.NotificationUtil.sendNotification
import
com.base.datarecovery.help.BaseFragment
import
com.base.datarecovery.help.KotlinExt.toFormatSize
import
com.google.android.gms.ads.AdView
class
HomeFragment
:
BaseFragment
<
FragmentHomeBinding
>()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment