sanders: LineageActions -> MotoActions

This commit is contained in:
jhenrique09
2018-01-04 17:22:14 -02:00
committed by therootlord
parent a4b148e469
commit 5ed4bb49f9
57 changed files with 186 additions and 186 deletions

View File

@@ -5,7 +5,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := LineageActions LOCAL_PACKAGE_NAME := MotoActions
LOCAL_CERTIFICATE := platform LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true LOCAL_PRIVILEGED_MODULE := true

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.settings.device" package="com.moto.actions"
android:sharedUserId="android.uid.system" android:sharedUserId="android.uid.system"
> >
@@ -25,8 +25,8 @@
android:persistent="true"> android:persistent="true">
<provider <provider
android:name=".LineageActionsSearchIndexablesProvider" android:name=".MotoActionsSearchIndexablesProvider"
android:authorities="org.lineageos.settings.device" android:authorities="com.moto.actions"
android:multiprocess="false" android:multiprocess="false"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:permission="android.permission.READ_SEARCH_INDEXABLES" android:permission="android.permission.READ_SEARCH_INDEXABLES"
@@ -36,7 +36,7 @@
</intent-filter> </intent-filter>
</provider> </provider>
<receiver android:name="org.lineageos.settings.device.BootCompletedReceiver"> <receiver android:name="com.moto.actions.BootCompletedReceiver">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@@ -52,9 +52,9 @@
<activity <activity
android:name=".DozeSettingsActivity" android:name=".DozeSettingsActivity"
android:label="@string/ambient_display_title" android:label="@string/ambient_display_title"
android:theme="@style/LineageActions"> android:theme="@style/MotoActions">
<intent-filter> <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" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
@@ -63,7 +63,7 @@
android:name=".ActionsPreferenceActivity" android:name=".ActionsPreferenceActivity"
android:label="@string/moto_actions_title" android:label="@string/moto_actions_title"
android:summary="@string/device_gestures_summary" android:summary="@string/device_gestures_summary"
android:theme="@style/LineageActions"> android:theme="@style/MotoActions">
<intent-filter> <intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" /> <action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter> </intent-filter>
@@ -81,13 +81,13 @@
<activity <activity
android:name=".GestureSettingsActivity" android:name=".GestureSettingsActivity"
android:label="@string/device_gestures_title" android:label="@string/device_gestures_title"
android:theme="@style/LineageActions"> android:theme="@style/MotoActions">
</activity> </activity>
<activity <activity
android:name=".FPGestureSettingsActivity" android:name=".FPGestureSettingsActivity"
android:label="@string/fingerprint_gestures_title" android:label="@string/fingerprint_gestures_title"
android:theme="@style/LineageActions"> android:theme="@style/MotoActions">
</activity> </activity>
</application> </application>

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -43,6 +43,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@null" android:background="@null"
android:theme="@style/LineageActions.SwitchBar" /> android:theme="@style/MotoActions.SwitchBar" />
</LinearLayout> </LinearLayout>

View File

@@ -17,42 +17,42 @@
--> -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<style name="LineageActions" parent="@android:style/Theme.DeviceDefault.Settings"> <style name="MotoActions" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="dialogPreferenceStyle">@style/LineageActions.DialogPreferenceStyle</item> <item name="dialogPreferenceStyle">@style/MotoActions.DialogPreferenceStyle</item>
<item name="preferenceCategoryStyle">@style/LineageActions.PreferenceCategoryStyle</item> <item name="preferenceCategoryStyle">@style/MotoActions.PreferenceCategoryStyle</item>
<item name="preferenceFragmentStyle">@style/LineageActions.PreferenceFragmentStyle</item> <item name="preferenceFragmentStyle">@style/MotoActions.PreferenceFragmentStyle</item>
<item name="preferenceStyle">@style/LineageActions.PreferenceStyle</item> <item name="preferenceStyle">@style/MotoActions.PreferenceStyle</item>
<item name="preferenceTheme">@style/LineageActions.PreferenceTheme</item> <item name="preferenceTheme">@style/MotoActions.PreferenceTheme</item>
<item name="switchPreferenceStyle">@style/LineageActions.SwitchPreferenceStyle</item> <item name="switchPreferenceStyle">@style/MotoActions.SwitchPreferenceStyle</item>
</style> </style>
<style name="LineageActions.DialogPreferenceStyle" parent="@style/LineageActions.PreferenceStyle"> <style name="MotoActions.DialogPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
</style> </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="allowDividerAbove">true</item>
<item name="allowDividerBelow">true</item> <item name="allowDividerBelow">true</item>
<item name="android:layout">@layout/preference_category_material_settings</item> <item name="android:layout">@layout/preference_category_material_settings</item>
</style> </style>
<style name="LineageActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material"> <style name="MotoActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
<item name="allowDividerAfterLastItem">false</item> <item name="allowDividerAfterLastItem">false</item>
</style> </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="allowDividerAbove">false</item>
<item name="allowDividerBelow">true</item> <item name="allowDividerBelow">true</item>
<item name="singleLineTitle">false</item> <item name="singleLineTitle">false</item>
<item name="android:layout">@layout/preference_material_settings</item> <item name="android:layout">@layout/preference_material_settings</item>
</style> </style>
<style name="LineageActions.PreferenceTheme"> <style name="MotoActions.PreferenceTheme">
</style> </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> <item name="widgetLayout">@*android:layout/preference_widget_switch</item>
</style> </style>
<style name="LineageActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar"> <style name="MotoActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
</style> </style>
</resources> </resources>

View File

@@ -24,8 +24,8 @@
android:summary="@string/device_gestures_summary" android:summary="@string/device_gestures_summary"
android:icon="@drawable/ic_settings_gestures"> android:icon="@drawable/ic_settings_gestures">
<intent <intent
android:targetPackage="org.lineageos.settings.device" android:targetPackage="com.moto.actions"
android:targetClass="org.lineageos.settings.device.GestureSettingsActivity" /> android:targetClass="com.moto.actions.GestureSettingsActivity" />
</Preference> </Preference>
<Preference <Preference
@@ -34,8 +34,8 @@
android:summary="@string/ambient_display_manage_summary" android:summary="@string/ambient_display_manage_summary"
android:icon="@drawable/ic_settings_doze"> android:icon="@drawable/ic_settings_doze">
<intent <intent
android:targetPackage="org.lineageos.settings.device" android:targetPackage="com.moto.actions"
android:targetClass="org.lineageos.settings.device.DozeSettingsActivity" /> android:targetClass="com.moto.actions.DozeSettingsActivity" />
</Preference> </Preference>
<Preference <Preference
@@ -44,8 +44,8 @@
android:summary="@string/fingerprint_gestures_manage_summary" android:summary="@string/fingerprint_gestures_manage_summary"
android:icon="@drawable/ic_settings_fingerprint"> android:icon="@drawable/ic_settings_fingerprint">
<intent <intent
android:targetPackage="org.lineageos.settings.device" android:targetPackage="com.moto.actions"
android:targetClass="org.lineageos.settings.device.FPGestureSettingsActivity" /> android:targetClass="com.moto.actions.FPGestureSettingsActivity" />
</Preference> </Preference>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.os.Bundle; import android.os.Bundle;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.os.Bundle; import android.os.Bundle;
import android.support.v14.preference.PreferenceFragment; import android.support.v14.preference.PreferenceFragment;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.ComponentName; import android.content.ComponentName;
@@ -27,12 +27,12 @@ import android.content.ServiceConnection;
import android.os.IBinder; import android.os.IBinder;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.util.FileUtils; import com.moto.actions.util.FileUtils;
import org.lineageos.settings.device.actions.Constants; import com.moto.actions.actions.Constants;
import org.lineageos.settings.device.ServiceWrapper.LocalBinder; import com.moto.actions.ServiceWrapper.LocalBinder;
public class BootCompletedReceiver extends BroadcastReceiver { public class BootCompletedReceiver extends BroadcastReceiver {
static final String TAG = "LineageActions"; static final String TAG = "MotoActions";
final String NAVBAR_SHOWN = "navbar_shown"; final String NAVBAR_SHOWN = "navbar_shown";
private ServiceWrapper mServiceWrapper; private ServiceWrapper mServiceWrapper;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.os.Bundle; import android.os.Bundle;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.app.ActionBar; import android.app.ActionBar;
import android.os.Bundle; import android.os.Bundle;
@@ -63,7 +63,7 @@ public class DozeSettingsFragment extends PreferenceFragment {
View switchBar = view.findViewById(R.id.switch_bar); View switchBar = view.findViewById(R.id.switch_bar);
mAmbientDisplaySwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget); mAmbientDisplaySwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget);
mAmbientDisplaySwitch.setChecked(LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver())); mAmbientDisplaySwitch.setChecked(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()));
mAmbientDisplaySwitch.setOnCheckedChangeListener(mAmbientDisplayPrefListener); mAmbientDisplaySwitch.setOnCheckedChangeListener(mAmbientDisplayPrefListener);
switchBar.setOnClickListener(new View.OnClickListener() { switchBar.setOnClickListener(new View.OnClickListener() {
@@ -74,14 +74,14 @@ public class DozeSettingsFragment extends PreferenceFragment {
}); });
mSwitchBarText = switchBar.findViewById(R.id.switch_text); 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); R.string.switch_bar_off);
} }
@Override @Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.doze_panel); addPreferencesFromResource(R.xml.doze_panel);
boolean dozeEnabled = LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver()); boolean dozeEnabled = MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver());
mHandwavePreference = (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE); mHandwavePreference = (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE);
mPickupPreference = (SwitchPreference) findPreference(KEY_GESTURE_PICK_UP); mPickupPreference = (SwitchPreference) findPreference(KEY_GESTURE_PICK_UP);
updatePrefs(dozeEnabled); updatePrefs(dozeEnabled);

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.os.Bundle; import android.os.Bundle;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.app.ActionBar; import android.app.ActionBar;
import android.os.Bundle; import android.os.Bundle;
@@ -33,10 +33,10 @@ import android.widget.CompoundButton;
import android.widget.Switch; import android.widget.Switch;
import android.widget.TextView; 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 com.moto.actions.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_OFF;
public class FPGestureSettingsFragment extends PreferenceFragment { public class FPGestureSettingsFragment extends PreferenceFragment {

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.os.Bundle; import android.os.Bundle;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.os.Bundle; import android.os.Bundle;
import android.support.v14.preference.PreferenceFragment; import android.support.v14.preference.PreferenceFragment;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.app.ActivityManagerNative; import android.app.ActivityManagerNative;
@@ -64,11 +64,11 @@ import android.widget.Toast;
import com.android.internal.os.DeviceKeyHandler; import com.android.internal.os.DeviceKeyHandler;
import com.android.internal.util.ArrayUtils; import com.android.internal.util.ArrayUtils;
import org.lineageos.settings.device.util.FileUtils; import com.moto.actions.util.FileUtils;
import java.util.List; import java.util.List;
import static org.lineageos.settings.device.actions.Constants.*; import static com.moto.actions.actions.Constants.*;
public class KeyHandler implements DeviceKeyHandler { public class KeyHandler implements DeviceKeyHandler {
@@ -607,8 +607,8 @@ public class KeyHandler implements DeviceKeyHandler {
if (ai != null && !ai.supportsPictureInPicture()) { if (ai != null && !ai.supportsPictureInPicture()) {
try { try {
PackageManager pm = mContext.getPackageManager(); PackageManager pm = mContext.getPackageManager();
Resources resources = pm.getResourcesForApplication("org.lineageos.settings.device"); Resources resources = pm.getResourcesForApplication("com.moto.actions");
int resId = resources.getIdentifier("app_does_not_support_pip", "string", "org.lineageos.settings.device"); int resId = resources.getIdentifier("app_does_not_support_pip", "string", "com.moto.actions");
final String text = resources.getString(resId); final String text = resources.getString(resId);
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
public void run() { public void run() {

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.database.Cursor; import android.database.Cursor;
import android.database.MatrixCursor; 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.INDEXABLES_XML_RES_COLUMNS;
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS; import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
public class LineageActionsSearchIndexablesProvider extends SearchIndexablesProvider { public class MotoActionsSearchIndexablesProvider extends SearchIndexablesProvider {
private static final String TAG = "LineageActionsSearchIndexablesProvider"; private static final String TAG = "MotoActionsSearchIndexablesProvider";
@Override @Override
public boolean onCreate() { 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_CLASS_NAME] = null;
ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId; 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_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; ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className;
return ref; return ref;
} }

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.app.IntentService; import android.app.IntentService;
import android.content.Context; import android.content.Context;
@@ -27,23 +27,23 @@ import android.util.Log;
import java.util.List; import java.util.List;
import java.util.LinkedList; import java.util.LinkedList;
import org.lineageos.settings.device.actions.UpdatedStateNotifier; import com.moto.actions.actions.UpdatedStateNotifier;
import org.lineageos.settings.device.actions.CameraActivationSensor; import com.moto.actions.actions.CameraActivationSensor;
import org.lineageos.settings.device.actions.ChopChopSensor; import com.moto.actions.actions.ChopChopSensor;
import org.lineageos.settings.device.actions.FlipToMute; import com.moto.actions.actions.FlipToMute;
import org.lineageos.settings.device.actions.LiftToSilence; import com.moto.actions.actions.LiftToSilence;
import org.lineageos.settings.device.actions.ProximitySilencer; import com.moto.actions.actions.ProximitySilencer;
import org.lineageos.settings.device.doze.DozePulseAction; import com.moto.actions.doze.DozePulseAction;
//import org.lineageos.settings.device.doze.GlanceSensor; //import com.moto.actions.doze.GlanceSensor;
import org.lineageos.settings.device.doze.ProximitySensor; import com.moto.actions.doze.ProximitySensor;
import org.lineageos.settings.device.doze.ScreenReceiver; import com.moto.actions.doze.ScreenReceiver;
import org.lineageos.settings.device.doze.ScreenStateNotifier; import com.moto.actions.doze.ScreenStateNotifier;
import org.lineageos.settings.device.doze.StowSensor; import com.moto.actions.doze.StowSensor;
public class LineageActionsService extends IntentService implements ScreenStateNotifier, public class MotoActionsService extends IntentService implements ScreenStateNotifier,
UpdatedStateNotifier { UpdatedStateNotifier {
private static final String TAG = "LineageActions"; private static final String TAG = "MotoActions";
private final Context mContext; private final Context mContext;
@@ -57,13 +57,13 @@ public class LineageActionsService extends IntentService implements ScreenStateN
private final List<UpdatedStateNotifier> mUpdatedStateNotifiers = private final List<UpdatedStateNotifier> mUpdatedStateNotifiers =
new LinkedList<UpdatedStateNotifier>(); new LinkedList<UpdatedStateNotifier>();
public LineageActionsService(Context context) { public MotoActionsService(Context context) {
super("LineageActionService"); super("MotoActionService");
mContext = context; mContext = context;
Log.d(TAG, "Starting"); Log.d(TAG, "Starting");
LineageActionsSettings lineageActionsSettings = new LineageActionsSettings(context, this); MotoActionsSettings motoActionsSettings = new MotoActionsSettings(context, this);
mSensorHelper = new SensorHelper(context); mSensorHelper = new SensorHelper(context);
mScreenReceiver = new ScreenReceiver(context, this); mScreenReceiver = new ScreenReceiver(context, this);
@@ -71,19 +71,19 @@ public class LineageActionsService extends IntentService implements ScreenStateN
mScreenStateNotifiers.add(mDozePulseAction); mScreenStateNotifiers.add(mDozePulseAction);
// Actionable sensors get screen on/off notifications // Actionable sensors get screen on/off notifications
//mScreenStateNotifiers.add(new GlanceSensor(lineageActionsSettings, mSensorHelper, mDozePulseAction)); //mScreenStateNotifiers.add(new GlanceSensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
mScreenStateNotifiers.add(new ProximitySensor(lineageActionsSettings, mSensorHelper, mDozePulseAction)); mScreenStateNotifiers.add(new ProximitySensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
mScreenStateNotifiers.add(new StowSensor(lineageActionsSettings, mSensorHelper, mDozePulseAction)); mScreenStateNotifiers.add(new StowSensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
// Other actions that are always enabled // Other actions that are always enabled
mUpdatedStateNotifiers.add(new CameraActivationSensor(lineageActionsSettings, mSensorHelper)); mUpdatedStateNotifiers.add(new CameraActivationSensor(motoActionsSettings, mSensorHelper));
mUpdatedStateNotifiers.add(new ChopChopSensor(lineageActionsSettings, mSensorHelper)); mUpdatedStateNotifiers.add(new ChopChopSensor(motoActionsSettings, mSensorHelper));
mUpdatedStateNotifiers.add(new ProximitySilencer(lineageActionsSettings, context, mSensorHelper)); mUpdatedStateNotifiers.add(new ProximitySilencer(motoActionsSettings, context, mSensorHelper));
mUpdatedStateNotifiers.add(new FlipToMute(lineageActionsSettings, context, mSensorHelper)); mUpdatedStateNotifiers.add(new FlipToMute(motoActionsSettings, context, mSensorHelper));
mUpdatedStateNotifiers.add(new LiftToSilence(lineageActionsSettings, context, mSensorHelper)); mUpdatedStateNotifiers.add(new LiftToSilence(motoActionsSettings, context, mSensorHelper));
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "LineageActionsWakeLock"); mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MotoActionsWakeLock");
updateState(); updateState();
} }

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
@@ -25,13 +25,13 @@ import android.provider.Settings;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.actions.Constants; import com.moto.actions.actions.Constants;
import org.lineageos.settings.device.actions.UpdatedStateNotifier; import com.moto.actions.actions.UpdatedStateNotifier;
import org.lineageos.settings.device.actions.CameraActivationAction; import com.moto.actions.actions.CameraActivationAction;
import org.lineageos.settings.device.actions.TorchAction; import com.moto.actions.actions.TorchAction;
public class LineageActionsSettings { public class MotoActionsSettings {
private static final String TAG = "LineageActions"; private static final String TAG = "MotoActions";
private static final String GESTURE_CAMERA_ACTION_KEY = "gesture_camera_action"; private static final String GESTURE_CAMERA_ACTION_KEY = "gesture_camera_action";
private static final String GESTURE_CHOP_CHOP_KEY = "gesture_chop_chop"; private static final String GESTURE_CHOP_CHOP_KEY = "gesture_chop_chop";
@@ -52,7 +52,7 @@ public class LineageActionsSettings {
private boolean mFlipToMuteEnabled; private boolean mFlipToMuteEnabled;
private boolean mLiftToSilenceEnabled; private boolean mLiftToSilenceEnabled;
public LineageActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) { public MotoActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) {
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
loadPreferences(sharedPrefs); loadPreferences(sharedPrefs);
sharedPrefs.registerOnSharedPreferenceChangeListener(mPrefListener); sharedPrefs.registerOnSharedPreferenceChangeListener(mPrefListener);

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
public interface SensorAction { public interface SensorAction {
public void action(); public void action();

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import java.util.List; import java.util.List;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@@ -30,7 +30,7 @@ import android.hardware.TriggerEventListener;
import android.util.Log; import android.util.Log;
public class SensorHelper { 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_CAMERA_ACTIVATION = 65540;
private static final int SENSOR_TYPE_MMI_CHOP_CHOP = 65546; private static final int SENSOR_TYPE_MMI_CHOP_CHOP = 65546;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device; package com.moto.actions;
import android.content.Intent; import android.content.Intent;
import android.os.Binder; import android.os.Binder;
@@ -24,10 +24,10 @@ import android.os.IBinder;
import android.util.Log; import android.util.Log;
public class ServiceWrapper extends android.app.Service { 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 final IBinder mBinder = new LocalBinder();
private LineageActionsService mLineageActionsService; private MotoActionsService mMotoActionsService;
public interface ServiceCallback { public interface ServiceCallback {
void sendResults(int resultCode, Bundle b); void sendResults(int resultCode, Bundle b);
@@ -45,7 +45,7 @@ public class ServiceWrapper extends android.app.Service {
public void onCreate() { public void onCreate() {
Log.i(TAG, "onCreate"); Log.i(TAG, "onCreate");
super.onCreate(); super.onCreate();
mLineageActionsService = new LineageActionsService(this); mMotoActionsService = new MotoActionsService(this);
} }
@Override @Override

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import java.util.List; import java.util.List;
@@ -32,10 +32,10 @@ import android.os.Vibrator;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.SensorAction; import com.moto.actions.SensorAction;
public class CameraActivationAction implements 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; private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import java.util.List; import java.util.List;
@@ -25,23 +25,23 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager; import android.hardware.SensorManager;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
public class CameraActivationSensor implements SensorEventListener, UpdatedStateNotifier { 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 static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
private final LineageActionsSettings mLineageActionsSettings; private final MotoActionsSettings mMotoActionsSettings;
private final SensorHelper mSensorHelper; private final SensorHelper mSensorHelper;
private final Sensor mSensor; private final Sensor mSensor;
private boolean mIsEnabled; private boolean mIsEnabled;
public CameraActivationSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper) { public CameraActivationSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mSensor = sensorHelper.getCameraActivationSensor(); mSensor = sensorHelper.getCameraActivationSensor();
mSensorHelper.registerListener(mSensor, this); mSensorHelper.registerListener(mSensor, this);
@@ -49,10 +49,10 @@ public class CameraActivationSensor implements SensorEventListener, UpdatedState
@Override @Override
public synchronized void updateState() { public synchronized void updateState() {
if (mLineageActionsSettings.isCameraGestureEnabled() && !mIsEnabled) { if (mMotoActionsSettings.isCameraGestureEnabled() && !mIsEnabled) {
Log.d(TAG, "Enabling"); Log.d(TAG, "Enabling");
mIsEnabled = true; mIsEnabled = true;
} else if (! mLineageActionsSettings.isCameraGestureEnabled() && mIsEnabled) { } else if (! mMotoActionsSettings.isCameraGestureEnabled() && mIsEnabled) {
Log.d(TAG, "Disabling"); Log.d(TAG, "Disabling");
mIsEnabled = false; mIsEnabled = false;
} }
@@ -61,7 +61,7 @@ public class CameraActivationSensor implements SensorEventListener, UpdatedState
@Override @Override
public void onSensorChanged(SensorEvent event) { public void onSensorChanged(SensorEvent event) {
Log.d(TAG, "activate camera"); Log.d(TAG, "activate camera");
if (mIsEnabled) mLineageActionsSettings.cameraAction(); if (mIsEnabled) mMotoActionsSettings.cameraAction();
} }
@Override @Override

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import java.util.List; import java.util.List;
@@ -25,15 +25,15 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager; import android.hardware.SensorManager;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier { 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 static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
private final LineageActionsSettings mLineageActionsSettings; private final MotoActionsSettings mMotoActionsSettings;
private final SensorHelper mSensorHelper; private final SensorHelper mSensorHelper;
private final Sensor mSensor; private final Sensor mSensor;
private final Sensor mProx; private final Sensor mProx;
@@ -41,8 +41,8 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
private boolean mIsEnabled; private boolean mIsEnabled;
private boolean mProxIsCovered; private boolean mProxIsCovered;
public ChopChopSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper) { public ChopChopSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mSensor = sensorHelper.getChopChopSensor(); mSensor = sensorHelper.getChopChopSensor();
mProx = sensorHelper.getProximitySensor(); mProx = sensorHelper.getProximitySensor();
@@ -50,12 +50,12 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
@Override @Override
public synchronized void updateState() { public synchronized void updateState() {
if (mLineageActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) { if (mMotoActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) {
Log.d(TAG, "Enabling"); Log.d(TAG, "Enabling");
mSensorHelper.registerListener(mSensor, this); mSensorHelper.registerListener(mSensor, this);
mSensorHelper.registerListener(mProx, mProxListener); mSensorHelper.registerListener(mProx, mProxListener);
mIsEnabled = true; mIsEnabled = true;
} else if (! mLineageActionsSettings.isChopChopGestureEnabled() && mIsEnabled) { } else if (! mMotoActionsSettings.isChopChopGestureEnabled() && mIsEnabled) {
Log.d(TAG, "Disabling"); Log.d(TAG, "Disabling");
mSensorHelper.unregisterListener(this); mSensorHelper.unregisterListener(this);
mSensorHelper.unregisterListener(mProxListener); mSensorHelper.unregisterListener(mProxListener);
@@ -70,7 +70,7 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
Log.d(TAG, "proximity sensor covered, ignoring chop-chop"); Log.d(TAG, "proximity sensor covered, ignoring chop-chop");
return; return;
} }
mLineageActionsSettings.chopChopAction(); mMotoActionsSettings.chopChopAction();
} }
@Override @Override

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@@ -25,13 +25,13 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.util.FileUtils; import com.moto.actions.util.FileUtils;
public class Constants { public class Constants {
public static final boolean DEBUG = false; public static final boolean DEBUG = false;
private static final String TAG = "LineageActions"; private static final String TAG = "MotoActions";
// FP gestures // FP gestures
public static final int FP_TAP_SCANCODE = 616; public static final int FP_TAP_SCANCODE = 616;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
@@ -27,14 +27,14 @@ import android.hardware.SensorEvent;
import android.hardware.SensorEventListener; import android.hardware.SensorEventListener;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
public class FlipToMute implements UpdatedStateNotifier { 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 NotificationManager mNotificationManager;
private final LineageActionsSettings mLineageActionsSettings; private final MotoActionsSettings mMotoActionsSettings;
private final SensorHelper mSensorHelper; private final SensorHelper mSensorHelper;
private final Sensor mFlatDown; private final Sensor mFlatDown;
private final Sensor mStow; private final Sensor mStow;
@@ -46,9 +46,9 @@ public class FlipToMute implements UpdatedStateNotifier {
private Context mContext; private Context mContext;
private Receiver mReceiver; private Receiver mReceiver;
public FlipToMute(LineageActionsSettings lineageActionsSettings, Context context, public FlipToMute(MotoActionsSettings motoActionsSettings, Context context,
SensorHelper sensorHelper) { SensorHelper sensorHelper) {
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mContext = context; mContext = context;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mFlatDown = sensorHelper.getFlatDownSensor(); mFlatDown = sensorHelper.getFlatDownSensor();
@@ -61,14 +61,14 @@ public class FlipToMute implements UpdatedStateNotifier {
@Override @Override
public void updateState() { public void updateState() {
if (mLineageActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) { if (mMotoActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) {
Log.d(TAG, "Enabling"); Log.d(TAG, "Enabling");
mSensorHelper.registerListener(mFlatDown, mFlatDownListener); mSensorHelper.registerListener(mFlatDown, mFlatDownListener);
mSensorHelper.registerListener(mStow, mStowListener); mSensorHelper.registerListener(mStow, mStowListener);
mContext.registerReceiver(mReceiver, mContext.registerReceiver(mReceiver,
new IntentFilter(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED)); new IntentFilter(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED));
mIsEnabled = true; mIsEnabled = true;
} else if (!mLineageActionsSettings.isFlipToMuteEnabled() && mIsEnabled) { } else if (!mMotoActionsSettings.isFlipToMuteEnabled() && mIsEnabled) {
Log.d(TAG, "Disabling"); Log.d(TAG, "Disabling");
mSensorHelper.unregisterListener(mFlatDownListener); mSensorHelper.unregisterListener(mFlatDownListener);
mSensorHelper.unregisterListener(mStowListener); mSensorHelper.unregisterListener(mStowListener);

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import android.content.Context; import android.content.Context;
import android.hardware.Sensor; import android.hardware.Sensor;
@@ -26,13 +26,13 @@ import android.telecom.TelecomManager;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
public class LiftToSilence extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier { 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 SensorHelper mSensorHelper;
private final Sensor mFlatUpSensor; private final Sensor mFlatUpSensor;
private final Sensor mStowSensor; private final Sensor mStowSensor;
@@ -44,9 +44,9 @@ public class LiftToSilence extends PhoneStateListener implements SensorEventList
private boolean mIsStowed; private boolean mIsStowed;
private boolean mLastFlatUp; private boolean mLastFlatUp;
public LiftToSilence(LineageActionsSettings lineageActionsSettings, Context context, public LiftToSilence(MotoActionsSettings motoActionsSettings, Context context,
SensorHelper sensorHelper) { SensorHelper sensorHelper) {
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mFlatUpSensor = sensorHelper.getFlatUpSensor(); mFlatUpSensor = sensorHelper.getFlatUpSensor();
mStowSensor = sensorHelper.getStowSensor(); mStowSensor = sensorHelper.getStowSensor();
@@ -56,7 +56,7 @@ public class LiftToSilence extends PhoneStateListener implements SensorEventList
@Override @Override
public void updateState() { public void updateState() {
if (mLineageActionsSettings.isLiftToSilenceEnabled()) { if (mMotoActionsSettings.isLiftToSilenceEnabled()) {
mTelephonyManager.listen(this, LISTEN_CALL_STATE); mTelephonyManager.listen(this, LISTEN_CALL_STATE);
} else { } else {
mTelephonyManager.listen(this, 0); mTelephonyManager.listen(this, 0);

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import android.content.Context; import android.content.Context;
import android.hardware.Sensor; import android.hardware.Sensor;
@@ -26,31 +26,31 @@ import android.telecom.TelecomManager;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
import static android.telephony.TelephonyManager.*; import static android.telephony.TelephonyManager.*;
public class ProximitySilencer extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier { 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 static final int SILENCE_DELAY_MS = 500;
private final TelecomManager mTelecomManager; private final TelecomManager mTelecomManager;
private final TelephonyManager mTelephonyManager; private final TelephonyManager mTelephonyManager;
private final LineageActionsSettings mLineageActionsSettings; private final MotoActionsSettings mMotoActionsSettings;
private final SensorHelper mSensorHelper; private final SensorHelper mSensorHelper;
private final Sensor mSensor; private final Sensor mSensor;
private boolean mIsRinging; private boolean mIsRinging;
private long mRingStartedMs; private long mRingStartedMs;
private boolean mCoveredRinging; private boolean mCoveredRinging;
public ProximitySilencer(LineageActionsSettings lineageActionsSettings, Context context, public ProximitySilencer(MotoActionsSettings motoActionsSettings, Context context,
SensorHelper sensorHelper) { SensorHelper sensorHelper) {
mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE); mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mSensor = sensorHelper.getProximitySensor(); mSensor = sensorHelper.getProximitySensor();
mCoveredRinging = false; mCoveredRinging = false;
@@ -59,7 +59,7 @@ public class ProximitySilencer extends PhoneStateListener implements SensorEvent
@Override @Override
public void updateState() { public void updateState() {
if (mLineageActionsSettings.isIrSilencerEnabled()) { if (mMotoActionsSettings.isIrSilencerEnabled()) {
mTelephonyManager.listen(this, LISTEN_CALL_STATE); mTelephonyManager.listen(this, LISTEN_CALL_STATE);
} else { } else {
mTelephonyManager.listen(this, 0); mTelephonyManager.listen(this, 0);

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
import android.content.Context; import android.content.Context;
import android.hardware.camera2.CameraManager; import android.hardware.camera2.CameraManager;
@@ -24,10 +24,10 @@ import android.hardware.camera2.CameraAccessException;
import android.os.Vibrator; import android.os.Vibrator;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.SensorAction; import com.moto.actions.SensorAction;
public class TorchAction implements 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; private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.actions; package com.moto.actions.actions;
public interface UpdatedStateNotifier { public interface UpdatedStateNotifier {
public void updateState(); public void updateState();

View File

@@ -15,16 +15,16 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.doze; package com.moto.actions.doze;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.SensorAction; import com.moto.actions.SensorAction;
public class DozePulseAction implements SensorAction, ScreenStateNotifier { 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; private static final int DELAY_BETWEEN_DOZES_IN_MS = 1500;

View File

@@ -15,21 +15,21 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.doze; package com.moto.actions.doze;
import android.hardware.Sensor; import android.hardware.Sensor;
import android.hardware.SensorEvent; import android.hardware.SensorEvent;
import android.hardware.SensorEventListener; import android.hardware.SensorEventListener;
import android.util.Log; import android.util.Log;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorAction; import com.moto.actions.SensorAction;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
public class ProximitySensor implements ScreenStateNotifier, SensorEventListener { 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 SensorHelper mSensorHelper;
private final SensorAction mSensorAction; private final SensorAction mSensorAction;
private final Sensor mSensor; private final Sensor mSensor;
@@ -38,9 +38,9 @@ public class ProximitySensor implements ScreenStateNotifier, SensorEventListener
private boolean mSawNear = false; private boolean mSawNear = false;
public ProximitySensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper, public ProximitySensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
SensorAction action) { SensorAction action) {
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mSensorAction = action; mSensorAction = action;
@@ -58,7 +58,7 @@ public class ProximitySensor implements ScreenStateNotifier, SensorEventListener
@Override @Override
public void screenTurnedOff() { public void screenTurnedOff() {
if (mLineageActionsSettings.isIrWakeupEnabled() && !mEnabled) { if (mMotoActionsSettings.isIrWakeupEnabled() && !mEnabled) {
Log.d(TAG, "Enabling"); Log.d(TAG, "Enabling");
mSensorHelper.registerListener(mSensor, this); mSensorHelper.registerListener(mSensor, this);
mEnabled = true; mEnabled = true;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.doze; package com.moto.actions.doze;
import java.util.List; import java.util.List;
@@ -24,7 +24,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import org.lineageos.settings.device.actions.Constants; import com.moto.actions.actions.Constants;
public class ScreenReceiver extends BroadcastReceiver { public class ScreenReceiver extends BroadcastReceiver {
private final ScreenStateNotifier mNotifier; private final ScreenStateNotifier mNotifier;

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.doze; package com.moto.actions.doze;
public interface ScreenStateNotifier { public interface ScreenStateNotifier {
public void screenTurnedOn(); public void screenTurnedOn();

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.doze; package com.moto.actions.doze;
import android.hardware.Sensor; import android.hardware.Sensor;
import android.hardware.SensorEvent; import android.hardware.SensorEvent;
@@ -24,15 +24,15 @@ import android.util.Log;
import java.lang.System; import java.lang.System;
import org.lineageos.settings.device.LineageActionsSettings; import com.moto.actions.MotoActionsSettings;
import org.lineageos.settings.device.SensorAction; import com.moto.actions.SensorAction;
import org.lineageos.settings.device.SensorHelper; import com.moto.actions.SensorHelper;
public class StowSensor implements ScreenStateNotifier, SensorEventListener { 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 static final int IN_POCKET_MIN_TIME = 5000;
private final LineageActionsSettings mLineageActionsSettings; private final MotoActionsSettings mMotoActionsSettings;
private final SensorHelper mSensorHelper; private final SensorHelper mSensorHelper;
private final SensorAction mSensorAction; private final SensorAction mSensorAction;
private final Sensor mSensor; private final Sensor mSensor;
@@ -41,9 +41,9 @@ public class StowSensor implements ScreenStateNotifier, SensorEventListener {
private boolean mLastStowed; private boolean mLastStowed;
private long isStowedTime; private long isStowedTime;
public StowSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper, public StowSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
SensorAction action) { SensorAction action) {
mLineageActionsSettings = lineageActionsSettings; mMotoActionsSettings = motoActionsSettings;
mSensorHelper = sensorHelper; mSensorHelper = sensorHelper;
mSensorAction = action; mSensorAction = action;
@@ -61,8 +61,8 @@ public class StowSensor implements ScreenStateNotifier, SensorEventListener {
@Override @Override
public void screenTurnedOff() { public void screenTurnedOff() {
if (!mLineageActionsSettings.isIrWakeupEnabled() && if (!mMotoActionsSettings.isIrWakeupEnabled() &&
mLineageActionsSettings.isPickUpEnabled() && !mEnabled) { mMotoActionsSettings.isPickUpEnabled() && !mEnabled) {
Log.d(TAG, "Enabling"); Log.d(TAG, "Enabling");
mSensorHelper.registerListener(mSensor, this); mSensorHelper.registerListener(mSensor, this);
mEnabled = true; mEnabled = true;

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.lineageos.settings.device.util; package com.moto.actions.util;
import android.util.Log; import android.util.Log;

View File

@@ -133,9 +133,9 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/gps/etc/xtwifi.conf:system/vendor/etc/xtwifi.conf \ $(LOCAL_PATH)/gps/etc/xtwifi.conf:system/vendor/etc/xtwifi.conf \
$(LOCAL_PATH)/gps/etc/cacert_location.pem:system/vendor/etc/cacert_location.pem $(LOCAL_PATH)/gps/etc/cacert_location.pem:system/vendor/etc/cacert_location.pem
# LineageActions # MotoActions
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
LineageActions MotoActions
# Display # Display
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \

View File

@@ -309,10 +309,10 @@
<bool name="config_supportDoubleTapWake">false</bool> <bool name="config_supportDoubleTapWake">false</bool>
<!-- Paths to the libraries that contain device specific key handlers --> <!-- 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 --> <!-- 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 --> <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
<bool name="config_intrusiveNotificationLed">true</bool> <bool name="config_intrusiveNotificationLed">true</bool>