sanders: LineageActions -> MotoActions
This commit is contained in:
@@ -5,7 +5,7 @@ LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_PACKAGE_NAME := LineageActions
|
||||
LOCAL_PACKAGE_NAME := MotoActions
|
||||
LOCAL_CERTIFICATE := platform
|
||||
LOCAL_PRIVILEGED_MODULE := true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.lineageos.settings.device"
|
||||
package="com.moto.actions"
|
||||
android:sharedUserId="android.uid.system"
|
||||
>
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
android:persistent="true">
|
||||
|
||||
<provider
|
||||
android:name=".LineageActionsSearchIndexablesProvider"
|
||||
android:authorities="org.lineageos.settings.device"
|
||||
android:name=".MotoActionsSearchIndexablesProvider"
|
||||
android:authorities="com.moto.actions"
|
||||
android:multiprocess="false"
|
||||
android:grantUriPermissions="true"
|
||||
android:permission="android.permission.READ_SEARCH_INDEXABLES"
|
||||
@@ -36,7 +36,7 @@
|
||||
</intent-filter>
|
||||
</provider>
|
||||
|
||||
<receiver android:name="org.lineageos.settings.device.BootCompletedReceiver">
|
||||
<receiver android:name="com.moto.actions.BootCompletedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
@@ -52,9 +52,9 @@
|
||||
<activity
|
||||
android:name=".DozeSettingsActivity"
|
||||
android:label="@string/ambient_display_title"
|
||||
android:theme="@style/LineageActions">
|
||||
android:theme="@style/MotoActions">
|
||||
<intent-filter>
|
||||
<action android:name="org.lineageos.settings.device.DOZE_SETTINGS" />
|
||||
<action android:name="com.moto.actions.DOZE_SETTINGS" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
@@ -63,7 +63,7 @@
|
||||
android:name=".ActionsPreferenceActivity"
|
||||
android:label="@string/moto_actions_title"
|
||||
android:summary="@string/device_gestures_summary"
|
||||
android:theme="@style/LineageActions">
|
||||
android:theme="@style/MotoActions">
|
||||
<intent-filter>
|
||||
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||
</intent-filter>
|
||||
@@ -81,13 +81,13 @@
|
||||
<activity
|
||||
android:name=".GestureSettingsActivity"
|
||||
android:label="@string/device_gestures_title"
|
||||
android:theme="@style/LineageActions">
|
||||
android:theme="@style/MotoActions">
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".FPGestureSettingsActivity"
|
||||
android:label="@string/fingerprint_gestures_title"
|
||||
android:theme="@style/LineageActions">
|
||||
android:theme="@style/MotoActions">
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
@@ -43,6 +43,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:theme="@style/LineageActions.SwitchBar" />
|
||||
android:theme="@style/MotoActions.SwitchBar" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -17,42 +17,42 @@
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
<style name="LineageActions" parent="@android:style/Theme.DeviceDefault.Settings">
|
||||
<item name="dialogPreferenceStyle">@style/LineageActions.DialogPreferenceStyle</item>
|
||||
<item name="preferenceCategoryStyle">@style/LineageActions.PreferenceCategoryStyle</item>
|
||||
<item name="preferenceFragmentStyle">@style/LineageActions.PreferenceFragmentStyle</item>
|
||||
<item name="preferenceStyle">@style/LineageActions.PreferenceStyle</item>
|
||||
<item name="preferenceTheme">@style/LineageActions.PreferenceTheme</item>
|
||||
<item name="switchPreferenceStyle">@style/LineageActions.SwitchPreferenceStyle</item>
|
||||
<style name="MotoActions" parent="@android:style/Theme.DeviceDefault.Settings">
|
||||
<item name="dialogPreferenceStyle">@style/MotoActions.DialogPreferenceStyle</item>
|
||||
<item name="preferenceCategoryStyle">@style/MotoActions.PreferenceCategoryStyle</item>
|
||||
<item name="preferenceFragmentStyle">@style/MotoActions.PreferenceFragmentStyle</item>
|
||||
<item name="preferenceStyle">@style/MotoActions.PreferenceStyle</item>
|
||||
<item name="preferenceTheme">@style/MotoActions.PreferenceTheme</item>
|
||||
<item name="switchPreferenceStyle">@style/MotoActions.SwitchPreferenceStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.DialogPreferenceStyle" parent="@style/LineageActions.PreferenceStyle">
|
||||
<style name="MotoActions.DialogPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.PreferenceCategoryStyle" parent="@*android:style/Preference.DeviceDefault.Category">
|
||||
<style name="MotoActions.PreferenceCategoryStyle" parent="@*android:style/Preference.DeviceDefault.Category">
|
||||
<item name="allowDividerAbove">true</item>
|
||||
<item name="allowDividerBelow">true</item>
|
||||
<item name="android:layout">@layout/preference_category_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
|
||||
<style name="MotoActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
|
||||
<item name="allowDividerAfterLastItem">false</item>
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.PreferenceStyle" parent="@*android:style/Preference.DeviceDefault">
|
||||
<style name="MotoActions.PreferenceStyle" parent="@*android:style/Preference.DeviceDefault">
|
||||
<item name="allowDividerAbove">false</item>
|
||||
<item name="allowDividerBelow">true</item>
|
||||
<item name="singleLineTitle">false</item>
|
||||
<item name="android:layout">@layout/preference_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.PreferenceTheme">
|
||||
<style name="MotoActions.PreferenceTheme">
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.SwitchPreferenceStyle" parent="@style/LineageActions.PreferenceStyle">
|
||||
<style name="MotoActions.SwitchPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
|
||||
<item name="widgetLayout">@*android:layout/preference_widget_switch</item>
|
||||
</style>
|
||||
|
||||
<style name="LineageActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
|
||||
<style name="MotoActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
|
||||
</style>
|
||||
</resources>
|
||||
@@ -24,8 +24,8 @@
|
||||
android:summary="@string/device_gestures_summary"
|
||||
android:icon="@drawable/ic_settings_gestures">
|
||||
<intent
|
||||
android:targetPackage="org.lineageos.settings.device"
|
||||
android:targetClass="org.lineageos.settings.device.GestureSettingsActivity" />
|
||||
android:targetPackage="com.moto.actions"
|
||||
android:targetClass="com.moto.actions.GestureSettingsActivity" />
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
@@ -34,8 +34,8 @@
|
||||
android:summary="@string/ambient_display_manage_summary"
|
||||
android:icon="@drawable/ic_settings_doze">
|
||||
<intent
|
||||
android:targetPackage="org.lineageos.settings.device"
|
||||
android:targetClass="org.lineageos.settings.device.DozeSettingsActivity" />
|
||||
android:targetPackage="com.moto.actions"
|
||||
android:targetClass="com.moto.actions.DozeSettingsActivity" />
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
@@ -44,8 +44,8 @@
|
||||
android:summary="@string/fingerprint_gestures_manage_summary"
|
||||
android:icon="@drawable/ic_settings_fingerprint">
|
||||
<intent
|
||||
android:targetPackage="org.lineageos.settings.device"
|
||||
android:targetClass="org.lineageos.settings.device.FPGestureSettingsActivity" />
|
||||
android:targetPackage="com.moto.actions"
|
||||
android:targetClass="com.moto.actions.FPGestureSettingsActivity" />
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v14.preference.PreferenceFragment;
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
@@ -27,12 +27,12 @@ import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.util.FileUtils;
|
||||
import org.lineageos.settings.device.actions.Constants;
|
||||
import org.lineageos.settings.device.ServiceWrapper.LocalBinder;
|
||||
import com.moto.actions.util.FileUtils;
|
||||
import com.moto.actions.actions.Constants;
|
||||
import com.moto.actions.ServiceWrapper.LocalBinder;
|
||||
|
||||
public class BootCompletedReceiver extends BroadcastReceiver {
|
||||
static final String TAG = "LineageActions";
|
||||
static final String TAG = "MotoActions";
|
||||
final String NAVBAR_SHOWN = "navbar_shown";
|
||||
|
||||
private ServiceWrapper mServiceWrapper;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.os.Bundle;
|
||||
@@ -63,7 +63,7 @@ public class DozeSettingsFragment extends PreferenceFragment {
|
||||
|
||||
View switchBar = view.findViewById(R.id.switch_bar);
|
||||
mAmbientDisplaySwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget);
|
||||
mAmbientDisplaySwitch.setChecked(LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver()));
|
||||
mAmbientDisplaySwitch.setChecked(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()));
|
||||
mAmbientDisplaySwitch.setOnCheckedChangeListener(mAmbientDisplayPrefListener);
|
||||
|
||||
switchBar.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -74,14 +74,14 @@ public class DozeSettingsFragment extends PreferenceFragment {
|
||||
});
|
||||
|
||||
mSwitchBarText = switchBar.findViewById(R.id.switch_text);
|
||||
mSwitchBarText.setText(LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver()) ? R.string.switch_bar_on :
|
||||
mSwitchBarText.setText(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()) ? R.string.switch_bar_on :
|
||||
R.string.switch_bar_off);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.doze_panel);
|
||||
boolean dozeEnabled = LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver());
|
||||
boolean dozeEnabled = MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver());
|
||||
mHandwavePreference = (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE);
|
||||
mPickupPreference = (SwitchPreference) findPreference(KEY_GESTURE_PICK_UP);
|
||||
updatePrefs(dozeEnabled);
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.os.Bundle;
|
||||
@@ -33,10 +33,10 @@ import android.widget.CompoundButton;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.lineageos.settings.device.actions.Constants;
|
||||
import com.moto.actions.actions.Constants;
|
||||
|
||||
import static org.lineageos.settings.device.actions.Constants.FP_HOME_KEY;
|
||||
import static org.lineageos.settings.device.actions.Constants.FP_HOME_KEY_OFF;
|
||||
import static com.moto.actions.actions.Constants.FP_HOME_KEY;
|
||||
import static com.moto.actions.actions.Constants.FP_HOME_KEY_OFF;
|
||||
|
||||
public class FPGestureSettingsFragment extends PreferenceFragment {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v14.preference.PreferenceFragment;
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityManagerNative;
|
||||
@@ -64,11 +64,11 @@ import android.widget.Toast;
|
||||
import com.android.internal.os.DeviceKeyHandler;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
|
||||
import org.lineageos.settings.device.util.FileUtils;
|
||||
import com.moto.actions.util.FileUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.lineageos.settings.device.actions.Constants.*;
|
||||
import static com.moto.actions.actions.Constants.*;
|
||||
|
||||
public class KeyHandler implements DeviceKeyHandler {
|
||||
|
||||
@@ -607,8 +607,8 @@ public class KeyHandler implements DeviceKeyHandler {
|
||||
if (ai != null && !ai.supportsPictureInPicture()) {
|
||||
try {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
Resources resources = pm.getResourcesForApplication("org.lineageos.settings.device");
|
||||
int resId = resources.getIdentifier("app_does_not_support_pip", "string", "org.lineageos.settings.device");
|
||||
Resources resources = pm.getResourcesForApplication("com.moto.actions");
|
||||
int resId = resources.getIdentifier("app_does_not_support_pip", "string", "com.moto.actions");
|
||||
final String text = resources.getString(resId);
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.database.MatrixCursor;
|
||||
@@ -33,8 +33,8 @@ import static android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS;
|
||||
import static android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS;
|
||||
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
|
||||
|
||||
public class LineageActionsSearchIndexablesProvider extends SearchIndexablesProvider {
|
||||
private static final String TAG = "LineageActionsSearchIndexablesProvider";
|
||||
public class MotoActionsSearchIndexablesProvider extends SearchIndexablesProvider {
|
||||
private static final String TAG = "MotoActionsSearchIndexablesProvider";
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
@@ -73,7 +73,7 @@ public class LineageActionsSearchIndexablesProvider extends SearchIndexablesProv
|
||||
ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null;
|
||||
ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId;
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_ACTION] = "com.android.settings.action.EXTRA_SETTINGS";
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "org.lineageos.settings.device";
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "com.moto.actions";
|
||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className;
|
||||
return ref;
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.app.IntentService;
|
||||
import android.content.Context;
|
||||
@@ -27,23 +27,23 @@ import android.util.Log;
|
||||
import java.util.List;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import org.lineageos.settings.device.actions.UpdatedStateNotifier;
|
||||
import org.lineageos.settings.device.actions.CameraActivationSensor;
|
||||
import org.lineageos.settings.device.actions.ChopChopSensor;
|
||||
import org.lineageos.settings.device.actions.FlipToMute;
|
||||
import org.lineageos.settings.device.actions.LiftToSilence;
|
||||
import org.lineageos.settings.device.actions.ProximitySilencer;
|
||||
import com.moto.actions.actions.UpdatedStateNotifier;
|
||||
import com.moto.actions.actions.CameraActivationSensor;
|
||||
import com.moto.actions.actions.ChopChopSensor;
|
||||
import com.moto.actions.actions.FlipToMute;
|
||||
import com.moto.actions.actions.LiftToSilence;
|
||||
import com.moto.actions.actions.ProximitySilencer;
|
||||
|
||||
import org.lineageos.settings.device.doze.DozePulseAction;
|
||||
//import org.lineageos.settings.device.doze.GlanceSensor;
|
||||
import org.lineageos.settings.device.doze.ProximitySensor;
|
||||
import org.lineageos.settings.device.doze.ScreenReceiver;
|
||||
import org.lineageos.settings.device.doze.ScreenStateNotifier;
|
||||
import org.lineageos.settings.device.doze.StowSensor;
|
||||
import com.moto.actions.doze.DozePulseAction;
|
||||
//import com.moto.actions.doze.GlanceSensor;
|
||||
import com.moto.actions.doze.ProximitySensor;
|
||||
import com.moto.actions.doze.ScreenReceiver;
|
||||
import com.moto.actions.doze.ScreenStateNotifier;
|
||||
import com.moto.actions.doze.StowSensor;
|
||||
|
||||
public class LineageActionsService extends IntentService implements ScreenStateNotifier,
|
||||
public class MotoActionsService extends IntentService implements ScreenStateNotifier,
|
||||
UpdatedStateNotifier {
|
||||
private static final String TAG = "LineageActions";
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
@@ -57,13 +57,13 @@ public class LineageActionsService extends IntentService implements ScreenStateN
|
||||
private final List<UpdatedStateNotifier> mUpdatedStateNotifiers =
|
||||
new LinkedList<UpdatedStateNotifier>();
|
||||
|
||||
public LineageActionsService(Context context) {
|
||||
super("LineageActionService");
|
||||
public MotoActionsService(Context context) {
|
||||
super("MotoActionService");
|
||||
mContext = context;
|
||||
|
||||
Log.d(TAG, "Starting");
|
||||
|
||||
LineageActionsSettings lineageActionsSettings = new LineageActionsSettings(context, this);
|
||||
MotoActionsSettings motoActionsSettings = new MotoActionsSettings(context, this);
|
||||
mSensorHelper = new SensorHelper(context);
|
||||
mScreenReceiver = new ScreenReceiver(context, this);
|
||||
|
||||
@@ -71,19 +71,19 @@ public class LineageActionsService extends IntentService implements ScreenStateN
|
||||
mScreenStateNotifiers.add(mDozePulseAction);
|
||||
|
||||
// Actionable sensors get screen on/off notifications
|
||||
//mScreenStateNotifiers.add(new GlanceSensor(lineageActionsSettings, mSensorHelper, mDozePulseAction));
|
||||
mScreenStateNotifiers.add(new ProximitySensor(lineageActionsSettings, mSensorHelper, mDozePulseAction));
|
||||
mScreenStateNotifiers.add(new StowSensor(lineageActionsSettings, mSensorHelper, mDozePulseAction));
|
||||
//mScreenStateNotifiers.add(new GlanceSensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
|
||||
mScreenStateNotifiers.add(new ProximitySensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
|
||||
mScreenStateNotifiers.add(new StowSensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
|
||||
|
||||
// Other actions that are always enabled
|
||||
mUpdatedStateNotifiers.add(new CameraActivationSensor(lineageActionsSettings, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new ChopChopSensor(lineageActionsSettings, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new ProximitySilencer(lineageActionsSettings, context, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new FlipToMute(lineageActionsSettings, context, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new LiftToSilence(lineageActionsSettings, context, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new CameraActivationSensor(motoActionsSettings, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new ChopChopSensor(motoActionsSettings, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new ProximitySilencer(motoActionsSettings, context, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new FlipToMute(motoActionsSettings, context, mSensorHelper));
|
||||
mUpdatedStateNotifiers.add(new LiftToSilence(motoActionsSettings, context, mSensorHelper));
|
||||
|
||||
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "LineageActionsWakeLock");
|
||||
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MotoActionsWakeLock");
|
||||
updateState();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
@@ -25,13 +25,13 @@ import android.provider.Settings;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.actions.Constants;
|
||||
import org.lineageos.settings.device.actions.UpdatedStateNotifier;
|
||||
import org.lineageos.settings.device.actions.CameraActivationAction;
|
||||
import org.lineageos.settings.device.actions.TorchAction;
|
||||
import com.moto.actions.actions.Constants;
|
||||
import com.moto.actions.actions.UpdatedStateNotifier;
|
||||
import com.moto.actions.actions.CameraActivationAction;
|
||||
import com.moto.actions.actions.TorchAction;
|
||||
|
||||
public class LineageActionsSettings {
|
||||
private static final String TAG = "LineageActions";
|
||||
public class MotoActionsSettings {
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
private static final String GESTURE_CAMERA_ACTION_KEY = "gesture_camera_action";
|
||||
private static final String GESTURE_CHOP_CHOP_KEY = "gesture_chop_chop";
|
||||
@@ -52,7 +52,7 @@ public class LineageActionsSettings {
|
||||
private boolean mFlipToMuteEnabled;
|
||||
private boolean mLiftToSilenceEnabled;
|
||||
|
||||
public LineageActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) {
|
||||
public MotoActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
loadPreferences(sharedPrefs);
|
||||
sharedPrefs.registerOnSharedPreferenceChangeListener(mPrefListener);
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
public interface SensorAction {
|
||||
public void action();
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -30,7 +30,7 @@ import android.hardware.TriggerEventListener;
|
||||
import android.util.Log;
|
||||
|
||||
public class SensorHelper {
|
||||
private static final String TAG = "LineageActions";
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
private static final int SENSOR_TYPE_MMI_CAMERA_ACTIVATION = 65540;
|
||||
private static final int SENSOR_TYPE_MMI_CHOP_CHOP = 65546;
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device;
|
||||
package com.moto.actions;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Binder;
|
||||
@@ -24,10 +24,10 @@ import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
public class ServiceWrapper extends android.app.Service {
|
||||
static final String TAG = "LineageActions-ServiceWrapper";
|
||||
static final String TAG = "MotoActions-ServiceWrapper";
|
||||
|
||||
private final IBinder mBinder = new LocalBinder();
|
||||
private LineageActionsService mLineageActionsService;
|
||||
private MotoActionsService mMotoActionsService;
|
||||
|
||||
public interface ServiceCallback {
|
||||
void sendResults(int resultCode, Bundle b);
|
||||
@@ -45,7 +45,7 @@ public class ServiceWrapper extends android.app.Service {
|
||||
public void onCreate() {
|
||||
Log.i(TAG, "onCreate");
|
||||
super.onCreate();
|
||||
mLineageActionsService = new LineageActionsService(this);
|
||||
mMotoActionsService = new MotoActionsService(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,10 +32,10 @@ import android.os.Vibrator;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.SensorAction;
|
||||
import com.moto.actions.SensorAction;
|
||||
|
||||
public class CameraActivationAction implements SensorAction {
|
||||
private static final String TAG = "LineageActions";
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,23 +25,23 @@ import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
public class CameraActivationSensor implements SensorEventListener, UpdatedStateNotifier {
|
||||
private static final String TAG = "LineageActions-CameraSensor";
|
||||
private static final String TAG = "MotoActions-CameraSensor";
|
||||
|
||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
|
||||
private final Sensor mSensor;
|
||||
|
||||
private boolean mIsEnabled;
|
||||
|
||||
public CameraActivationSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper) {
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
public CameraActivationSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mSensorHelper = sensorHelper;
|
||||
mSensor = sensorHelper.getCameraActivationSensor();
|
||||
mSensorHelper.registerListener(mSensor, this);
|
||||
@@ -49,10 +49,10 @@ public class CameraActivationSensor implements SensorEventListener, UpdatedState
|
||||
|
||||
@Override
|
||||
public synchronized void updateState() {
|
||||
if (mLineageActionsSettings.isCameraGestureEnabled() && !mIsEnabled) {
|
||||
if (mMotoActionsSettings.isCameraGestureEnabled() && !mIsEnabled) {
|
||||
Log.d(TAG, "Enabling");
|
||||
mIsEnabled = true;
|
||||
} else if (! mLineageActionsSettings.isCameraGestureEnabled() && mIsEnabled) {
|
||||
} else if (! mMotoActionsSettings.isCameraGestureEnabled() && mIsEnabled) {
|
||||
Log.d(TAG, "Disabling");
|
||||
mIsEnabled = false;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class CameraActivationSensor implements SensorEventListener, UpdatedState
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event) {
|
||||
Log.d(TAG, "activate camera");
|
||||
if (mIsEnabled) mLineageActionsSettings.cameraAction();
|
||||
if (mIsEnabled) mMotoActionsSettings.cameraAction();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,15 +25,15 @@ import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier {
|
||||
private static final String TAG = "LineageActions-ChopChopSensor";
|
||||
private static final String TAG = "MotoActions-ChopChopSensor";
|
||||
|
||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
private final Sensor mSensor;
|
||||
private final Sensor mProx;
|
||||
@@ -41,8 +41,8 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
|
||||
private boolean mIsEnabled;
|
||||
private boolean mProxIsCovered;
|
||||
|
||||
public ChopChopSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper) {
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
public ChopChopSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mSensorHelper = sensorHelper;
|
||||
mSensor = sensorHelper.getChopChopSensor();
|
||||
mProx = sensorHelper.getProximitySensor();
|
||||
@@ -50,12 +50,12 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
|
||||
|
||||
@Override
|
||||
public synchronized void updateState() {
|
||||
if (mLineageActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) {
|
||||
if (mMotoActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) {
|
||||
Log.d(TAG, "Enabling");
|
||||
mSensorHelper.registerListener(mSensor, this);
|
||||
mSensorHelper.registerListener(mProx, mProxListener);
|
||||
mIsEnabled = true;
|
||||
} else if (! mLineageActionsSettings.isChopChopGestureEnabled() && mIsEnabled) {
|
||||
} else if (! mMotoActionsSettings.isChopChopGestureEnabled() && mIsEnabled) {
|
||||
Log.d(TAG, "Disabling");
|
||||
mSensorHelper.unregisterListener(this);
|
||||
mSensorHelper.unregisterListener(mProxListener);
|
||||
@@ -70,7 +70,7 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
|
||||
Log.d(TAG, "proximity sensor covered, ignoring chop-chop");
|
||||
return;
|
||||
}
|
||||
mLineageActionsSettings.chopChopAction();
|
||||
mMotoActionsSettings.chopChopAction();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,13 +25,13 @@ import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.util.FileUtils;
|
||||
import com.moto.actions.util.FileUtils;
|
||||
|
||||
public class Constants {
|
||||
|
||||
public static final boolean DEBUG = false;
|
||||
|
||||
private static final String TAG = "LineageActions";
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
// FP gestures
|
||||
public static final int FP_TAP_SCANCODE = 616;
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -27,14 +27,14 @@ import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
public class FlipToMute implements UpdatedStateNotifier {
|
||||
private static final String TAG = "LineageActions-FlipToMute";
|
||||
private static final String TAG = "MotoActions-FlipToMute";
|
||||
|
||||
private final NotificationManager mNotificationManager;
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
private final Sensor mFlatDown;
|
||||
private final Sensor mStow;
|
||||
@@ -46,9 +46,9 @@ public class FlipToMute implements UpdatedStateNotifier {
|
||||
private Context mContext;
|
||||
private Receiver mReceiver;
|
||||
|
||||
public FlipToMute(LineageActionsSettings lineageActionsSettings, Context context,
|
||||
public FlipToMute(MotoActionsSettings motoActionsSettings, Context context,
|
||||
SensorHelper sensorHelper) {
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mContext = context;
|
||||
mSensorHelper = sensorHelper;
|
||||
mFlatDown = sensorHelper.getFlatDownSensor();
|
||||
@@ -61,14 +61,14 @@ public class FlipToMute implements UpdatedStateNotifier {
|
||||
|
||||
@Override
|
||||
public void updateState() {
|
||||
if (mLineageActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) {
|
||||
if (mMotoActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) {
|
||||
Log.d(TAG, "Enabling");
|
||||
mSensorHelper.registerListener(mFlatDown, mFlatDownListener);
|
||||
mSensorHelper.registerListener(mStow, mStowListener);
|
||||
mContext.registerReceiver(mReceiver,
|
||||
new IntentFilter(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED));
|
||||
mIsEnabled = true;
|
||||
} else if (!mLineageActionsSettings.isFlipToMuteEnabled() && mIsEnabled) {
|
||||
} else if (!mMotoActionsSettings.isFlipToMuteEnabled() && mIsEnabled) {
|
||||
Log.d(TAG, "Disabling");
|
||||
mSensorHelper.unregisterListener(mFlatDownListener);
|
||||
mSensorHelper.unregisterListener(mStowListener);
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
@@ -26,13 +26,13 @@ import android.telecom.TelecomManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
public class LiftToSilence extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
||||
private static final String TAG = "LineageActions-LiftToSilence";
|
||||
private static final String TAG = "MotoActions-LiftToSilence";
|
||||
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
private final Sensor mFlatUpSensor;
|
||||
private final Sensor mStowSensor;
|
||||
@@ -44,9 +44,9 @@ public class LiftToSilence extends PhoneStateListener implements SensorEventList
|
||||
private boolean mIsStowed;
|
||||
private boolean mLastFlatUp;
|
||||
|
||||
public LiftToSilence(LineageActionsSettings lineageActionsSettings, Context context,
|
||||
public LiftToSilence(MotoActionsSettings motoActionsSettings, Context context,
|
||||
SensorHelper sensorHelper) {
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mSensorHelper = sensorHelper;
|
||||
mFlatUpSensor = sensorHelper.getFlatUpSensor();
|
||||
mStowSensor = sensorHelper.getStowSensor();
|
||||
@@ -56,7 +56,7 @@ public class LiftToSilence extends PhoneStateListener implements SensorEventList
|
||||
|
||||
@Override
|
||||
public void updateState() {
|
||||
if (mLineageActionsSettings.isLiftToSilenceEnabled()) {
|
||||
if (mMotoActionsSettings.isLiftToSilenceEnabled()) {
|
||||
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
||||
} else {
|
||||
mTelephonyManager.listen(this, 0);
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
@@ -26,31 +26,31 @@ import android.telecom.TelecomManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
import static android.telephony.TelephonyManager.*;
|
||||
|
||||
public class ProximitySilencer extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
||||
private static final String TAG = "LineageActions-ProximitySilencer";
|
||||
private static final String TAG = "MotoActions-ProximitySilencer";
|
||||
|
||||
private static final int SILENCE_DELAY_MS = 500;
|
||||
|
||||
private final TelecomManager mTelecomManager;
|
||||
private final TelephonyManager mTelephonyManager;
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
private final Sensor mSensor;
|
||||
private boolean mIsRinging;
|
||||
private long mRingStartedMs;
|
||||
private boolean mCoveredRinging;
|
||||
|
||||
public ProximitySilencer(LineageActionsSettings lineageActionsSettings, Context context,
|
||||
public ProximitySilencer(MotoActionsSettings motoActionsSettings, Context context,
|
||||
SensorHelper sensorHelper) {
|
||||
mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
|
||||
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mSensorHelper = sensorHelper;
|
||||
mSensor = sensorHelper.getProximitySensor();
|
||||
mCoveredRinging = false;
|
||||
@@ -59,7 +59,7 @@ public class ProximitySilencer extends PhoneStateListener implements SensorEvent
|
||||
|
||||
@Override
|
||||
public void updateState() {
|
||||
if (mLineageActionsSettings.isIrSilencerEnabled()) {
|
||||
if (mMotoActionsSettings.isIrSilencerEnabled()) {
|
||||
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
||||
} else {
|
||||
mTelephonyManager.listen(this, 0);
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
@@ -24,10 +24,10 @@ import android.hardware.camera2.CameraAccessException;
|
||||
import android.os.Vibrator;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.SensorAction;
|
||||
import com.moto.actions.SensorAction;
|
||||
|
||||
public class TorchAction implements SensorAction {
|
||||
private static final String TAG = "LineageActions";
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.actions;
|
||||
package com.moto.actions.actions;
|
||||
|
||||
public interface UpdatedStateNotifier {
|
||||
public void updateState();
|
||||
@@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.doze;
|
||||
package com.moto.actions.doze;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.SensorAction;
|
||||
import com.moto.actions.SensorAction;
|
||||
|
||||
public class DozePulseAction implements SensorAction, ScreenStateNotifier {
|
||||
private static final String TAG = "LineageActions";
|
||||
private static final String TAG = "MotoActions";
|
||||
|
||||
private static final int DELAY_BETWEEN_DOZES_IN_MS = 1500;
|
||||
|
||||
@@ -15,21 +15,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.doze;
|
||||
package com.moto.actions.doze;
|
||||
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.util.Log;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorAction;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorAction;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
public class ProximitySensor implements ScreenStateNotifier, SensorEventListener {
|
||||
private static final String TAG = "LineageActions-ProximitySensor";
|
||||
private static final String TAG = "MotoActions-ProximitySensor";
|
||||
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
private final SensorAction mSensorAction;
|
||||
private final Sensor mSensor;
|
||||
@@ -38,9 +38,9 @@ public class ProximitySensor implements ScreenStateNotifier, SensorEventListener
|
||||
|
||||
private boolean mSawNear = false;
|
||||
|
||||
public ProximitySensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper,
|
||||
public ProximitySensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
|
||||
SensorAction action) {
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mSensorHelper = sensorHelper;
|
||||
mSensorAction = action;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ProximitySensor implements ScreenStateNotifier, SensorEventListener
|
||||
|
||||
@Override
|
||||
public void screenTurnedOff() {
|
||||
if (mLineageActionsSettings.isIrWakeupEnabled() && !mEnabled) {
|
||||
if (mMotoActionsSettings.isIrWakeupEnabled() && !mEnabled) {
|
||||
Log.d(TAG, "Enabling");
|
||||
mSensorHelper.registerListener(mSensor, this);
|
||||
mEnabled = true;
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.doze;
|
||||
package com.moto.actions.doze;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
|
||||
import org.lineageos.settings.device.actions.Constants;
|
||||
import com.moto.actions.actions.Constants;
|
||||
|
||||
public class ScreenReceiver extends BroadcastReceiver {
|
||||
private final ScreenStateNotifier mNotifier;
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.doze;
|
||||
package com.moto.actions.doze;
|
||||
|
||||
public interface ScreenStateNotifier {
|
||||
public void screenTurnedOn();
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.doze;
|
||||
package com.moto.actions.doze;
|
||||
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
@@ -24,15 +24,15 @@ import android.util.Log;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
import org.lineageos.settings.device.LineageActionsSettings;
|
||||
import org.lineageos.settings.device.SensorAction;
|
||||
import org.lineageos.settings.device.SensorHelper;
|
||||
import com.moto.actions.MotoActionsSettings;
|
||||
import com.moto.actions.SensorAction;
|
||||
import com.moto.actions.SensorHelper;
|
||||
|
||||
public class StowSensor implements ScreenStateNotifier, SensorEventListener {
|
||||
private static final String TAG = "LineageActions-StowSensor";
|
||||
private static final String TAG = "MotoActions-StowSensor";
|
||||
private static final int IN_POCKET_MIN_TIME = 5000;
|
||||
|
||||
private final LineageActionsSettings mLineageActionsSettings;
|
||||
private final MotoActionsSettings mMotoActionsSettings;
|
||||
private final SensorHelper mSensorHelper;
|
||||
private final SensorAction mSensorAction;
|
||||
private final Sensor mSensor;
|
||||
@@ -41,9 +41,9 @@ public class StowSensor implements ScreenStateNotifier, SensorEventListener {
|
||||
private boolean mLastStowed;
|
||||
private long isStowedTime;
|
||||
|
||||
public StowSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper,
|
||||
public StowSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
|
||||
SensorAction action) {
|
||||
mLineageActionsSettings = lineageActionsSettings;
|
||||
mMotoActionsSettings = motoActionsSettings;
|
||||
mSensorHelper = sensorHelper;
|
||||
mSensorAction = action;
|
||||
|
||||
@@ -61,8 +61,8 @@ public class StowSensor implements ScreenStateNotifier, SensorEventListener {
|
||||
|
||||
@Override
|
||||
public void screenTurnedOff() {
|
||||
if (!mLineageActionsSettings.isIrWakeupEnabled() &&
|
||||
mLineageActionsSettings.isPickUpEnabled() && !mEnabled) {
|
||||
if (!mMotoActionsSettings.isIrWakeupEnabled() &&
|
||||
mMotoActionsSettings.isPickUpEnabled() && !mEnabled) {
|
||||
Log.d(TAG, "Enabling");
|
||||
mSensorHelper.registerListener(mSensor, this);
|
||||
mEnabled = true;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.device.util;
|
||||
package com.moto.actions.util;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -133,9 +133,9 @@ PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/gps/etc/xtwifi.conf:system/vendor/etc/xtwifi.conf \
|
||||
$(LOCAL_PATH)/gps/etc/cacert_location.pem:system/vendor/etc/cacert_location.pem
|
||||
|
||||
# LineageActions
|
||||
# MotoActions
|
||||
PRODUCT_PACKAGES += \
|
||||
LineageActions
|
||||
MotoActions
|
||||
|
||||
# Display
|
||||
PRODUCT_PACKAGES += \
|
||||
|
||||
@@ -309,10 +309,10 @@
|
||||
<bool name="config_supportDoubleTapWake">false</bool>
|
||||
|
||||
<!-- Paths to the libraries that contain device specific key handlers -->
|
||||
<string name="config_deviceKeyHandlerLib" translatable="false">/system/priv-app/LineageActions/LineageActions.apk</string>
|
||||
<string name="config_deviceKeyHandlerLib" translatable="false">/system/priv-app/MotoActions/MotoActions.apk</string>
|
||||
|
||||
<!-- Names of the key handler classes -->
|
||||
<string name="config_deviceKeyHandlerClass" translatable="false">org.lineageos.settings.device.KeyHandler</string>
|
||||
<string name="config_deviceKeyHandlerClass" translatable="false">com.moto.actions.KeyHandler</string>
|
||||
|
||||
<!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
|
||||
<bool name="config_intrusiveNotificationLed">true</bool>
|
||||
|
||||
Reference in New Issue
Block a user