Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc839c9d authored by Abhisek Devkota's avatar Abhisek Devkota
Browse files

SUW: Update for LineageOS platform & sdk

Change-Id: Idb765ea4808b4ba3c01414974e40ccf735f77f9d
parent e0605c03
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v13 \
    libphonenumber \
    org.cyanogenmod.platform.internal \
    org.cyanogenmod.platform.sdk
    org.lineageos.platform.internal \
    org.lineageos.platform.sdk

LOCAL_JAVA_LIBRARIES := \
    telephony-common
+4 −5
Original line number Diff line number Diff line
@@ -39,12 +39,12 @@
    <uses-permission android:name="android.permission.MANAGE_USERS" />
    <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
    <uses-permission android:name="cyanogenmod.permission.HARDWARE_ABSTRACTION_ACCESS" />
    <uses-permission android:name="lineageos.permission.HARDWARE_ABSTRACTION_ACCESS" />
    <uses-permission android:name="android.permission.BACKUP" />
    <uses-permission android:name="cyanogenmod.permission.FINISH_SETUP" />
    <uses-permission android:name="cyanogenmod.permission.LEGALESE" />
    <uses-permission android:name="cyanogenmod.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="cyanogenmod.permission.WRITE_SECURE_SETTINGS"/>
    <uses-permission android:name="lineageos.permission.WRITE_SETTINGS" />
    <uses-permission android:name="lineageos.permission.WRITE_SECURE_SETTINGS" />

    <permission
        android:name="cyanogenmod.permission.PROTECTED_APP"
@@ -52,8 +52,7 @@

    <permission
        android:name="cyanogenmod.permission.FINISH_SETUP"
        android:protectionLevel="signatureOrSystem"
        androidprv:allowViaWhitelist="true" />
        android:protectionLevel="signatureOrSystem" />

    <protected-broadcast android:name="com.cyanogenmod.setupwizard.SETUP_FINISHED"
                         android:permission="cyanogenmod.permission.FINISH_SETUP"/>
+16 −16
Original line number Diff line number Diff line
@@ -47,8 +47,8 @@ import com.android.setupwizardlib.util.WizardManagerHelper;

import com.cyanogenmod.setupwizard.util.EnableAccessibilityController;

import cyanogenmod.hardware.CMHardwareManager;
import cyanogenmod.providers.CMSettings;
import lineageos.hardware.LineageHardwareManager;
import lineageos.providers.LineageSettings;

public class FinishActivity extends BaseSetupWizardActivity {

@@ -189,8 +189,8 @@ public class FinishActivity extends BaseSetupWizardActivity {
        Bundle privacyData = setupWizardApp.getSettingsBundle();
        if (privacyData != null
                && privacyData.containsKey(KEY_SEND_METRICS)) {
            CMSettings.Secure.putInt(setupWizardApp.getContentResolver(),
                    CMSettings.Secure.STATS_COLLECTION, privacyData.getBoolean(KEY_SEND_METRICS)
            LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
                    LineageSettings.Secure.STATS_COLLECTION, privacyData.getBoolean(KEY_SEND_METRICS)
                            ? 1 : 0);
        }
    }
@@ -198,8 +198,8 @@ public class FinishActivity extends BaseSetupWizardActivity {
    private static void handlePrivacyGuard(SetupWizardApp setupWizardApp) {
        Bundle mPrivacyData = setupWizardApp.getSettingsBundle();
        if (mPrivacyData != null && mPrivacyData.containsKey(KEY_PRIVACY_GUARD)) {
            CMSettings.Secure.putInt(setupWizardApp.getContentResolver(),
                    CMSettings.Secure.PRIVACY_GUARD_DEFAULT,
            LineageSettings.Secure.putInt(setupWizardApp.getContentResolver(),
                    LineageSettings.Secure.PRIVACY_GUARD_DEFAULT,
                    mPrivacyData.getBoolean(KEY_PRIVACY_GUARD) ? 1 : 0);
        }
    }
@@ -214,22 +214,22 @@ public class FinishActivity extends BaseSetupWizardActivity {
    private static void writeDisableNavkeysOption(Context context, boolean enabled) {
        final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

        CMSettings.Global.putInt(context.getContentResolver(),
                CMSettings.Global.DEV_FORCE_SHOW_NAVBAR, enabled ? 1 : 0);
        CMHardwareManager hardware = CMHardwareManager.getInstance(context);
        hardware.set(CMHardwareManager.FEATURE_KEY_DISABLE, enabled);
        LineageSettings.Global.putInt(context.getContentResolver(),
                LineageSettings.Global.DEV_FORCE_SHOW_NAVBAR, enabled ? 1 : 0);
        LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
        hardware.set(LineageHardwareManager.FEATURE_KEY_DISABLE, enabled);

        /* Save/restore button timeouts to disable them in softkey mode */
        if (enabled) {
            CMSettings.Secure.putInt(context.getContentResolver(),
                    CMSettings.Secure.BUTTON_BRIGHTNESS, 0);
            LineageSettings.Secure.putInt(context.getContentResolver(),
                    LineageSettings.Secure.BUTTON_BRIGHTNESS, 0);
        } else {
            int currentBrightness = CMSettings.Secure.getInt(context.getContentResolver(),
                    CMSettings.Secure.BUTTON_BRIGHTNESS, 100);
            int currentBrightness = LineageSettings.Secure.getInt(context.getContentResolver(),
                    LineageSettings.Secure.BUTTON_BRIGHTNESS, 100);
            int oldBright = prefs.getInt(KEY_BUTTON_BACKLIGHT,
                    currentBrightness);
            CMSettings.Secure.putInt(context.getContentResolver(),
                    CMSettings.Secure.BUTTON_BRIGHTNESS, oldBright);
            LineageSettings.Secure.putInt(context.getContentResolver(),
                    LineageSettings.Secure.BUTTON_BRIGHTNESS, oldBright);
        }
    }
}
+12 −12
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ import com.android.setupwizardlib.util.WizardManagerHelper;

import com.cyanogenmod.setupwizard.R;

import cyanogenmod.hardware.CMHardwareManager;
import cyanogenmod.providers.CMSettings;
import lineageos.hardware.LineageHardwareManager;
import lineageos.providers.LineageSettings;

public class LineageSettingsActivity extends BaseSetupWizardActivity {

@@ -155,8 +155,8 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
        mPrivacyGuardRow = findViewById(R.id.privacy_guard);
        mPrivacyGuardRow.setOnClickListener(mPrivacyGuardClickListener);
        mPrivacyGuard = (CheckBox) findViewById(R.id.privacy_guard_checkbox);
        mPrivacyGuard.setChecked(CMSettings.Secure.getInt(getContentResolver(),
                CMSettings.Secure.PRIVACY_GUARD_DEFAULT, 0) == 1);
        mPrivacyGuard.setChecked(LineageSettings.Secure.getInt(getContentResolver(),
                LineageSettings.Secure.PRIVACY_GUARD_DEFAULT, 0) == 1);
    }

    @Override
@@ -210,8 +210,8 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
    private void updateDisableNavkeysOption() {
        if (!mHideNavKeysRow) {
            final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
            boolean enabled = CMSettings.Secure.getInt(getContentResolver(),
                    CMSettings.Secure.DEV_FORCE_SHOW_NAVBAR, 0) != 0;
            boolean enabled = LineageSettings.Secure.getInt(getContentResolver(),
                    LineageSettings.Secure.DEV_FORCE_SHOW_NAVBAR, 0) != 0;
            boolean checked = myPageBundle.containsKey(DISABLE_NAV_KEYS) ?
                    myPageBundle.getBoolean(DISABLE_NAV_KEYS) :
                    enabled;
@@ -222,8 +222,8 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {

    private void updatePrivacyGuardOption() {
        final Bundle bundle = mSetupWizardApp.getSettingsBundle();
        boolean enabled = CMSettings.Secure.getInt(getContentResolver(),
                CMSettings.Secure.PRIVACY_GUARD_DEFAULT, 0) != 0;
        boolean enabled = LineageSettings.Secure.getInt(getContentResolver(),
                LineageSettings.Secure.PRIVACY_GUARD_DEFAULT, 0) != 0;
        boolean checked = bundle.containsKey(KEY_PRIVACY_GUARD) ?
                bundle.getBoolean(KEY_PRIVACY_GUARD) :
                enabled;
@@ -232,12 +232,12 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
    }

    private static boolean hideKeyDisabler(Context context) {
        final CMHardwareManager hardware = CMHardwareManager.getInstance(context);
        return !hardware.isSupported(CMHardwareManager.FEATURE_KEY_DISABLE);
        final LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
        return !hardware.isSupported(LineageHardwareManager.FEATURE_KEY_DISABLE);
    }

    private static boolean isKeyDisablerActive(Context context) {
        final CMHardwareManager hardware = CMHardwareManager.getInstance(context);
        return hardware.get(CMHardwareManager.FEATURE_KEY_DISABLE);
        final LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
        return hardware.get(LineageHardwareManager.FEATURE_KEY_DISABLE);
    }
}
+8 −10
Original line number Diff line number Diff line
@@ -58,18 +58,19 @@ public class EnableAccessibilityController {
        public void handleMessage(Message message) {
            switch (message.what) {
                case MESSAGE_SPEAK_WARNING: {
                    String text = mContext.getString(R.string.continue_to_enable_accessibility);
                    mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
                    // TODO: Fix these or remove these
                    //String text = mContext.getString(R.string.continue_to_enable_accessibility);
                    //mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
                } break;
                case MESSAGE_SPEAK_ENABLE_CANCELED: {
                    String text = mContext.getString(R.string.enable_accessibility_canceled);
                    mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
                    //String text = mContext.getString(R.string.enable_accessibility_canceled);
                    //mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
                } break;
                case MESSAGE_ENABLE_ACCESSIBILITY: {
                    enableAccessibility();
                    mTone.play();
                    mTts.speak(mContext.getString(R.string.accessibility_enabled),
                            TextToSpeech.QUEUE_FLUSH, null);
                    //mTone.play();
                    //mTts.speak(mContext.getString(R.string.accessibility_enabled),
                    //        TextToSpeech.QUEUE_FLUSH, null);
                } break;
            }
        }
@@ -261,9 +262,6 @@ public class EnableAccessibilityController {
                Settings.Secure.putIntForUser(resolver, Settings.Secure.TOUCH_EXPLORATION_ENABLED,
                        1, userId);
            }
            // Enable accessibility script injection (AndroidVox) for web content.
            Settings.Secure.putIntForUser(resolver, Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION,
                    1, userId);
            // Turn on accessibility mode last.
            Settings.Secure.putIntForUser(resolver, Settings.Secure.ACCESSIBILITY_ENABLED,
                    1, userId);
Loading