Commit a5af3646 by Wang Xu

Merge remote-tracking branch 'origin/master'

parents effbc9af 6786e8ed
...@@ -2,6 +2,5 @@ ...@@ -2,6 +2,5 @@
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Launcher3" vcs="Git" />
</component> </component>
</project> </project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!--
<!--
/* /*
** **
** Copyright 2016, The Android Open Source Project ** Copyright 2016, The Android Open Source Project
...@@ -17,10 +16,10 @@ ...@@ -17,10 +16,10 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<manifest <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.launcher3" package="com.android.launcher3"
android:sharedUserId="com.secspace.runtime"> android:sharedUserId="com.secspace.runtime">
<uses-sdk android:targetSdkVersion="23" /> <uses-sdk android:targetSdkVersion="23" />
<!-- <!--
...@@ -33,10 +32,10 @@ ...@@ -33,10 +32,10 @@
--> -->
<permission <permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT" android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS" android:description="@string/permdesc_install_shortcut"
android:protectionLevel="dangerous"
android:label="@string/permlab_install_shortcut" android:label="@string/permlab_install_shortcut"
android:description="@string/permdesc_install_shortcut" /> android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="dangerous" />
<uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" /> <uses-permission android:name="android.permission.SET_WALLPAPER" />
...@@ -44,78 +43,87 @@ ...@@ -44,78 +43,87 @@
<uses-permission android:name="android.permission.BIND_APPWIDGET" /> <uses-permission android:name="android.permission.BIND_APPWIDGET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<application <application
android:backupAgent="com.android.launcher3.LauncherBackupAgent" android:backupAgent="com.android.launcher3.LauncherBackupAgent"
android:fullBackupOnly="true"
android:fullBackupContent="@xml/backupscheme" android:fullBackupContent="@xml/backupscheme"
android:fullBackupOnly="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher_home" android:icon="@drawable/ic_launcher_home"
android:label="@string/derived_app_name" android:label="@string/derived_app_name"
android:largeHeap="@bool/config_largeHeap" android:largeHeap="@bool/config_largeHeap"
android:restoreAnyVersion="true" android:restoreAnyVersion="true"
android:supportsRtl="true" > android:supportsRtl="true">
<!-- Intent received used to install shortcuts from other applications --> <!-- Intent received used to install shortcuts from other applications -->
<receiver <receiver
android:name="com.android.launcher3.InstallShortcutReceiver" android:name="com.android.launcher3.InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT" android:enabled="@bool/enable_install_shortcut_api"
android:enabled="@bool/enable_install_shortcut_api" > android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter> <intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" /> <action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<!-- Intent received when a session is committed --> <!-- Intent received when a session is committed -->
<receiver <receiver android:name="com.android.launcher3.SessionCommitReceiver">
android:name="com.android.launcher3.SessionCommitReceiver" >
<intent-filter> <intent-filter>
<action android:name="android.content.pm.action.SESSION_COMMITTED" /> <action android:name="android.content.pm.action.SESSION_COMMITTED" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<!-- Intent received used to initialize a restored widget --> <!-- Intent received used to initialize a restored widget -->
<receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver" > <receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED"/> <action android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<service android:name="com.android.launcher3.dynamicui.ColorExtractionService" <service
android:name="com.android.launcher3.dynamicui.ColorExtractionService"
android:exported="false" android:exported="false"
android:process=":wallpaper_chooser" android:permission="android.permission.BIND_JOB_SERVICE"
android:permission="android.permission.BIND_JOB_SERVICE"> android:process=":wallpaper_chooser"></service>
</service>
<service android:name="com.android.launcher3.notification.NotificationListener" <service
android:enabled="@bool/notification_badging_enabled" android:name="com.android.launcher3.notification.NotificationListener"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"> android:enabled="@bool/notification_badging_enabled"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter> <intent-filter>
<action android:name="android.service.notification.NotificationListenerService" /> <action android:name="android.service.notification.NotificationListenerService" />
</intent-filter> </intent-filter>
</service> </service>
<meta-data android:name="android.nfc.disable_beam_default" <meta-data
android:value="true" /> android:name="android.nfc.disable_beam_default"
android:value="true" />
<activity android:name="com.android.launcher3.dragndrop.AddItemActivity" <activity
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:name="com.android.launcher3.dragndrop.AddItemActivity"
android:excludeFromRecents="true"
android:autoRemoveFromRecents="true" android:autoRemoveFromRecents="true"
android:label="@string/action_add_to_workspace" > android:excludeFromRecents="true"
android:label="@string/action_add_to_workspace"
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert">
<intent-filter> <intent-filter>
<action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" /> <action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" />
<action android:name="android.content.pm.action.CONFIRM_PIN_APPWIDGET" /> <action android:name="android.content.pm.action.CONFIRM_PIN_APPWIDGET" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".settings.AppChooseActivity" <activity
android:name=".settings.AppChooseActivity"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:theme="@style/AppTheme"/> android:theme="@style/AppTheme" />
<activity android:name=".settings.SettingActivity" <activity
android:name=".settings.SettingActivity"
android:excludeFromRecents="true"
android:theme="@style/AppTheme" />
<activity
android:name=".settings.wifi.WifiWhiteListActivity"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:theme="@style/AppTheme"/> android:theme="@style/AppTheme" />
<!-- <!--
Should point to the content provider which can be used to dump Launcher3 compatible Should point to the content provider which can be used to dump Launcher3 compatible
......
...@@ -19,6 +19,8 @@ import java.util.Set; ...@@ -19,6 +19,8 @@ import java.util.Set;
public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> { public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> {
public static final String TAG="AppChooseListAdapter"; public static final String TAG="AppChooseListAdapter";
public static final int SYSTEM_APP_FLAG=0;
public static final int USER_APP_FLAG=1;
private Set<String> flagShow = new HashSet(); private Set<String> flagShow = new HashSet();
private Set<String> flagAutostart = new HashSet(); private Set<String> flagAutostart = new HashSet();
private String packageName = ""; private String packageName = "";
...@@ -83,19 +85,17 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> { ...@@ -83,19 +85,17 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> {
checkBoxAutostart.setChecked(false); checkBoxAutostart.setChecked(false);
} }
Log.i(TAG, "autoStartPkgList: "+mAutoStartPkgs.toString()); // Log.i(TAG, "autoStartPkgList: "+mAutoStartPkgs.toString());
for (int i = 0; i < mAutoStartPkgs.size(); i++) { for (int i = 0; i < mAutoStartPkgs.size(); i++) {
if (packageName.equals(mAutoStartPkgs.get(i))){ if (packageName.equals(mAutoStartPkgs.get(i))){
Log.i(TAG, "autoStartPkgList is Checked");
checkBoxAutostart.setChecked(true); checkBoxAutostart.setChecked(true);
break; break;
} }
} }
Log.i(TAG, "showPkgList: "+mShowAppPkgs.toString()); // Log.i(TAG, "showPkgList: "+mShowAppPkgs.toString());
for (int i = 0; i < mShowAppPkgs.size(); i++) { for (int i = 0; i < mShowAppPkgs.size(); i++) {
if (packageName.equals(mShowAppPkgs.get(i))){ if (packageName.equals(mShowAppPkgs.get(i))){
Log.i(TAG, "showPkgList is Checked");
checkBoxShow.setChecked(true); checkBoxShow.setChecked(true);
break; break;
} }
...@@ -105,7 +105,7 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> { ...@@ -105,7 +105,7 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> {
public void saveResult(Context context) { public void saveResult(Context context) {
//使用preference 记录,这个需要实现一下 //使用preference 记录,这个需要实现一下
//用字串也行 用位也行 //用字串也行 用位也行
if (mAppTypeFlag==0){ if (mAppTypeFlag==SYSTEM_APP_FLAG){
StringBuilder stringBuilderShowPkgs = new StringBuilder(); StringBuilder stringBuilderShowPkgs = new StringBuilder();
for (String name : flagShow) { for (String name : flagShow) {
stringBuilderShowPkgs.append(name); stringBuilderShowPkgs.append(name);
...@@ -141,12 +141,16 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> { ...@@ -141,12 +141,16 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> {
List<String> autoStartAppPkgs = new ArrayList<>(); List<String> autoStartAppPkgs = new ArrayList<>();
String showAppPkgs; String showAppPkgs;
String autoStartPkgs; String autoStartPkgs;
if (mAppTypeFlag==0){ if (mAppTypeFlag==SYSTEM_APP_FLAG){
showAppPkgs = Prefs.getSystemShowAppPkgs(context); showAppPkgs = Prefs.getSystemShowAppPkgs(context);
autoStartPkgs=Prefs.getSystemAutoStartPkgs(context); autoStartPkgs=Prefs.getSystemAutoStartPkgs(context);
Log.i(TAG, "showAppPkgs 0: "+showAppPkgs);
Log.i(TAG, "autoStartPkgs 0: "+autoStartPkgs);
}else { }else {
showAppPkgs = Prefs.getUserShowAppPkgs(context); showAppPkgs = Prefs.getUserShowAppPkgs(context);
autoStartPkgs=Prefs.getUserAutoStartPkgs(context); autoStartPkgs=Prefs.getUserAutoStartPkgs(context);
Log.i(TAG, "showAppPkgs 1: "+showAppPkgs);
Log.i(TAG, "autoStartPkgs 1: "+autoStartPkgs);
} }
if (showAppPkgs.equals("null")) { if (showAppPkgs.equals("null")) {
mShowAppPkgs=systemAppPkgs; mShowAppPkgs=systemAppPkgs;
...@@ -160,6 +164,13 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> { ...@@ -160,6 +164,13 @@ public class AppChooseListAdapter extends BaseRecyclerViewAdapter<AppModel> {
String[] split = autoStartPkgs.split(";"); String[] split = autoStartPkgs.split(";");
mAutoStartPkgs= Arrays.asList(split); mAutoStartPkgs= Arrays.asList(split);
} }
for (int i = 0; i < mShowAppPkgs.size(); i++) {
flagShow.add(mShowAppPkgs.get(i));
}
for (int i = 0; i < mAutoStartPkgs.size(); i++) {
flagAutostart.add(mShowAppPkgs.get(i));
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment