Revert "Hide the Battery Stats Viewer launcher by default"

This reverts commit 02f76e7656.

Issue: calyxos#2921
Change-Id: Ib1e4a169708fbf26b4940e38106c9e650bd57aef
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Michael Bestas
2025-01-23 11:45:11 +02:00
committed by Ghosuto
parent e315f3cb4a
commit 63e4ddeae9
3 changed files with 1 additions and 90 deletions

View File

@@ -20,7 +20,6 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
@@ -32,8 +31,7 @@
<activity android:name=".BatteryConsumerPickerActivity"
android:label="Battery Stats"
android:launchMode="singleTop"
android:exported="true"
android:enabled="false">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@@ -43,25 +41,5 @@
<activity android:name=".BatteryStatsViewerActivity"
android:label="Battery Stats"
android:parentActivityName=".BatteryConsumerPickerActivity"/>
<activity android:name=".TrampolineActivity"
android:exported="true"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.development" />
<meta-data android:name="com.android.settings.title"
android:resource="@string/settings_title" />
<meta-data android:name="com.android.settings.summary"
android:resource="@string/settings_summary" />
<meta-data android:name="com.android.settings.group_key"
android:value="debug_debugging_category" />
<meta-data android:name="com.android.settings.order"
android:value="2" />
</activity>
</application>
</manifest>

View File

@@ -1,20 +0,0 @@
<!--
~ Copyright (C) 2024 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="settings_title">Launch Battery Stats Viewer</string>
<string name="settings_summary">The Battery Stats Viewer will be visible in the Launcher after it is opened once.</string>
</resources>

View File

@@ -1,47 +0,0 @@
/*
* Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.frameworks.core.batterystatsviewer;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import androidx.annotation.Nullable;
public class TrampolineActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
showLauncherIcon();
launchMainActivity();
}
private void showLauncherIcon() {
PackageManager pm = getPackageManager();
pm.setComponentEnabledSetting(new ComponentName(this, BatteryConsumerPickerActivity.class),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
}
private void launchMainActivity() {
startActivity(new Intent(this, BatteryConsumerPickerActivity.class));
finish();
}
}