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

Commit eeb23f5e authored by Danesh M's avatar Danesh M Committed by Steve Kondik
Browse files

SystemUI : Navbar ring targets

Change-Id: I113d9d257ffa0cb5a51823bee37bd86bb7f19527
parent 9c1f93a2
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package android.hardware;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -163,6 +164,19 @@ public class TorchManager {
        }
    };

    public void toggleTorch() {
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                try {
                    mService.toggleTorch();
                } catch (RemoteException e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public void setTorchEnabled(final boolean newState) {
        mHandler.post(new Runnable() {
            @Override
@@ -184,6 +198,10 @@ public class TorchManager {
        }
    }

    public boolean isTorchSupported() {
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
    }

    public boolean isAvailable() {
        try {
            return mService.isAvailable();
+13 −0
Original line number Diff line number Diff line
@@ -1252,6 +1252,9 @@ public final class Settings {
            MOVED_TO_SECURE.add(Secure.QS_TILES);
            MOVED_TO_SECURE.add(Secure.QS_USE_MAIN_TILES);
            MOVED_TO_SECURE.add(Secure.QS_SHOW_BRIGHTNESS_SLIDER);
            for (String s : Secure.NAVIGATION_RING_TARGETS) {
                MOVED_TO_SECURE.add(s);
            }
        }

        private static final HashSet<String> MOVED_TO_GLOBAL;
@@ -5795,6 +5798,16 @@ public final class Settings {
         */
        public static final String QS_LOCATION_ADVANCED = "qs_location_advanced";

        /**
         * Custom navring actions
         * @hide
         */
        public static final String[] NAVIGATION_RING_TARGETS = new String[] {
                "navigation_ring_targets_0",
                "navigation_ring_targets_1",
                "navigation_ring_targets_2",
        };

        /**
         * This are the settings to be backed up.
         *
+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@

    <protected-broadcast android:name="android.os.UpdateLock.UPDATE_LOCK_CHANGED" />
    <protected-broadcast android:name="android.intent.action.NAVBAR_EDIT" />
    <protected-broadcast android:name="android.intent.action.NAVBAR_RING_EDIT" />

    <protected-broadcast android:name="android.intent.action.DREAMING_STARTED" />
    <protected-broadcast android:name="android.intent.action.DREAMING_STOPPED" />
+9 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
    // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
    // is properly propagated through your change.  Not doing so will result in a loss of user
    // settings.
    private static final int DATABASE_VERSION = 120;
    private static final int DATABASE_VERSION = 121;

    private static final String HEADSET = "_headset";
    private static final String SPEAKER = "_speaker";
@@ -1930,6 +1930,14 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            upgradeVersion = 120;
        }

        if (upgradeVersion < 121) {
            String[] settingsToMove = Settings.Secure.NAVIGATION_RING_TARGETS;

            moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_SECURE,
                    settingsToMove, true);
            upgradeVersion = 121;
        }

        // *** Remember to update DATABASE_VERSION above!

        if (upgradeVersion != currentVersion) {
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (c) 2015 The CyanogenMod 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="48dp"
    android:height="48dp"
    android:viewportWidth="48"
    android:viewportHeight="48">

    <path
        android:fillColor="#000000"
        android:pathData="M38 12.83L35.17 10 24 21.17 12.83 10 10 12.83 21.17 24 10 35.17 12.83 38 24
26.83 35.17 38 38 35.17 26.83 24z" />
</vector>
Loading