Skip to content

Commit

Permalink
Create power-management-aidl
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikjesus authored Mar 1, 2024
1 parent fb3d956 commit 183d4f5
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions knowledgebase/bliss-bass/interfaces/power-management-aidl
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>
```


**&lt;parameters>** is the method number in aidl

1: reboot

2: shutdown

3: sleep

0 comments on commit 183d4f5

Please sign in to comment.