-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb3d956
commit 183d4f5
Showing
1 changed file
with
71 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
## Bliss Power Management AIDL Interface: | ||
|
||
|
||
``` | ||
package org.blissos.powermanagerclient; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.widget.Button; | ||
import org.blissos.powermanager.BlissPowerManager; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
Button rebootBtn = findViewById(R.id.rebootBtn); | ||
Button shutdownBtn = findViewById(R.id.shutdownBtn); | ||
Button sleepBtn = findViewById(R.id.sleepBtn); | ||
|
||
BlissPowerManager blissPowerManager = BlissPowerManager.getInstance(this); | ||
|
||
rebootBtn.setOnClickListener(v -> blissPowerManager.reboot()); | ||
shutdownBtn.setOnClickListener(v -> blissPowerManager.shutdown()); | ||
sleepBtn.setOnClickListener(v -> blissPowerManager.sleep()); | ||
} | ||
} | ||
``` | ||
|
||
|
||
1) copy paste “**system_libs/bliss-power-framework.jar**” from sample app | ||
|
||
2) gradle: | ||
|
||
|
||
``` | ||
implementation fileTree(dir: 'system_libs/', include: ['*.jar']) | ||
``` | ||
|
||
|
||
3) java: | ||
|
||
|
||
``` | ||
import org.blissos.powermanager.BlissPowerManager; | ||
|
||
BlissPowerManager blissPowerManager = BlissPowerManager.getInstance(this); | ||
blissPowerManager.reboot() | ||
blissPowerManager.shutdown() | ||
blissPowerManager.sleep() | ||
``` | ||
|
||
|
||
|
||
##### ADB Interface: | ||
|
||
|
||
``` | ||
adb shell service call blisspower <parameters> | ||
``` | ||
|
||
|
||
**<parameters>** is the method number in aidl | ||
|
||
1: reboot | ||
|
||
2: shutdown | ||
|
||
3: sleep |