This commit is contained in:
coco
2026-07-03 15:47:27 +08:00
commit 7846a45f2c
38575 changed files with 4736783 additions and 0 deletions
@@ -0,0 +1 @@
/build
@@ -0,0 +1,26 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.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.
*
*/
plugins {
alias(libs.plugins.com.eblan.launcher.library)
alias(libs.plugins.com.eblan.launcher.hilt)
}
android {
namespace = "com.eblan.launcher.framework.settings"
}
@@ -0,0 +1,22 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.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.eblan.launcher.framework.settings
interface AndroidSettingsWrapper {
fun isNotificationAccessGranted(): Boolean
}
@@ -0,0 +1,34 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.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.eblan.launcher.framework.settings
import android.content.Context
import android.provider.Settings
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
internal class DefaultSettingsWrapper @Inject constructor(@ApplicationContext private val context: Context) : AndroidSettingsWrapper {
override fun isNotificationAccessGranted(): Boolean {
val enabledNotificationListeners = Settings.Secure.getString(
context.contentResolver,
"enabled_notification_listeners",
)
return enabledNotificationListeners?.contains(context.packageName) == true
}
}
@@ -0,0 +1,33 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.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.eblan.launcher.framework.settings
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
internal interface SettingsModule {
@Binds
@Singleton
fun AndroidSettingsWrapper(impl: DefaultSettingsWrapper): AndroidSettingsWrapper
}