Skip to content

Commit 14f29f0

Browse files
committed
Run pre-commit run --all
Change-Id: Ieeaad8927dedfad7d7ddeca5caec313c174c0faa
1 parent 6ceb3db commit 14f29f0

8 files changed

Lines changed: 54 additions & 54 deletions

File tree

Euicc/res/raw/esim_intro_illustration_lottie.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Euicc/src/org/lineageos/euicc/EuiccDisabler.kt

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,35 @@ import android.util.Log
1414
object EuiccDisabler {
1515
private const val TAG = "SonyEuiccDisabler"
1616

17-
private val EUICC_DEPENDENCIES = listOf(
18-
"com.google.android.gms",
19-
"com.google.android.gsf",
20-
)
21-
22-
private val EUICC_PACKAGES = listOf(
23-
"com.google.android.euicc",
24-
"com.google.euiccpixel",
25-
"com.google.android.ims",
26-
)
27-
28-
private fun isInstalled(pm: PackageManager, pkgName: String) = runCatching {
29-
val info = pm.getApplicationInfo(pkgName, ApplicationInfoFlags.of(0))
30-
info.flags and ApplicationInfo.FLAG_INSTALLED != 0
31-
}.getOrDefault(false)
32-
33-
private fun isInstalledAndEnabled(pm: PackageManager, pkgName: String) = runCatching {
34-
val info = pm.getApplicationInfo(pkgName, ApplicationInfoFlags.of(0))
35-
Log.d(TAG, "package $pkgName installed, enabled = ${info.enabled}")
36-
info.enabled
37-
}.getOrDefault(false)
17+
private val EUICC_DEPENDENCIES = listOf("com.google.android.gms", "com.google.android.gsf")
18+
19+
private val EUICC_PACKAGES =
20+
listOf("com.google.android.euicc", "com.google.euiccpixel", "com.google.android.ims")
21+
22+
private fun isInstalled(pm: PackageManager, pkgName: String) =
23+
runCatching {
24+
val info = pm.getApplicationInfo(pkgName, ApplicationInfoFlags.of(0))
25+
info.flags and ApplicationInfo.FLAG_INSTALLED != 0
26+
}
27+
.getOrDefault(false)
28+
29+
private fun isInstalledAndEnabled(pm: PackageManager, pkgName: String) =
30+
runCatching {
31+
val info = pm.getApplicationInfo(pkgName, ApplicationInfoFlags.of(0))
32+
Log.d(TAG, "package $pkgName installed, enabled = ${info.enabled}")
33+
info.enabled
34+
}
35+
.getOrDefault(false)
3836

3937
fun enableOrDisableEuicc(context: Context) {
4038
val pm = context.packageManager
4139
val disable = EUICC_DEPENDENCIES.any { !isInstalledAndEnabled(pm, it) }
42-
val flag = if (disable) {
43-
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
44-
} else {
45-
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
46-
}
40+
val flag =
41+
if (disable) {
42+
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
43+
} else {
44+
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
45+
}
4746

4847
for (pkg in EUICC_PACKAGES) {
4948
if (isInstalled(pm, pkg)) {

XperiaParts/src/org/lineageos/settings/device/display/CreatorModeUtils.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ import android.content.Context
99
import android.hardware.display.ColorDisplayManager
1010
import android.provider.Settings
1111
import android.util.Log
12-
1312
import lineageos.hardware.LiveDisplayManager
14-
1513
import vendor.semc.hardware.display.V2_0.IDisplay
1614
import vendor.semc.hardware.display.V2_0.IDisplayCallback
1715
import vendor.semc.hardware.display.V2_0.PccMatrix
1816

1917
class CreatorModeUtils(private val context: Context) : IDisplayCallback.Stub() {
2018
private val colorDisplayManager: ColorDisplayManager =
21-
context.getSystemService(ColorDisplayManager::class.java)
22-
?: throw Exception("Display manager is NULL")
19+
context.getSystemService(ColorDisplayManager::class.java)
20+
?: throw Exception("Display manager is NULL")
2321
private val semcDisplayService: IDisplay by lazy {
2422
val service = IDisplay.getService() ?: throw Exception("SEMC Display HIDL not found")
2523

XperiaParts/src/org/lineageos/settings/device/display/DisplaySettingsActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package org.lineageos.settings.device.display
77

88
import android.os.Bundle
9-
109
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
1110

1211
class DisplaySettingsActivity : CollapsingToolbarBaseActivity() {
@@ -17,7 +16,7 @@ class DisplaySettingsActivity : CollapsingToolbarBaseActivity() {
1716
.replace(
1817
com.android.settingslib.collapsingtoolbar.R.id.content_frame,
1918
DisplaySettingsFragment(),
20-
TAG
19+
TAG,
2120
)
2221
.commit()
2322
}

XperiaParts/src/org/lineageos/settings/device/display/DisplaySettingsFragment.kt

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
package org.lineageos.settings.device.display
77

88
import android.app.AlertDialog
9-
import android.content.Context
109
import android.os.Bundle
1110
import android.provider.Settings
1211
import android.view.View
1312
import android.widget.CheckBox
1413
import androidx.preference.*
15-
1614
import org.lineageos.settings.device.R
1715

1816
const val CREATOR_MODE_KEY = "switchCreatorMode"
@@ -46,22 +44,31 @@ class DisplaySettingsFragment : PreferenceFragment(), Preference.OnPreferenceCha
4644
when (preference.key) {
4745
CREATOR_MODE_KEY -> {
4846
if (newValue as Boolean) {
49-
if (Settings.Secure.getInt(context.contentResolver,
50-
CREATOR_MODE_DIALOG_DISABLE_KEY, 0) == 0) {
51-
builder.setTitle(R.string.cm_dialog_title)
52-
.setView(checkBoxView)
53-
.setCancelable(false)
54-
.setMessage(R.string.cm_dialog_message)
55-
.setPositiveButton(android.R.string.ok) { _, _ ->
56-
creatorModeUtils.setMode(true)
57-
}
58-
.setNegativeButton(android.R.string.cancel) { _, _ ->
59-
preference as SwitchPreferenceCompat
60-
preference.isChecked = !preference.isChecked
47+
if (
48+
Settings.Secure.getInt(
49+
context.contentResolver,
50+
CREATOR_MODE_DIALOG_DISABLE_KEY,
51+
0,
52+
) == 0
53+
) {
54+
builder
55+
.setTitle(R.string.cm_dialog_title)
56+
.setView(checkBoxView)
57+
.setCancelable(false)
58+
.setMessage(R.string.cm_dialog_message)
59+
.setPositiveButton(android.R.string.ok) { _, _ ->
60+
creatorModeUtils.setMode(true)
61+
}
62+
.setNegativeButton(android.R.string.cancel) { _, _ ->
63+
preference as SwitchPreferenceCompat
64+
preference.isChecked = !preference.isChecked
6165

62-
Settings.Secure.putInt(context.contentResolver,
63-
CREATOR_MODE_DIALOG_DISABLE_KEY, 0)
64-
}
66+
Settings.Secure.putInt(
67+
context.contentResolver,
68+
CREATOR_MODE_DIALOG_DISABLE_KEY,
69+
0,
70+
)
71+
}
6572
builder.show()
6673
} else {
6774
creatorModeUtils.setMode(true)

interfaces/semc/hardware/display/2.0/types.hal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ struct PccMatrix {
1919
float red;
2020
float green;
2121
float blue;
22-
};
22+
};

interfaces/semc/hardware/display/2.1/IFramerateController.hal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ package vendor.semc.hardware.display@2.1;
99
interface IFramerateController {
1010
set_fps_mode(int32_t mode) generates (int32_t status);
1111
};
12-

interfaces/semc/hardware/display/2.2/IFramerateController.hal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ interface IFramerateController extends @2.1::IFramerateController {
1212
set_opec_mode(int32_t mode) generates (int32_t status);
1313
set_hmd_mode(int32_t mode) generates (int32_t status);
1414
};
15-
16-

0 commit comments

Comments
 (0)