summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2015-09-30 14:25:43 +0800
committerRockchip2015-09-30 14:25:43 +0800
commit2b9af39aad388081a7071dff977f081a1bbfcfdf (patch)
treef5854b7294feef7d513fda9fea4b7b175a418c78
parent70accff834ae4d34171a9f27c7b9dc99ab66af76 (diff)
Revert "add dual screen function"
This reverts commit 6e271cbb14b75b1ec04efd3adcacfe25b72cc597. Signed-off-by: Rockchip <service@rock-chips.com>
-rwxr-xr-xAndroidManifest.xml18
-rwxr-xr-xres/drawable-mdpi/ic_dual_screen.pngbin849 -> 0 bytes
-rw-r--r--[-rwxr-xr-x]res/values-zh-rCN/strings.xml8
-rw-r--r--[-rwxr-xr-x]res/values/strings.xml8
-rw-r--r--[-rwxr-xr-x]res/xml/display_settings.xml6
-rwxr-xr-xres/xml/dualscreen.xml10
-rwxr-xr-xsrc/com/android/settings/Settings.java1
-rwxr-xr-xsrc/com/android/settings/SettingsActivity.java4
-rwxr-xr-xsrc/com/android/settings/dualscreen/DualscreenSettings.java202
9 files changed, 1 insertions, 256 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 021ae1d..9ec3d30 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1868,24 +1868,6 @@
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
-
- <!-- add by wgh-->
- <activity android:name="Settings$DualscreenSettingsActivity"
- android:label="@string/dualscreen_setting"
- android:taskAffinity="">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <action android:name="android.settings.DREAM_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="com.android.settings.SHORTCUT" />
- </intent-filter>
- <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.dualscreen.DualscreenSettings" />
- <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
- android:resource="@id/display_settings" />
- <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
- android:value="true" />
- </activity>
<activity android:name="Settings$UserSettingsActivity"
android:label="@string/user_settings_title"
diff --git a/res/drawable-mdpi/ic_dual_screen.png b/res/drawable-mdpi/ic_dual_screen.png
deleted file mode 100755
index 1ff9cbc..0000000
--- a/res/drawable-mdpi/ic_dual_screen.png
+++ /dev/null
Binary files differ
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 6a943ca..5ac18cf 100755..100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -2538,14 +2538,6 @@
<string name="screenshot_version">截屏管理器版本</string>
<string name="screenshot_storage_title">设置截屏图片存储位置</string>
<string name="later">秒以后截屏</string>
-
- <!-- dual screen but different contents-->
- <string name="dualscreen_setting">双屏显示</string>
- <string name="dualscreen_manual">双屏显示手册</string>
- <string name="dualscreen_settings_title">双屏显示</string>
- <string name="dualscreen_manual_summary">"启用此功能,如果有连接hdmi,您可以在平板和电视两个屏幕上运行不同的应用,比如说您可以在电视上播放视频,而平板上运行其它应用程序。
- \n\n两屏显示模式切换:\n <ul>\n两屏显示不同内容:\n 手指触摸屏幕左边50个像素区域快速向右滑动或者触摸屏幕右边50个像素区域快速向左滑动,焦点应用窗口就只在电视上显示,而平板上可以操作其它的应用程序。
- \n\n两屏显示相同内容:\n 状态栏上有一个同步的按钮(在最近打开应用程序图标的右边),点击按钮即可让两屏显示相同内容。</ul>"</string>
<!-- ethernet settings by blb-->
<string name="ethernet_settings">以太网</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index eea9d7c..882d268 100755..100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6079,14 +6079,6 @@
<string name="screenshot_storage_title">Set the location of screenshot storage</string>
<string name="later">s later capture</string>
- <!-- dual screen but different contents-->
- <string name="dualscreen_setting">Dual-Screen</string>
- <string name="dualscreen_manual">Dual-Screen Manual</string>
- <string name="dualscreen_settings_title">Dual screen</string>
- <string name="dualscreen_manual_summary">"When this feature is turned on,If the pad have connected to the HDMI,you can run different applications in pad and TV two screens,for example, you can play video on TV, and run other applications on pad.
- \n\nThe switching of two display mode:\n <ul>\nShow different content on two screen:\n Touch screen on the left side of the 50 pixel region and fast slide to the right or touch screen on the right side of the 50 pixel region and fast slide to the left, the focus application window will only display on TV, and the pad can operate other applications.
- \n\nShow same content on two screen:\n There is a simultaneous button on the status bar (right of the recently application icon), click on the button to make the two screen display the same content.</ul>"</string>
-
<!-- ethernet settings by blb-->
<string name="ethernet_settings">Ethernet</string>
<string name="ethernet_connect">Connect</string>
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index b975659..fc4f3b4 100755..100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -113,12 +113,6 @@
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.screen.ScreenScaleActivity" />
</Preference>
- <!-- add by wgh-->
- <PreferenceScreen
- android:key="dualscreen"
- android:title="@string/dualscreen_setting"
- android:fragment="com.android.settings.dualscreen.DualscreenSettings" />
-
<ListPreference
android:key="main_screen_interface"/>
diff --git a/res/xml/dualscreen.xml b/res/xml/dualscreen.xml
deleted file mode 100755
index 0dca3eb..0000000
--- a/res/xml/dualscreen.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <PreferenceScreen
- android:key="dualscreen_manual"
- android:fragment="com.android.settings.dualscreen.DualScreenSettings$ToggleDualScreenManualPreferenceFragment"
- android:title="@string/dualscreen_manual"
- />
-
-</PreferenceScreen>
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 92f5e1e..6795e31 100755
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -104,6 +104,5 @@ public class Settings extends SettingsActivity {
public static class HdmiSettingsActivity extends SettingsActivity { /* empty */ }
public static class ScreenshotSettingsActivity extends SettingsActivity { /* empty */ }
public static class UsbConnectSettingsActivity extends SettingsActivity { /* empty */ }
- public static class DualscreenSettingsActivity extends SettingsActivity { /* empty */ }
}
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 611984f..b2fa3b1 100755
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -115,7 +115,6 @@ import com.android.settings.wifi.p2p.WifiP2pSettings;
import com.android.settings.HdmiSettings;
import com.android.settings.ScreenshotSetting;
import com.android.settings.UsbSetting;
-import com.android.settings.dualscreen.DualscreenSettings;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -313,8 +312,7 @@ public class SettingsActivity extends Activity
ApnSettings.class.getName(),
HdmiSettings.class.getName(),
ScreenshotSetting.class.getName(),
- UsbSetting.class.getName(),
- DualscreenSettings.class.getName()
+ UsbSetting.class.getName()
};
diff --git a/src/com/android/settings/dualscreen/DualscreenSettings.java b/src/com/android/settings/dualscreen/DualscreenSettings.java
deleted file mode 100755
index 588cd29..0000000
--- a/src/com/android/settings/dualscreen/DualscreenSettings.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.dualscreen;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.app.Fragment;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.pm.PackageManager;
-import android.database.DataSetObserver;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.preference.Preference;
-import android.preference.PreferenceActivity;
-import android.preference.PreferenceFragment;
-import android.preference.PreferenceGroupAdapter;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-import android.widget.Switch;
-import android.widget.TextView;
-import android.database.ContentObserver;
-import android.os.Handler;
-import android.provider.Settings;
-import android.app.ActivityManagerNative;
-import android.app.IActivityManager;
-import android.content.res.Configuration;
-import android.os.RemoteException;
-import com.android.settings.R;
-import android.view.Gravity;
-
-import com.android.settings.SettingsActivity;
-import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.widget.SwitchBar;
-
-
-public class DualscreenSettings extends SettingsPreferenceFragment implements SwitchBar.OnSwitchChangeListener {
- private static final String TAG = DualscreenSettings.class.getSimpleName();
- static final boolean DEBUG = true;
-
- private static final String KEY_DUALSCREEN_MANUAL = "dualscreen_manual";
- private boolean mOpened;
-
- private final String store_key = Settings.System.DUAL_SCREEN_MODE;
- private final String icon_key = Settings.System.DUAL_SCREEN_ICON_USED;
-
- private final int DUAL_SCREEN_CLOSE = 0;
- private final int DUAL_SCREEN_OPEN = 1;
-
- private Context mContext;
- private SwitchBar mSwitchBar;
-
- @Override
- public void onAttach(Activity activity) {
- logd("onAttach(%s)", activity.getClass().getSimpleName());
- super.onAttach(activity);
- mContext = activity;
- }
-
- @Override
- public void onCreate(Bundle icicle) {
- logd("onCreate(%s)", icicle);
- super.onCreate(icicle);
-
- //mManual = (PreferenceScreen)findPreference(KEY_DUALSCREEN_MANUAL);
- }
-
- @Override
- public void onSwitchChanged(Switch switchView, boolean isChecked) {
- logd("-----------------------------isChecked:"+isChecked);
- int value = DUAL_SCREEN_CLOSE;
-
- mContext.getContentResolver().unregisterContentObserver(mValueObserver);
- mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(store_key), false, mValueObserver);
- if (isChecked) {
- value = DUAL_SCREEN_OPEN;
- } else {
- Settings.System.putInt(mContext.getContentResolver(), icon_key, 0);
- }
- Settings.System.putInt(mContext.getContentResolver(), store_key, value);
- handleStateChanged(value);
- }
-
- @Override
- public void onStart() {
- logd("onStart()");
- super.onStart();
- }
-
- @Override
- public void onDestroyView() {
- logd("onDestroyView()");
- super.onDestroyView();
-
- mSwitchBar.removeOnSwitchChangeListener(this);
- mSwitchBar.hide();
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- logd("onActivityCreated(%s)", savedInstanceState);
- super.onActivityCreated(savedInstanceState);
-
- ListView listView = getListView();
- listView.setItemsCanFocus(true);
-
- TextView emptyView = (TextView) getView().findViewById(android.R.id.empty);
- emptyView.setText(R.string.dualscreen_manual_summary);
- emptyView.setTextSize(24);
- emptyView.setGravity(Gravity.LEFT);
- listView.setEmptyView(emptyView);
-
- final SettingsActivity sa = (SettingsActivity) getActivity();
- mSwitchBar = sa.getSwitchBar();
- mSwitchBar.addOnSwitchChangeListener(this);
- mSwitchBar.show();
- }
-
- @Override
- public void onPause() {
- logd("onPause()");
- super.onPause();
-
- mContext.getContentResolver().unregisterContentObserver(mValueObserver);
- }
-
- @Override
- public void onResume() {
- logd("onResume()");
- super.onResume();
- handleStateChanged(getDualScreenValue());
- mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor(store_key), false, mValueObserver);
- }
-
- private int getDualScreenValue(){
- return Settings.System.getInt(mContext.getContentResolver(), store_key, DUAL_SCREEN_CLOSE);
- }
-
- void handleStateChanged(int state) {
- switch (state) {
- case DUAL_SCREEN_CLOSE:
- mSwitchBar.setChecked(false);
- break;
- case DUAL_SCREEN_OPEN:
- mSwitchBar.setChecked(true);
- break;
- }
- }
-
- private final ContentObserver mValueObserver = new ContentObserver(new Handler()) {
- @Override
- public void onChange(boolean selfChange) {
- final boolean enable = (DUAL_SCREEN_CLOSE != getDualScreenValue());
- Log.d(TAG, "onchagne enable=" + enable + ", selfChange=" + selfChange);
-
- try {
- IActivityManager am = ActivityManagerNative.getDefault();
- Configuration config = am.getConfiguration();
-
- // Will set userSetLocale to indicate this isn't some passing default - the user
- // wants this remembered
- config.setDualScreenFlag(enable);
-
- am.updateConfiguration(config);
-
- } catch (RemoteException e) {
- // Intentionally left blank
- }
- }
- };
-
- private static void logd(String msg, Object... args) {
- if (DEBUG)
- Log.d(TAG, args == null || args.length == 0 ? msg : String.format(msg, args));
- }
-
-}