Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_packages_services_VncFlinger
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LMODroid
platform_packages_services_VncFlinger
Commits
fbfab796
Commit
fbfab796
authored
2 years ago
by
Nick
Browse files
Options
Downloads
Patches
Plain Diff
support setting notification intent
parent
c4132464
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/org/eu/droid_ng/vncflinger/VncFlinger.java
+17
-4
17 additions, 4 deletions
java/org/eu/droid_ng/vncflinger/VncFlinger.java
with
17 additions
and
4 deletions
java/org/eu/droid_ng/vncflinger/VncFlinger.java
+
17
−
4
View file @
fbfab796
...
...
@@ -7,9 +7,11 @@ import android.annotation.SuppressLint;
import
android.app.Notification
;
import
android.app.NotificationChannel
;
import
android.app.NotificationManager
;
import
android.app.PendingIntent
;
import
android.app.Service
;
import
android.content.ClipData
;
import
android.content.ClipboardManager
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.hardware.display.DisplayManager
;
...
...
@@ -47,6 +49,10 @@ public class VncFlinger extends Service {
public
PointerIcon
mOldPointerIcon
;
public
int
mOldPointerIconId
;
public
boolean
nIntentEnable
;
public
String
nIntentPkg
;
public
String
nIntentComponent
;
private
Context
mContext
;
@SuppressLint
(
"ServiceCast"
)
...
...
@@ -64,6 +70,9 @@ public class VncFlinger extends Service {
allowResize
=
intent
.
getBooleanExtra
(
"allowResize"
,
false
);
audio
=
intent
.
getBooleanExtra
(
"audio"
,
true
);
remoteCursor
=
intent
.
getBooleanExtra
(
"remoteCursor"
,
false
);
nIntentEnable
=
intent
.
getBooleanExtra
(
"nIntentEnable"
,
false
);
nIntentPkg
=
intent
.
getStringExtra
(
"nIntentPkg"
);
nIntentComponent
=
intent
.
getStringExtra
(
"nIntentComponent"
);
if
((
w
<
0
||
h
<
0
||
dpi
<
0
)
&&
!
isInternal
)
{
throw
new
IllegalStateException
(
"invalid extras"
);
}
...
...
@@ -118,13 +127,17 @@ public class VncFlinger extends Service {
channel
.
setBlockable
(
true
);
notificationManager
.
createNotificationChannel
(
channel
);
}
Notification
notification
=
Notification
.
Builder
notification
=
new
Notification
.
Builder
(
this
,
CHANNEL_ID
)
.
setContentTitle
(
getText
(
R
.
string
.
notification_title
))
.
setContentText
(
getString
(
R
.
string
.
notification_message
,
getText
(
R
.
string
.
app_name
)))
.
setSmallIcon
(
R
.
drawable
.
ic_desktop
)
.
build
();
startForeground
(
ONGOING_NOTIFICATION_ID
,
notification
);
.
setSmallIcon
(
R
.
drawable
.
ic_desktop
);
if
(
nIntentEnable
)
{
Intent
i
=
new
Intent
();
i
.
setComponent
(
new
ComponentName
(
nIntentPkg
,
nIntentComponent
));
notification
.
setContentIntent
(
PendingIntent
.
getActivity
(
mContext
,
0
,
i
,
PendingIntent
.
FLAG_IMMUTABLE
));
}
startForeground
(
ONGOING_NOTIFICATION_ID
,
notification
.
build
());
return
START_NOT_STICKY
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment