sm8350-common: parts: Add thermal profiles tile

* Launches ThermalActivity
This commit is contained in:
AnierinB 2023-04-07 13:30:23 +05:45 committed by DigiGoon
parent 8907b9860a
commit d623393e11
3 changed files with 80 additions and 0 deletions

View file

@ -108,5 +108,16 @@
android:permission="RefreshService">
</service>
<service
android:name=".thermal.ThermalTileService"
android:icon="@drawable/ic_thermal"
android:label="@string/thermal_title"
android:exported="true"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action
android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>
</application>
</manifest>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M17 3H21V5H17V3M17 7H21V9H17V7M17 11H21V13H17.75L17 12.1V11M21 15V17H19C19 16.31 18.9 15.63 18.71 15H21M7 3V5H3V3H7M7 7V9H3V7H7M7 11V12.1L6.25 13H3V11H7M3 15H5.29C5.1 15.63 5 16.31 5 17H3V15M15 13V5C15 3.34 13.66 2 12 2S9 3.34 9 5V13C6.79 14.66 6.34 17.79 8 20S12.79 22.66 15 21 17.66 16.21 16 14C15.72 13.62 15.38 13.28 15 13M12 4C12.55 4 13 4.45 13 5V8H11V5C11 4.45 11.45 4 12 4Z" />
</vector>

View file

@ -0,0 +1,59 @@
/*
* Copyright (C) 2018 The OmniROM Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.lineageos.settings.thermal;
import android.annotation.TargetApi;
import android.content.Intent;
import android.service.quicksettings.TileService;
@TargetApi(24)
public class ThermalTileService extends TileService {
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void onTileAdded() {
super.onTileAdded();
}
@Override
public void onTileRemoved() {
super.onTileRemoved();
}
@Override
public void onStartListening() {
super.onStartListening();
}
@Override
public void onStopListening() {
super.onStopListening();
}
@Override
public void onClick() {
super.onClick();
Intent ThermalProfiles = new Intent(this, ThermalActivity.class);
ThermalProfiles.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityAndCollapse(ThermalProfiles);
}
}