-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
228 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "UnifiedNlpApi"] | ||
path = UnifiedNlpApi | ||
[submodule "extern/UnifiedNlpApi"] | ||
path = extern/UnifiedNlpApi | ||
url = https://github.com/microg/android_external_UnifiedNlpApi.git |
Submodule UnifiedNlpApi
deleted from
06d113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1 @@ | ||
/* | ||
Copyright 2013-2015 µg Project Team | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.0.0' | ||
} | ||
} | ||
|
||
final boolean buildNlpAsLib = name.equals('UnifiedNlpLib') | ||
|
||
if (buildNlpAsLib) { | ||
apply plugin: 'com.android.library' | ||
} else { | ||
apply plugin: 'com.android.application' | ||
} | ||
|
||
dependencies { | ||
compile 'com.android.support:support-v4:21.0.3' | ||
compile 'com.android.support:appcompat-v7:21.0.3' | ||
compile project(':UnifiedNlpApi') | ||
provided project('compat') | ||
} | ||
|
||
android { | ||
compileSdkVersion 21 | ||
buildToolsVersion "21.1.2" | ||
lintOptions.abortOnError false | ||
|
||
sourceSets { | ||
main { | ||
manifest.srcFile 'AndroidManifest.xml' | ||
java.srcDirs = ['src'] | ||
aidl.srcDirs = ['src'] | ||
res.srcDirs = ['res'] | ||
} | ||
} | ||
|
||
if (!buildNlpAsLib) { | ||
productFlavors { | ||
NetworkLocation { | ||
applicationId = 'com.google.android.gms' | ||
minSdkVersion 19 | ||
} | ||
LegacyNetworkLocation { | ||
applicationId = 'com.google.android.location' | ||
} | ||
UnifiedNlp { | ||
applicationId = 'org.microg.nlp' | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (file('user.gradle').exists()) { | ||
apply from: 'user.gradle' | ||
} | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. |
Submodule UnifiedNlpApi
added at
caa1b9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
include ':compat', ':UnifiedNlpApi' | ||
include ':unifiednlp-compat' | ||
include ':unifiednlp-api' | ||
include ':unifiednlp-base' | ||
include ':unifiednlp-app' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extern/UnifiedNlpApi/unifiednlp-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
Copyright 2013-2015 µg Project Team | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.1.3' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
|
||
dependencies { | ||
compile project(':unifiednlp-base') | ||
} | ||
|
||
android { | ||
compileSdkVersion 22 | ||
buildToolsVersion "22.0.0" | ||
|
||
productFlavors { | ||
NetworkLocation { | ||
applicationId = 'com.google.android.gms' | ||
minSdkVersion 19 | ||
} | ||
LegacyNetworkLocation { | ||
applicationId = 'com.google.android.location' | ||
} | ||
UnifiedNlp { | ||
applicationId = 'org.microg.nlp' | ||
} | ||
} | ||
} | ||
|
||
if (file('user.gradle').exists()) { | ||
apply from: 'user.gradle' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright 2013-2015 µg Project Team | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.microg.nlp.app" | ||
android:versionName="1.4" | ||
android:versionCode="10400"> | ||
|
||
<uses-sdk | ||
android:minSdkVersion="9" | ||
android:targetSdkVersion="21" /> | ||
|
||
<application | ||
android:icon="@drawable/ic_nlp_app" | ||
android:allowBackup="true" | ||
android:label="@string/nlp_app_name"> | ||
|
||
<activity | ||
android:name="org.microg.nlp.ui.SettingsLauncherActivity" | ||
android:icon="@drawable/ic_nlp_settings" | ||
android:label="@string/nlp_app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
55 changes: 55 additions & 0 deletions
55
unifiednlp-app/src/main/java/org/microg/nlp/ui/SettingsLauncherActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2013-2015 µg Project Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.microg.nlp.ui; | ||
|
||
import android.app.Activity; | ||
import android.content.ComponentName; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.pm.PackageManager; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
|
||
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED; | ||
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; | ||
import static android.content.pm.PackageManager.DONT_KILL_APP; | ||
|
||
public class SettingsLauncherActivity extends Activity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
startActivity(new Intent(this, SettingsActivity.class)); | ||
finish(); | ||
} | ||
|
||
public static void setLauncherIconEnabled(Context context, boolean enabled) { | ||
PackageManager pm = context.getPackageManager(); | ||
pm.setComponentEnabledSetting(new ComponentName(context, SettingsLauncherActivity.class), | ||
enabled ? COMPONENT_ENABLED_STATE_ENABLED : COMPONENT_ENABLED_STATE_DISABLED, | ||
DONT_KILL_APP); | ||
} | ||
|
||
public static void updateLauncherIcon(Context context) { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | ||
if (SettingInjectorService.settingsInjectionPossible(context)) { | ||
setLauncherIconEnabled(context, false); | ||
} else { | ||
setLauncherIconEnabled(context, true); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright 2013-2015 µg Project Team | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.1.3' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
dependencies { | ||
compile 'com.android.support:support-v4:22.0.0' | ||
compile 'com.android.support:appcompat-v7:22.0.0' | ||
compile project(':unifiednlp-api') | ||
provided project(':unifiednlp-compat') | ||
} | ||
|
||
android { | ||
compileSdkVersion 22 | ||
buildToolsVersion "22.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.