mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-16 23:12:51 +00:00
33 lines
No EOL
898 B
Java
33 lines
No EOL
898 B
Java
package com.beemdevelopment.aegis.services;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Build;
|
|
import android.service.quicksettings.Tile;
|
|
import android.service.quicksettings.TileService;
|
|
|
|
import androidx.annotation.RequiresApi;
|
|
|
|
import com.beemdevelopment.aegis.ui.MainActivity;
|
|
|
|
@RequiresApi(api = Build.VERSION_CODES.N)
|
|
public class LaunchAppTileService extends TileService {
|
|
|
|
@Override
|
|
public void onStartListening() {
|
|
super.onStartListening();
|
|
Tile tile = getQsTile();
|
|
tile.setState(Tile.STATE_INACTIVE);
|
|
tile.updateTile();
|
|
}
|
|
|
|
@Override
|
|
public void onClick() {
|
|
super.onClick();
|
|
|
|
Intent intent = new Intent(this, MainActivity.class);
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
intent.setAction(Intent.ACTION_MAIN);
|
|
|
|
startActivityAndCollapse(intent);
|
|
}
|
|
} |